View previous topic :: View next topic |
Author |
Message |
elomaniak n00b
Joined: 27 Jan 2013 Posts: 47
|
Posted: Wed Nov 13, 2013 1:50 pm Post subject: Static linking with MPI |
|
|
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 |
|
|
heiwa n00b
Joined: 24 Oct 2012 Posts: 70
|
Posted: Mon Dec 16, 2013 6:57 pm Post subject: |
|
|
*.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 |
|
|
|