计算化学公社

标题: 求助Cmake : recompile with -fPIC [打印本页]

作者
Author:
zhouquan    时间: 2019-3-18 16:40
标题: 求助Cmake : recompile with -fPIC
[build]$ make
[  2%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/kinds.f90.o
[  4%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/settings.f90.o
[  7%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/teletype.f90.o
[  9%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/globals.f90.o
[ 11%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/tensor.f90.o
[ 14%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/acid.f90.o
[ 16%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/gtodefs.f90.o
[ 19%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/intgrl.f90.o
[ 21%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/basis.f90.o
[ 23%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/factorial.f90.o
[ 26%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/cao2sao.f90.o
[ 28%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/caos.f90.o
[ 30%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/bfeval.f90.o
[ 33%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/reorder.f90.o
[ 35%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/dens.f90.o
[ 38%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/gaussint.f90.o
[ 40%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/gausspoints.f90.o
[ 42%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/jtensor.F90.o
[ 45%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/timer.f90.o
[ 47%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/gimic_interface.f90.o
[ 50%] Building Fortran object src/libgimic/CMakeFiles/gimic2.dir/lip.f90.o
[ 52%] Building C object src/libgimic/CMakeFiles/gimic2.dir/gausspoints.c.o
[ 54%] Building CXX object src/libgimic/CMakeFiles/gimic2.dir/GimicInterface.cpp.o
[ 57%] Linking CXX static library libgimic2.a
[ 57%] Built target gimic2
[ 59%] Compiling Cython CXX source for gimic...
/share/home/ZhuangW/zhouq/python/install-python/lib/python2.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /share/home/ZhuangW/zhouq/GIMIC-new/gimic-master/src/libgimic/gimic.pxd
  tree = Parsing.p_module(s, pxd, full_module_name)
Scanning dependencies of target gimic
[ 61%] Building CXX object src/libgimic/CMakeFiles/gimic.dir/gimic.cxx.o
[ 64%] Linking CXX shared module gimic.so
/usr/bin/ld: /share/home/ZhuangW/zhouq/python/install-python/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/share/home/ZhuangW/zhouq/python/install-python/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [src/libgimic/gimic.so] Error 1
make[1]: *** [src/libgimic/CMakeFiles/gimic.dir/all] Error 2
make: *** [all] Error 2
红色部分的问题如何解决


作者
Author:
bluewhale    时间: 2019-3-18 16:58
编译python时加 --enable-shared
作者
Author:
zhouquan    时间: 2019-3-18 19:44
bluewhale 发表于 2019-3-18 16:58
编译python时加 --enable-shared

还是一样的错误

作者
Author:
zjxitcc    时间: 2019-3-18 20:11
我曾经在一台机器上安装Amber时碰到过recompile with -fPIC的问题,解决方法可能对你有帮助:
在Makefile里找到编译选项,通常是CFLAG, CXXFLAG之类的,在这一行追加-fPIC,重新编译。
这可能是另一库的安装位置不太对造成的。
作者
Author:
itpfeng    时间: 2019-3-18 21:02
zjxitcc 发表于 2019-3-18 20:11
我曾经在一台机器上安装Amber时碰到过recompile with -fPIC的问题,解决方法可能对你有帮助:
在Makefile ...

至少我遇到类似错误时这个办法不起作用。
作者
Author:
阿志    时间: 2023-6-27 15:56
itpfeng 发表于 2019-3-18 21:02
至少我遇到类似错误时这个办法不起作用。

请问您解决这个问题了吗?





欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3