Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Static linking with MPI
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
elomaniak
n00b
n00b


Joined: 27 Jan 2013
Posts: 46

PostPosted: Wed Nov 13, 2013 1:50 pm    Post subject: Static linking with MPI Reply with quote

Hi
I am currently running into a small problem.
I want to run an MPI Programm in two nodes
the thing is the nodes use the uclibc libs and the host is using normal glibc

now when compiling a simple hello world for MPI i am using the -static option to include all include files

this is what I am gettin
Code:

mpicc -static -o mpi_hello_world mpi_hello_world.c
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmpi
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lhwloc
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lhwloc
collect2: error: ld returned 1 exit status
make: *** [mpi_hello_world] Error 1


mpicc -showme
Code:
mpicc -showme
x86_64-pc-linux-gnu-gcc -pthread -L/usr/lib64 -lmpi -ldl -lhwloc -Wl,--export-dynamic -lrt -lnsl -lutil -lm -lhwloc -ldl


I know libmpi.so and libhwloc.so are in /usr/lib64/
any way to make it compile with the -static option?

thanks in advance
Back to top
View user's profile Send private message
heiwa
n00b
n00b


Joined: 24 Oct 2012
Posts: 5

PostPosted: Mon Dec 16, 2013 6:57 pm    Post subject: Reply with quote

*.so files are shared libraries needed for dynamic linking. For static linking you need *.a files instead. Using the -static-libs use flag you can control for many ebuilds whether static libraries are installed or not.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum