Building/Linux
From enGrid Wiki
Contents |
Manual Building
Note: This chapter still needs a lot of work done on it. Currently it's simply an adjusted transcription from here.
Retrieving code from git
Source code repository to get the latest development version (UNSTABLE):
git clone git://engits.eu/git/engrid.git
or
git clone http://engits.eu/git/engrid.git
Using the git protocol should be faster.
WARNING: The master branch may be unstable! It is the main development branch.
Please use the release branch if you want a stable version.
To use the release branch, run the following command after git clone:
git checkout -b release remotes/origin/release
The git repository can also be browsed at engrid.git.sourceforge.net.
Preparations
Variables to change according to your needs
VTKPREFIX = where to install VTK ( Default = /usr/local ) VTKVERSION = VTK version QTPREFIX = where to install QT ( Default = /usr/local/Trolltech/Qt-4.5.0/ ) CGNSPREFIX = where to install CGNS ( Default = /usr/local/ )
Compiling VTK from source
You can get VTK from here.
cmake -DCMAKE_INSTALL_PREFIX:PATH=$VTKPREFIX -DBUILD_SHARED_LIBS:BOOL=ON -DVTK_USE_GUISUPPORT:BOOL=ON -DVTK_USE_QVTK:BOOL=ON -DVTK_USE_QT:BOOL=ON -DDESIRED_QT_VERSION:STRING=4 . chmod 644 Utilities/vtktiff/tif_fax3sm.c make && su -c 'make install'
Optionally, you may also use ccmake or cmake-gui to simplify defining the configuration variables:
cmake . ccmake .
or
cmake . cmake-gui .
Configuration variables:
CMAKE_INSTALL_PREFIX = VTKPREFIX BUILD_SHARED_LIBS = ON VTK_USE_GUISUPPORT = ON VTK_USE_QVTK = ON VTK_USE_QT = ON DESIRED_QT_VERSION = 4
If you also want the Java, Python and Tcl/Tk wrappers:
VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL
Compiling Qt from source
You can get Qt from here.
./configure --prefix=$QTPREFIX -opensource -nomake examples -nomake demos -nomake docs -no-webkit -no-phonon -no-phonon-backend -no-qt3support -no-accessibility -silent make && su -c 'make install'
Compiling CGNS from source
You can get CGNS from here.
mkdir -p $CGNSPREFIX/include mkdir -p $CGNSPREFIX/lib ./configure --prefix=$CGNSPREFIX && make && make install
Compiling enGrid from source
export VTKINCDIR=$VTKPREFIX/include/vtk-VTKVERSION/ export VTKLIBDIR=$VTKPREFIX/lib/ (or VTKPREFIX/lib/vtk-VTKVERSION in some cases) export LD_LIBRARY_PATH=$VTKLIBDIR:$LD_LIBRARY_PATH export CGNSINCDIR=/opt/shared/cgns/include/ export CGNSLIBDIR=/opt/shared/cgns/lib/ export LD_LIBRARY_PATH=$CGNSLIBDIR:$LD_LIBRARY_PATH export PATH=$QTPREFIX/bin:$PATH export QTDIR=$QTPREFIX export LD_LIBRARY_PATH=$QTPREFIX/lib:$LD_LIBRARY_PATH ./build-nglib.sh qmake make
Note: When using libqt4-dev from the repositories on Debian-based systems, make sure you use qt4 instead of qt3 by running:
sudo update-alternatives --config qmake
Automatic Building
Note: This chapter still needs a lot of work done on it. Currently it's simply an adjusted transcription from here.
Requirements
It requires g++, cmake, zenity, git, svn, libxext/mesa development files.
- On Debian/Ubuntu:
sudo apt-get install cmake zenity git-core subversion libxext-dev build-essential libxt-dev libglu1-mesa-dev
- On OpenSUSE:
sudo zypper install cmake zenity git-core subversion xorg-x11-libXext-devel gcc "gcc-c++" xorg-x11-libXt-devel Mesa-devel
- On Fedora:
yum install cmake zenity git-core subversion libXext-devel gcc "gcc-c++" libXt-devel mesa-libGLU-devel qt-devel wget
On Debian/Ubuntu (or any recent distro providing a version of Qt4 >4.5.0), you can skip the installation of QT4, by installing libqt4-dev from the repositories instead. Just make sure you set the variables in the config file accordingly. (should be QTPREFIX=/usr).
Installing the Qt SDK (binary release) should also work, but hasn't been tested yet.
Building and installing
Download the following files:
Change the configuration file engrid_installer_updater.cfg according to your needs.
Make engrid_installer_updater.sh executable:
chmod +x ./engrid_installer_updater.sh
Then run "engrid_installer_updater.sh" and check the actions you wish to run:
./engrid_installer_updater.sh
If you want to install to a non-user-writable directory:
sudo ./engrid_installer_updater.sh
IMPORTANT: Using the script can require up to 5.4 GB of disk-space!
Size of the source directories after compilation (those directories can be removed after installation):
4.1G ~/engrid_install/ 3.9M ~/engrid_install/cgnslib_2.5/ 3.6G ~/engrid_install/qt-x11-opensource-src-4.5.2/ 308M ~/engrid_install/VTK/
Size after installation:
1.3G /opt/engits/ 12K /opt/engits/bin/ 668K /opt/engits/CGNS/ 1.2G /opt/engits/QT/ 58M /opt/engits/src/ 75M /opt/engits/VTK/
Once installed, you can start engrid with the command (assuming default .cfg file):
/opt/engits/bin/start_engrid
This corresponds to BINPREFIX/START_ENGRID using the variables defined in the .cfg file.
More information described in the following subsections:
DESCRIPTION
The script allows:
- downloading, building and installing the dependencies for engrid
- downloading, building and installing engrid
- updating netgen
- updating engrid
- rebuilding engrid
- generating an environment setup script that can then be sourced by ~/.bashrc
- generating a startup script that sets up the environment and then starts engrid
USAGE
- First of all change the configuration file engrid_installer_updater.cfg according to your needs.
- Then you can run this script and choose the actions you wish to execute. Multiple actions can be run at once. They will be run in the order of the check-list.
Note 1: Although it should be enough to run create_bash_engrid once, it's recommended to run it every time to make sure the other actions use the correct environment.
EXAMPLES
Engrid installation:
[X] create_bash_engrid [X] install_QT [X] install_VTK [X] install_CGNS [X] build_engrid [ ] update_netgen [ ] update_engrid [ ] rebuild_engrid [X] create_start_engrid
Engrid update:
[X] create_bash_engrid [ ] install_QT [ ] install_VTK [ ] install_CGNS [ ] build_engrid [X] update_netgen [X] update_engrid [ ] rebuild_engrid [ ] create_start_engrid
Engrid rebuild:
[X] create_bash_engrid [ ] install_QT [ ] install_VTK [ ] install_CGNS [ ] build_engrid [ ] update_netgen [ ] update_engrid [X] rebuild_engrid [ ] create_start_engrid
Additional notes:
- The script is written in a way to bypass the licence acceptance question from the QT configure script (Chooses open-source edition and answers yes to license question).
- This means that if you use it to install QT, you automatically accept the GPL v3 and LGPL v2.1!
- We will change this eventually in the future, but for now this is a simple solution and we're assuming that you won't use the QT libraries installed in this way in proprietary applications.