Skip to content
This repository was archived by the owner on Sep 23, 2019. It is now read-only.

Building

cfsengineering edited this page Feb 18, 2019 · 19 revisions

Building For Linux

Perequisites

To successfully build CPACSCreator you need to have the following 3 libraries installed. These requirements are similar to TIGL.

  • TIXI3
  • OpenCASCADE
  • Qt5 or Qt4 (Qt5 is preferred)

Depending which distribution you use, there is slightly different ways to get the required libraries. We have done the installation process for Debian 9 and Centos 7.5.

Perequisites For Debian 9

1. Install TIXI3

Clone the git repository of TIXI:
git clone https://github.com/DLR-SC/tixi.git

Move into this new TIXI repository, create a folder called "build" and go inside "build":
cd tixi
mkdir build
cd build

Install dependencies for TIXI
sudo apt-get update
sudo apt-get install cmake
sudo apt-get install libcurl4-nss-dev
sudo apt-get install libxslt-dev

Make sure that the installed version of cmake is version 3.7 or higer.

Create the makefiles by running cmake:
cmake -DCMAKE_INSTALL_PREFIX=install ..

Build TIXI with make:
make

Install TIXI library:
make install

Copy all the files of "install" into "/usr/local/":
sudo cp -r install/* /usr/local/

2. Installing qt5 dependencies
apt-get install qtscript5-dev

3. Install oce-0.17.1

There is two solutions for install OCE either download the binaries from TiGl project "https://build.opensuse.org/package/show/science:dlr/OCE" and install it or build OCE from source. The binaries from TiGL patch a bug of OCE (see issue https://github.com/DLR-SC/tigl/issues/514). So it's the preferred solution.

3.1.a Install oce-0.17 from binaries

Download and extract the dev and standard rpm from "https://build.opensuse.org/package/show/science:dlr/OCE". Delete all previous version of OCE. Copy every files from this two repositories into /usr from you computuer

(deprecated: Do not forget to set the cmake option TIGL_OCE_COONS_PATCHED=ON if you install the patched version on your computer.)

3.1.b Install oce-0.17.1 from the source code

Go to https://github.com/tpaviot/oce/ and in the "OCE history" section download the version 0.17.1 .
(You can also download this code from our git at https://github.com/cfsengineering/CPACSCreator/blob/cpacs_3/thirdparty/OCE-0.17.1/oce-OCE-0.17.1.zip)

Extract the content of the zip, go in the new OCE-0.17.1 folder.

Install the dependencies for the OCE library:
sudo apt-get install libfreetype6-dev
sudo apt-get install tcl-dev tk-dev mesa-common-dev libjpeg-dev libtogl-dev

Create a "build" folder and go inside.
mkdir build
cd build

Create the makefiles:
cmake -DOCE_INSTALL_PREFIX:PATH=../install -DOCE_WITH_FREEIMAGE:BOOL=ON -DOCE_WITH_GL2PS:BOOL=ON -DOCE_DRAW:BOOL=ON ..

Build OCE with make:
make
make install/strip

Copy all the OCE files of "install" into "/usr/local/":
sudo cp -r install/* /usr/local/

Perequisites For Centos 7

The procedure is really similar to the procedure of Debian. The biggest difference is to use "yum" instead of "apt". The package names also slightly differ.

1. Install TIXI3

Clone the git repository of TIXI:
git clone https://github.com/DLR-SC/tixi.git

Move into this new TIXI repository, create a folder called "build" and go inside "build":
cd tixi
mkdir build
cd build

Make sure you have cmake installed with version 3.7 or higher. If cmake is not present on your machine, you can follow the instructions of the cmake web page (https://cmake.org/install/).

Install dependencies for TIXI:
sudo yum check-update
sudo yum install curl-devel
sudo yum install libxslt-devel

Create the makefiles by running cmake:
cmake -DCMAKE_INSTALL_PREFIX=install ..

Build TIXI with make:
make

Install TIXI library:
make install

Copy all the files of "install" into "/usr/local/":
sudo cp -r install/* /usr/local/

2. Installing qt5 dependencies
yum install qt5-qtbase-devel
yum install qt5-qtscript
yum install qt5-qtscript-devel

3. Install oce-0.17.1

There is two solutions for install OCE either download the binaries from TiGl project "https://build.opensuse.org/package/show/science:dlr/OCE" and install it or build OCE from source. The binaries from TiGL patch a bug of OCE (see issue https://github.com/DLR-SC/tigl/issues/514). So it's the preferred solution. Do not forget to set the cmake option TIGL_OCE_COONS_PATCHED=ON if you install the patched version on your computer.

3.1 Install oce-0.17.1 from the source code option

Go to https://github.com/tpaviot/oce/ and in the "OCE history" section download the version 0.17.1 .
(You can also download this code from our git at https://github.com/cfsengineering/CPACSCreator/blob/cpacs_3/thirdparty/OCE-0.17.1/oce-OCE-0.17.1.zip)

Extract the content of the zip, go in the new OCE-0.17.1 folder.

Install the dependencies for the OCE library:
yum install mesa-libGL-devel yum install freeglut-devel
yum install freetype-devel
yum install tcl
yum install tcl-devel
yum install tk
yum install tk-devel

Create a "build" folder and go inside.
mkdir build
cd build

Create the makefiles (Replace $BUILD_DIR by the absolute path of the build folder) :
cmake -DOCE_INSTALL_PREFIX:PATH=$BUILD_DIR/install -DOCE_WITH_FREEIMAGE:BOOL=ON -DOCE_WITH_GL2PS:BOOL=ON -DOCE_DRAW:BOOL=ON ..

Build OCE with make:
make
make install/strip

Copy all the needed OCE files into "/usr/local/":
sudo cp -R bin /usr/local/
sudo cp -R lib /usr/local/
sudo cp -R share /usr/local/
sudo cp -R include /usr/local/

At this point, you should have all the needed files to compile the TIGL and CPACSCreator code from the sources!

Build steps

Download the CPACSCreator source code. git clone https://github.com/cfsengineering/CPACSCreator.git

Enter into the new "CPACSCreator" directory, create a "build" directory and move into the "build" directory:
mkdir build
cd build

Create the makefiles by running cmake (cmake version should be higher or equal to 3.7):
cmake -DCMAKE_INSTALL_PREFIX=install DTIGL_OCE_COONS_PATCHED=ON ..
or
cmake -DCMAKE_INSTALL_PREFIX=install .. (if you don't have installed the patched version)

Build CPACSCreator and TiGL:
make

If you have dependencies issues. Check that the right libraries are installed. As said before, the package names for one distribution to another can differ.

Install CPACSCreator and TiGL:
make install

At this point, if the build is perform correctly you can open the CPACSCreator software by going into the "install/bin" folder and double click on tiglviewer-3. If you want to install CPACSCreator as another program, you can simply copy the files to the system path as the next step does:

Copy the CPACSCreator and TiGL files into "/usr/local/":
sudo cp -r install/* /usr/local/

CPACSCreator, TIGL and CPACSCreatorLib should be now installed on your machine. You can start CPACSCreator by typing tiglviewer-3 in a terminal.

Alternatives

Once you have installed the perequisites, it is possible to open the project with CLion or QtCreator. In fact, it should work with any IDE compatible with cmake. For CLion simply open the folder containing the primary cmake file.

Clone this wiki locally