我的机器(Ubuntu 12.04)上安装了MPICH 3.0.4 。我正在尝试安装一个名为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
我环顾四周,似乎明显(也是唯一可能的)解决方案是按照编译器所说的:重新编译-fPIC
. 但是,我很犹豫是否要浏览和编辑 Qthreads 的任何 Makefile,因为它们又长又复杂。有没有一种简单的方法来重新编译-fPIC
?
请指教。我很感激任何意见。