-
Notifications
You must be signed in to change notification settings - Fork 61
Building TiGL from Source
TiGL depends on following software/libraries to build properly:
- CMake (http://www.cmake.org/)
- OpenCascade or OCE.
- Windows: Download the latest OCE binaries from https://github.com/tpaviot/oce/releases.
-
Linux: Download our pre-compiled OCE packages from the Open Build Service
- For rpm based distros (OpenSuse, RedHat...) https://software.opensuse.org/download.html?project=home%3Amartinsiggel&package=OCE-devel
- For deb based distros (Debian, Ubuntu, Mint...) https://software.opensuse.org/download.html?project=home%3Amartinsiggel&package=liboce-dev
- Mac: Build OCE from sources (see https://github.com/tpaviot/oce/wiki/Build-(Mac-OSX))
- TiXI (http://tixi.googlecode.com)
- For TiGL Viewer (optional): Qt 4 (http://qt-project.org/)
We recommend building TiGL with Visual C++ 2010 as a 32bit variant. The free Visual C++ Express also works. Other compilers should do as well, but we don't porivide any support for them.
- Download the CMake installer from http://www.cmake.org/ and install it.
- Download OCE binaries for VS2010 from https://github.com/tpaviot/oce/releases and extract them.
- Download and extract latest TiXI binaries from https://code.google.com/p/tixi/wiki/Downloads?tm=2
- Optional: Download and install Qt 4.8 for VS2010 from http://download.qt.io/archive/qt/4.8/
- Extract the TiGL Code to a directory of your choice. In this tutorial, the directory will be d:\src\tigl
- Open the command shell (Press Windows key and type in cmd.exe)
- Change into the TiGL source directory, e.g.
cd d:\src\tigl
- Create a build directory and change into it
mkdir build && cd build
- Create the building environment by running cmake
cmake -G "Visual Studio 10 2010" -DTIXI_PATH=d:\src\tixi-binaries -DCASROOT=d:\src\oce-binaries -DCMAKE_INSTALL_PREFIX=install ..
You might change the paths where you extracted TiXI and OCE.
-
If everything is fine, close the command shell. Open the Windows Explorer and go to the
d:\src\tigl\build
directory. Open the TIGL.sln file with Visual C++. -
In Visual C++, perform the Release build of the ALL_BUILD project. The Debug build would require a special OCE debug version.
-
Finally install TiGL by building the INSTALL project. You can find the installed TiGL in
d:\src\tigl\build\install
Please add our package repository matching your distribution via
echo 'deb http://download.opensuse.org/repositories/home:martinsiggel/xUbuntu_13.04/ /' >> /etc/apt/sources.list.d/tigl.list
Replace the string xUbuntu_13.0 by your distribution id. This allows installing opencascade and tixi from out repository.
The required software can be installed via
sudo apt-get update
sudo apt-get install cmake libtixi-dev qt4-dev-tools liboce-dev
Download the CMake installer from http://www.cmake.org/ and install it.
Build OCE as described here
Download and install QT 4.8 or newer. Tixi has to be build from source (see https://code.google.com/p/tixi/wiki/InstallationHowto)
TiGL uses the CMake build system, which can generate build scripts / project files for e.g. MS Visual Studio, Apple XCode, Eclipse CDT, GNU Makefiles and many more.
CMake uses out-of-source builds, i.e. it uses a different build directory than the source directory. After starting the CMake GUI, the locations of the source and the build directory have to be specified.
To allow CMake to find the OpenCASCADE / OCE libraries, the environment Variable CASROOT has to be set to its installation directory.
After pressing "Configure", cmake tries to find the locations of the required libraries automatically. If the configuration fails, you may have to enter the path to OCE/OpenCASCADE and TiXI.
If the configuration succeeds, the build scripts (VC Project Files, Makefiles etc) are generated by pressing the button "Generate". The generated files can be found in the build directory. Project files (Visual Studio, Eclipse, XCode) have to be opened with the corresponding IDE. When using Makefiles, please change into the build directory and type make
.
After a successful compilation, the compiled TiGL library and its interfaces can be found in the "lib" directory of the build tree.
If python is installed, the python interface will be automatically built at the compile phase. The resulting file tiglwrapper.py
is located under buildDir/lib/
. When using the TiGL installer, the python wrapper can be found in installDir/share/tigl/python/
. To install the TiGL python wrapper, please copy this file in your python/Lib/site-packages/
folder.