Page 1 of 1

Running Examples

Posted: Wed Mar 22, 2017 12:07 pm
by matthiasredies
I installed magma through AUR (arch user repository) and now I'm trying to build some of the examples that come with MAGMA. After setting some of the variables I would built the examples:

Code: Select all

MAGMADIR     ?= /opt/magma
CUDADIR      ?= /opt/cuda
OPENBLASDIR  ?= /usr/local/openblas
The building throws no errors, but when I run the examples I get:

Code: Select all

./example_v2: error while loading shared libraries: libmagma.so: cannot open shared object file: No such file or directory
What am I doing wrong?

Kind regards

Matthias

Re: Running Examples

Posted: Wed Mar 22, 2017 1:54 pm
by mgates3
To use as a shared library, MAGMA needs to be in your library path. Assuming you installed MAGMA in MAGMADIR, typically you can do this by adding $MAGMADIR/lib to LD_LIBRARY_PATH. E.g., with sh:

Code: Select all

    if [ -n "${LD_LIBRARY_PATH}" ] ; then
        OLD_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:"
    fi
    export LD_LIBRARY_PATH="${OLD_LD_LIBRARY_PATH}${MAGMADIR}/lib"
If you haven't installed MAGMA, then just set MAGMADIR to the source distribution, e.g., /path/to/magma-2.2.0

This can also be solved by linking using -rpath, which is what is done for the MAGMA testers.

-mark