[Trilinos-Users] [EXTERNAL] Makefile: Can't find .so files

Rush, Simon simon.rush at ttu.edu
Tue Sep 13 17:16:41 EDT 2016


Sorry to have bothered everyone. It was a stupid mistake on my part. I was using "make file" instead of "make file.exe" where my Makefile had things like "%.exe: %.o ...."

________________________________
From: Bradley, Andrew Michael <ambradl at sandia.gov>
Sent: Monday, September 5, 2016 11:18:51 AM
To: Rush, Simon; trilinos-users at trilinos.org
Subject: Re: [EXTERNAL] [Trilinos-Users] Makefile: Can't find .so files


Hi Simon,


Looks like it might just be a matter of your LD_LIBRARY_PATH, then. In bash

    export LD_LIBRARY_PATH=/usr/local/Trilinos/BUILDS/SERIAL-OPT/lib:${LD_LIBRARY_PATH}

in other shells, there are equivalent lines.


Alternatively, add

    -Wl,-rpath=$(MYAPP_TRILINOS_DIR)/lib

to the end of the link line so that the executable is built with knowledge of the .so file locations.


Cheers,

Andrew


________________________________
From: Rush, Simon <simon.rush at ttu.edu>
Sent: Monday, September 5, 2016 8:18 AM
To: Bradley, Andrew Michael; trilinos-users at trilinos.org
Subject: Re: [EXTERNAL] [Trilinos-Users] Makefile: Can't find .so files


Hi Andrew,


       I included your suggested two lines, but unfortunately, ran into the same issues. Here is the output from my make command and the attempt to execute; note the file compiles, it is in trying to run it I get errors.


make command:

/usr/bin/g++ -c -std=c++11 -O3  "-I/usr/local/Trilinos/BUILDS/SERIAL-OPT/include" -I/usr/include -I/usr/local/include -DMYAPP_EPETRA src_file.cpp
/usr/bin/ar cr libmyappLib.a src_file.o
/usr/bin/g++ -std=c++11 -O3  libmyappLib.a -o MyApp.exe -lgfortran "-I/usr/local/Trilinos/BUILDS/SERIAL-OPT/include" -I/usr/include -I/usr/local/include -DMYAPP_EPETRA "-L/usr/local/Trilinos/BUILDS/SERIAL-OPT/lib"  -lpdeopt -lsundanceStdFwk -lsundanceStdMesh -lsundanceCore -lsundanceInterop -lsundanceUtils -lplaya -lnoxepetra -lnoxlapack -lnox -lModeLaplace -lanasaziepetra -lanasazi -lbelosepetra -lbelos -lml -lifpack -lmapvarlib -lfastqlib -lblotlib -lplt -lsvdi_cgi_cps -lvdicps_dual -lvdx11cps -lsvdi_cgi_met -lsvdi_cgi_pst -lsvdi_cgi_x11 -lsvdi_cdr -lsvdi_cgi -lsuplib -lsupes -laprepro_lib -lchaco -lIonit -lIotr -lIohb -lIogn -lIoex -lIoss -lnemesis -lexodus_for -lexodus -lmapvarlib -lfastqlib -lblotlib -lplt -lsvdi_cgi_cps -lvdicps_dual -lvdx11cps -lsvdi_cgi_met -lsvdi_cgi_pst -lsvdi_cgi_x11 -lsvdi_cdr -lsvdi_cgi -lsuplib -lsupes -laprepro_lib -lchaco -lIonit -lIotr -lIohb -lIogn -lIoex -lIoss -lnemesis -lexodus_for -lexodus -lamesos -laztecoo -lepetraext -ltriutils -lepetra -lteuchosremainder -lteuchosnumerics -lteuchoscomm -lteuchosparameterlist -lteuchoscore -lteuchosremainder -lteuchosnumerics -lteuchoscomm -lteuchosparameterlist -lteuchoscore /usr/lib/x86_64-linux-gnu/libX11.so /usr/local/lib/libnetcdf.so /usr/local/lib/liblapack.so /usr/local/lib/libblas.so /usr/lib/x86_64-linux-gnu/libpthread.so


./MyApp.exe

./MyApp.exe: error while loading shared libraries: libteuchoscomm.so.11: cannot open shared object file: No such file or directory

Thanks for y'all's help!


________________________________
From: Bradley, Andrew Michael <ambradl at sandia.gov>
Sent: Sunday, September 4, 2016 3:30 PM
To: Rush, Simon; trilinos-users at trilinos.org
Subject: Re: [EXTERNAL] [Trilinos-Users] Makefile: Can't find .so files


Hi Simon,


I'm taking a wild guess here. I suspect that for some reason (possibly a bug in the build system?), Trilinos_LIBRARY_DIRS and Trilinos_INCLUDE_DIRS are coming out as having relative, rather than absolute, paths, and these relative paths have nothing to do with your app's location.


As a kludge, try modifying the Makefile like this:


# Add these two extra lines ...
Trilinos_LIBRARY_DIRS="-L$(MYAPP_TRILINOS_DIR)/lib"
Trilinos_INCLUDE_DIRS="-I$(MYAPP_TRILINOS_DIR)/include"
# ... before reaching here.
INCLUDE_DIRS=$(Trilinos_INCLUDE_DIRS) $(Trilinos_TPL_INCLUDE_DIRS)
LIBRARY_DIRS=$(Trilinos_LIBRARY_DIRS) $(Trilinos_TPL_LIBRARY_DIRS)
LIBRARIES=$(Trilinos_LIBRARIES) $(Trilinos_TPL_LIBRARIES)


Here I've assumed MYAPP_TRILINOS_DIR is an installation containing lib/ and include/ directories.


Let us know if this fixes your app's build. Whether or not it does, would you send us the full output of the make command so that we can examine the print_info target's output?


Cheers,

Andrew



________________________________
From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of Rush, Simon <simon.rush at ttu.edu>
Sent: Sunday, September 4, 2016 2:03 PM
To: trilinos-users at trilinos.org
Subject: [EXTERNAL] [Trilinos-Users] Makefile: Can't find .so files


Hi,


      I'm a grad student working with Trilinos, and I can't get my Makefile to compile a simple program with a few Anasazi header files included. Attached is my Makefile, which I took from https://trilinos.org/oldsite/Export_Makefile_example.txt. Even though I have clearly included Teuchos as a package, and /my_build/lib, I am getting errors about not being able to find .so files that are located at /my_build/lib. Can anyone tell me what I am doing wrong?


Simon Rush
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20160913/857f67f8/attachment.html>


More information about the Trilinos-Users mailing list