Hi Jeff (and everyone),
Thanks! Now I have compiled the openmpi-1.2.2 successfully under i386-Linux (Debian Sarge) with the following configurations:
./configure CFLAGS=-g -pg -O3 --enable-mpi-threads --enable-progress-threads --enable-static --disable-shared
However when I compile my client program using mpicc and I inserted -static,
(compile is done by a makefile)
mpicc -static -g -pg -O3 -W -Wall -pedantic -std=c99 -o raytrace bbox.o cr.o env.o fbuf.o geo.o huprn.o husetup.o hutv.o isect.o main.o matrix.o memory.o poly.o raystack.o shade.o sph.o trace.o tri.o debug.o
it fails to link and complains that
: multiple definition of `_int_malloc'
/usr/lib/libopen-pal.a(lt1-malloc.o)(.text+0x18a0):openmpi-1.2.2/opal/mca/memory/ptmalloc2/malloc.c:3954: first defined here
/usr/bin/ld: Warning: size of symbol `_int_malloc' changed from 1266 in /usr/lib/libopen- pal.a(lt1-malloc.o) to 1333 in /home/490_research/490/src/mpi.optimized_profiling//lib/libopen-pal.a(lt1-malloc.o)
so what could go wrong here?
Is it because openmpi has internal implementatios of system-provided functions (such as malloc) that are also used in my program, but the one the client program use is provided by the system whereas the one in the library has a different internal implementation?
In such case, how could I do the static linking in my client program? I really need static linking as far as possible to do the profiling.
On Jun 7, 2007, at 2:07 AM, Code Master wrote:
> I wish to compile openmpi-1.2.2 so that it:
> - support MPI_THREAD_MULTIPLE
> - enable profiling (generate gmon.out for each process after my
> client app finish running) to tell apart CPU time of my client
> program from the MPI library
> - static linking for everything (incl client app and all components
> of library openmpi)
> in the documentation, it says that --enable-mcs-static=<CSV list>
> will enable static linking of the modules in the list, however what
> can I specify if I want to statically link *all* mcs modules
> without knowing the list of modules available?
You should be able to do:
./configure --enable-static --disable-shared ...
This will do 2 things:
- libmpi (and friends) will be compiled as .a's (instead of .so's)
- all the MCA components will be physically contained in libmpi (and
friends) instead of being built as standalone plugins
> Also this is the plan for my command used for configuring openmpi:
> ./configure CFLAGS="-g -pg -O3 -static" --prefix=./ --enable-mpi-
> threads --enable-progress-threads --enable-static --disable-shared
> --enable-mcs-static --with-devel-headers
It's actually --enable-mca-static, not --enable-mcs-static.
However, that should not be necessary; the --enable-static and --
disable-shared should take care of pulling all the components into
the libraries for you.
users mailing list