C'est une question un peu en double (voir Comment définir PATH pour R installé dans mon répertoire ) mais j'ai rencontré un nouveau problème avec la nouvelle version de R.
J'essayais d'installer une nouvelle version de R (R 3.3.1) dans mon propre répertoire.
J'ai suivi mon flux d'installation précédent
Mais j'ai rencontré un problème que je n'avais pas auparavant.
./configure --prefix=$HOME/Programme/R-3.3.1
.......
checking for zlib.h... yes
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and headers are required
il semble que la version de zlib soit trop basse, j'ai donc installé la version actuelle de zlib
tar xvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=$HOME/Programme/zlib-1.2.11
make && make install
puis j'ai essayé de refaire la configuration pour R comme :
./configure --prefix=$HOME/Programme/R-3.3.1 --enable-R-shlib LDFLAGS="-L/$HOME/Programme/zlib-1.2.11/lib" CPPFLAGS="-I/$HOME/Programme/zlib-1.2.11/include"
j'ai toujours la même erreur :
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and headers are required
Ensuite, j'ai remarqué que quelqu'un contournait le problème en modifiant le fichier de configuration de R
J'ai suivi cet exemple, j'ai résolu l'erreur zlib.
mais d'autres erreurs se sont ensuivies. Pour résumer,
j'ai installé d'autres bibliothèques dépendantes
tar xvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=$HOME$Programme/zlib-1.2.11
make && make install
tar zxvf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
make -f Makefile-libbz2_so
make clean
# modify the Makefile (original: CC=gcc after modification: CC=gcc -fPIC) as suggested [here][2]
make
make install PREFIX=/opt/bzip2-1.0.6
tar zxvf xz-5.2.3.tar.gz
cd /root/xz-5.2.3
./configure --prefix=$HOME/Programme/xz-5.2.3
make -j3
make install
tar zxvf pcre-8.40.tar.gz
cd /root/pcre-8.40
./configure --prefix=$HOME/Programme/pcre-8.40 --enable-utf8
make -j3 && make install
tar zxvf curl-7.52.1.tar.gz
cd /root/curl-7.52.1
./configure --prefix=$HOME/Programme/curl-7.52.1
make && make install
./configure --prefix=$HOME/Programme/R-3.3.1 --enable-R-shlib LDFLAGS="-L/$HOME/Programme/zlib-1.2.11/lib -L/$HOME/Programme/bzip2-1.0.6/lib -L/$HOME/Programme/xz-5.2.3/lib -L/$HOME/Programme/pcre-8.40/lib -L/$HOME/Programme/curl-7.52.1/lib" CPPFLAGS="-I/$HOME/Programme/zlib-1.2.11/include -I/$HOME/Programme/bzip2-1.0.6/include -I/$HOME/Programme/xz-5.2.3/include -I/$HOME/Programme/pcre-8.40/include -I/$HOME/Programme/curl-7.52.1/include"
La configuration semble fonctionner :
R is now configured for x86_64-pc-linux-gnu
Source directory: .
Installation directory: $HOME/Programme/R-3.3.1
C compiler: gcc -std=gnu99 -g -O2
Fortran 77 compiler: gfortran -g -O2
C++ compiler: g++ -g -O2
C++11 compiler: g++ -std=c++0x -g -O2
Fortran 90/95 compiler: gfortran -g -O2
Obj-C compiler:
Interfaces supported: X11, tcltk
External libraries: readline, curl
Additional capabilities: PNG, JPEG, NLS, cairo, ICU
Options enabled: shared R library, shared BLAS, R profiling
Capabilities skipped: TIFF
Options not enabled: memory profiling
Recommended packages: yes
mais quand j'appelle
make && make install
encore "faire" n'a pas pu le faire jusqu'à la fin :
...
gcc -std=gnu99 -Wl,--export-dynamic -fopenmp -L../../lib -L//HOME/Programme/zlib-1.2.11/lib -L//HOME/Programme/bzip2-1.0.6/lib -L//HOME/Programme/xz-5.2.3/lib -L//HOME/Programme/pcre-8.40/lib -L//HOME/Programme/curl-7.52.1/lib -o R.bin Rmain.o -lR -lRblas
/usr/bin/ld: warning: libpcre.so.1, needed by ../../lib/libR.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: liblzma.so.5, needed by ../../lib/libR.so, not found (try using -rpath or -rpath-link)
../../lib/libR.so: undefined reference to `pcre_fullinfo'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `pcre_config'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `pcre_free'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `pcre_exec'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `pcre_maketables'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
../../lib/libR.so: undefined reference to `pcre_compile'
../../lib/libR.so: undefined reference to `pcre_study'
../../lib/libR.so: undefined reference to `pcre_version'
../../lib/libR.so: undefined reference to `[email protected]_5.0'
collect2: error: ld returned 1 exit status
...
make: *** [R] Error 1
Suivi :
Sur la base de la suggestion de thrig, j'ai ajouté les lignes ci-dessous à mon fichier .cshrc
setenv LD_LIBRARY_PATH $HOME/Programme/pcre-8.40/lib
setenv LD_LIBRARY_PATH $HOME/Programme/xz-5.2.3/lib
et
source .cshrc
problème résolu !
En relation :Comment faire en sorte que `date` affiche l'heure d'un fuseau horaire différent ?Réponse acceptée :
C'est la solution au problème mentionné ci-dessus
Suivez l'exemple pour modifier le fichier de configuration de R Alors :
tar xvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=$HOME/Programme/zlib-1.2.11
make && make install
tar zxvf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
make -f Makefile-libbz2_so
make clean
modifier le Makefile (original :CC=gcc après modification :CC=gcc -fPIC) comme suggéré ici
make
make install PREFIX=$HOME/Programme/bzip2-1.0.6
tar zxvf xz-5.2.3.tar.gz
cd xz-5.2.3
./configure --prefix=$HOME/Programme/xz-5.2.3
make -j3
make install
tar zxvf pcre-8.40.tar.gz
cd pcre-8.40
./configure --prefix=$HOME/Programme/pcre-8.40 --enable-utf8
make -j3 && make install
tar zxvf curl-7.52.1.tar.gz
cd curl-7.52.1
./configure --prefix=$HOME/Programme/curl-7.52.1 --with-ssl
make && make install
./configure --prefix=$HOME/Programme/R-3.3.1 --enable-R-shlib LDFLAGS="-L/$HOME/Programme/zlib-1.2.11/lib -L/$HOME/Programme/bzip2-1.0.6/lib -L/$HOME/Programme/xz-5.2.3/lib -L/$HOME/Programme/pcre-8.40/lib -L/$HOME/Programme/curl-7.52.1/lib" CPPFLAGS="-I/$HOME/Programme/zlib-1.2.11/include -I/$HOME/Programme/bzip2-1.0.6/include -I/$HOME/Programme/xz-5.2.3/include -I/$HOME/Programme/pcre-8.40/include -I/$HOME/Programme/curl-7.52.1/include"
Ajoutez les lignes ci-dessous à mon fichier .cshrc
setenv LD_LIBRARY_PATH $HOME/Programme/pcre-8.40/lib
setenv LD_LIBRARY_PATH $HOME/Programme/xz-5.2.3/lib
et
source .cshrc
Allez maintenant dans le répertoire R-3.3.1 :
make && make install
ça devrait marcher.