With help from ALCF and using MPICH 3.1.4 I managed to solve the problem. Jeff, I needed dynamic libraries because I wanted to intercept some calls defined as weak symbols in other external libraries for tracing (e.g. malloc) and I did not find a form to accomplish this with static libraries. Now it works with dynamic libraries. Best regards Florin ________________________________________ From: Jeff Hammond [[email protected]] Sent: Thursday, March 19, 2015 10:40 AM To: [email protected] Subject: Re: [mpich-discuss] Problem linking an MPI program with an external shared library Do you need a dynamic library on BGQ? Why not just build static library? Best, Jeff On Thu, Mar 19, 2015 at 8:02 AM, Isaila, Florin D. <[email protected]> wrote:
Hi,
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:
mpicc -g -Wall -fPIC -Wextra -I. -c hello.c -o hello.o mpicc -g -Wall -fPIC -Wextra -I. -c dyn_lib.c -o dyn_lib.o mpicc -shared -Wl,-soname,libdyn_lib.so -o libdyn_lib.so dyn_lib.o mpicc -g -Wall -fPIC -Wextra -I. -o hello hello.o -dynamic -Wl,-rpath, -L. -ldyn_lib /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 /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 collect2: ld returned 1 exit status make: *** [hello] Error 1
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:
[fisaila@vestalac2 lib]$ nm libmpich.so | grep __dso_handle U __dso_handle
My MPICH3.1 is configured with: ./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
Any suggestion is welcome
Thanks Florin
_______________________________________________ discuss mailing list [email protected] To manage subscription options or unsubscribe: https://lists.mpich.org/mailman/listinfo/discuss
-- Jeff Hammond [email protected] http://jeffhammond.github.io/ _______________________________________________ discuss mailing list [email protected] To manage subscription options or unsubscribe: https://lists.mpich.org/mailman/listinfo/discuss _______________________________________________ discuss mailing list [email protected] To manage subscription options or unsubscribe: https://lists.mpich.org/mailman/listinfo/discuss