Notes on using IT++ on Athena by alexp (Alex Prengel) 2/26/08 The IT++ libraries (along with multiple helper libraries) have been installed on Athena for Sun and Linux. All libraries and binaries were built from source; the compilers used (and hence recommended compiler) are: Sun: gcc/g++/g77 in gcc-3.4 locker: gcc version 3.4.4 Linux: default gcc/g++/g77 in Athena 9.4 release: gcc version 3.4.6 20060404 (Red Hat 3.4.6-9) Both static and dynamic libraries have been built; however fully static binaries are generally not possible as libc and libX11, needed by most applications, are not available in static form on all platforms. You will need to add the itpp locker. Sourcing the file /mit/itpp/cshrc after this will set proper paths and environment variables for building your applications. The itpp-config utility, located in the itpp_v4.0.2 locker (and accessible from the itpp locker) can be used to determine compiler and linker flags suitable for building your applications- typing " itpp-config --help" gives usage information. You will need to use include files in /mit/itpp_v4.0.2/include in your applications, i.e. like: #include (or whatever other includes your application requires) and link against libraries in /mit/itpp_v4.0.2/lib; generally you will need to use multiple libraries in this directory, and various other system libraries. You should use itpp-config output to generate the command-line, i.e. g++ -O2 `itpp-config --cflags` -o myfile myfile.cpp `itpp-config --libs` NOTE: `itpp-config --libs` may not always supply the full needed library list, and you may get "undefined symbol" errors in some cases. Linking against additional libraries in /mit/itpp_v4.0.2/lib will usually fix this. See comments in file example.cpp in the same directory as this file for a specific example. When you run dynamically linked binaries you build with IT++ later, you will need to point the runtime system to the dynamic libraries through the LD_LIBRARY_PATH environment variable. This is done automatically if you add the itpp locker and source /mit/itpp/cshrc (setting ITPP_VERSION if you are not using the default version), but you probably won't want to do this every time you run something. A fairly simple way around this is to rename your binary and use a small "wrapper" script. If your binary is "foo", rename it to "foo.real", and write a shell script called "foo" as follows: #!/bin/csh -f set HERE=`dirname $0` if (-e /etc/athena/reactivate) then set isathena=1 attach -q itpp else set isathena=0 setenv ATHENA_SYS `fs sysname | awk '{ print substr($4,2,length($4)-2)}'` afslocker itpp >/dev/null endif if ( ! $?ITPP_VERSION) then setenv ITPP_LOCKER itpp-default else setenv ITPP_LOCKER ITPP_v${ITPP_VERSION} endif setenv MACHINE `machtype` if ($MACHINE == sun4) then set addpath=/mit/itpp/${ITPP_LOCKER}/lib:/usr/sfw/lib/sparcv9 else set addpath=/mit/itpp/${ITPP_LOCKER}/lib endif if ( $?LD_LIBRARY_PATH ) then setenv LD_LIBRARY_PATH ${addpath}:$LD_LIBRARY_PATH else setenv LD_LIBRARY_PATH ${addpath} endif exec ${HERE}/foo.real $* or the equivalent with the Bourne shell. PLEASE NOTE THAT WE CAN'T GUARANTEE THAT DYNAMIC LIBRARIES WILL STAY AROUND INDEFINITELY IN THE SAME LOCATIONS THEY ARE IN NOW! THIS MAY BREAK DYNAMICALLY LINKED BINARIES! You may want to copy the relevant dynamic libraries to a location of your choosing, or use static linking instead. Note that the current default version of the library will be used, but this may be overridden by setting the ITPP_VERSION environment variable at run time. Online documentation is at http://itpp.sourceforge.net/current/