我的机器上安装了MPICH 3.0.4 (Ubuntu12.04)。我正在尝试安装一个名为Qthreads的库,我以前使用过该库并成功地安装了它(除了安装了MPICH2包之外)。配置工作正常:
./configure --prefix=/usr/local/qthreads --enable-multinode --with-multinode-runtime=mpi --with-portals4=/usr/local/portals4 --with-hwloc=/usr/local/hwloc
...
...
...
System Characteristics:
Target Style: unix
Multi-node: yes, mpi
Topology API: hwloc
Qtimer type: clock_gettime
Aligned_t size: 8 (aligned on 8 byte boundaries)
Default Stack size: 4kB
Safety/Debugging:
Sanity assert()s: no
Check alignment: no
Profiling: none
Debugging Output: no
Guard Pages: no
Speed:
Scheduler: sherwood (multiworker shepherds)
Sinc Style: donecount
Barrier Style: feb
Dictionary Style: simple
Lazy Thread IDs: yes
Pools/caches: memory, spawns
RCRTool: no
Increments/CAS/FEBs: Compiler Builtin (both), lock-based hash当我尝试运行make时,我得到以下错误:
...
...
...
CCLD libqthread.la
/usr/bin/ld: /usr/local/lib/libmpich.a(barrier.o): relocation R_X86_64_32 against `MPIR_ThreadInfo' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libmpich.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libqthread.la] Error 1
make[2]: Leaving directory `/home/alex/Downloads/qthread-1.9/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/alex/Downloads/qthread-1.9/src'
make: *** [all-recursive] Error 1我有looked around,显然(也是唯一可能的)解决方案是按照编译器说的做:用-fPIC重新编译。然而,我很犹豫要不要浏览和编辑Qthread的任何Makefiles,因为它们又长又复杂。有没有用-fPIC重新编译的简单方法?
请给我建议。我很感谢你的意见。
发布于 2013-08-23 09:30:12
在所有讨论之后,我完成了MPICH3.0.4的全新安装,--enable-shared是唯一提供的配置选项。由于某些原因,它成功地编译和构建,尽管以前没有这样做。在此之后,Qthread被成功地配置和构建,不需要任何额外的选项。
发布于 2013-08-23 02:02:51
最终的答案将取决于所讨论的makefile,但使用make CFLAGS=-fPIC可能会像使用MYCFLAGS或许多其他类似变量一样工作。您必须查看并查看Qthread使用什么来创建该归档文件。
发布于 2013-08-23 03:02:49
也有可能这只是一种症状,而不是问题。看看这个答案是否有帮助(how to recompile with -fPIC)。对于MPICH 3.0.4,默认情况下使用共享库而不是静态库进行构建,因此您可能需要确保它们是一致的。
https://stackoverflow.com/questions/18387247
复制相似问题