Re: Help to run gadget2 in macbook

From: Florian Bürzle <florian.buerzle_at_uni-konstanz.de>
Date: Wed, 12 Jan 2011 20:13:59 +0100

Am 12.01.2011 um 16:01 schrieb Prem Dhungel:

> Hi,
>
> I am still stuck up ..... !
>
> I went gadget2 user's guide thoroughly.
> Installed mpi and gsl successfully.
> Configured fftw with necessary flags.
> But while I do "make", finally I got the following error :
>
> Undefined symbols:
> "_lam_mpi_float", referenced from:
> _lam_mpi_float$non_lazy_ptr in libsfftw_mpi.a(transpose_mpi.o)
> "_lam_mpi_int", referenced from:
> _lam_mpi_int$non_lazy_ptr in test_transpose_mpi.o
> "_lam_mpi_comm_world", referenced from:
> _lam_mpi_comm_world$non_lazy_ptr in test_transpose_mpi.o
> _lam_mpi_comm_world$non_lazy_ptr in libsfftw_mpi.a(fftwnd_mpi.o)
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> make[1]: *** [test_transpose_mpi] Error 1
> make: *** [all-recursive] Error 1
>
> Sorry to trouble again and again.

Don't worry.

I would recommend doing one thing first (if you haven't done this already): In Gadget's Makefile switch all the TreePM options off, then go to the line that reads

LIBS = $(HDF5LIB) -g $(MPICHLIB) $(GSL_LIBS) -lgsl -lgslcblas -lm $(FFTW_LIB)

and replace it by

ifeq (PMGRID,$(findstring PMGRID,$(OPT)))
  LIBS = $(HDF5LIB) -g $(MPICHLIB) $(GSL_LIBS) -lgsl -lgslcblas -lm $(FFTW_LIB)
else
  LIBS = $(HDF5LIB) -g $(MPICHLIB) $(GSL_LIBS) -lgsl -lgslcblas -lm
endif

Now the linking does not rely on fftw libs any more, and Gadget should compile without problems. If it does not, there are additional issues unrelated to fftw.

Now to your fftw-2 installation problem: probably this one is due to the LAM/MPI installation - but you need to know that the OpenMPI library comes with Apple's XCode, so it should be present already on your MacBook (if you have at least OS X 10.5 and XCode 3.0). It should reside in the /Developer/SDKs directory structure. That means that you don't need to install another MPI library (as long as you don't want Fortran 90/95/... support). Actually, two different MPI libraries might result in conflicts, so I would recommend to uninstall LAM. Additionally, LAM is legacy software - so going for OpenMPI is, in my opinion, the best choice anyway.

But maybe a brief description of my own fftw-2 installation helps. To install fftw-2.1.5, I did the following:

./configure --enable-mpi --enable-float --enable-type-prefix --prefix=/opt/fftw2
make
make install

Then, In Gadget's makefile I included:

FFTW_INCL = -I/opt/fftw2/include
FFTW_LIBS = -L/opt/fftw2/lib

A final remark: Installing fftw-2 using a package management system like MacPorts or Fink (or probably HomeBrew) would be favorable. It would be a lot easier than doing the installation by hand, since the package manager keeps track of the dependences. Unfortunately, MacPorts (as far as I know) does not support the installation of fftw-2 with MPI support, so I had to install this one manually (don't know if Fink or HomeBrew are able to handle this better, since I don't use them) - maybe some other gadget-list reader has a hack or solution for this.

Cheers
Florian
Received on 2011-01-12 20:13:52

This archive was generated by hypermail 2.3.0 : 2022-09-01 14:03:42 CEST