Re: [Rd] Using custom R_LIBS with R CMD install

2012-02-09 Thread Uwe Ligges



On 08.02.2012 21:05, Hadley Wickham wrote:

2012/2/8 Uwe Ligges:



On 08.02.2012 19:36, Hadley Wickham wrote:


I wonder it works that far. It won't for me on Windows nor Linux, because
system2 passes the whole thing shQuoted to the shell. Hence it is highly
shell dependent what happens with the ill formed command.



Well I was using the env argument to system2, which claims to be
cross-platform (at least for R and make).  This command:

R_LIBS=/Users/hadley/R-dev R CMD INSTALL aL3xa-rapport-08e68ca/

is ok, isn't it?



You haven't said you were using the env argument, have you? If so, I missed
that part. I assumed you were specifying the above as the "command"
argument.

Hmmm, former message not quoted, as we ask in the posting guide. Where is
the reproducible example?


We seem to be having a bit of a communication breakdown.  This is the
code that I run from the command line (on mac os x):

R_LIBS=/Users/hadley/R-dev R CMD INSTALL aL3xa-rapport-08e68ca/
# Desktop : R_LIBS=/Users/hadley/R-dev R CMD INSTALL aL3xa-rapport-08e68ca/
# * installing to library ‘/Users/hadley/R’
# ERROR: dependency ‘ascii’ is not available for package ‘rapport’

But:

ls /Users/hadley/R-dev/
# HandyStuff animation  biOps  mcmcTools  mvbutils   quantreg   testthat
# SparseMascii  ggplot2mturkr nstest scales whisker

It's hard to provide a reproducible example because it depends on
exactly what package you have installed where, but I had hoped that
this would at least illustrate my problem - R CMD install doesn't seem
to be respecting R_LIBS.  I'm trying to understand whether this is a
bug, or something I don't understand correctly about R CMD INSTALL.


That's right, then you want (under Linux alikes):

system2("R", "CMD INSTALL package_version.tar.gz", env="R_LIBS=lib")

obviously.

Under Windows, you have to construct the shell command:

"set R_LIBS=lib&  R CMD INSTALL package_version.tar.gz"


To clarify, system2 doesn't work in windows?


It does.

> The system2

documentation has: " On Windows, ‘env’ is currently only supported for
commands such as ‘R’ and ‘make’ which accept environment variables on
their command line."


Yes, but "R CMD INSTALL" does not accept those variables in the command 
line. This could perhaps be improved given someone finds some time to do it.


Uwe




Hadley



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Using custom R_LIBS with R CMD install

2012-02-09 Thread Hadley Wickham
>>
>> To clarify, system2 doesn't work in windows?
>
> It does.
>
>> The system2
>>
>> documentation has: " On Windows, ‘env’ is currently only supported for
>> commands such as ‘R’ and ‘make’ which accept environment variables on
>> their command line."
>
> Yes, but "R CMD INSTALL" does not accept those variables in the command
> line. This could perhaps be improved given someone finds some time to do it.

Ok, so R does, but R CMD INSTALL does not.  That was the source of my
confusion - thanks for clearing that up!

However, is there a reason that system2 doesn't use the more general
technique of Sys.setenv?

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] FORTRAN compilation error

2012-02-09 Thread David L Lorenz
I should also have explained that I was using the default Makeconf file in 
R-2.14.1\etc\i386. it is reproduced below. I've tried it on other packages 
and it inserts a z in front of the object files.
Dave

#-*- Makefile -*-
# $(R_HOME}/etc$(R_ARCH)/Makeconf

# Hand-edited version for gnuwin32.

ifdef DEBUG
  DLLFLAGS=
  DEBUGFLAG=-gdwarf-2
else
  DLLFLAGS=-s
  DEBUGFLAG=
endif

DLLFLAGS+= -static-libgcc
LINKFLAGS+= -static-libgcc

## Things which are substituted by fixed/Makefile (and also -O3 -> -O2)
WIN = 32
BINPREF = 
# SYMPAT = 's/^.* [BCDRT] _/ /p' for 32-bit
# SYMPAT = 's/^.* [BCDRT] / /p' for 64-bit
SYMPAT = 's/^.* [BCDRT] _/ /p'
IMPDIR = bin/i386
# flags for multilib builds, for compilers, dlltool and windres
M_ARCH = 
DT_ARCH = 
RC_ARCH = 
# Used by packages tcltk and tkrplot
TCL_HOME = $(R_HOME)/Tcl
LOCAL_SOFT = d:/RCompile/CRANpkg/extralibs/local

ifneq ($(strip $(LOCAL_SOFT)),)
LOCAL_CPPFLAGS = -I"$(LOCAL_SOFT)/include"
LOCAL_LIBS = -L"$(LOCAL_SOFT)/lib$(R_ARCH)" -L"$(LOCAL_SOFT)/lib"
endif

DLLTOOL = $(BINPREF)dlltool --as $(BINPREF)as $(DT_ARCH)
DLLTOOLFLAGS = -k
NM = $(BINPREF)nm
RESCOMP = $(BINPREF)windres $(RC_ARCH)
## MAIN_LD needs to be set by the package
LINKER = $(MAIN_LD)
## as a default
DLL = $(CC)

## Things defined in Renviron on Unix
SED = sed
TAR = tar

## Things defined in MkRules
CAT = cat
CP = cp
MKDIR = mkdir
RM = rm -f
SORT = sort

## For use in packages
GRAPHAPP_LIB = -lRgraphapp
TCL_VERSION = 85
ZLIB_LIBS = -lRzlib

AR = $(BINPREF)ar
## Used by packages 'maps' and 'mapdata'
AWK = gawk
BLAS_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRblas
C_VISIBILITY = 
CC = $(BINPREF)gcc $(M_ARCH)
CFLAGS = -O3 -Wall $(DEBUGFLAG) -std=gnu99 -mtune=core2
CPICFLAGS = 
CPPFLAGS =
CXX = $(BINPREF)g++ $(M_ARCH)
CXXCPP = $(CXX) -E
CXXFLAGS = -O2 -Wall $(DEBUGFLAG) -mtune=core2
CXXPICFLAGS = 
DYLIB_EXT = .dll
DYLIB_LD = $(DLL)
DYLIB_LDFLAGS = -shared
DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
ECHO = echo
ECHO_C = 
ECHO_N = -n
ECHO_T = 
FC = $(BINPREF)gfortran $(M_ARCH)
FCFLAGS = -O3 $(DEBUGFLAG) -mtune=core2
# additional libs needed when linking with $(FC), e.g. on Solaris
FCLIBS =
F77 = $(BINPREF)gfortran $(M_ARCH)
F77_VISIBILITY = 
FFLAGS = -O3 $(DEBUGFLAG) -mtune=core2
FLIBS = -lgfortran
FCPICFLAGS =
FPICFLAGS = 
FOUNDATION_CPPFLAGS =
FOUNDATION_LIBS =
JAR =
JAVA =
JAVAC = 
JAVAH =
# JAVA_HOME = 
# JAVA_LD_LIBRARY_PATH = 
JAVA_LIBS = -L"$(JAVA_HOME)/bin/client" -ljvm -ljvm-w32
JAVA_CPPFLAGS = -I"$(JAVA_HOME)/../include" 
-I"$(JAVA_HOME)/../include/win32"
LAPACK_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRlapack
## we only need this is if it is external, as otherwise link to R
LIBINTL=
LIBM = -lm
LIBR = -L"$(R_HOME)/$(IMPDIR)" -lR
LIBS =  -lm
## needed by R CMD config
LIBnn = lib
LIBTOOL =
LDFLAGS =
## needed to build applications linking to static libR
# MAIN_LD =
# MAIN_LDFLAGS =
# MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
# don't have this: would 'mkdir -p' do?
# MKINSTALLDIRS = $(R_HOME)/bin/mkinstalldirs
OBJC = $(CC)
OBJCFLAGS = -O2
OBJC_LIBS = -lobjc
OBJCXX =
R_ARCH = /i386
RANLIB = $(BINPREF)ranlib
SAFE_FFLAGS = -O3 -ffloat-store
SED = sed
## it seems some makes (but not ours) get upset if SHELL is set.
# SHELL = /bin/sh
SHLIB_CFLAGS = 
SHLIB_CXXFLAGS = 
SHLIB_CXXLD = $(CXX)
## ideally -shared -static-libstdc++, but not for gcc 4.2.1
SHLIB_CXXLDFLAGS = -shared
SHLIB_EXT = .dll
SHLIB_FCLD = $(FC)
## ideally -shared -static-libgfortran, but not for gcc 4.2.1
SHLIB_FCLDFLAGS = -shared
SHLIB_FFLAGS = 
SHLIB_LD = $(CC)
SHLIB_LDFLAGS = -shared
SHLIB_LIBADD =
SHLIB_LINK = $(SHLIB_LD) -Wl,--export-all-symbols $(SHLIB_LDFLAGS) 
$(LDFLAGS)
# not implemented in current toolchain
SHLIB_OPENMP_CFLAGS =
SHLIB_OPENMP_CXXFLAGS =
SHLIB_OPENMP_FCFLAGS =
SHLIB_OPENMP_FFLAGS =
STRIP_LIBS = $(BINPREF)strip --strip-unneeded
STRIP_STATIC_LIBS = $(BINPREF)strip --strip-debug
TCLTK_CPPFLAGS = -I "$(TCL_HOME)/include" -DWin32
TCLTK_LIBS = -L"$(TCL_HOME)/bin" -ltcl$(TCL_VERSION) -ltk$(TCL_VERSION)

STATIC_LIBR =

R_XTRA_CFLAGS =
R_XTRA_CPPFLAGS = -I"$(R_HOME)/include"
R_XTRA_CXXFLAGS = 
R_XTRA_FFLAGS = 

ALL_CFLAGS = $(R_XTRA_CFLAGS) $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) 
$(CFLAGS)
ALL_CPPFLAGS = $(R_XTRA_CPPFLAGS) $(PKG_CPPFLAGS) $(CPPFLAGS) 
$($*-CPPFLAGS) $(CLINK_CPPFLAGS) $(LOCAL_CPPFLAGS)
ALL_CXXFLAGS = $(R_XTRA_CXXFLAGS) $(PKG_CXXFLAGS) $(CXXPICFLAGS) 
$(SHLIB_CXXFLAGS) $(CXXFLAGS)
ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS)
ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) 
$(OBJCXXFLAGS)
ALL_FFLAGS = $(R_XTRA_FFLAGS) $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) 
$(FFLAGS)
ALL_LIBS = $(LOCAL_LIBS) $(PKG_LIBS) $(SHLIB_LIBADD) $(LIBR) $(LIBINTL)

.SUFFIXES:
.SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o .a .def .dll .exe .rc

.c.o:
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@
.c.d:
@echo "making $@ from $<"
@$(CC) -std=gnu99 -MM $(ALL_CPPFLAGS) $< > $@
.cc.o:
$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
.cpp.o:

Re: [Rd] FORTRAN compilation error

2012-02-09 Thread Simon Urbanek
On Feb 9, 2012, at 9:54 AM, David L Lorenz wrote:

> 
> I should also have explained that I was using the default Makeconf file in 
> R-2.14.1\etc\i386. it is reproduced below. I've tried it on other packages 
> and it inserts a z in front of the object files. 

I'm not talking about R Makeconf, but the one in your package (in src). What 
are your settings there? And what are the files?

Thanks,
Simon



> Dave 
> 
> #-*- Makefile -*- 
> # $(R_HOME}/etc$(R_ARCH)/Makeconf 
> 
> # Hand-edited version for gnuwin32. 
> 
> ifdef DEBUG 
>   DLLFLAGS= 
>   DEBUGFLAG=-gdwarf-2 
> else 
>   DLLFLAGS=-s 
>   DEBUGFLAG= 
> endif 
> 
> DLLFLAGS+= -static-libgcc 
> LINKFLAGS+= -static-libgcc 
> 
> ## Things which are substituted by fixed/Makefile (and also -O3 -> -O2) 
> WIN = 32 
> BINPREF = 
> # SYMPAT = 's/^.* [BCDRT] _/ /p' for 32-bit 
> # SYMPAT = 's/^.* [BCDRT] / /p' for 64-bit 
> SYMPAT = 's/^.* [BCDRT] _/ /p' 
> IMPDIR = bin/i386 
> # flags for multilib builds, for compilers, dlltool and windres 
> M_ARCH = 
> DT_ARCH = 
> RC_ARCH = 
> # Used by packages tcltk and tkrplot 
> TCL_HOME = $(R_HOME)/Tcl 
> LOCAL_SOFT = d:/RCompile/CRANpkg/extralibs/local 
> 
> ifneq ($(strip $(LOCAL_SOFT)),) 
> LOCAL_CPPFLAGS = -I"$(LOCAL_SOFT)/include" 
> LOCAL_LIBS = -L"$(LOCAL_SOFT)/lib$(R_ARCH)" -L"$(LOCAL_SOFT)/lib" 
> endif 
> 
> DLLTOOL = $(BINPREF)dlltool --as $(BINPREF)as $(DT_ARCH) 
> DLLTOOLFLAGS = -k 
> NM = $(BINPREF)nm 
> RESCOMP = $(BINPREF)windres $(RC_ARCH) 
> ## MAIN_LD needs to be set by the package 
> LINKER = $(MAIN_LD) 
> ## as a default 
> DLL = $(CC) 
> 
> ## Things defined in Renviron on Unix 
> SED = sed 
> TAR = tar 
> 
> ## Things defined in MkRules 
> CAT = cat 
> CP = cp 
> MKDIR = mkdir 
> RM = rm -f 
> SORT = sort 
> 
> ## For use in packages 
> GRAPHAPP_LIB = -lRgraphapp 
> TCL_VERSION = 85 
> ZLIB_LIBS = -lRzlib 
> 
> AR = $(BINPREF)ar 
> ## Used by packages 'maps' and 'mapdata' 
> AWK = gawk 
> BLAS_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRblas 
> C_VISIBILITY = 
> CC = $(BINPREF)gcc $(M_ARCH) 
> CFLAGS = -O3 -Wall $(DEBUGFLAG) -std=gnu99 -mtune=core2 
> CPICFLAGS = 
> CPPFLAGS = 
> CXX = $(BINPREF)g++ $(M_ARCH) 
> CXXCPP = $(CXX) -E 
> CXXFLAGS = -O2 -Wall $(DEBUGFLAG) -mtune=core2 
> CXXPICFLAGS = 
> DYLIB_EXT = .dll 
> DYLIB_LD = $(DLL) 
> DYLIB_LDFLAGS = -shared 
> DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS) 
> ECHO = echo 
> ECHO_C = 
> ECHO_N = -n 
> ECHO_T = 
> FC = $(BINPREF)gfortran $(M_ARCH) 
> FCFLAGS = -O3 $(DEBUGFLAG) -mtune=core2 
> # additional libs needed when linking with $(FC), e.g. on Solaris 
> FCLIBS = 
> F77 = $(BINPREF)gfortran $(M_ARCH) 
> F77_VISIBILITY = 
> FFLAGS = -O3 $(DEBUGFLAG) -mtune=core2 
> FLIBS = -lgfortran 
> FCPICFLAGS = 
> FPICFLAGS = 
> FOUNDATION_CPPFLAGS = 
> FOUNDATION_LIBS = 
> JAR = 
> JAVA = 
> JAVAC = 
> JAVAH = 
> # JAVA_HOME = 
> # JAVA_LD_LIBRARY_PATH = 
> JAVA_LIBS = -L"$(JAVA_HOME)/bin/client" -ljvm -ljvm-w32 
> JAVA_CPPFLAGS = -I"$(JAVA_HOME)/../include" -I"$(JAVA_HOME)/../include/win32" 
> LAPACK_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRlapack 
> ## we only need this is if it is external, as otherwise link to R 
> LIBINTL= 
> LIBM = -lm 
> LIBR = -L"$(R_HOME)/$(IMPDIR)" -lR 
> LIBS =  -lm 
> ## needed by R CMD config 
> LIBnn = lib 
> LIBTOOL = 
> LDFLAGS = 
> ## needed to build applications linking to static libR 
> # MAIN_LD = 
> # MAIN_LDFLAGS = 
> # MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS) 
> # don't have this: would 'mkdir -p' do? 
> # MKINSTALLDIRS = $(R_HOME)/bin/mkinstalldirs 
> OBJC = $(CC) 
> OBJCFLAGS = -O2 
> OBJC_LIBS = -lobjc 
> OBJCXX = 
> R_ARCH = /i386 
> RANLIB = $(BINPREF)ranlib 
> SAFE_FFLAGS = -O3 -ffloat-store 
> SED = sed 
> ## it seems some makes (but not ours) get upset if SHELL is set. 
> # SHELL = /bin/sh 
> SHLIB_CFLAGS = 
> SHLIB_CXXFLAGS = 
> SHLIB_CXXLD = $(CXX) 
> ## ideally -shared -static-libstdc++, but not for gcc 4.2.1 
> SHLIB_CXXLDFLAGS = -shared 
> SHLIB_EXT = .dll 
> SHLIB_FCLD = $(FC) 
> ## ideally -shared -static-libgfortran, but not for gcc 4.2.1 
> SHLIB_FCLDFLAGS = -shared 
> SHLIB_FFLAGS = 
> SHLIB_LD = $(CC) 
> SHLIB_LDFLAGS = -shared 
> SHLIB_LIBADD = 
> SHLIB_LINK = $(SHLIB_LD) -Wl,--export-all-symbols $(SHLIB_LDFLAGS) $(LDFLAGS) 
> # not implemented in current toolchain 
> SHLIB_OPENMP_CFLAGS = 
> SHLIB_OPENMP_CXXFLAGS = 
> SHLIB_OPENMP_FCFLAGS = 
> SHLIB_OPENMP_FFLAGS = 
> STRIP_LIBS = $(BINPREF)strip --strip-unneeded 
> STRIP_STATIC_LIBS = $(BINPREF)strip --strip-debug 
> TCLTK_CPPFLAGS = -I "$(TCL_HOME)/include" -DWin32 
> TCLTK_LIBS = -L"$(TCL_HOME)/bin" -ltcl$(TCL_VERSION) -ltk$(TCL_VERSION) 
> 
> STATIC_LIBR = 
> 
> R_XTRA_CFLAGS = 
> R_XTRA_CPPFLAGS = -I"$(R_HOME)/include" 
> R_XTRA_CXXFLAGS = 
> R_XTRA_FFLAGS = 
> 
> ALL_CFLAGS = $(R_XTRA_CFLAGS) $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) 
> $(CFLAGS) 
> ALL_CPPFLAGS = $(R_XTRA_CPPFLAGS) $(PKG_CPPFLAGS) $(CPPFLAGS) $($*-CPPFLAGS) 
> $(CLINK_CPPFLAGS) $(LOCAL_CPPFLAGS) 
> ALL_CXXFLAGS = $(R_XTRA_CXXFLAGS) $(PKG_CXXFLAGS) $(CXXPICFLAGS

Re: [Rd] FORTRAN compilation error

2012-02-09 Thread David L Lorenz
Simon,
  It was not clear that I needed any makefiles in src. I have seen no 
documentation anywhere that I needed a makefile in src. 
  The FORTRAN source compiles just fine by hand, so the error is not in 
the code. It is just one single source code file with one subroutine.
  The problem appears to be the z that is inserted in from the the object 
file name when the .dll is created.
  Thanks.
Dave



From:
Simon Urbanek 
To:
David L Lorenz 
Cc:
r-devel@r-project.org
Date:
02/09/2012 09:24 AM
Subject:
Re: [Rd] FORTRAN compilation error



On Feb 9, 2012, at 9:54 AM, David L Lorenz wrote:

> 
> I should also have explained that I was using the default Makeconf file 
in R-2.14.1\etc\i386. it is reproduced below. I've tried it on other 
packages and it inserts a z in front of the object files. 

I'm not talking about R Makeconf, but the one in your package (in src). 
What are your settings there? And what are the files?

Thanks,
Simon



> Dave 
> 
> #-*- Makefile -*- 
> # $(R_HOME}/etc$(R_ARCH)/Makeconf 
> 
> # Hand-edited version for gnuwin32. 
> 
> ifdef DEBUG 
>   DLLFLAGS= 
>   DEBUGFLAG=-gdwarf-2 
> else 
>   DLLFLAGS=-s 
>   DEBUGFLAG= 
> endif 
> 
> DLLFLAGS+= -static-libgcc 
> LINKFLAGS+= -static-libgcc 
> 
> ## Things which are substituted by fixed/Makefile (and also -O3 -> -O2) 
> WIN = 32 
> BINPREF = 
> # SYMPAT = 's/^.* [BCDRT] _/ /p' for 32-bit 
> # SYMPAT = 's/^.* [BCDRT] / /p' for 64-bit 
> SYMPAT = 's/^.* [BCDRT] _/ /p' 
> IMPDIR = bin/i386 
> # flags for multilib builds, for compilers, dlltool and windres 
> M_ARCH = 
> DT_ARCH = 
> RC_ARCH = 
> # Used by packages tcltk and tkrplot 
> TCL_HOME = $(R_HOME)/Tcl 
> LOCAL_SOFT = d:/RCompile/CRANpkg/extralibs/local 
> 
> ifneq ($(strip $(LOCAL_SOFT)),) 
> LOCAL_CPPFLAGS = -I"$(LOCAL_SOFT)/include" 
> LOCAL_LIBS = -L"$(LOCAL_SOFT)/lib$(R_ARCH)" -L"$(LOCAL_SOFT)/lib" 
> endif 
> 
> DLLTOOL = $(BINPREF)dlltool --as $(BINPREF)as $(DT_ARCH) 
> DLLTOOLFLAGS = -k 
> NM = $(BINPREF)nm 
> RESCOMP = $(BINPREF)windres $(RC_ARCH) 
> ## MAIN_LD needs to be set by the package 
> LINKER = $(MAIN_LD) 
> ## as a default 
> DLL = $(CC) 
> 
> ## Things defined in Renviron on Unix 
> SED = sed 
> TAR = tar 
> 
> ## Things defined in MkRules 
> CAT = cat 
> CP = cp 
> MKDIR = mkdir 
> RM = rm -f 
> SORT = sort 
> 
> ## For use in packages 
> GRAPHAPP_LIB = -lRgraphapp 
> TCL_VERSION = 85 
> ZLIB_LIBS = -lRzlib 
> 
> AR = $(BINPREF)ar 
> ## Used by packages 'maps' and 'mapdata' 
> AWK = gawk 
> BLAS_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRblas 
> C_VISIBILITY = 
> CC = $(BINPREF)gcc $(M_ARCH) 
> CFLAGS = -O3 -Wall $(DEBUGFLAG) -std=gnu99 -mtune=core2 
> CPICFLAGS = 
> CPPFLAGS = 
> CXX = $(BINPREF)g++ $(M_ARCH) 
> CXXCPP = $(CXX) -E 
> CXXFLAGS = -O2 -Wall $(DEBUGFLAG) -mtune=core2 
> CXXPICFLAGS = 
> DYLIB_EXT = .dll 
> DYLIB_LD = $(DLL) 
> DYLIB_LDFLAGS = -shared 
> DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS) 
> ECHO = echo 
> ECHO_C = 
> ECHO_N = -n 
> ECHO_T = 
> FC = $(BINPREF)gfortran $(M_ARCH) 
> FCFLAGS = -O3 $(DEBUGFLAG) -mtune=core2 
> # additional libs needed when linking with $(FC), e.g. on Solaris 
> FCLIBS = 
> F77 = $(BINPREF)gfortran $(M_ARCH) 
> F77_VISIBILITY = 
> FFLAGS = -O3 $(DEBUGFLAG) -mtune=core2 
> FLIBS = -lgfortran 
> FCPICFLAGS = 
> FPICFLAGS = 
> FOUNDATION_CPPFLAGS = 
> FOUNDATION_LIBS = 
> JAR = 
> JAVA = 
> JAVAC = 
> JAVAH = 
> # JAVA_HOME = 
> # JAVA_LD_LIBRARY_PATH = 
> JAVA_LIBS = -L"$(JAVA_HOME)/bin/client" -ljvm -ljvm-w32 
> JAVA_CPPFLAGS = -I"$(JAVA_HOME)/../include" 
-I"$(JAVA_HOME)/../include/win32" 
> LAPACK_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRlapack 
> ## we only need this is if it is external, as otherwise link to R 
> LIBINTL= 
> LIBM = -lm 
> LIBR = -L"$(R_HOME)/$(IMPDIR)" -lR 
> LIBS =  -lm 
> ## needed by R CMD config 
> LIBnn = lib 
> LIBTOOL = 
> LDFLAGS = 
> ## needed to build applications linking to static libR 
> # MAIN_LD = 
> # MAIN_LDFLAGS = 
> # MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS) 
> # don't have this: would 'mkdir -p' do? 
> # MKINSTALLDIRS = $(R_HOME)/bin/mkinstalldirs 
> OBJC = $(CC) 
> OBJCFLAGS = -O2 
> OBJC_LIBS = -lobjc 
> OBJCXX = 
> R_ARCH = /i386 
> RANLIB = $(BINPREF)ranlib 
> SAFE_FFLAGS = -O3 -ffloat-store 
> SED = sed 
> ## it seems some makes (but not ours) get upset if SHELL is set. 
> # SHELL = /bin/sh 
> SHLIB_CFLAGS = 
> SHLIB_CXXFLAGS = 
> SHLIB_CXXLD = $(CXX) 
> ## ideally -shared -static-libstdc++, but not for gcc 4.2.1 
> SHLIB_CXXLDFLAGS = -shared 
> SHLIB_EXT = .dll 
> SHLIB_FCLD = $(FC) 
> ## ideally -shared -static-libgfortran, but not for gcc 4.2.1 
> SHLIB_FCLDFLAGS = -shared 
> SHLIB_FFLAGS = 
> SHLIB_LD = $(CC) 
> SHLIB_LDFLAGS = -shared 
> SHLIB_LIBADD = 
> SHLIB_LINK = $(SHLIB_LD) -Wl,--export-all-symbols $(SHLIB_LDFLAGS) 
$(LDFLAGS) 
> # not implemented in current toolchain 
> SHLIB_OPENMP_CFLAGS = 
> SHLIB_OPENMP_CXXFLAGS = 
> SHLIB_OPENMP_FCFLAGS = 
> SHLIB_OPENMP_FFLAGS = 
> STRIP_LIBS = $(BINPREF)strip --strip-unneeded 
> STRIP_STATIC_LIBS = $(BINPREF)strip

Re: [Rd] FORTRAN compilation error

2012-02-09 Thread Simon Urbanek
David,

On Feb 9, 2012, at 10:48 AM, David L Lorenz wrote:

> 
> Simon, 
>   It was not clear that I needed any makefiles in src. I have seen no 
> documentation anywhere that I needed a makefile in src. 

You don't - I thought you are using one to modify the object list. Simple 
output of ls -l in your src would have been very helpful with your first e-mail 
;).


>   The FORTRAN source compiles just fine by hand, so the error is not in the 
> code. It is just one single source code file with one subroutine. 
>   The problem appears to be the z that is inserted in from the the object 
> file name when the .dll is created. 

Actually, I think I now see the problem - you have incompatible "make" on your 
PATH that does not come form the R tools (easy way to tell is that our make is 
case-sensitive while yours is not - hence the warning). Please make sure you 
have Rtools on your PATH *before* any other tools.

Cheers,
Simon


> 
> 
> From: Simon Urbanek 
> To:   David L Lorenz 
> Cc:   r-devel@r-project.org
> Date: 02/09/2012 09:24 AM
> Subject:  Re: [Rd] FORTRAN compilation error
> 
> 
> 
> 
> On Feb 9, 2012, at 9:54 AM, David L Lorenz wrote:
> 
> > 
> > I should also have explained that I was using the default Makeconf file in 
> > R-2.14.1\etc\i386. it is reproduced below. I've tried it on other packages 
> > and it inserts a z in front of the object files. 
> 
> I'm not talking about R Makeconf, but the one in your package (in src). What 
> are your settings there? And what are the files?
> 
> Thanks,
> Simon
> 
> 
> 
> > Dave 
> > 
> > #-*- Makefile -*- 
> > # $(R_HOME}/etc$(R_ARCH)/Makeconf 
> > 
> > # Hand-edited version for gnuwin32. 
> > 
> > ifdef DEBUG 
> >   DLLFLAGS= 
> >   DEBUGFLAG=-gdwarf-2 
> > else 
> >   DLLFLAGS=-s 
> >   DEBUGFLAG= 
> > endif 
> > 
> > DLLFLAGS+= -static-libgcc 
> > LINKFLAGS+= -static-libgcc 
> > 
> > ## Things which are substituted by fixed/Makefile (and also -O3 -> -O2) 
> > WIN = 32 
> > BINPREF = 
> > # SYMPAT = 's/^.* [BCDRT] _/ /p' for 32-bit 
> > # SYMPAT = 's/^.* [BCDRT] / /p' for 64-bit 
> > SYMPAT = 's/^.* [BCDRT] _/ /p' 
> > IMPDIR = bin/i386 
> > # flags for multilib builds, for compilers, dlltool and windres 
> > M_ARCH = 
> > DT_ARCH = 
> > RC_ARCH = 
> > # Used by packages tcltk and tkrplot 
> > TCL_HOME = $(R_HOME)/Tcl 
> > LOCAL_SOFT = d:/RCompile/CRANpkg/extralibs/local 
> > 
> > ifneq ($(strip $(LOCAL_SOFT)),) 
> > LOCAL_CPPFLAGS = -I"$(LOCAL_SOFT)/include" 
> > LOCAL_LIBS = -L"$(LOCAL_SOFT)/lib$(R_ARCH)" -L"$(LOCAL_SOFT)/lib" 
> > endif 
> > 
> > DLLTOOL = $(BINPREF)dlltool --as $(BINPREF)as $(DT_ARCH) 
> > DLLTOOLFLAGS = -k 
> > NM = $(BINPREF)nm 
> > RESCOMP = $(BINPREF)windres $(RC_ARCH) 
> > ## MAIN_LD needs to be set by the package 
> > LINKER = $(MAIN_LD) 
> > ## as a default 
> > DLL = $(CC) 
> > 
> > ## Things defined in Renviron on Unix 
> > SED = sed 
> > TAR = tar 
> > 
> > ## Things defined in MkRules 
> > CAT = cat 
> > CP = cp 
> > MKDIR = mkdir 
> > RM = rm -f 
> > SORT = sort 
> > 
> > ## For use in packages 
> > GRAPHAPP_LIB = -lRgraphapp 
> > TCL_VERSION = 85 
> > ZLIB_LIBS = -lRzlib 
> > 
> > AR = $(BINPREF)ar 
> > ## Used by packages 'maps' and 'mapdata' 
> > AWK = gawk 
> > BLAS_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRblas 
> > C_VISIBILITY = 
> > CC = $(BINPREF)gcc $(M_ARCH) 
> > CFLAGS = -O3 -Wall $(DEBUGFLAG) -std=gnu99 -mtune=core2 
> > CPICFLAGS = 
> > CPPFLAGS = 
> > CXX = $(BINPREF)g++ $(M_ARCH) 
> > CXXCPP = $(CXX) -E 
> > CXXFLAGS = -O2 -Wall $(DEBUGFLAG) -mtune=core2 
> > CXXPICFLAGS = 
> > DYLIB_EXT = .dll 
> > DYLIB_LD = $(DLL) 
> > DYLIB_LDFLAGS = -shared 
> > DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS) 
> > ECHO = echo 
> > ECHO_C = 
> > ECHO_N = -n 
> > ECHO_T = 
> > FC = $(BINPREF)gfortran $(M_ARCH) 
> > FCFLAGS = -O3 $(DEBUGFLAG) -mtune=core2 
> > # additional libs needed when linking with $(FC), e.g. on Solaris 
> > FCLIBS = 
> > F77 = $(BINPREF)gfortran $(M_ARCH) 
> > F77_VISIBILITY = 
> > FFLAGS = -O3 $(DEBUGFLAG) -mtune=core2 
> > FLIBS = -lgfortran 
> > FCPICFLAGS = 
> > FPICFLAGS = 
> > FOUNDATION_CPPFLAGS = 
> > FOUNDATION_LIBS = 
> > JAR = 
> > JAVA = 
> > JAVAC = 
> > JAVAH = 
> > # JAVA_HOME = 
> > # JAVA_LD_LIBRARY_PATH = 
> > JAVA_LIBS = -L"$(JAVA_HOME)/bin/client" -ljvm -ljvm-w32 
> > JAVA_CPPFLAGS = -I"$(JAVA_HOME)/../include" 
> > -I"$(JAVA_HOME)/../include/win32" 
> > LAPACK_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRlapack 
> > ## we only need this is if it is external, as otherwise link to R 
> > LIBINTL= 
> > LIBM = -lm 
> > LIBR = -L"$(R_HOME)/$(IMPDIR)" -lR 
> > LIBS =  -lm 
> > ## needed by R CMD config 
> > LIBnn = lib 
> > LIBTOOL = 
> > LDFLAGS = 
> > ## needed to build applications linking to static libR 
> > # MAIN_LD = 
> > # MAIN_LDFLAGS = 
> > # MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS) 
> > # don't have this: would 'mkdir -p' do? 
> > # MKINSTALLDIRS = $(R_HOME)/bin/mkinstalldirs 
> > OBJC = $(CC) 
> > OBJCFLAGS = -O2 
> > OBJC_LIBS = -lobjc 
> > OBJCXX = 
> > R_ARCH = /i386 

[Rd] na.omit option in prcomp: formula interface only

2012-02-09 Thread Ben Bolker

  This is a wishlist/request for discussion about the behaviour of the
na.action option in prcomp, specifically the fact that it only applies
to the formula interface.

   I had a question from a friend (who is smart and careful and
generally R's TFM, although like all of us he misses things sometimes)
asking why the na.action= argument didn't seem to be doing anything in
prcomp (i.e. one gets an "Error in svd(x, nu=0): infinite or missing
values in 'x'").  Some poking later, I realized that na.action only
applied to the formula interface (so I told him to try
prcomp(~.,data=x,...) instead).  Sufficiently careful reading of the
help page, with hindsight, revealed that na.action only appears in the
arguments for the formula method, not the default (on the other hand,
'scale.' only appears in the default formula, but it *does* work with
prcomp.formula as well, because prcomp.formula passes ... through to
prcomp.default ...)

  Would it be reasonable to (at least) add a sentence to the
documentation saying that na.action applies only to the formula
interface or (possibly) to add some NA-processing machinery to
prcomp.default to allow it to handle na.action as well?  (I can
appreciate from looking at stats:::prcomp.formula that the NA-processing
is not completely trivial ...)

  Ben Bolker

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel