> Am 14.09.2016 um 15:05 schrieb Gilles Gouaillardet > <gilles.gouaillar...@gmail.com>: > > in this case, you should configure OpenMPI with > --disable-shared --enable-static --disable-dlopen > > then you can manually run the mpifort link command with --showme, > so you get the fully expanded gfortran link command. > then you can edit this command, and non system libs (e.g. lapack, openmpi, > siesta) with -static, but system libs (e.g. m, ibverbs, ...) with -dynamic > you might have to manually append -ldl, though that should not be needed
For me it's necessary to use -ldl, I didn't find the time to look further into it. See my post from Aug 11, 2016. With older versions of Open MPI it wasn't necessary to supply it in addition. -- Reuti > > Cheers, > > Gilles > > > > On Wednesday, September 14, 2016, Mahmood Naderan <mahmood...@gmail.com> > wrote: > Well I want to omit LD_LIBRARY_PATH. For that reason I am building the binary > statically. > > > note this is not required when Open MPI is configure'd with > >--enable-mpirun-prefix-by-default > I really did that. Using Rocks-6, I installed the application and openmpi on > the shared file system (/export). > Yes it is possible to add the library paths to LD_LIBRARY_PATH, but I want to > statically put the required libraries in the binary. > > > > Regards, > Mahmood > > > > On Wed, Sep 14, 2016 at 4:44 PM, Gilles Gouaillardet > <gilles.gouaillar...@gmail.com> wrote: > Mahmood, > > try to prepend /export/apps/siesta/openmpi-1.8.8/lib to your $LD_LIBRARY_PATH > > note this is not required when Open MPI is configure'd with > --enable-mpirun-prefix-by-default > > > Cheers, > > Gilles > > On Wednesday, September 14, 2016, Mahmood Naderan <mahmood...@gmail.com> > wrote: > Hi, > Here is the problem with statically linking an application with a program. > > by specifying the library names: > > FC=/export/apps/siesta/openmpi-1.8.8/bin/mpifort > FFLAGS=-g -Os > FPPFLAGS= -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT > LDFLAGS=-static > MPI1=/export/apps/siesta/openmpi-1.8.8/lib/libmpi_mpifh.a > MPI2=/export/apps/siesta/openmpi-1.8.8/lib/libmpi_usempi.a > BLAS_LIBS=../libopenblas.a > SCALAPACK_LIBS=../libscalapack.a > LIBS=$(SCALAPACK_LIBS) $(BLAS_LIBS) $(MPI1) $(MPI2) > > > > > The output of "make" is: > > /export/apps/siesta/openmpi-1.8.8/bin/mpifort -o transiesta \ > -static automatic_cell.o ...<OMITTED LIB NAMES>..... > libmpi_f90.a > `FoX/FoX-config --libs --wcml` ../libscalapack.a > ../libopenblas.a /export/apps/siesta/openmpi-1.8.8/lib/libmpi_mpifh.a > /export/apps/siesta/openmpi-1.8.8/lib/libmpi_usempi.a > /export/apps/siesta/openmpi-1.8.8/lib/libopen-pal.a(dl_dlopen_module.o): In > function `dlopen_open': > dl_dlopen_module.c:(.text+0x473): warning: Using 'dlopen' in statically > linked applications requires at runtime the shared libraries from the glibc > version used for linking > /usr/bin/ld: cannot find -libverbs > collect2: ld returned 1 exit status > > > > > If I drop -static, the error is gone... However, ldd command shoes that > binary can not access those two MPI libraries. > > > Regards, > Mahmood > > > > _______________________________________________ > users mailing list > users@lists.open-mpi.org > https://rfd.newmexicoconsortium.org/mailman/listinfo/users > > _______________________________________________ > users mailing list > users@lists.open-mpi.org > https://rfd.newmexicoconsortium.org/mailman/listinfo/users _______________________________________________ users mailing list users@lists.open-mpi.org https://rfd.newmexicoconsortium.org/mailman/listinfo/users