Arne thanks for this,
Defining LD_LIBRARY_PATH works

I also tried installing the opm-core, opm-parser, ecl libraries, compiling
with
g++ -std=c++11 -o mytest tutorial1.cpp -lopmcore -lParser -lecl

It compiles, but it still doesn't find the shared library for ecl when
running
I still need to define LD_LIBRARY_PATH, but this time to a different
path.. /usr/local/lib/x86_64-linux-gnu

Anyway, it is sorted, and you gave me plenty of options to get started!

Thanks again

Paolo



On Tue, Jun 24, 2014 at 5:47 PM, Arne Morten Kvarving <
[email protected]> wrote:

>  On 24/06/14 17:41, Paolo Orsini wrote:
>
> Thanks for sll your help,
>
>  Adding explicitly the path to the libraries as suggested by Andreas I
> was able to compile tutorial 1 externally.
>
>  This the build command I used
>
>  g++ -std=c++11 -o mytest tutorial1.cpp
> /home/paolo/OPM/opm-core/build/lib/libopmcore.a
> /home/paolo/OPM/opm-parser/build/lib/x86_64-linux-gnu/libParser.a
> /home/paolo/OPM/ert/ert/devel/lib/x86_64-linux-gnu/libecl.so
>
>  However when running mytest I got the following error:
>
>   ./mytest: error while loading shared libraries: libecl.so.1.0: cannot
> open shared object file: No such file or directory
>
>  Still some issue with linking...
>
> yes, that's what happens when you take bad advice :> (joke, andreas!)
>
>
> you can make it work this way by doing
>
> LD_LIBRARY_PATH=/home/paolo/OPM/ert/ert/devel/lib/x86_64-linux-gnu ./mytest
>
> you are linking to a shared library outside system paths. LD_LIBRARY_PATH
> adds a path for the linker to look in.
>
> never use shared libs from a build tree. either recompile your ert static,
> or install it on the system level and link with -lecl
>
> (sorry for the dupe paolo, forgot to cc the list..)
>
_______________________________________________
Opm mailing list
[email protected]
http://www.opm-project.org/mailman/listinfo/opm

Reply via email to