简体   繁体   English

编译 Cairo R 包 - /usr/lib64/libcairo.a:添加符号时出错:值错误

[英]Compile Cairo R package - /usr/lib64/libcairo.a: error adding symbols: Bad value

I am trying to compile the R package "Cairo" from Source ( https://cran.r-project.org/web/packages/Cairo/index.html , latest version) for R3.2.4.我正在尝试从 Source( https://cran.r-project.org/web/packages/Cairo/index.html ,最新版本)为 R3.2.4 编译 R 包“Cairo”。

This is needed because the server (SLES11 SP4, no option to change) on which this should be installed has no internet connection, so I can't install from repo.这是必需的,因为应该安装它的服务器(SLES11 SP4,没有更改选项)没有互联网连接,所以我无法从 repo 安装。

Some problems are already fixed by setting correct environment variables (see settings below).通过设置正确的环境变量已经修复了一些问题(请参阅下面的设置)。 Unfortunately trying to install the package still gives me a compile error after the configure.不幸的是,在配置后尝试安装该软件包仍然给我一个编译错误。

Settings:设置:

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'

Output (on R commandline):输出(在 R 命令行上):

> 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

Hopefully some gcc/ld/R compiling expert can tell me what is wrong and how I can fix this.希望一些 gcc/ld/R 编译专家可以告诉我出了什么问题以及如何解决这个问题。

Thanks, BadTenMan谢谢,BadTenMan

The problem was that in /usr/lib64/ the libcairo.so link was broken:问题在于 /usr/lib64/ 中的 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

There was no libcairo.so.2.10800.0, so ld linked libcairo.a.没有 libcairo.so.2.10800.0,所以 ld 链接了 libcairo.a。 Fixing the link to libcairo.so.2.10800.8 solved it.修复指向 libcairo.so.2.10800.8 的链接解决了它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何修复 R 中的“gcc:错误:“/usr/lib64/R/library/Rhdf5lib/lib/libhdf5.a”:没有这样的文件或目录 - How to fix 'gcc: error: “/usr/lib64/R/library/Rhdf5lib/lib/libhdf5.a”: No such file or directory' in R /usr/lib64/libstdc++.so.6:加载R软件包时找不到版本“ CXXABI_1.3.8” - /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found when loading R packages 安装 Cairo R 包时出错 - Error in Installing the Cairo R Package 错误:/lib64/libstdc++.so.6:安装 R devtools 时在 Centos Linux 7.7 上找不到版本“GLIBCXX_3.4.20” - ERROR: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found on Centos Linux 7.7 while installing R devtools R安装Cairo package报错 - Error message installing Cairo package in R TwitteR r包:/usr/lib/x86_64-linux-gnu/libcurl.so.4:找不到版本`CURL_OPENSSL_3' - TwitteR r package: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found 在CentOS上安装cairo和libcairo2 - install cairo and libcairo2 on CentOS 安装 R Bioconductor package 时,'lib = "/usr/lib/R/library"' is not writable" - 'lib = "/usr/lib/R/library"' is not writable" while installing R Bioconductor package 闪亮的错误:“ / usr / bin / R:第238行:/ usr / lib / R / etc / ldpaths:权限被拒绝” - Shiny error: “/usr/bin/R: line 238: /usr/lib/R/etc/ldpaths: Permission denied” 在库“/usr/lib/R/lib/libR.so”中找不到 rpy2 错误符号“R_tryCatchError” - rpy2 error symbol 'R_tryCatchError' not found in library '/usr/lib/R/lib/libR.so'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM