[mpich-discuss] Problem linking an MPI program with an external shared library

Jeff Hammond jeff.science at gmail.com
Thu Mar 19 10:40:18 CDT 2015


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. <fisaila at mcs.anl.gov> 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 at 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     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss



-- 
Jeff Hammond
jeff.science at gmail.com
http://jeffhammond.github.io/
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list