========================================== Earth Observation CFI Release 4.2 C++ Libraries Installation hints ========================================== The CFI libraries are provided in different packages depending on the platform: --------------- SOLARIS & LINUX --------------- The CFI libraries are distributed as compressed (gzip) files: 32-bit: * EOCFI_C++_4_2_LINUX.tar.gz * EOCFI_C++_4_2_SOLARIS.tar.gz 64-bit: * EOCFI_C++_4_2_LINUX64.tar.gz * EOCFI_C++_4_2_SOLARIS64.tar.gz In order to install the libraries is necessary to follow these steps: 1. Copy the required files (from the zipped files listed above) in the directory where the user wants to install, say (CFI_INSTALL). 2. Uncompress (gzip) and untar (tar xvf) the files. 3. It is assumed that the libxml2 is installed on your system. If not, please consult your linux/solaris documentation for additional libraries documentation. libxml2 can be downloaded here: http://xmlsoft.org/ Packages for LINUX and SOLARIS 32-bit can be downloaded from the EOP-PE website: http://eop-cfi.esa.int/ee_cfi_distribution/XML_LIBRARIES/V2.6.22/ The supported version of libxml2 is 2.6.22. 4. (building an application using the CFI C++ libraries) The CFI C++ libraries are delivered as shared objects ( .so files ). They are located (symbolic links) in the (CFI_INSTALL)/libraries/(OS) directory, being (OS) either LINUX, LINUX64, SOLARIS, SOLARIS64. The correspondent header files ( .h files) are located in (CFI_INSTALL)/include. The dynamic loader shall be configured so that all shared objects needed by the application to run can be found (the easiest way is to set properly the LD_LIBRARY_PATH environment variable). The following is an example on how to build and run a program myapp from source file myapp.cpp on LINUX 32-bit: prompt> export CFI_INSTALL=/path/to/CFI/C++/installation prompt> export LIBXML_DIR=/path/to/libxml2/libraries prompt> g++ -m32 -I $CFI_INSTALL/include \ -L $CFI_INSTALL/libraries/LINUX \ -L $LIBXML_DIR \ -lCfiOrbit -lCfiLib -lCfiDataHandling -lCfiFileHandling -lCfiEECommon -lxml2 -lm -lc \ -o myapp myapp.cpp prompt> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBXML_DIR:$CFI_INSTALL/libraries/LINUX (if required, LD_LIBRARY_PATH shall point also to the directory storing libxml2 shared objects) prompt> ./myapp 5. (building and running example and validation programs) a) Define the following environment variables in order to build and run the example and validation programs: EOCFI_DEV shall point to (CFI_INSTALL) directory EOCFI_DIR shall point to (CFI_INSTALL) directory LD_LIBRARY_PATH shall point to the directory containing the libxml2 shared objects and to the directories containing the CFI C++ shared objects b) Run the corresponding validation/example programs (for each of the libraries), using the commands: prompt> cd (PRG_DIRECTORY) prompt> make -f (MAKEFILE) PRG_DIRECTORY is the directory storing the example/validation program for a given library, e.g. for the Orbit library: - PRG_DIRECTORY is $CFI_INSTALL/Orbit/validation (for validation program) - PRG_DIRECTORY is $CFI_INSTALL/Orbit/example (for example program) MAKEFILE is the makefile corresponding to the platform, it can be either: make.SOLARIS, make.SOLARIS64, make.LINUX, make.LINUX64. (Such makefile may need to be adapted to the user platform configuration) This will compile, link and execute the example / validation program. In case of successful installation of the library, a message similar to the following will be printed on standard output by the validation program: LIBRARY INSTALLATION = OK ------------------------------------ MACOS X (Power PC & Intel) ------------------------------------ The CFI libraries are distributed using an installation program: 32-bit: * EOCFI_C++_4_2_MACIN.dmg * EOCFI_C++_4_2_MACOS.dmg 64-bit: * EOCFI_C++_4_2_MACIN64.dmg In order to install the libraries is necessary to follow these steps: 1. Expand the archive (if necessary) by double clicking. 2. Double click on the application, in order to start up the installation program. 3. Follow the instructions displayed by the installation application. Note: Installation of MAC OS X disk images a) From GUI: a1. Expand the .dmg archive by double clicking. a2. Follow the instructions displayed by the installation application. b) From terminal: b1. Type the command: hdid EOCFI_4_1_MACOS.dmg Now the disk image is mounted under the /Volumes directory. The name of the package is shown (e.g. EE_CFI_Installation.mpkg) b2. Run the command line version of the Mac OS X installer. sudo /usr/sbin/installer -verbose -pkg EE_CFI_Installation.mpkg -target / b3. Copy the directory created to the (CFI_INSTALL) folder b4. Unmount the *.dmg disk image First you need to execute the mount command to determine which virtual disk device the dmg is mounted as (e.g. /dev/disk1s2). Then we use 'hdiutil detach' to unmount it. hdiutil detach /dev/disk1s2 -force 3. It is assumed that the libxml2 is installed on your system. If not, please consult your Mac documentation for additional libraries installation. libxml2 can be downloaded here: http://xmlsoft.org/ Pre-built packages can be downloaded from the EOP-PE website: http://eop-cfi.esa.int/ee_cfi_distribution/XML_LIBRARIES/V2.6.22/ * MACOS: combo-2005-11-06.dmg.gz * MACIN64: libxml2-2.6.22_MACIN64.tar.gz * MACOS64: libxml2-2.6.22_MACOS64.tar.gz The supported version of libxml2 is 2.6.22. 4. (building an application using the CFI C++ libraries) The CFI C++ libraries are delivered as shared objects ( .dylib files ). They are located (symbolic links) in the (CFI_INSTALL)/lib directory. The correspondent header files ( .h files) are located in (CFI_INSTALL)/include. The dynamic loader shall be configured so that all shared objects needed by the application to run can be found (the easiest way is to set properly the DYLD_LIBRARY_PATH environment variable). The following is an example on how to build and run a program myapp from source file myapp.cpp on MACIN 32-bit: prompt> export CFI_INSTALL=/path/to/CFI/C++/installation prompt> export LIBXML_DIR=/path/to/libxml2/libraries prompt> g++ -m32 -I $CFI_INSTALL/include \ -L $CFI_INSTALL/lib \ -L $LIBXML_DIR \ -lCfiOrbit -lCfiLib -lCfiDataHandling -lCfiFileHandling -lCfiEECommon -lxml2 -lm -lc \ -o myapp myapp.cpp prompt> export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBXML_DIR:$CFI_INSTALL/lib (if required, DYLD_LIBRARY_PATH shall point also to the directory storing libxml2 shared objects) prompt> ./myapp 5. (building and running example and validation programs) a) Define the following environment variables in order to build and run the example and validation programs: EOCFI_DEV shall point to (CFI_INSTALL) directory EOCFI_DIR shall point to (CFI_INSTALL) directory DYLD_LIBRARY_PATH shall point to the directory containing the libxml2 shared objects and to the directories containing the CFI C++ shared objects b) Run the corresponding validation/example programs (for each of the libraries), using the commands: prompt> cd (PRG_DIRECTORY) prompt> make -f (MAKEFILE) PRG_DIRECTORY is the directory storing the example/validation program for a given library, e.g. for the Orbit library: - PRG_DIRECTORY is $CFI_INSTALL/example and validation/Orbit/validation (for validation program) - PRG_DIRECTORY is $CFI_INSTALL/example and validation/Orbit/example (for example program) MAKEFILE is the makefile corresponding to the platform, it can be either: make.MACOS, make.MACOS64, make.MACIN, make.MACIN64 (Such makefile may need to be adapted to the user platform configuration). This will compile, link and execute the example / validation program. In case of successful installation of the library, a message similar to the following will be printed on standard output by the validation program: LIBRARY INSTALLATION = OK ------------------------------------ Windows ------------------------------------ COMPATIBILITY NOTE: Microsoft Visual C++ 9.0 (Visual Studio 2008) is required in order to build program applications using the Earth Observation CFI C++ Libraries for Windows. The CFI libraries are distributed using an installation program: * EOCFI_C++_4_2_WINDOWS_DLL.exe: as dynamic link libraries ( .DLL files ) * EOCFI_C++_4_2_WINDOWS_STA.exe: as static libraries ( .LIB files ) In order to install the libraries is necessary to follow these steps: 1. Double click on the application, in order to start up the installation program. 2. Follow the instructions displayed by the installation application. 3. The environment variables are automatically set by the installation program. Required additional libraries (libxml2, pthread are in the cfi_tools directory. 4. (building an application using the CFI C++ libraries) They are located (symbolic links) in the (CFI_INSTALL)/lib directory. In case of DYNAMIC LIBRARIES, the lib directory contains, for each library (e.g. Orbit): - one DLL file (libOrbit.dll) and - one import library (libOrbit.lib) In case of STATIC LIBRARIES, the lib directory contains, for each library (e.g. Orbit): - one static library (libOrbit.lib), this is DIFFERENT from libOrbit.lib in the Dynamic library package. The correspondent header files ( .h files) are located in (CFI_INSTALL)/include. The following is an example on how to build and run a program myapp from source file myapp.cpp on WINDOWS: prompt> cl /I \path\to\cfi\installation\include myapp.cpp /c /o myapp.obj prompt> link myapp.obj /libpath:\path\to\cfi\installation\lib /libpath:\path\to\cfi\installation\cfi_tools libOrbit.lib libLib.lib libDataHandling.lib libFileHandling.lib libEECommon.lib libxml2.lib pthread.lib The PATH environment variable shall point to the directory containing the required DLLs: prompt> set PATH=%PATH%;\path\to\cfi\installation\cfi_tools When CFI DLL libraries are used, PATH shall be pointing also to the directory containing the DLL files: prompt> set PATH=%PATH%;\path\to\cfi\installation\cfi_tools 5. (building and running example and validation programs) - Go in the directory containing the validation/example program source (e.g. \path\to\cfi\installation\example and validation\Orbit\validation or \path\to\cfi\installation\example and validation\Orbit\example). - Adapt the makefile (either make.WINDOWS_DLL.mak or make.WINDOWS_STA.mak). - run: nmake /f (MAKEFILE) This will compile, link and execute the example / validation program. In case of successful installation of the library, a message similar to the following will be printed on standard output by the validation program: LIBRARY INSTALLATION = OK