sgaure / chebpol Goto Github PK
View Code? Open in Web Editor NEWSource code for R package chebpol on CRAN
Source code for R package chebpol on CRAN
I had some difficulty installing chebpol
in R 4.0.3
.
I was able to solve the problem and thought I would share the problem and solution here for everyone's sake.
Perhaps you can put a note about this in the documentation or a new installation guide for future reference.
I tried to install chebpol
from CRAN and it failed:
> install.packages("chebpol")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/chebpol_2.1-2.tar.gz'
Content type 'application/x-gzip' length 2349391 bytes (2.2 MB)
================================================== downloaded 2.2 MB
* installing *source* package ‘chebpol’ ...
** package ‘chebpol’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FFTW... yes
checking for GSL... yes
checking for working fftw_plan_r2r in R... Error in dyn.load("conftest.so") :
checking for working fftw_plan_r2r in R... Error in dyn.load("conftest.so") :
unable to load shared object '/tmp/Rtmpnqg7uw/R.INSTALL24b26868b96a/chebpol/conftest.so':
/tmp/Rtmpnqg7uw/R.INSTALL24b26868b96a/chebpol/conftest.so: cannot open shared object file: No
such file or directory
Execution halted
yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/config.h
config.status: src/config.h is unchanged
** libs
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fvisibility=hidden -fopenmp -fpic -g -
O2 -fdebug-prefix-map=/build/r-base-8T8CYO/r-base-4.0.3=. -fstack-protector-strong -Wformat -We
rror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c chebpol.c -o chebpol.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -fvisibility=hidden -fopenmp -fpic -g -
O2 -fdebug-prefix-map=/build/r-base-8T8CYO/r-base-4.0.3=. -fstack-protector-strong -Wformat -We
rror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c stalker.c -o stalker.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o chebpol.so che
bpol.o stalker.o -L/usr/local/lib -lfftw3 -lgsl -lgslcblas -lm -llapack -lblas -lgfortran -lm -
lquadmath -fopenmp -fopenmp -L/usr/lib/R/lib -lR
/usr/bin/ld: /usr/local/lib/libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol `stdo
ut@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: chebpol.so] Error 1
ERROR: compilation failed for package ‘chebpol’
* removing ‘/usr/local/lib/R/site-library/chebpol’
The downloaded source packages are in
‘/tmp/RtmpbkIO5x/downloaded_packages’
Warning message:
In install.packages("chebpol") :
installation of package ‘chebpol’ had non-zero exit status
The function fftw_plan_r2r
referred to in the error message is from the fftw
package.
I found a github issue from another repository with a similar error message. There, it was suggested to provide the flag --enable-shared
when building the FFTW package.
This therefore requires us to download and build the FFTW package from source, not from a package manager like apt-get
.
I did this as follows:
wget https://www.fftw.org/fftw-3.3.9.tar.gz
tar zxvf fftw-3.3.9.tar.gz
cd fftw-3.3.9
./configure --enable-shared
make
sudo make install
and then when I tried to install chebpol
in R
again, it worked!
install.packages("chebpol")
For reference, here is some session info:
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] rstudioapi_0.13 magrittr_2.0.1 usethis_2.0.1
[4] devtools_2.4.2 pkgload_1.2.1 R6_2.5.0
[7] rlang_0.4.11 fastmap_1.0.1 tools_4.0.3
[10] pkgbuild_1.2.0 sessioninfo_1.1.1 cli_3.0.1
[13] withr_2.4.2 ellipsis_0.3.2 remotes_2.3.0
[16] rprojroot_2.0.2 lifecycle_1.0.0 crayon_1.4.1
[19] processx_3.5.2 BiocManager_1.30.16 purrr_0.3.4
[22] callr_3.7.0 fs_1.5.0 ps_1.4.0
[25] testthat_3.0.3 curl_4.3 memoise_2.0.0
[28] glue_1.4.2 cachem_1.0.4 compiler_4.0.3
[31] desc_1.3.0 prettyunits_1.1.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.