2. Installation
Dinver framework is made of one library (dinvercore) and one application: dinver which provides a graphical user interface and a command line interface. A series of plugins can be added for particular inversion problems: e.g. surface wave inversion (dinverdc), templates for new inversion problems (dinvercpp, dinverc, dinverfor, dinvermatlab, dinverext)...
All individual libraries or applications can be downloaded and installed separately. However, for the sake of simplicity a single archive (Sesarray package) is provided which contains all components included. Compiling from source distributions may take some time whilst binary packages are ready once downloaded.
For binary distributions (Windows and Mac OS X only), download the corresponding archives and follow instructions (user friendly installer). Installation from source is detailed here below.
The recommended compiler is gcc (>=3.3.5), available for all platforms (also for Windows, minGw). With any versions >=3.4, time needed for compiling is greatly reduced thanks to pre-compiled headers. This optimization is automatically handled by ./configure (see below). Building process is divided in two main steps: compiling Qt (if not already available) and Sesarray.
Building 3rd party libraries
All 3rd party libraries except Qt are included in Sesarray package (lapack, fftw, libf2c). Qt must be built before starting Sesarray installation. Qt Script for Application (QSA) is no longer developed by Trolltech. QSA for Qt 4 will reach end of life status December 1st, 2008. A new scripting engine will be available with Qt 4.3 conforming to ECMA Standard 262.
Fastest method
Qt archive delivered by Trolltech is a huge file mainly dedicated to developers. It requires more than 1.5 Gb of disk space to build completely. If you do not want to loose time and disk space, you may want to try qt-light-install, a script wrote to ease Qt installation (13 minutes on a AMD64 3500+ and only 90 Mb of disk space during comppilation).
| Installing Qt with qt-light-install |
$ tar xvfpz qt-light-install.tar.gz $ ./qt-light-install -prefix /usr/local/Trolltech -qsa |
If you have network access qt-light-install will download all necessary archives for you. In case of problem during downloads, you may be requested to provide manually these archives. qt-light-install can start over from archives in any states (unzipped, untared, partially compiled,...).
A slightly longer method
Before starting you must install the latest Qt libraries available at www.trolltech.com.
| Building and installing Qt |
$ cd qt-x11-opensource-src-X.X.X $ ./configure -release -no-exceptions -prefix /usr/local/Trolltech/Qt-X.X.X $ make $ su - # necessarry only if your usual account has no write permissions to /usr/local $ make install $ cd /usr/local/Trolltech $ ln -s Qt-X.X.X qt $ exit $ cd .. |
Building Sesarray
Unix like systems (Linux, Mac OS X, ...)
| Unpacking the archive |
$ tar xvfpz sesarray-src-X.X.X.tar.gz $ cd sesarray-src-X.X.X |
A configure script creates the necessary Makefiles. Usual options for configure are available (option '--help' for details, '--prefix' to change installation directory).
| Configure the installation path (Linux and Mac) |
$ ./configure |
You will be prompted for the license agreement. You are ready to compile and to install the package:
| Compile and install |
$ make install |
Windows
Building sesarray package is useless under Windows and time consuming. Prefer the binary release if you just want to use the software and do not want to loose your time. However, in some situations, debugging symbols included in the binary executable are necessary. For instance, if you encounter random crashes of the packages and you want to help the developers of this code.
This tutorial guides you through all steps required for building sesarray package from sources. Windows does not contain by default all necessary development tools. Hence, we first guide you through their installation before the installation of the package itself.
Contents:
- Installing Mingw and MSYS environment
- Customizing a MS-DOS terminal suitable for building
- Building Qt4
- Installing Qt4 for MSYS
- Building sesarray
Installing Mingw and MSYS environment
- Download the following files (also available at http://www.mingw.org/download.shtml#hdr2):
- Download install-mingw.zip from ftp://ftp.geopsy.org/softwares/qt and unzip it (for instance with 7-zip).
- If you want to customize the installation path you must edit the header of file install-mingw.bat.
- Inside the extracted folder, double-click on "install.bat". This script launch the installation of all mingw and msys packages sequentially. During msys installation, you will prompted in the terminal for a post-install. It is really important to answer as specified at first in the terminal.
Customizing a MS-DOS terminal suitable for building
- Drag the MS-DOS terminal icon from the Start menu ( usually in Programs/Accessories ) to your Desktop or anywhere else.
- Right click on it and select "Properties"
- Add " /K c:\sesarray\setenv.bat" to the target. The target must be like that:
%SystemRoot%\system32\cmd.exe /K c:\sesarray\setenv.bat - Modify the starting folder to "c:\sesarray"
- Close the dialog box
- Rename the MS-DOS terminal shortcut to "sesarray-term"
- Create folder c:\sesarray
- Create a new text file called c:\sesarray\setenv.bat containing:
set PATH=c:\mingw\bin;c:\qt\bin;%PATH%
- To test the terminal, double click on "sesarray-term", you should have a terminal waiting for commands with the correct environment. Type echo %PATH% to check it. It should be something like:
c:\mingw\bin;c:\qt\bin;c:\WINNT\system32 ...etc
Building Qt4
- Download the latest version for Windows from http://www.trolltech.com/download/qt/windows.html
- Unzip the archive "qt-win-opensource-src-X.X.X.zip", for instance with 7-zip
- Move and rename qt-win-opensource-src-X.X.X folder to c:\qt
- If you want to use QSA (scripting engine), patch Qt as explained above inside a MSYS terminal. Then, run ./configure and make in the MSDOS terminal .
- Double-click on "sesarray-term" and type:
$ cd ..\qt $ configure -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg $ make
- Wait for at least one hour... depending upon your machine performances!
Installing Qt4 for MSYS
- Change the PATH environment variable to include Qt path
- Create file ~/.profile with the following lines (e.g. with vi):
$ vi ~/.profile - Inside vi, type 'i' to start edition and insert the next line:
export PATH=/c/qt/bin:$PATH - To save and exit, hit 'ESCAPE', then type ':wq'
- Restart MSYS and check that you can start qmake for instance:
$ qmake -v QMake version: 2.00a Using Qt version 4.1.1 in C:\qt\lib
Building sesarray
- Download sesarray-X.X.X.tar.gz (the source archive, not the specific Windows sesarray-win which contains only binary executables). In the following, sesarray-X.X.X.tar.gz is supposed to be in c:\sesarray. Replace X.X.X by the appropriate version.
- Open a MSYS terminal (usually there is an icon on the desktop)
- Change current directory to /c/sesarray by typing:
$ cd /c/sesarray - Uncompress the archive by typing:
$ tar xvfpz sesarray-X.X.X.tar.gz - Enter in sesarray-X.X.X directory:
$ cd sesarray-X.X.X - Configure the package by typing:
$ sh configure -prefix "C:\Program Files\sesarray" -debug - compile the 3rd party library under MSYS
$ make 3rdparty - Open "sesarray-term"
- Change current directory to c:\sesarray\sesarray-X.X.X
- Type "make install"
That's all, you should have a working version of sesarray in C:\Program Files\sesarray, which includes debug information.
Final touch
With the last step, you were probably happy to see geopsy.exe ready in C:\Program Files\sesarray\bin and you double-clicked on it. Desesperated you are because of missing dlls (mingwm10.dll, QtCored4.dll or QtGuid4.dll).
To correct this, you must copy these dynamic libraries into a directory listed in your system %PATH%. Either add C:\mingw\bin and C:\qt\bin to the system path (see Start Menu/control panel/System/Advanced/Environment Variables), or copy these libraries to C:\Program Files\sesarray\bin, close to all other sesarray binaries. With the last method, you can copy the whole directory C:\Program Files\sesarray to other Windows computers without much effort
Thanks for your patience!