-
Notifications
You must be signed in to change notification settings - Fork 97
Compiling
In this section we assume that you have successfully acquired the sources as described in the downloads section.
The compilation is tested daily on several systems (Linux, Windows, macOS). However, if you experience a problem please report it at GitHub issues.
You can review the daily compilation results on:
The current status of the compilation on Linux, macOS and MS Windows is:

Short version: Go to the source directory and type
make. G+Smo will build in the ./build subfolder. Alternatively callcmake [path to gismo source]from the build-folder of your choice. Afterward you can start the build withmakeorcmake --build .(Last one works also under Windows with Visual Studio, no call ofnmakeis needed, and the setting of the compiler still works from cmake).
The library uses standard C++ code and has minimal requirements. These are a C++ compiler and the CMake configuration tools. In detail:
As an example, on a clean Ubuntu installation, the packages g++, libstdc++ and libstdc++-dev are needed (as well as cmake, and possibly svn or git).
-
Operating systems:
- MS Windows
- Linux
- macOS
-
Configuration: CMake 2.8.8 or newer
Note: On Windows, it is recommended that during installation you choose to have the CMake tools added to your
PATHenvironmental variable.
If you use Visual Studio 2017/2019 (or newer) or CLion, you can skip the installation of CMake because it is bundled with these IDEs - select the UNIX Build Tools target in the Visual Studio Installer.
-
Compilers tested include recent versions of:
- GNU GCC
- MS Visual C++ 2010 or newer
- free Visual Studio Community 2019 for both, Windows and macOS
from Workloads Desktop development with C++
from Individual components Git for Windows and GithHub extension for Visual Studio
- free Visual Studio Community 2019 for both, Windows and macOS
- Clang
- Intel C++ compiler
- Mingw64
-
Recommended:
- Paraview for visualization: G+Smo can produce Paraview files for visualization of geometric objects. These can be opened as soon as Paraview is installed on your system.
- An IDE with CMake support like:
- CLion (free for students), all major systems
- Visual Studio Community 2017, Windows and macOS
- Qt Creator
- ...
Note: if your IDE supports CMake, let it do the base configuration for you
The compilation requires configuration using CMake at a new, empty folder (in-source builds are disabled).
On macOS Xcode command line tools should be installed. Use
xcode-select --installto start the installation wizard.
A Unix makefile exists in the root source folder. Running make creates a sub folder named build and executes CMake and compilation inside that folder. Alternatively, choose your own build folder and execute CMake pointing to the sources by cmake [path to source].
If your source folder is named "gismo" then the sequence of commands
$ cd gismo
$ make
...
[100%] Built
$ cd build
$ ./bin/gsViewwill compile the library and execute an example program.
If you wish to have a build folder other than gismo/build, create a folder and execute (take a short coffee break after typing make, you can also increase number of processers that are used for compiling with -j# where # is the number of threads)
$ mkdir my-build-folder
$ cd my-build-folder
$ cmake ../path-to/gismo
-- Build files have been written to: /path-to/my-build-folder
$ make -j4
...
[100%] BuiltAfter successful compilation a dynamic library is created in ./lib and executable example programs are output at the ./bin subdirectory of the build folder.
If Doxygen is available on your system, you can compile and open the Doxygen HTML pages by executing
$ cd my-build-folder
$ make doc
...
Built target doc
$ firefox doc/html/index.html
https://github.com/gismo/gismo.git for the URL to the
Git repo, disable Recursively Clone Submodules and you can clone the repositorie to your local machine. After this,
Visual Studio opens the project and starts with the CMake process.

This
dialog creates a CMakeSettings.json file that contain your CMake configure options.
The compiler itself is selected trough the generator tag. Build type (CMAKE_BUILD_TYPE) refers to configurationType. All other configuration options can be given to the cmakeCommandArgs string.
Run cmake-gui tool (from an environment that is configured with your compiler) to generate makefiles (or Visual Studio project). Then execute the make tool to launch compilation. Alternatively, use the QtCreator GUI and open the CMakeLists.txt file on the root folder to create a QtCreator project.
In more detail, after installation of MS Visual C++ compiler, open the Visual C++ command prompt (which is configured with the vcvarsall.bat script) and
> mkdir build-gismo
> cd build-gismo
> cmake ../path-to/gismo
** - Build files have been written to: /path-to/build-gismo
> nmake
...
[100%] BuiltThe procedure can also be carried out in the graphical environment of !QtCreator as outlined here.
After successful compilation a dynamic library is created in \lib and executable example programs are output at the \bin subdirectory of the build folder.
Upon configuration, G+Smo presents a set of basic configuration options:
Configuration:
CMAKE_BUILD_TYPE RelWithDebInfo
GISMO_COEFF_TYPE double
GISMO_EXTRA_DEBUG OFF
GISMO_BUILD_LIB ON
GISMO_BUILD_EXAMPLES ON
GISMO_BUILD_AXL OFF
GISMO_WITH_PSOLID OFF
GISMO_WITH_ONURBS OFF
CMAKE_INSTALL_PREFIX /usr/local
-- Number of examples to compile: 12
The default value of each option is shown in the column on the right. A short description of each option follows:
-
CMAKE_BUILD_TYPE: Available values are the standard CMake build configurations:Debug,Release,RelWithDebInfo,MinSizeRel. -
GISMO_COEFF_TYPE: The arithmetic type to be used for all computations. Available options includedouble,long double,float. -
GISMO_EXTRA_DEBUG: If set toONadditional debugging tools are enabled during compilation. These include checked iterators for GCC and MSVC compilers and call stack back-trace printout when a runtime exception occurs. -
GISMO_BUILD_LIB: If enabled a dynamic library is created usingGISMO_COEFF_TYPEarithmetic. A target for a static library named gismo_static is also created but not compiled by default. -
GISMO_BUILD_EXAMPLES: If enabled the programs in the examples folder are compiled, and executables are created in build-folder/bin. -
GISMO_BUILD_AXL: If enabled the plugin for Axel modeler is compiled (requires Axel). -
GISMO_WITH_PSOLID: If enabled the extensions using functionalities of Parasolid geometric kernel are compiled.(requires Parasolid). -
GISMO_WITH_ONURBS: If enabled the extension for reading and writing of Rhinoceros' 3DM is compiled. -
CMAKE_INSTALL_PREFIX: The location for installation of the library, e.g. /usr/local on some Linux systems. -
NOSNIPPTES: Turn toONif you want to build doxygen documentation without building snippets - fastens up doxygen build. -
GISMO_WARNINGS: Turn toONif you want see more warnings. This is useful to clean up the code during development.
The source tree consists of the following sub-folders:
- src Contains all source files. Code is partitioned into modules. Here are some modules which are present as sub-folders:
- examples Examples of usage, small programs and tutorials.
- filedata Data files in the XML format the G+Smo can read and write.
- extensions Optional additional features that can be compiled along G+Smo.
- plugins Plugins for exporting functionality of G+Smo to third party software.
- cmake Cmake configuration files
- doc Files related to doxygen documentation.
