Instead of --static try using -Wl,-Bstatic. I do not think you can safely mix --static with -Wl,-Bdynamic.
-Nathan HPC-ENV, LANL On Thu, Mar 17, 2016 at 03:54:33PM +0100, evelina dumitrescu wrote: > hello, > > I unsuccessfully tried to link the statically compiled OpenMPI library. > I used for compilation: > > ./configure --enable-static -disable-shared > make -j 4 > make install > > When I try to link the library to my executable, I get the following > error: > > gcc mm.c --static -I/usr/local/include/openmpi mm.c -o mm.out > -L/usr/local/lib -L/usr/local/lib/openmpi -lmpi -lopen-rte -lopen-pal > -Wl,--whole-archive -libverbs -Wl,--no-whole-archive -lrt > -Wl,--export-dynamic -Wl,-Bdynamic -ldl -lc -lnsl -lutil -lm -ldl -fPIE > -pie > > /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginT.o: relocation > R_X86_64_32 against `__TMC_END__' can not be used when making a shared > object; recompile with -fPIC > /usr/lib/gcc/x86_64-linux-gnu/4.8/crtbeginT.o: error adding symbols: Bad > value > collect2: error: ld returned 1 exit status > > I use openmpi-1.10.2 and Ubuntu 14.04. > What am I doing wrog ? > > Evelina > _______________________________________________ > users mailing list > us...@open-mpi.org > Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/users > Link to this post: > http://www.open-mpi.org/community/lists/users/2016/03/28735.php
pgpESURJuqCK9.pgp
Description: PGP signature