You are not logged in.

#1 2012-08-24 20:16:20

djraymondnm
Member
From: Socorro, NM, USA
Registered: 2011-12-28
Posts: 59
Website

OpenMPI compile/link problems [SOLVED]

After installing openmpi 1.6-2, I tried compiling a well-tested mpi program that
I have been running under lam mpi on Debian linux.  Attempting to compile on
Arch openmpi results in missing libraries:

swallow:~/svn/conv/trunk$ make
mpicc -g -c main.c
mpicc -g -c timestep.c
mpicc -g -c thermo.c
mpicc -g -c toyrad.c
mpicc -g -c getprofile.c
mpicc -g -o conv main.o timestep.o thermo.o toyrad.o \
getprofile.o -lcdf -lm
main.o: In function `main':
/home/raymond/svn/conv/trunk/main.c:157: undefined reference to `lam_mpi_comm_world'
/home/raymond/svn/conv/trunk/main.c:158: undefined reference to `lam_mpi_comm_world'
/home/raymond/svn/conv/trunk/main.c:187: undefined reference to `lam_mpi_comm_world'
/home/raymond/svn/conv/trunk/main.c:189: undefined reference to `lam_mpi_comm_world'
/home/raymond/svn/conv/trunk/main.c:629: undefined reference to `lam_mpi_sum'
...
collect2: error: ld returned 1 exit status
make: *** [conv] Error 1
swallow:~/svn/conv/trunk$ 

I then downloaded the openmpi package from the OpenMPI website, compiled it myself,
and installed it in /usr/local.  I was able to compile and run the program with no trouble.
(The --prefix /usr/local flag was needed on mpirun.)

I notice that the openmpi libraries have been moved to /usr/lib/openmpi/ in the Arch version.
Presumably Arch openmpi would work if one told the system where the libraries were (I haven't
tried it), but relocating the libraries seems like an unnecessary complication to me and a
booby trap for the unwary.

Last edited by djraymondnm (2012-09-11 12:57:18)

Offline

#2 2012-09-04 23:09:46

stephane
Forum Fellow
Registered: 2009-10-18
Posts: 25

Re: OpenMPI compile/link problems [SOLVED]

Compilation of C code works for me. The location of the libs should not be a problem because the linker find them with the following file :

    $ cat  /etc/ld.so.conf.d/openmpi.conf
    /usr/lib/openmpi

I just pushed openmpi-1.6.1 in [extra]. Let me know if it works for you. If not, could you please give me a minimal example that does not compile for you ?

Last edited by stephane (2012-09-04 23:10:17)

Offline

#3 2012-09-11 12:55:54

djraymondnm
Member
From: Socorro, NM, USA
Registered: 2011-12-28
Posts: 59
Website

Re: OpenMPI compile/link problems [SOLVED]

OK, found the problem -- some old lam include files in /usr/local/include!

Offline

Board footer

Powered by FluxBB