[m-users.] Installed library not found

Volker Wysk post at volker-wysk.de
Tue Sep 13 20:48:57 AEST 2022


Hi!

I've installed the latest RODT version of Mercury. I've also installed the
Posix extra library, with "mmc -j8 --make libposix.install".

I can compile my program with no problems, but when I call it, I get:

desktop ~/src/tt $ ./tt
./tt: error while loading shared libraries: libposix.so: cannot open shared
object file: No such file or directory

The installed library is here:

/usr/local/lib/mercury-srcdist-rotd-2022-09-
07/lib/mercury/lib/asm_fast.par.gc.stseg/libposix.so

When I put the above path (the directory part of it) in the LD_LIBRARY_PATH
variable, the program starts okay.

What would be the right/official/supported way to install the library, such
that it will be found at run time? Is it a Mercury bug or have I not 
properly installed the lib?

I've compiled the program with:

mmc -j8 -E --make --parallel \
    --output-compile-error-lines=200 \
    -lposix \
    --grade asm_fast.par.gc.stseg \
    --mercury-linkage static \
    --cflags "$(pkg-config --cflags glib-2.0)" \
    `pkg-config --libs glib-2.0` \
    "$1"

I've build and installed Mercury as my normal user, not root. I've made the
target directory be owned by him. Just in case, if this could play a role.

Cheers,
Volker


More information about the users mailing list