Re: [R-pkg-devel] fftw linking

2018-02-04 Thread Dirk Eddelbuettel

On 4 February 2018 at 15:38, Denis Rastegaev wrote:
| I try to upload my package on CRAN but the package
| does not pass the incoming checks. How to link external
| compiler with fftw?

CRAN is a treasure trove with over 12k packages. Learn to search it.

For example, package fftwtools has this line in its src/Makevars.win:
   PKG_LIBS= -lfftw3 -lm  
See https://github.com/cran/fftwtools/blob/master/src/Makevars.win#L12
It appears to be producing Windows binaries based on its CRAN page.

For example package fftw has a 'SystemRequirements: fftw3' but also provides
Windows binaries.  Its src/Makrvars.win has
   PKG_LIBS=-L$(LIB_FFTW)/lib -l fftw3
so it seems to use the (documented !!) facility of using a _predefined set_
of external libraries via an environment variable.  For what it is worth, I
do the same for the GSL.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[R-pkg-devel] fftw linking

2018-02-04 Thread Denis Rastegaev
Hello everyone!
I try to upload my package on CRAN but the package
does not pass the incoming checks. How to link external
compiler with fftw? My package on github:
https://github.com/drastega/specklestar

Installation log:

* installing *source* package 'specklestar' ...
** libs

*** arch - i386
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++
-I"D:/RCompile/recent/R/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"
-I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
-mtune=core2 -c RcppExports.cpp -o RcppExports.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++
-I"D:/RCompile/recent/R/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"
-I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
-mtune=core2 -c image_helper.cpp -o image_helper.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++
-I"D:/RCompile/recent/R/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"
-I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
-mtune=core2 -c middle_frame.cpp -o middle_frame.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++
-I"D:/RCompile/recent/R/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"
-I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
-mtune=core2 -c ps.cpp -o ps.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++
-I"D:/RCompile/recent/R/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"
-I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
-mtune=core2 -c ps_diff.cpp -o ps_diff.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++
-I"D:/RCompile/recent/R/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"
-I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
-mtune=core2 -c speckle_acf.cpp -o speckle_acf.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++
-I"D:/RCompile/recent/R/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"
-I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
-mtune=core2 -c speckle_generator.cpp -o speckle_generator.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++
-I"D:/RCompile/recent/R/include" -DNDEBUG
-I"d:/RCompile/CRANpkg/lib/3.5/Rcpp/include"
-I"d:/Compiler/gcc-4.9.3/local330/include" -pedantic -O2 -Wall
-mtune=core2 -c speckle_stat.cpp -o speckle_stat.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/g++ -shared -s -static-libgcc -o
specklestar.dll tmp.def RcppExports.o image_helper.o middle_frame.o
ps.o ps_diff.o speckle_acf.o speckle_generator.o speckle_stat.o
-Ld:/Compiler/gcc-4.9.3/local330/lib/i386
-Ld:/Compiler/gcc-4.9.3/local330/lib -LD:/RCompile/recent/R/bin/i386
-lR
ps.o:ps.cpp:(.text+0x669): undefined reference to `fftw_malloc'
ps.o:ps.cpp:(.text+0x77d): undefined reference to `fftw_plan_dft_r2c_2d'
ps.o:ps.cpp:(.text+0x787): undefined reference to `fftw_execute'
ps.o:ps.cpp:(.text+0x78f): undefined reference to `fftw_destroy_plan'
ps.o:ps.cpp:(.text+0x7de): undefined reference to `fftw_free'
ps_diff.o:ps_diff.cpp:(.text+0x699): undefined reference to `fftw_malloc'
ps_diff.o:ps_diff.cpp:(.text+0xd27): undefined reference to
`fftw_plan_dft_r2c_2d'
ps_diff.o:ps_diff.cpp:(.text+0xd31): undefined reference to `fftw_execute'
ps_diff.o:ps_diff.cpp:(.text+0xd39): undefined reference to `fftw_destroy_plan'
ps_diff.o:ps_diff.cpp:(.text+0xda0): undefined reference to `fftw_free'
speckle_acf.o:speckle_acf.cpp:(.text+0x323): undefined reference to
`fftw_malloc'
speckle_acf.o:speckle_acf.cpp:(.text+0x349): undefined reference to
`fftw_plan_dft_c2r_2d'
speckle_acf.o:speckle_acf.cpp:(.text+0x354): undefined reference to
`fftw_execute'
speckle_acf.o:speckle_acf.cpp:(.text+0x35f): undefined reference to
`fftw_destroy_plan'
speckle_acf.o:speckle_acf.cpp:(.text+0x384): undefined reference to `fftw_free'
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 'specklestar'
* removing 'd:/RCompile/CRANincoming/R-devel/lib/specklestar'
In R CMD INSTALL

[[alternative HTML version deleted]]

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