<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,
<br>
<br>
I have problems linking the an MPI program with an external shared library in MPICH3.1 on Vesta BGQ. The error message I get is:
<br>
<br>
 mpicc  -g -Wall -fPIC -Wextra  -I.  -c hello.c  -o hello.o<br>
mpicc  -g -Wall -fPIC -Wextra  -I.  -c dyn_lib.c  -o dyn_lib.o<br>
mpicc  -shared -Wl,-soname,libdyn_lib.so  -o libdyn_lib.so dyn_lib.o<br>
mpicc  -g -Wall -fPIC -Wextra  -I.  -o hello hello.o  -dynamic  -Wl,-rpath, -L. -ldyn_lib 
<br>
/bgsys/drivers/toolchain/V1R2M2_base-efix014/gnu-linux/lib/gcc/powerpc64-bgq-linux/4.4.7/../../../../powerpc64-bgq-linux/bin/ld: hello: hidden symbol `__dso_handle' in /bgsys/drivers/toolchain/V1R2M2_base-efix014/gnu-linux/lib/gcc/powerpc64-bgq-linux/4.4.7/crtbegin.o
 is referenced by DSO<br>
/bgsys/drivers/toolchain/V1R2M2_base-efix014/gnu-linux/lib/gcc/powerpc64-bgq-linux/4.4.7/../../../../powerpc64-bgq-linux/bin/ld: final link failed: Bad value<br>
collect2: ld returned 1 exit status<br>
make: *** [hello] Error 1<br>
<br>
The problem seems to be caused by a __dso_handle symbol in the MPICH library (both in static and dynamic libraries), but I do not know what the solution is:<br>
<br>
[fisaila@vestalac2 lib]$ nm libmpich.so | grep __dso_handle<br>
                 U __dso_handle<br>
<br>
<br>
My MPICH3.1 is configured with: <br>
./configure --prefix=/home/fisaila/software/mpich-3.1-THR_MULT-nodebug-install2rpath --host=powerpc64-bgq-linux --with-device=pamid --with-file-system=bg+bglockless --enable-thread-cs=per-object --with-atomic-primitives --enable-handle-allocation=tls --enable-refcount=lock-free
 --disable-predefined-refcount CC=powerpc64-bgq-linux-gcc <br>
<br>
Any suggestion is welcome<br>
<br>
Thanks<br>
Florin<br>
<br>
<br>
</div>
</body>
</html>