计算化学公社

 找回密码 Forget password
 注册 Register
Views: 6662|回复 Reply: 5
打印 Print 上一主题 Last thread 下一主题 Next thread

[新手求助] 求助Cmake : recompile with -fPIC

[复制链接 Copy URL]

30

帖子

0

威望

341

eV
积分
371

Level 3 能力者

跳转到指定楼层 Go to specific reply
楼主
[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
红色部分的问题如何解决

74

帖子

0

威望

863

eV
积分
937

Level 4 (黑子)

6#
发表于 Post on 2023-6-27 15:56:21 | 只看该作者 Only view this author
itpfeng 发表于 2019-3-18 21:02
至少我遇到类似错误时这个办法不起作用。

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

145

帖子

0

威望

3930

eV
积分
4075

Level 6 (一方通行)

5#
发表于 Post on 2019-3-18 21:02:58 | 只看该作者 Only view this author
zjxitcc 发表于 2019-3-18 20:11
我曾经在一台机器上安装Amber时碰到过recompile with -fPIC的问题,解决方法可能对你有帮助:
在Makefile ...

至少我遇到类似错误时这个办法不起作用。

3814

帖子

4

威望

8002

eV
积分
11896

Level 6 (一方通行)

MOKIT开发者

4#
发表于 Post on 2019-3-18 20:11:27 | 只看该作者 Only view this author
我曾经在一台机器上安装Amber时碰到过recompile with -fPIC的问题,解决方法可能对你有帮助:
在Makefile里找到编译选项,通常是CFLAG, CXXFLAG之类的,在这一行追加-fPIC,重新编译。
这可能是另一库的安装位置不太对造成的。
自动做多参考态计算的程序MOKIT

30

帖子

0

威望

341

eV
积分
371

Level 3 能力者

3#
 楼主 Author| 发表于 Post on 2019-3-18 19:44:24 | 只看该作者 Only view this author
bluewhale 发表于 2019-3-18 16:58
编译python时加 --enable-shared

还是一样的错误

165

帖子

0

威望

4787

eV
积分
4952

Level 6 (一方通行)

2#
发表于 Post on 2019-3-18 16:58:52 | 只看该作者 Only view this author
编译python时加 --enable-shared

手机版 Mobile version|北京科音自然科学研究中心 Beijing Kein Research Center for Natural Sciences|京公网安备 11010502035419号|计算化学公社 — 北京科音旗下高水平计算化学交流论坛 ( 京ICP备14038949号-1 )|网站地图

GMT+8, 2024-11-27 09:45 , Processed in 0.402369 second(s), 22 queries , Gzip On.

快速回复 返回顶部 返回列表 Return to list