Re: Installing and running Gadget 2 on Ubuntu 16.04 LTS

From: Manodeep Sinha <manodeep.sinha_at_vanderbilt.edu>
Date: Thu, 17 Nov 2016 19:33:44 +1100

On 11/17/16 6:43 PM, turhan nasri wrote:
> Hi,
>
> I am just starting to learn SPH simulation. I was following this
> tutorial:
> https://astrobites.org/2011/04/02/installing-and-running-gadget-2/
>
> It seems I succesfully generated the executable Gadget2 inside the
> /Gadget2 directory, then I copied both the Gadget2 executable and
> galaxy.param file to a newly created galaxy directory. However when I run:
>
> mpirun -np 2 ./Gadget2 ./galaxy.param
>
> I get the following error:
>
> ./Gadget2: error while loading shared libraries: libgsl.so.0:
> cannot open shared object file: No such file or directory
> ./Gadget2: error while loading shared libraries: libgsl.so.0:
> cannot open shared object file: No such file or directory
>
> I believe it has to do something with my Makefile. I am sharing the
> adjust settings for target computer part, if it gives any hint to the
> error:
>
> #--------------------------------------- Select target computer
>
> SYSTYPE="trina"
> #SYSTYPE="Mako"
> #SYSTYPE="Regatta"
> #SYSTYPE="RZG_LinuxCluster"
> #SYSTYPE="RZG_LinuxCluster-gcc"
> #SYSTYPE="OpteronMPA"
> #SYSTYPE="OPA-Cluster32"
> #SYSTYPE="OPA-Cluster64"
>
>
> #--------------------------------------- Adjust settings for
> target computer
>
> ifeq ($(SYSTYPE),"trina")
> CC = mpicc
> OPTIMIZE = -O3 -Wall
> GSL_INCL = -I/usr/local/include
> GSL_LIBS = -L/usr/local/lib
> FFTW_INCL= -I/usr/local/include
> FFTW_LIBS= -L/usr/local/lib
> MPICHLIB = -L/usr/lib
> endif
>
> I thought if there were error in makefile, the executable would not
> have created at the first place. But the executable was there and I
> have this error. I would very much appreciate if anyone has any
> suggestion on this. thanks
>
> Turhan
Unfortunately, you can still run into such runtime errors even though
the executable compiled fine. This error happens because the search path
at runtime does not include the actual directory location for the
compile-time library. The easiest way to fix this error is by embedding
the library path into the executable *during* compilation:

GSL_LIB_DIR := /usr/local/lib
GSL_LIBS := -L$(GSL_LIB_DIR) -Xlinker -rpath -Xlinker $(GSL_LIB_DIR)


Cheers,
Manodeep
Received on 2016-11-17 09:33:58

This archive was generated by hypermail 2.3.0 : 2023-01-10 10:01:32 CET