From mboxrd@z Thu Jan 1 00:00:00 1970 From: Moritz Lell Subject: How can I change the Makeconf file of R to not use hardcoded, wrong include paths when compiling a package with Rcpp Date: Tue, 14 Jan 2020 00:49:31 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56116) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ir9Sl-0006tj-Rc for help-guix@gnu.org; Mon, 13 Jan 2020 18:49:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ir9Sh-0004T4-Jf for help-guix@gnu.org; Mon, 13 Jan 2020 18:49:39 -0500 Received: from mout02.posteo.de ([185.67.36.66]:58079) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ir9Sh-0004Qa-0L for help-guix@gnu.org; Mon, 13 Jan 2020 18:49:35 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 8A5082400FC for ; Tue, 14 Jan 2020 00:49:32 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 47xVgJ074Yz9rxD for ; Tue, 14 Jan 2020 00:49:31 +0100 (CET) Content-Language: en-US-large List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org Hello! to reproduce a scientific project, I need a setup with an old R version (3.4.3), together with other, newer libraries. I created a profile, the manifest and package definitions are below. However, when loading the profile I cannot compile R packages with this version: The last lines of the output of `install.packages("Rcpp_1.0.3.tar.gz", repos =3D NULL)` (I have to manually download/use the miniCRAN package because of SSL errors while downloading via R but that is another questio= n) --- begin -------------------------------------------------------------- g++ -shared -L/gnu/store/d64gfblqc5b9gmwj3rbl8nx3zwbf973b-r-minimal-3.4.3/lib/R/lib -L/usr/local/lib -o Rcpp.so api.o attributes.o barrier.o date.o module.o rcpp_init.o -L/gnu/store/d64gfblqc5b9gmwj3rbl8nx3zwbf973b-r-minimal-3.4.3/lib/R/lib -= lR installing to /home/moritz/IPK/R/code/Unbalanced/renv/library/R-3.4/x86_64-unknown-linu= x-gnu/Rcpp/libs ** R ** inst ** preparing package for lazy loading code for methods in class =E2=80=9CC++OverloadedMethods=E2=80=9D was not = checked for suspicious field assignments (recommended package =E2=80=98codetools=E2=80= =99 not available?) code for methods in class =E2=80=9CRcppClass=E2=80=9D was not checked for= suspicious field assignments (recommended package =E2=80=98codetools=E2=80=99 not av= ailable?) code for methods in class =E2=80=9CRcppClass=E2=80=9D was not checked for= suspicious field assignments (recommended package =E2=80=98codetools=E2=80=99 not av= ailable?) ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded Error: package or namespace load failed for =E2=80=98Rcpp=E2=80=99 in dyn= .load(file, DLLpath =3D DLLpath, ...): kann shared object '/home/user/r-test/renv/library/R-3.4/x86_64-unknown-linux-gnu/Rcpp/libs/= Rcpp.so' nicht laden: /gnu/store/5imx9c2y6bkd27rprrghnaw59x0svyxb-gfortran-7.4.0-lib/lib/libstd= c++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/user/r-test/renv/library/R-3.4/x86_64-unknown-linux-gnu/Rcpp/libs/R= cpp.so) --- end --------------------------------------------------------------- The problem is `-I/usr/local/include` in the g++ call. It refers to a directory outside of my GUIX installation and hence I get errors because libraries there mismatch with those inside GUIX. Apparently, GUIX libs are used for the linker but not for the compiler. The problem lies in the file /gnu/store/d64gfblqc5b9gmwj3rbl8nx3zwbf973b-r-minimal-3.4.3/etc/Makeconf --- begin ------------------------------------------------------------ ... CPPFLAGS =3D -I/usr/local/include ... FLIBS =3D -L/gnu/store/5imx9c2y6bkd27rprrghnaw59x0svyxb-gfortran-7.4.0-lib/lib/gcc/= x86_64-unknown-linux-gnu/7.4.0 -L/gnu/store/5imx9c2y6bkd27rprrghnaw59x0svyxb-gfortran-7.4.0-lib/lib -lgfortran -lm -lquadmath --- end -------------------------------------------------------------- CPPFLAGS is set to the wrong, hardcoded value, but for example FLIBS is set correctly. How can I install R such that CPPFLAGS refers to the /lib/include directory of my profile or doesn't refer to anything? I can define the PKG_CXXFLAGS environment variable that can be used to insert additional header locations for R compilation, but unfortunately they are inserted after the R default locations. But I can use it if the R default is set to nothing. I've also tested setting CPLUS_INCLUDE_PATH and PKG_CPPFLAGS, to no avail. Cheers, Moritz =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Appendix: Profile manifests and other files manifest.scm --- manifest file for guix package packages/ --- include in GUIX_PACKAGE_PATH packages/statistics.scm --- Checked out from the guix repo with `git show cbe1314a7e:gnu/packages/statistics.scm` and edited to only include r-minimal packages/old-tzdata.scm --- for the package tzdata-2017b ----------------------------------------------------------------------- # Commands to create the files needed to reproduce the problem mkdir packages cat >manifest.scm <manifest '("r-minimal@3.4.3" "glibc-utf8-locales" "gcc-toolchain" "gfortran-toolchain")) EOF # ---------------------------------------------------------------------- cat >packages/old-tzdata.scm <packages/statistics.scm <