Manual Building with g++: Difference between revisions
From NEOSYS Dev Wiki
Jump to navigationJump to search
No edit summary |
|||
Line 1: | Line 1: | ||
To give some insight into the automatic procedure. | To give some insight into the automatic procedure. | ||
Line 46: | Line 38: | ||
http://www.ibm.com/developerworks/library/l-shobj/ | http://www.ibm.com/developerworks/library/l-shobj/ | ||
ldd libexodus.so.1.0|grep | ldd libexodus.so.1.0|grep "not found" | ||
ldd -u libexodus.so.1.0 | ldd -u libexodus.so.1.0 | ||
Latest revision as of 14:00, 24 November 2010
To give some insight into the automatic procedure.
Building
get into the source code
cd ~/exodus/trunk/exodus/exodus/exodus
Copy the headers to a standard include path
#include files sudo cp exo*.h /usr/include sudo cp mv*.h /usr/include
Compile (Ignore three warnings in /boost/thread/tss.hpp included from mvdbpostgres.cpp)
g++ -fPIC -c *.cpp gcc -fPIC -c *.c
Link and output the library file
g++ -shared -o libexodus.so.1.0 *.o -lc -lpq -lboost_filesystem-gcc41-mt -lboost_regex-gcc41-mt\ -lboost_thread-gcc41-mt -Wl,-soname,libexodus.so.1
Installing
This will place the libraries so that you can compile from anywhere on the system
#copy to a standard library folder sudo cp libexodus.so.1.0 /usr/lib #register the library file with the linux library cache sudo ldconfig -v #create the pointer to version 1 sudo ln -sf /usr/lib/libexodus.so.1 /usr/lib/libexodus.so
Checking the Build
http://www.ibm.com/developerworks/library/l-shobj/
ldd libexodus.so.1.0|grep "not found" ldd -u libexodus.so.1.0
Testing libexodus
g++ test.cpp -lexodus ./a.out ldd -u a.out