-fPIC问题的解决.

在测试最新版(15.3.23)Caffe时,编译过程中遇到2次 


  1. relocation R_X86_64_  
  2. 32 against `******' can not be used when making a shared object; rec  
  3. ompile with -fPIC 

这种问题,一开始知道怎么搞,后来发现是自己从网上编译安装了最新的Pyton版本,没有 --enable-unicode,也米有--enable-shared
参考别的博客内容,重新编译安装了一遍.
./configure --enable-unicode=ucs4 --enable-shared CFLAGS=-fPIC 
但是..最后python2.7.9消失了..只留下python2.7.6,不管是/usr/bin 还是/usr/local/bin 都只能启动python2.7.6.
----------------------------------------------
更新,不能随便加--enable-shared 参数,这样会共享原来系统自带的Python文件,不加这个参数,就没问题了~

不过问题解决了



make -C src all make[1]: Entering directory '/home/zzuer/Lyp_folder/pmdk/src' make -C libpmem make[2]: Entering directory '/home/zzuer/Lyp_folder/pmdk/src/libpmem' cc -MD -c -o ../nondebug/libpmem/file.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/file.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/file.o ../../src/../src/common/file.c cc -MD -c -o ../nondebug/libpmem/file_posix.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/file_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/file_posix.o ../../src/../src/common/file_posix.c cc -MD -c -o ../nondebug/libpmem/fs_posix.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/fs_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/fs_posix.o ../../src/../src/common/fs_posix.c cc -MD -c -o ../nondebug/libpmem/mmap.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/mmap.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/mmap.o ../../src/../src/common/mmap.c cc -MD -c -o ../nondebug/libpmem/mmap_posix.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/mmap_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/mmap_posix.o ../../src/../src/common/mmap_posix.c cc -MD -c -o ../nondebug/libpmem/os_posix.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/os_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/os_posix.o ../../src/../src/common/os_posix.c cc -MD -c -o ../nondebug/libpmem/os_thread_posix.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/os_thread_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/os_thread_posix.o ../../src/../src/common/os_thread_posix.c cc -MD -c -o ../nondebug/libpmem/os_deep_linux.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/os_deep_linux.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/os_deep_linux.o ../../src/../src/common/os_deep_linux.c cc -MD -c -o ../nondebug/libpmem/os_auto_flush_linux.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/os_auto_flush_linux.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/os_auto_flush_linux.o ../../src/../src/common/os_auto_flush_linux.c cc -MD -c -o ../nondebug/libpmem/out.o -Wno-error -std=gnu99 -I../include -I../common/ -fPIC ../../src/../src/common/out.c ../../src/../src/common/out.c: In function ‘out_init’: ../../src/../src/common/out.c:241:20: error: expected ‘,’ or ‘;’ before ‘SRCVERSION’ 241 | "src version: " SRCVERSION; | ^~~~~~~~~~ make[2]: *** [../Makefile.inc:304: ../nondebug/libpmem/out.o] Error 1 make[2]: Leaving directory '/home/zzuer/Lyp_folder/pmdk/src/libpmem' make[1]: *** [Makefile:167: libpmem] Error 2 make[1]: Leaving directory '/home/zzuer/Lyp_folder/pmdk/src' make: *** [Makefile:83: all] Error 2
最新发布
05-30
zzuer@zzu:~/Lyp_folder/pmdk$ make CFLAGS="-Wno-error" make -C src all make[1]: Entering directory '/home/zzuer/Lyp_folder/pmdk/src' make -C libpmem make[2]: Entering directory '/home/zzuer/Lyp_folder/pmdk/src/libpmem' mkdir -p ../nondebug/libpmem cc -MD -c -o ../nondebug/libpmem/file.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/file.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/file.o ../../src/../src/common/file.c cc -MD -c -o ../nondebug/libpmem/file_posix.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/file_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/file_posix.o ../../src/../src/common/file_posix.c cc -MD -c -o ../nondebug/libpmem/fs_posix.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/fs_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/fs_posix.o ../../src/../src/common/fs_posix.c cc -MD -c -o ../nondebug/libpmem/mmap.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/mmap.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/mmap.o ../../src/../src/common/mmap.c cc -MD -c -o ../nondebug/libpmem/mmap_posix.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/mmap_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/mmap_posix.o ../../src/../src/common/mmap_posix.c cc -MD -c -o ../nondebug/libpmem/os_posix.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/os_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/os_posix.o ../../src/../src/common/os_posix.c cc -MD -c -o ../nondebug/libpmem/os_thread_posix.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/os_thread_posix.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/os_thread_posix.o ../../src/../src/common/os_thread_posix.c cc -MD -c -o ../nondebug/libpmem/os_deep_linux.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/os_deep_linux.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/os_deep_linux.o ../../src/../src/common/os_deep_linux.c cc -MD -c -o ../nondebug/libpmem/os_auto_flush_linux.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/os_auto_flush_linux.c ../../src/../utils/check-os.sh ../../src/../utils/os-banned ../nondebug/libpmem/os_auto_flush_linux.o ../../src/../src/common/os_auto_flush_linux.c cc -MD -c -o ../nondebug/libpmem/out.o -Wno-error -I../include -I../common/ -fPIC ../../src/../src/common/out.c ../../src/../src/common/out.c: In function ‘out_init’: ../../src/../src/common/out.c:241:20: error: expected ‘,’ or ‘;’ before ‘SRCVERSION’ 241 | "src version: " SRCVERSION; | ^~~~~~~~~~ make[2]: *** [../Makefile.inc:304: ../nondebug/libpmem/out.o] Error 1 make[2]: Leaving directory '/home/zzuer/Lyp_folder/pmdk/src/libpmem' make[1]: *** [Makefile:167: libpmem] Error 2 make[1]: Leaving directory '/home/zzuer/Lyp_folder/pmdk/src' make: *** [Makefile:83: all] Error 2
05-30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值