Building with HOOPS Solve
After the package is unpacked and the license is activated, this page describes how to compile and link a program against HOOPS Solve.
Pick the tab that matches your situation. Building Your Own Application is the recommended route for any new project; the legacy tab is kept for projects that were link against the old obfuscated source distribution.
The package is a binary distribution. You only compile your code, and then link it to the pre-compiled libraries.
Package Contents
The HoopsSAM library is designed to link against the third-party packages bundled with the distribution. These packages are tested with HOOPS SAM to ensure compatibility. The distribution includes libraries such as Abaqus, Ansys DPF, Blosc, CGNS, GKLib, HDF5, Intel MKL, Intel OpenMP, and METIS. The exact versions are listed in the corresponding third-party folders and are documented in the release notes for the package. Each third-party software is redistributed under its respective license terms. Tech Soft 3D is not the author of those packages, and redistribution is subject to the license terms included with the distribution. See the appropriate release note page to find a list of the provided packages with their versions. This information is only available starting HOOPS SAM 2.5.0.
The extracted package root is named according to the platform it was generarted on, for example HOOPS_Solve_Access_Mesh_<version>_Windows_x86-64_v142\ on Windows and HOOPS_Solve_Access_Mesh_<version>_Linux_x86-64_glibc235/ on Linux.
The HOOPS SAM releases use the Semantic Versioning scheme. The include file base.h defines two macros that can be used to retrieve version information:
- SYS_VERSION defines a hexadecimal value built up from the major, minor, and patch version numbers. This value is guaranteed to be monotonically increasing for each new release.
- SYS_VERSIONSTR defines a string built up from the major, minor, and patch version numbers. It may also contain pre-release or other supplemental information if available.
HOOPS_Solve_Access_Mesh_<version>_Windows_x86-64_v142\
│
├── include\ <- the HEADER files + source files for bindings of FORTRAN, C++, and C#
│ ├── sam\ <- C API: base, vis, vdm, vfe, vfs, vfx, msh
│ └── samcpp\ <- C++ API: core, access
│
├── lib\ <- IMPORT libraries, used by the LINKER
│ ├── HoopsSAM_core.lib <- Foundation.
│ ├── HoopsSAM_access.lib <- Access library: reading and writing CAE files.
│ ├── HoopsSAM_mesh.lib <- Mesh library: meshing functionality.
│ ├── HoopsSAM_solve.lib <- Solve library: solving functionality.
│ ├── HoopsSAM_linearAlgebraCore.lib <- linear algebra core functionality used by solve and mesh (internally)
│ ├── HoopsSAM_static_MD.lib <- static variant, /MD runtime
│ ├── HoopsSAM_static_MT.lib <- static variant, /MT runtime
│ ├── DataProviderHostLib.lib <- data provider host library
│ ├── DataProviderPluginHeaders.lib <- data provider plugin headers library
│ └── zlibstatic.lib <- static variant of zlib
│
├── bin\ <- the DLLs, loaded by the PROGRAM at run time
│ ├── HoopsSAM_core.dll
│ ├── HoopsSAM_access.dll
│ ├── HoopsSAM_mesh.dll
│ ├── HoopsSAM_solve.dll
│ ├── HoopsSAM_linearAlgebraCore.dll
│ ├── HoopsSAMcs.dll <- C# wrapper DLL for HoopsSAM
│ ├── exchangePlugin\ <- plugin for exchange library
│ ├── openfoamPlugin\ <- plugin for OpenFOAM reader
│ ├── vtkPlugin\ <- plugin for VTK readers
│ └── dynamicLoadingLibraries\ <- wrapper libraries for Abaqus, AutoDyn and SAMCEF readers
│
├── thirdparty\ <- helper libraries/ vendor SDKS
│ ├── intelopenmp-<version>-win64\
│ ├── intelmkl.win-x64\
│ ├── hdf5-<version>-win64\
│ ├── abaqus-odb_api-<year>-win64\
│ └── ...
│
├── Examples\ <- ready-made sample programs (sam, legacy)
├── cmake\ <- helper modules used by the examples
├── DataProviderFramework\ <- plugin SDKs framework
├── dynamicLoadingWrapperSource\ <- source of the reader wrappers
├── migration_scripts\ <- scripts to help with migrating between major versions
├── VersionInfo.json
└── README.txt
Important
The files in lib are primarily import libraries used during linking, while the DLLs in bin are loaded at runtime. The only exceptions are the two static libraries.
HOOPS_Solve_Access_Mesh_<version>_Linux_x86-64_glibc235/
│
├── include/ <- the HEADER files + source files for bindings of FORTRAN, C++, and C#
│ ├── sam/ <- C API: base/, vis/, vdm/, vfe/, vfs/, vfx/, msh/
│ └── samcpp/ <- C++ API: core/, access/
│
├── lib/ <- the LIBRARIES
│ ├── HoopsSAM_core.so <- Foundation.
│ ├── HoopsSAM_access.so <- Access library: reading and writing CAE files.
│ ├── HoopsSAM_mesh.so <- Mesh library: meshing functionality.
│ ├── HoopsSAM_solve.so <- Solve library: solving functionality.
│ ├── HoopsSAM_linearAlgebraCore.so <- linear algebra core functionality used by solve and mesh (internally)
│ ├── HoopsSAM_static.a <- static variant of the above
│ ├── libDataProviderHostLib.a <- data provider host library
│ ├── libDataProviderPluginHeaders.a <- data provider plugin headers library
│ ├── libzstatic.a <- static zlib library
│ ├── exchangePlugin\ <- plugin for exchange library
│ ├── openfoamPlugin\ <- plugin for OpenFOAM reader
│ ├── vtkPlugin\ <- plugin for VTK readers
│ └── dynamicLoadingLibraries/ <- wrapper libraries for Abaqus, AutoDyn and SAMCEF readers
│
├── thirdparty/ <- helper libraries/ vendor SDKS
│ ├── intelopenmp-<v>-linux64/lib/
│ ├── intelmkl.linux-x64/lib/
│ ├── hdf5-<v>-linux64/lib/
│ ├── abaqus-odb_api-<y>-linux64/lib/
│ └── ...
│
├── Examples/ <- ready-made sample programs (sam/, legacy/)
├── cmake/ <- helper modules used by the examples
├── DataProviderFramework/ <- optional plugin SDK
├── dynamicLoadingWrapperSource/ <- source of the reader wrappers
├── migration_scripts/ <- scripts to help with migrating between major versions
├── VersionInfo.json
└── README.txt
The next step is to focus on building the program and connecting it to the required components:
| Folder | Job |
|---|---|
include |
#include "sam/base/base.h"
#include "sam/vis/vis.h"
#include "sam/vfx/vfx.h"
#include "sam/vfe/vfe.h" # To use the built-in element api
#include "sam/vfs/vfs.h" # To use the built-in linear algebra/matrix api
|
lib |
HoopsSAM_access.lib # if access functionality needed
HoopsSAM_solve.lib
HoopsSAM_core.lib
HoopsSAM_access.so # if access functionality needed
HoopsSAM_solve.so
HoopsSAM_core.so
|
thirdparty |
Dependency libraries (Intel OpenMP, Intel MKL, HDF5, METIS, GKLib, Zlib and Vendor SDKs are optional) |
Step 1 - Create Your Project Folder
Create an empty folder named SolveExample for the project. It does not need to live next to the distribution.
The project consists of two files:
SolveExample/
├── CMakeLists.txt <- the recipe (Step 3)
└── main.cpp <- your program (Step 2)
Step 2 - Write A Very Small Program
Create main.cpp. The program below builds a single hexahedral element, fixes its bottom face, puts
a pressure on its top face and runs a linear static analysis.
#include "sam/base/base.h"
#include "sam/base/license.h"
#include "sam/hoops_license.h"
#include "sam/vis/vis.h"
#include "sam/vfx/vfx.h"
#include <cstdio>
/* One unit cube: fixed at the bottom, pressed on the top. */
static Vdouble coords[8][3] = {
{0., 0., 0.}, {1., 0., 0.}, {1., 1., 0.}, {0., 1., 0.},
{0., 0., 1.}, {1., 0., 1.}, {1., 1., 1.}, {0., 1., 1.},
};
static Vint conn[8] = {1, 2, 3, 4, 5, 6, 7, 8};
int
main(void)
{
/* Always validate the license before calling anything else. */
vsy_LicenseValidate(HOOPS_LICENSE);
vis_Model* model = vis_ModelBegin();
/* --- the mesh --- */
vis_Connect* connect = vis_ConnectBegin();
vis_ConnectPre(connect, SYS_DOUBLE);
vis_ConnectDef(connect, 8, 1);
for (Vint i = 0; i < 8; i++) {
vis_ConnectSetCoordsdv(connect, i + 1, coords[i]);
}
vis_ConnectSetTopology(connect, 1, VIS_SHAPEHEX, 2, 0, 0);
vis_ConnectSetElemNode(connect, 1, conn);
vis_ConnectSetElemAssoc(connect, VIS_FEATYPE, 1, VIS_ELEM_SOLID);
vis_ConnectSetElemAssoc(connect, VIS_PROPID, 1, 1);
vis_ModelSetObject(model, VIS_CONNECT, connect);
vis_GridFun* gf = vis_GridFunBegin();
vis_ConnectGridFun(connect, gf);
/* --- material and element property --- */
vsy_HashTable* mphash = vsy_HashTableBegin();
vis_MProp* mprop = vis_MPropBegin();
vis_MPropDef(mprop, SYS_MAT_ISOTROPIC);
vis_MPropSetValued(mprop, MPROP_E, 1.0e+7);
vis_MPropSetValued(mprop, MPROP_NU, 0.3);
vsy_HashTableInsert(mphash, 1, mprop);
vis_ModelSetHashTable(model, VIS_MPROP, mphash);
vsy_HashTable* ephash = vsy_HashTableBegin();
vis_EProp* eprop = vis_EPropBegin();
vis_EPropDef(eprop, VIS_ELEM_SOLID);
vis_EPropSetValuei(eprop, EPROP_MID, 1);
vsy_HashTableInsert(ephash, 1, eprop);
vis_ModelSetHashTable(model, VIS_EPROP, ephash);
/* --- restraint: the bottom face is fully fixed --- */
vsy_HashTable* rchash = vsy_HashTableBegin();
vis_RCase* rcase = vis_RCaseBegin();
for (Vint n = 1; n <= 4; n++) {
vis_RCaseSetSPC(rcase, n, SYS_DOF_TX, RCASE_FIXED, NULL, 0);
vis_RCaseSetSPC(rcase, n, SYS_DOF_TY, RCASE_FIXED, NULL, 0);
vis_RCaseSetSPC(rcase, n, SYS_DOF_TZ, RCASE_FIXED, NULL, 0);
}
vsy_HashTableInsert(rchash, 1, rcase);
vis_ModelSetHashTable(model, VIS_RCASE, rchash);
/* --- load: pressure on the top face --- */
vsy_HashTable* lchash = vsy_HashTableBegin();
vis_LCase* lcase = vis_LCaseBegin();
vis_LCaseSetObject(lcase, VIS_GRIDFUN, gf);
Vdouble pres[4] = {50., 50., 50., 50.};
vis_LCaseSetDistdv(lcase, SYS_FACE, 1, 2, LCASE_PRES, pres);
vsy_HashTableInsert(lchash, 1, lcase);
vis_ModelSetHashTable(model, VIS_LCASE, lchash);
/* --- the solution to perform --- */
vsy_List* splist = vsy_ListBegin();
vis_SProp* sprop = vis_SPropBegin();
vis_SPropDef(sprop, SYS_SOL_STATIC);
vis_SPropSetValuei(sprop, SPROP_ANALYSIS, SYS_ANALYSIS_STRUCTURAL);
vis_SPropSetValuei(sprop, SPROP_CASEID, 1);
vis_SPropSetValuei(sprop, SPROP_RCASE, 1);
vis_SPropSetValued(sprop, SPROP_RCASE_FACTOR, 1.);
vis_SPropSetValuei(sprop, SPROP_LCASE_NUM, 1);
vis_SPropSetValuei(sprop, SPROP_LCASE, 1);
vis_SPropSetValued(sprop, SPROP_LCASE_FACTOR, 1.);
vsy_ListInsert(splist, 1, sprop);
vis_ModelSetList(model, VIS_SPROP, splist);
/* --- solve --- */
vfx_ProSolve* prosolve = vfx_ProSolveBegin();
vfx_ProSolveSetObject(prosolve, VIS_MODEL, model);
vfx_ProSolveExec(prosolve);
Vint ierr = vfx_ProSolveError(prosolve);
std::printf("Solver finished, error = %d\n", (int)ierr);
vfx_ProSolveEnd(prosolve);
vis_ModelDelete(model);
return ierr ? 1 : 0;
}
Warning
The HOOPS_LICENSE must be validated before any calls to the HOOPS Solve API functions. Please refer to Installing HOOPS Solve for more details.
Step 3 - Write The CMakeLists.txt
Create CMakeLists.txt next to main.cpp (Step 2). Pick the flavour you want: link against the
shared libraries (the usual choice), or link everything into one self-contained executable. The library
names differ per platform, so there is one tab per combination.
cmake_minimum_required(VERSION 3.21)
project(SolveExample LANGUAGES CXX)
# --- 1. Path to unpacked distribution------------------------------
set(SAM_ROOT "" CACHE PATH "Root of the HOOPS Solve, Access & Mesh distribution")
set(SAM_INCLUDE_DIR "${SAM_ROOT}/include")
set(SAM_LIB_DIR "${SAM_ROOT}/lib")
# --- 2. executable --------------------------------------------------------
add_executable(solve_example main.cpp)
target_compile_features(solve_example PRIVATE cxx_std_17)
# --- 3. Headers -------------------------------------------------------------
target_include_directories(solve_example PRIVATE "${SAM_INCLUDE_DIR}")
# --- 4. Libraries -----------------------------------------------------------
target_link_libraries(solve_example PRIVATE
"${SAM_LIB_DIR}/HoopsSAM_access.lib" # if access functionality needed
"${SAM_LIB_DIR}/HoopsSAM_solve.lib"
"${SAM_LIB_DIR}/HoopsSAM_core.lib")
install(TARGETS solve_example RUNTIME DESTINATION bin)
Note
The transitive dependencies of the main libraries (HoopsSAM_solve and HoopsSAM_core) are not automatically found at runtime. They are available in the thirdparty folders, so you need to add them to PATH - see Dependencies.
cmake_minimum_required(VERSION 3.21)
project(SolveExample LANGUAGES CXX)
# --- 1. Path to unpacked distribution------------------------------
set(SAM_ROOT "" CACHE PATH "Root of the HOOPS Solve, Access & Mesh distribution")
set(SAM_INCLUDE_DIR "${SAM_ROOT}/include")
set(SAM_LIB_DIR "${SAM_ROOT}/lib")
# --- 2. executable --------------------------------------------------------
add_executable(solve_example main.cpp)
target_compile_features(solve_example PRIVATE cxx_std_17)
# --- 3. Headers -------------------------------------------------------------
target_include_directories(solve_example PRIVATE "${SAM_INCLUDE_DIR}")
# --- 4. Libraries -----------------------------------------------------------
target_link_libraries(solve_example PRIVATE
"${SAM_LIB_DIR}/HoopsSAM_access.so" # if access functionality needed
"${SAM_LIB_DIR}/HoopsSAM_solve.so"
"${SAM_LIB_DIR}/HoopsSAM_core.so")
install(TARGETS solve_example RUNTIME DESTINATION bin)
Note
The transitive dependencies of the main libraries (HoopsSAM_solve and HoopsSAM_core) are not automatically found at runtime. They are available in the thirdparty folders, so you need to add them to LD_LIBRARY_PATH - see Dependencies.
cmake_minimum_required(VERSION 3.21)
project(SolveExample LANGUAGES CXX)
# --- 1. Path to unpacked distribution------------------------------
set(SAM_ROOT "" CACHE PATH "Root of the HOOPS Solve, Access & Mesh distribution")
set(SAM_INCLUDE_DIR "${SAM_ROOT}/include")
set(SAM_LIB_DIR "${SAM_ROOT}/lib")
set(SAM_THIRDPARTY "${SAM_ROOT}/thirdparty")
set(SAM_MKL_DIR "${SAM_THIRDPARTY}/intelmkl.win-x64/lib")
set(SAM_IOMP_DIR "${SAM_THIRDPARTY}/intelopenmp-2023.1.0-win64/lib")
set(SAM_HDF5_DIR "${SAM_THIRDPARTY}/hdf5-1.14.5-win64/lib")
set(SAM_METIS_DIR "${SAM_THIRDPARTY}/METIS-win64/lib")
set(SAM_GKLIB_DIR "${SAM_THIRDPARTY}/GKlib-win64/lib")
# --- 2. executable --------------------------------------------------------
add_executable(solve_example main.cpp)
target_compile_features(solve_example PRIVATE cxx_std_17)
# --- 3. Headers -------------------------------------------------------------
target_include_directories(solve_example PRIVATE "${SAM_INCLUDE_DIR}")
# --- 4. Libraries -----------------------------------------------------------
target_link_libraries(solve_example PRIVATE
# HOOPS SAM (static)
"${SAM_LIB_DIR}/HoopsSAM_static_MD.lib"
# Linear algebra: Intel MKL (LP64) + Intel OpenMP runtime
"${SAM_MKL_DIR}/mkl_intel_lp64_dll.lib"
"${SAM_MKL_DIR}/mkl_intel_thread_dll.lib"
"${SAM_MKL_DIR}/mkl_core_dll.lib"
"${SAM_IOMP_DIR}/libiomp5md.lib"
# Mesh partitioning / reordering. metis.lib must precede GKlib.lib:
"${SAM_METIS_DIR}/metis.lib"
"${SAM_GKLIB_DIR}/GKlib.lib"
# File access: the native .vdm format is an HDF5 container
"${SAM_LIB_DIR}/zlibstatic.lib" # if access functionality needed
"${SAM_HDF5_DIR}/libhdf5_hl.lib" # if access functionality needed
"${SAM_HDF5_DIR}/libhdf5.lib" # if access functionality needed
)
install(TARGETS solve_example RUNTIME DESTINATION bin)
Note
HoopsSAM_static_MD.lib is built with the /MD (DLL) runtime, which is what CMake uses
by default. Use HoopsSAM_static_MT.lib instead if your project sets
MSVC_RUNTIME_LIBRARY to the static (/MT) runtime.
cmake_minimum_required(VERSION 3.21)
project(SolveExample LANGUAGES CXX)
# --- 1. Path to unpacked distribution------------------------------
set(SAM_ROOT "" CACHE PATH "Root of the HOOPS Solve, Access & Mesh distribution")
set(SAM_INCLUDE_DIR "${SAM_ROOT}/include")
set(SAM_LIB_DIR "${SAM_ROOT}/lib")
set(SAM_THIRDPARTY "${SAM_ROOT}/thirdparty")
set(SAM_MKL_DIR "${SAM_THIRDPARTY}/intelmkl.linux-x64/lib")
set(SAM_IOMP_DIR "${SAM_THIRDPARTY}/intelopenmp-2023.1.0-linux64/lib")
set(SAM_HDF5_DIR "${SAM_THIRDPARTY}/hdf5-1.14.5-linux64/lib")
set(SAM_METIS_DIR "${SAM_THIRDPARTY}/METIS-linux64/lib")
set(SAM_GKLIB_DIR "${SAM_THIRDPARTY}/GKlib-linux64/lib")
# --- 2. executable --------------------------------------------------------
add_executable(solve_example main.cpp)
target_compile_features(solve_example PRIVATE cxx_std_17)
# --- 3. Headers -------------------------------------------------------------
target_include_directories(solve_example PRIVATE "${SAM_INCLUDE_DIR}")
# --- 4. Libraries -----------------------------------------------------------
target_link_libraries(solve_example PRIVATE
# HOOPS SAM (static)
"${SAM_LIB_DIR}/HoopsSAM_static.a"
# Linear algebra: Intel MKL (LP64) + Intel OpenMP runtime
"${SAM_MKL_DIR}/libmkl_intel_lp64.so"
"${SAM_MKL_DIR}/libmkl_intel_thread.so"
"${SAM_MKL_DIR}/libmkl_core.so"
"${SAM_IOMP_DIR}/libiomp5.so"
# Mesh partitioning / reordering. libmetis.a must precede libGKlib.a:
"${SAM_METIS_DIR}/libmetis.a"
"${SAM_GKLIB_DIR}/libGKlib.a"
# File access: the native .vdm format is an HDF5 container
"${SAM_LIB_DIR}/libzstatic.a" # if access functionality needed
"${SAM_HDF5_DIR}/libhdf5_hl.so" # if access functionality needed
"${SAM_HDF5_DIR}/libhdf5.so" # if access functionality needed
)
install(TARGETS solve_example RUNTIME DESTINATION bin)
Step 4 - Configure And Build
The Visual Studio generator is multi-configuration: you do not choose the build type when you configure, you choose it when you build.
cmake -S . -B SolveExample ^
-G "Visual Studio 16 2019" -A x64 ^
-DSAM_ROOT=C:\path\to\HOOPS_Solve_Access_Mesh_<version>_Windows_x86-64_v142
cmake --build SolveExample --config Release
cmake -S . -B SolveExample \
-DCMAKE_BUILD_TYPE=Release \
-DSAM_ROOT=/path/to/HOOPS_Solve_Access_Mesh_<version>_Linux_x86-64_glibc235
cmake --build SolveExample
Step 5 - Run It
Compilation and linking alone are not sufficient. At runtime, the program must locate the shared libraries, and the build-time search paths are not retained. HOOPS Solve relies on Intel MKL and Intel OpenMP for linear algebra, so both dependency folders must remain accessible. The required locations are provided through environment variables: PATH on Windows and LD_LIBRARY_PATH on Linux.
Note
This step is still needed even if linked statically. Only the HoopsSAM_* libraries (plus METIS,
GKlib and zlib) end up inside the executable; Intel MKL, Intel OpenMP and HDF5 remain shared
libraries, so the thirdparty folders below have to be reachable either way.
set SAM_ROOT=C:\path\to\HOOPS_Solve_Access_Mesh_<version>_Windows_x86-64_v142
set PATH=%SAM_ROOT%\bin;%PATH%
set PATH=%SAM_ROOT%\thirdparty\intelopenmp-2023.1.0-win64\bin;%PATH%
set PATH=%SAM_ROOT%\thirdparty\intelmkl.win-x64\bin;%PATH%
SolveExample\Release\solve_example.exe
export SAM_ROOT=/path/to/HOOPS_Solve_Access_Mesh_<version>_Linux_x86-64_glibc235
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SAM_ROOT/thirdparty/intelopenmp-2023.1.0-linux64/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SAM_ROOT/thirdparty/intelmkl.linux-x64/lib"
./SolveExample/solve_example
Congratulations, your first program is built with HOOPS Solve.
Before HOOPS SAM 4.0, the package was distributed as obfuscated source code. In that workflow, the full library and the bundled examples were built locally using the built-in CMake system. This process remains documented here because it is still used by existing projects and because it reflects how the sample programs included with the package are built.
Note
For a new project, use the Building Your Own Application tab instead. The current package is a binary distribution, so there is no longer any need to compile HOOPS Solve itself.
Once you have completed the setup and configured a valid HOOPS Solve license, you can test the installation using the sample code provided with HOOPS Solve. The built-in CMake system is the easiest way to compile and link with HOOPS Solve.
Since HOOPS Solve 1.8.0, we provide CMake support for our sample code.
You need CMake version 3.21.0 or higher.
The example code projects follow a typical CMake workflow. If you are familiar with CMake, no special steps are required. If you are new to CMake, we recommend the official tutorial from Kitware.
To learn more or to download CMake, visit the official website.
Check if you have CMake
You can check if CMake is installed by running the following command in your terminal or command prompt:
cmake --version
This will show the version of CMake on your system. If you do not have it, or if the version is lower than 3.21.0, you should install a newer version.
You can download the installer from the CMake downloads page. There are versions for Windows, macOS, and Linux.
Building sample code with the CMake GUI
CMake has a graphical interface that can help you set up your project step by step. This is available on Windows, macOS, and Linux.
First, open the CMake application.
- In the field Where is the source code, choose the folder that contains the sample code.
- In the field Preset, select the preset that matches your platform and compiler.
- In the field Where to build the binaries, choose a different empty folder. This is where the build files will be created.
Click the Configure button. CMake will ask you which compiler or tool you want to use (see Supported Platforms). After configuration, you will see some options you can change if needed.
Click Generate to create the project files.
Now you can open the generated project in your IDE and build it there.
Building sample code from the command line
If you prefer to use the terminal, you can also run CMake from the command line.
First, create a new folder for the build:
mkdir build
cd build
Generate build files for your project. If you are on Windows, use the following command:
cmake --preset=Windows ..
Visual Studio 16 2019 is the default CMake Generator. This generator can be changed to a more recent Visual Studio version or another generator. Visual Studio 17 2022 generator can be enabled with the following command:
cmake --preset=Windows -G "Visual Studio 17 2022" ..
If you are on Linux, use this instead:
cmake --preset=Linux ..
Once CMake finishes, you can build the code with this command:
cmake --build .
If you are on Linux, you’ll need to add the path of the dependencies in the thirdparty directory to the
LD_LIBRARY_PATH environment variable. This allows the dynamic linker to find them at runtime. Here’s an
example of how to do this:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/techsoft3d/HoopsSAM/thirdparty/abaqus-odb_api-2023-linux64/lib
Replace /home/techsoft3d/HoopsSAM/thirdparty/abaqus-odb_api-2023-linux64/lib with the actual path to your thirdparty directory.
To facilitate the definition of the LD_LIBRARY_PATH or PATH environment variable, depending on the
operating system, CMake advanced variables are created when build files are generated.
CEE_SAM_OPTION_EXTERNAL_LIBRARIES_BIN_PATHS will contain all needed binary paths to run the compiled
HOOPS Solve binary. This variable content can be directly appended to the LD_LIBRARY_PATH or PATH
environment variable. Furthermore, on Linux operating systems, libraries may need to be preloaded using the
LD_PRELOAD environment variable. These binary paths can be found in the
CEE_SAM_OPTION_EXTERNAL_PRELOAD_LIBRARIES_BIN_PATHS CMake advanced variable.
CMake compilation options - CMakePreset
There are a variety of CMake definitions which are used to conditionally compile source code and allow to enable or disable options and reader support. The following definitions are set when using the predefined CMake Preset.
| CEE_SAM_PROJECT_NAME | “HoopsSAM” | Project Name |
| CMAKE_BUILD_TYPE | “Release” | Build type |
| CEE_SAM_VERBOSE_LOGGING | “OFF” | Verbose logging flag |
| CEE_SAM_BUILD_CONFIGURATION | “Static_and_shared” | Build configuration. Static, Shared and Static_and_shared for Windows and Linux available |
| CEE_SAM_BASE | “ON” | Add base sam src directory |
| CEE_SAM_VDM | “ON” | Add vdm sam src directory (HOOPS Access) |
| CEE_SAM_VIS | “ON” | Add vis sam src directory (HOOPS Mesh, GlobalModules) |
| CEE_SAM_VFE | “ON” | Add vfe sam src directory (HOOPS Solve) |
| CEE_SAM_VFS | “ON” | Add vfs sam src directory (HOOPS Solve) |
| CEE_SAM_VFX | “ON” | Add vfx sam src directory (HOOPS Solve) |
| CEE_SAM_VGL | “ON” | Add vgl legacy src directory (HOOPS legacy visualization) |
| CEE_SAM_VIS_LEGACY | “ON” | Add vis legacy src directory (HOOPS legacy visualization) |
| CEE_SAM_DATA_PROVIDER_FRAMEWORK | “ON” | Link against the Data Provider Framework |
| CEE_SAM_EXAMPLES | “ON” | Add Examples in the current project |
| CEE_SAM_PROVIDER_EXAMPLES | “ON” | Add Data Provider Framework Examples in the current project |
| CEE_SAM_INTERFACE_FORTRAN | “OFF” | Generate Fortran interface |
| CEE_SAM_INTERFACE_CSHARP | “OFF” | Generate C# interface |
| CEE_SAM_READER_ABAODB | “ON” | Link against Abaqus ODB API external library |
| CEE_SAM_READER_ALTAIR_H3D | “OFF” | Link against Altair H3D API external library |
| CEE_SAM_READER_ANSYS_AUTODYN | “OFF” | Link against ANSYS AUTODYN external library |
| CEE_SAM_READER_ANSYS_CFX | “OFF” | Link against ANSYS CFX external library |
| CEE_SAM_READER_ANSYS_DPF | “ON” | Link against ANSYS DPF API external library |
| CEE_SAM_READER_OPENFOAM | “ON” | Toggle support for OpenFOAM files. Requires linking with zlib |
| CEE_SAM_READER_PERMASLIB | “ON” | Toggle support for PERMAS files. Requires linking with zlib |
| CEE_SAM_READER_STARCCM | “OFF” | Link against STAR-CCM external library |
| CEE_SAM_READER_CGNS | “ON” | Link against CGNS API external library |
| CEE_SAM_CGNS_DYNAMIC_LOADING | “OFF” | Enable dynamic loading of CGNS library |
| CEE_SAM_READER_PAMLIBERF | “OFF” | Link against PAM API external library |
| CEE_SAM_READER_SAMCEF | “OFF” | Link against SAMCEF API external library |
| CEE_SAM_OPTION_OPENFOAM_PLUGIN | “ON” | Build the OpenFOAM Data Provider Plugin. |
| CEE_SAM_OPTION_VTU_PLUGIN | “ON” | Build the Vtk Data Provider for Vtu, Vtm, Pvd, Pvtu. |
| CEE_SAM_OPTION_EXCHANGE_PLUGIN | “OFF” | Build the Exchange Data Provider Plugin. Requires linking against HOOPS Exchange library. |
| CEE_SAM_OPTION_BLOSC | “ON” | Link against c-blosc library (Needed for compressed HDF5 Nastran result files) |
| CEE_SAM_OPTION_BOOST | “OFF” | Link against Boost (required for Autodyn library) |
| CEE_SAM_OPTION_LIB_PATH | “./lib” | Library binaries path for MSVC or Linux |
| CEE_SAM_OPTION_BIN_PATH | “./bin” | Binaries path for MSVC or Linux |
| CEE_SAM_OPTION_CAPRI | “OFF” | Link against CAPRI |
| CEE_SAM_OPTION_CHECK_ERRS | “ON” | Include additional error checking |
| CEE_SAM_OPTION_CHECK_FPE | “OFF” | Check floating-point exceptions |
| CEE_SAM_OPTION_CHECK_MEM | “OFF” | Include memory checks |
| CEE_SAM_OPTION_FFMPEG | “OFF” | Link against FFMPEG (required for vglTools) |
| CEE_SAM_OPTION_FREETYPE | “OFF” | Link against FREETYPE (required for vglTools) |
| CEE_SAM_OPTION_GLEW | “OFF” | Link against GLEW (required for VGL) |
| CEE_SAM_OPTION_HDF5 | “ON” | Link against HDF5 external library (required for CGNS reader) |
| CEE_SAM_OPTION_HDF5_BUILD_TYPE | “Static” | HDF5 external library build type used (Static or Dynamic) |
| CEE_SAM_OPTION_HOOPS | “OFF” | Link against HOOPS Exchange (option for HOOPS Mesh) |
| CEE_SAM_OPTION_INTEL_MKL | “ON” | Link against MKL (required for the eigensolver) |
| CEE_SAM_OPTION_INTEL_MKL_MULTITHREAD | “ON” | Link against MKL (required for the eigensolver) |
| CEE_SAM_OPTION_JTTK | “OFF” | Link against JT Open Toolkit |
| CEE_SAM_OPTION_JPEG | “None” | Link against the JPEG library. Options: None and Internal |
| CEE_SAM_OPTION_METIS | “ON” | Link against Metis (required for SurfMesh parallel mesher) |
| CEE_SAM_OPTION_MPI | “Off” | Link against on MPI library. Two options: Off or Microsoft |
| CEE_SAM_OPTION_MUMPS | “OFF” | Use MUMPS, the MUltifrontal Massively Parallel sparse direct Solver |
| CEE_SAM_OPTION_NOVGLTOOLS | “OFF” | Disable legacy vizualisation/vgl (VKI_NOVGLTOOLS) |
| CEE_SAM_OPTION_NOVISTOOLS | “OFF” | Disable legacy vizualisation tools/Legacy vis support (VKI_NOVISTOOLS) |
| CEE_SAM_OPTION_NOVISTOOLSMESH | “OFF” | Disable Mesh support (VKI_NOVISTOOLSMESH) |
| CEE_SAM_OPTION_NOVDMTOOLS | “OFF” | Disable Access/vdm support (VKI_NOVDMTOOLS) |
| CEE_SAM_OPTION_ODB_API_CURRENT_VERSION | “2025” | Current Abaqus ODB API version (2025 is cited as an example) |
| CEE_SAM_OPTION_ODB_API_SUPPORTED_VERSIONS | “2016;2017…” | Currently supported Abaqus ODB API versions |
| CEE_SAM_OPTION_ODB_API_LIBRARIES_LIST | “lib1.lib;…” | Semi-colon separated list of Abaqus ODB API libraries to be added to the link |
| CEE_SAM_OPTION_OPENGL | “OFF” | Link against OpenGL |
| CEE_SAM_OPTION_OPENMP | “ON” | Link against OPENMP |
| CEE_SAM_OPTION_OPENMP_VERSION | “Intel” | OpenMP version: Intel or Default |
| CEE_SAM_OPTION_OPEN_CASCADE | “OFF” | Link against Open CASCADE |
| CEE_SAM_OPTION_PARASOLID | “OFF” | Link against Parasolid |
| CEE_SAM_OPTION_PNG | “None” | Link against the PNG library. Options: None and Internal |
| CEE_SAM_OPTION_POLYGONICA | “OFF” | Link against Polygonica |
| CEE_SAM_OPTION_TIFF | “None” | Link against the TIFF library. Options: None and Internal |
| CEE_SAM_OPTION_THIRD_PARTY_DIRECTORY_NAME | “thirdparty” | Name of folder where the third-party libraries are located |
| CEE_SAM_OPTION_WIDECHAR | “OFF” | Build with Unicode support |
| CEE_SAM_OPTION_ZLIB | “Internal” | Link against zlib (required for OpenFOAM, Permas reader, and HDF5 link). Options: None, Internal and External |
| Third-party library | CMake option | Foundation/Global | Access | Solve | Mesh | Legacy Vistools/Vgltools |
|---|---|---|---|---|---|---|
| Abaqus API | CEE_SAM_READER_ABAODB | X | ||||
| Altair API | CEE_SAM_READER_ALTAIR_H3D | X | ||||
| Ansys DPF | CEE_SAM_READER_ANSYS_DPF | X | ||||
| c-blosc | CEE_SAM_OPTION_BLOSC | X | ||||
| CGNS | CEE_SAM_READER_CGNS | X | ||||
| FreeType | CEE_SAM_OPTION_FREETYPE | X | ||||
| GKlib | CEE_SAM_OPTION_METIS | X | X | |||
| GLEW | CEE_SAM_OPTION_GLEW | X | ||||
| HDF5 | CEE_SAM_OPTION_HDF5 | X | ||||
| Intel MKL | CEE_SAM_OPTION_INTEL_MKL | X | ||||
| Intel openMP | CEE_SAM_OPTION_OPENMP | X | X | X | X | X |
| JPEG | CEE_SAM_OPTION_JPEG | X | ||||
| METIS | CEE_SAM_OPTION_METIS | X | X | |||
| PNG | CEE_SAM_OPTION_PNG | X | ||||
| TIFF | CEE_SAM_OPTION_TIFF | X | ||||
| Zlib | CEE_SAM_OPTION_ZLIB | X | X | X |
The current external library APIs that can be used in HOOPS Solve are to support the ABAQUS .odb, PAM-CRASH .DSY, PAM-CRASH .erfh5, MSC/NASTRAN .h5, STAR-CCM results file, CGNS data base, AUTODYN results file, Altair H3D file, CFX results file, SAMCEF results file interfaces and any other HDF5 based interface.
ABAQUS .odb Interface
The HOOPS Solve distribution includes a version of the Abaqus libraries. These are provided to simplify the process of using Abaqus readers and writers when developing with HOOPS Solve. In order to distribute these in an application, users need to have a proper partnership agreement with Dassault Systemes. Calls to the Abaqus functions are conditionally compiled by setting CEE_SAM_READER_ABAODB CMake option. See the following URL for more information on Abaqus.
Required libraries are dependent upon the specific version of ABAQUS and computer platform.
Note: Linux users must export CATInstallPath as specified in the testOdbApi.csh file included in the Abaqus ODB API package.
Autodyn Interface
The Autodyn interface is implemented using the Autodyn toolkit provided by Ansys Autodyn. Calls to the Autodyn functions are conditionally compiled by setting CEE_SAM_READER_ANSYS_AUTODYN CMake option. See the following URL for more information on Ansys Autodyn.
FEMZIP LS-DYNA d3plot Interface
FEMZIP is used, amongst others, to compress a family of LS-DYNA d3plot files. The FEMZIP API is implemented using a toolkit provided by Fraunhofer SCAI. FEMZIP is written in Fortran so that the function names may be appended by an underscore on some platforms. Calls to the toolkit functions are conditionally compiled by defining VKI_LIBAPI_FEMZIP_ or VKI_LIBAPI_FEMZIP to access functions with or without an appended underscore respectively. See the following URL for more information on FEMZIP.
CFX Results File
The CFX results file API is implemented using a toolkit provided by Ansys CFX. Calls to the toolkit functions are conditionally compiled by setting CEE_SAM_READER_ANSYS_CFX CMake option. See the following URL for more information on Ansys CFX.
CGNS Data Base
The CFD General Notation System (CGNS) data base is a collection of conventions and software for the storage and retrieval of CFD data. In the source distribution, calls to the CGNS functions are conditionally compiled by setting CEE_SAM_READER_CGNS CMake option. In the binary distribution, calls to the CGNS functions are always available if the CGNS third-party binaries can be found in the environment or in the CEE_SAM_READER_CGNS_LIBRARY_DIR environment variable. The source code for the underlying CGNS library is publicly available. See the following URL for more information on CGNS.
Altair H3D Interface
The H3D interface is implemented using the H3D Toolkit provided by Altair Engineering. Calls to the H3D functions are conditionally compiled by enabling the CEE_SAM_READER_ALTAIR_H3D CMake option. For releases based on the binary distribution, only Altair H3D API version 2025 is supported. Support for the legacy 2014 API is no longer provided. See the following URL for more information about Altair H3D:
PAM-CRASH .DSY Interface
The .DSY API is implemented using a toolkit provided by ESI Group. Calls to the toolkit functions are conditionally compiled by defining VKI_LIBAPI_PAMDSY. See the following URL for more information on PAM-CRASH.
PAM-CRASH .erfh5 Interface, MSC/NASTRAN .h5, Native .vh5
The above file formats are implemented on top of the HDF5 interface. Calls to the toolkit functions are conditionally compiled by setting CEE_SAM_OPTION_HDF5 CMake option. See the following URL for more information on HDF5.
STAR-CCM .ccm Results File Interface
The STAR-CCM API is implemented using a toolkit then provided by CD-Adapco, and now by Siemens. Calls to the toolkit functions are conditionally compiled by setting CEE_SAM_READER_STARCCM CMake option. See the following URL for more information on STAR-CCM.
SAMCEF .des Results File Interface
The SAMCEF API is implemented using a toolkit provided by Siemens. In the source distribution, calls to the toolkit functions are conditionally compiled by setting CEE_SAM_READER_SAMCEF CMake option. In the binary distribution, calls to the toolkit functions are always available if the SAMCEF third-party binaries can be found in the environment or in the CEE_SAM_READER_SAMCEF_LIBRARY_DIR environment variable.
See the following URL,
The SAMCEF interface allows the definition of two environment variables: SAM_ZONE refers to the memory usage in the SAMCEF library. SAM_EXE identifies the SAMCEF library installation path.
Dependencies
A HOOPS Solve requires some shared libraries to be loaded at run time. Environment variables define the search paths used to locate these components.
For shared linking, the program must also locate HoopsSAM_linearAlgebraCore, which is a transitive dependency of HoopsSAM_Solve. This library is provided in the same folder as HoopsSAM_Solve. In addition, HOOPS Solve depends on two libraries from the thirdparty folder: Intel OpenMP and Intel MKL, which provide the linear algebra layer used by the solver.
Add the HOOPS SAM bin folder and the two third party bin folders to PATH:
set PATH=%SAM_ROOT%\bin;%PATH% :: the folder containing HoopsSAM_linearAlgebraCore.dll
set PATH=%SAM_ROOT%\thirdparty\intelopenmp-2023.1.0-win64\bin;%PATH%
set PATH=%SAM_ROOT%\thirdparty\intelmkl.win-x64\bin;%PATH%
set PATH=%SAM_ROOT%\thirdparty\hdf5-1.14.5-win64\bin;%PATH% :: if access functionality is used
Add the HOOPS SAM lib folder and the two third party lib folders to LD_LIBRARY_PATH:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SAM_ROOT/lib" # the folder containing HoopsSAM_linearAlgebraCore.so
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SAM_ROOT/thirdparty/intelopenmp-2023.1.0-linux64/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SAM_ROOT/thirdparty/intelmkl.linux-x64/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SAM_ROOT/thirdparty/hdf5-1.14.5-linux64/lib" # if access functionality is used
For Static linking, in addition to the above libraries, HOOPS Solve needs Metis, GKLib, Zlib and HDF5 libraries from the thirdparty folder. (Zlib and HDF5 are required only if your program performs file I/O with HOOPS Access.)
When HOOPS Access Is Also Used
The preceding information applies to HOOPS Solve used independently, where the model is created, solved, and retained in memory. If the application also reads or writes CAE files, it uses HOOPS Access (HoopsSAM_Access), which introduces additional run-time requirements. These requirements are documented on the Dependencies page of the HOOPS Access documentation; use that page as the reference whenever a file format is involved.
Important
Separate license is required for Access functionality when used together with Solver.
Need Help ?
The project is now ready for use with HOOPS Solve. For additional support, refer to the support resources or the forum.