2016-04-18 3 views
1

Je suis en train de compiler le paquet R "Cairo" à partir de Source (https://cran.r-project.org/web/packages/Cairo/index.html, dernière version) pour R3.2.4.Compiler Cairo R package - /usr/lib64/libcairo.a: erreur lors de l'ajout de symboles: Bad value

Ceci est nécessaire car le serveur (SLES11 SP4, aucune option de modification) sur lequel cela doit être installé n'a pas de connexion Internet, donc je ne peux pas installer à partir de repo.

Certains problèmes sont déjà résolus en réglant les variables d'environnement correctes (voir les paramètres ci-dessous). Malheureusement essayer d'installer le paquet me donne encore une erreur de compilation après la configuration.

Réglages:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64 
export CAIRO_INCLUDE_PATH=/usr/include/cairo 
export CAIRO_CFLAGS='-I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12' 
export CAIRO_LIBS='-L/usr/lib64 -lcairo -lfreetype -lpixman-1 -lfontconfig -lpng12 -lz -lXrender -lX11' 

sortie (sur R): commandline

> install.packages("/home/username/R_packages/Cairo_1.5-9.tar.gz", type="source", repos=NULL) 
* installing *source* package ‘Cairo’ ... 
** package ‘Cairo’ successfully unpacked and MD5 sums checked 
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 how to run the C preprocessor... gcc -std=gnu99 -E 
checking for grep that handles long lines and -e... /usr/bin/grep 
checking for egrep... /usr/bin/grep -E 
checking for ANSI C header files... yes 
checking for sys/wait.h that is POSIX.1 compatible... yes 
checking for sys/types.h... yes 
checking for sys/stat.h... yes 
checking for stdlib.h... yes 
checking for string.h... yes 
checking for memory.h... yes 
checking for strings.h... yes 
checking for inttypes.h... yes 
checking for stdint.h... yes 
checking for unistd.h... yes 
checking for string.h... (cached) yes 
checking sys/time.h usability... yes 
checking sys/time.h presence... yes 
checking for sys/time.h... yes 
checking for unistd.h... (cached) yes 
checking for an ANSI C-conforming const... yes 
checking for pkg-config... /usr/bin/pkg-config 
configure: CAIRO_CFLAGS=-I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 
checking if R was compiled with the RConn patch... no 
checking cairo.h usability... yes 
checking cairo.h presence... yes 
checking for cairo.h... yes 
checking for PNG support in Cairo... yes 
checking for ATS font support in Cairo... no 
configure: CAIRO_LIBS=-L/usr/lib64 -lcairo -lfreetype -lpixman-1 -lfontconfig -lpng12 -lz -lXrender -lX11 
checking for library containing deflate... none required 
checking whether Cairo programs can be compiled... yes 
checking whether cairo_image_surface_get_format is declared... no 
checking for FreeType support in cairo... yes 
checking whether FreeType needs additional flags... no 
checking wheter libjpeg works... no 
checking wheter libtiff works... no 
configure: creating ./config.status 
config.status: creating src/Makevars 
config.status: creating src/cconfig.h 
** libs 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c cairobem.c -o cairobem.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c cairogd.c -o cairogd.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c cairotalk.c -o cairotalk.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c img-backend.c -o img-backend.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c img-jpeg.c -o img-jpeg.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c img-tiff.c -o img-tiff.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c pdf-backend.c -o pdf-backend.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c ps-backend.c -o ps-backend.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c svg-backend.c -o svg-backend.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c w32-backend.c -o w32-backend.o 
gcc -std=gnu99 -I/home/username/R3/lib64/R/include -DNDEBUG -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/fontconfig -I/usr/include/libpng12 -I. -Iinclude -I/usr/local/include -g -O2 -fpic -g -O2 -c xlib-backend.c -o xlib-backend.o 
gcc -std=gnu99 -shared -L/home/username/R3/lib64/R/lib -L/usr/local/lib64 -o Cairo.so cairobem.o cairogd.o cairotalk.o img-backend.o img-jpeg.o img-tiff.o pdf-backend.o ps-backend.o svg-backend.o w32-backend.o xlib-backend.o -L/usr/lib64 -lcairo -lfreetype -lpixman-1 -lfontconfig -lpng12 -lz -lXrender -lX11 -L/home/username/R3/lib64/R/lib -lR 
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/libcairo.a(cairo.o): relocation R_X86_64_32 against `_cairo_pattern_nil' can not be used when making a shared object; recompile with -fPIC 
/usr/lib64/libcairo.a: error adding symbols: Bad value 
collect2: ld returned 1 exit status 
make: *** [Cairo.so] Error 1 
ERROR: compilation failed for package ‘Cairo’ 
* removing ‘/home/username/R3/lib64/R/library/Cairo’ 
Warning message: 
In install.packages("/home/username/R_packages/Cairo_1.5-9.tar.gz", : 
    installation of package ‘/home/username/R_packages/Cairo_1.5-9.tar.gz’ had non-zero exit status 

Espérons que certains gcc/ld/R compilation expert peut me dire ce qui ne va pas et comment je peux résoudre ce problème.

Merci, BadTenMan

+0

Dans la dernière ligne de votre env, essayez de supprimer '-lcairo'. – dlmeetei

+0

Cela ne fonctionne pas, Erreur: configurer: CAIRO_LIBS = -L/usr/lib64 -lfreetype -lpixman-1 -lfontconfig -lpng12 -lz -lXrender -lX11 vérification de la bibliothèque contenant deflate ... aucun requis vérifier si le Caire les programmes peuvent être compilés ... configure: error: Impossible de compiler un simple programme Cairo. Voir config.log pour plus de détails. ERREUR: la configuration a échoué pour le package 'Cairo' Cela semble obligatoire. – BadTenMan

Répondre

1

Le problème est que dans/usr/lib64/le lien a été brisé libcairo.so:

ls -l /usr/lib64 |grep -i cairo 
libcairo.a 
libcairo.la 
libcairo.so -> libcairo.so.2.10800.0 
libcairo.so.2 -> libcairo.so.2.10800.8 
libcairo.so.2.10800.8 

Il n'y avait pas libcairo.so.2.10800.0, si ld liés libcairo.a. La résolution du lien vers libcairo.so.2.10800.8 l'a résolu.