Ramon Diaz-Uriarte
2008-May-19 22:59 UTC
[Rd] using zlib in a package: problems in windows
Dear All, I am having trouble getting an R package to build and install correctly under Windows. In this package, which builds and checks OK under Linux, I use zlib (among other functions, gzprintf). As mentioned by Prof. Ripley a while back, the file "CHANGES" under src/gnuwin32 says explains that to, to use zlib, one has to set $(ZLIB_LIBS) in PKG_LIBS. I have a Makefile.win with just that. I have also downloaded the Windows toolset (Rtools.exe) which I have used to successfully build R-patched. However, I still cannot get the package to compile.>From the log, it seems that in fact the build is trying to use zlib,but the gzprintf symbol is not found. However, gzprintf is in the zlib.h header. 00install.out follows below. What am I doing wrong? Thanks, R. P.D. I am using Windows 2000 (under vmware). ---------- Making package RJaCGH ------------ ********************************************** WARNING: this package has a configure script It probably needs manual configuration ********************************************** adding build stamp to DESCRIPTION installing NAMESPACE file and metadata making DLL ... making nnhl.d from nnhl.c gcc -std=gnu99 -Ic:/R/R-patc~1/include -O3 -Wall -c nnhl.c -o nnhl.o windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I c:/R/R-patc~1/include -i RJaCGH_res.rc -o RJaCGH_res.o gcc -std=gnu99 -shared -s -o RJaCGH.dll RJaCGH.def nnhl.o RJaCGH_res.o -Lc:/R/R-patc~1/bin -lRzlib -lR nnhl.o:nnhl.c:(.text+0x138f): undefined reference to `gzprintf' nnhl.o:nnhl.c:(.text+0x13ae): undefined reference to `gzprintf' nnhl.o:nnhl.c:(.text+0x13d2): undefined reference to `gzprintf' nnhl.o:nnhl.c:(.text+0x13f6): undefined reference to `gzprintf' nnhl.o:nnhl.c:(.text+0x1415): undefined reference to `gzprintf' nnhl.o:nnhl.c:(.text+0x1451): more undefined references to `gzprintf' follow collect2: ld returned 1 exit status make[3]: *** [RJaCGH.dll] Error 1 make[2]: *** [srcDynlib] Error 2 make[1]: *** [all] Error 2 make: *** [pkg-RJaCGH] Error 2 *** Installation of RJaCGH failed *** -- Ramon Diaz-Uriarte Statistical Computing Team Structural Biology and Biocomputing Programme Spanish National Cancer Centre (CNIO) http://ligarto.org/rdiaz
gzprintf is not in Rzlib.dll. It has been commented out in the R build. So you will need to use you own copy of zlib. On Tue, 20 May 2008, Ramon Diaz-Uriarte wrote:> Dear All, > > I am having trouble getting an R package to build and install > correctly under Windows. In this package, which builds and checks OK > under Linux, I use zlib (among other functions, gzprintf). > > As mentioned by Prof. Ripley a while back, the file "CHANGES" under > src/gnuwin32 says explains that to, to use zlib, one has to set > $(ZLIB_LIBS) in PKG_LIBS. I have a Makefile.win with just that. > > I have also downloaded the Windows toolset (Rtools.exe) which I have > used to successfully build R-patched. However, I still cannot get the > package to compile. > >> From the log, it seems that in fact the build is trying to use zlib, > but the gzprintf symbol is not found. However, gzprintf is in the > zlib.h header. 00install.out follows below. > > What am I doing wrong? > > Thanks, > > R. > > P.D. I am using Windows 2000 (under vmware). > > > > > ---------- Making package RJaCGH ------------ > > ********************************************** > WARNING: this package has a configure script > It probably needs manual configuration > ********************************************** > > adding build stamp to DESCRIPTION > installing NAMESPACE file and metadata > making DLL ... > making nnhl.d from nnhl.c > gcc -std=gnu99 -Ic:/R/R-patc~1/include -O3 -Wall -c nnhl.c -o nnhl.o > windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I > c:/R/R-patc~1/include -i RJaCGH_res.rc -o RJaCGH_res.o > gcc -std=gnu99 -shared -s -o RJaCGH.dll RJaCGH.def nnhl.o > RJaCGH_res.o -Lc:/R/R-patc~1/bin -lRzlib -lR > nnhl.o:nnhl.c:(.text+0x138f): undefined reference to `gzprintf' > nnhl.o:nnhl.c:(.text+0x13ae): undefined reference to `gzprintf' > nnhl.o:nnhl.c:(.text+0x13d2): undefined reference to `gzprintf' > nnhl.o:nnhl.c:(.text+0x13f6): undefined reference to `gzprintf' > nnhl.o:nnhl.c:(.text+0x1415): undefined reference to `gzprintf' > nnhl.o:nnhl.c:(.text+0x1451): more undefined references to `gzprintf' follow > collect2: ld returned 1 exit status > make[3]: *** [RJaCGH.dll] Error 1 > make[2]: *** [srcDynlib] Error 2 > make[1]: *** [all] Error 2 > make: *** [pkg-RJaCGH] Error 2 > *** Installation of RJaCGH failed *** > > > > > -- > Ramon Diaz-Uriarte > Statistical Computing Team > Structural Biology and Biocomputing Programme > Spanish National Cancer Centre (CNIO) > http://ligarto.org/rdiaz > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595