On Mar 17, 2016, at 10:54 AM, evelina dumitrescu 
<evelina.a.dumitre...@gmail.com> 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 

Looks like you found the FAQ item about compiling statically -- good!

I think the dl library is only available for dynamic builds, not static builds 
(i.e., this is not an Open MPI thing; it's an OS/library thing).

Have you tried removing the -ldl's from your link line?

Also, is there a reason you list mm.c twice on your compile line?  That seems 
incorrect.

> /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


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/

Reply via email to