[Dune] problem with static linking
Jö Fahlke
jorrit at jorrit.de
Fri Jun 5 16:08:51 CEST 2015
Am Thu, 4. Jun 2015, 19:23:12 +0200 schrieb Arya Fallahi:
> Date: Thu, 4 Jun 2015 19:23:12 +0200
> From: Arya Fallahi <arya.fallahi at gmail.com>
> To: "dune at dune-project.org" <dune at dune-project.org>
> Subject: [Dune] problem with static linking
>
> Dear Dune,
>
> I am having a problem with running the object file of my dune application
> on a different machine. I compile it on my UBUNTU 14.04 LTS machine with
> gcc-4.8.2. Then, I run it on HPC clusters with gcc-4.4 and openmpi-1.8 and
> I get the following error:
>
> ../../cyrus/dgtd: error while loading shared libraries: libquadmath.so.0:
> cannot open shared object file: No such file or directory
>
> It seems that this library is not present in all openmpi and gcc
> installations. Do you know how I can statically link this library? I
> believe in this case it should not search for this shared library on
> clusters.
I would try to compile on the cluster. Usually that is done on the login
node, but check whether that particular cluster has different policies. That
should make sure the system environment during compilation matches the one
during execution.
If that does not work for some reason, you can try copying the
libquadmath.so.0 binary from your system to the cluster. You can find out
where it is using something like
ldd dgtd
Note that the libquadmath.so.0 you find this way will usually be a symlink,
you need to copy the target of the link to the cluster too.
Once the lib is on the cluster, you have to tell the linker where to find it.
This is done with the variable LD_LIBRARY_PATH:
LD_LIBRARY_PATH=/path/to/lib ../../cyrus/dgtd [ARGS...]
The /path/to/lib is the directory where you put the library, not the library
file itself. If you need multiple entries in LD_LIBRARY_PATH, seperate them
with ':'.
Note that if you do it like this, you likely need to copy more libraries, you
are trying to execute a binary compiled with one system's libc with a libc
from another system, which can break in funny ways.
Warning: Under no circumstances set LD_LIBRARY_PATH in your shell
initialization files (.bash_profile, .profile, .bashrc). You may override
essential system libraries with binary incompatible versions, and you could
lock yourself out of the system that way.
Regards,
Jö.
--
Jorrit (Jö) Fahlke, Institute for Computational und Applied Mathematics,
University of Münster, Orleans-Ring 10, D-48149 Münster
Tel: +49 251 83 35146 Fax: +49 251 83 32729
Of all the things I've lost, I miss my mind the most.
-- Ozzy Osbourne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150605/376ac27a/attachment.sig>
More information about the Dune
mailing list