Installation
Requirements
C++17 compiler
cmake 3.16+
ExodusII
Usually depends on NetCDF and HDF5
CMake
Standard installation steps should build the library:
$ cd /path/to/exodusIIcpp
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make install
Embedding into project
Copy files from
include/
andsrc/
directory into your project directoryAdd
CMakeLists.txt
file in that directory:project(exodusIIcpp) add_library(${PROJECT_NAME} STATIC exodusIIcppElementBlock.cpp exodusIIcppFile.cpp exodusIIcppNodeSet.cpp exodusIIcppSideSet.cpp ) target_link_libraries( ${PROJECT_NAME} PUBLIC ${EXODUSII_LIBRARY} ) install( DIRECTORY ${PROJECT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h" )
Copy the
FindExodsuII.cmake
andFindNetCDF.cmake
files from thecmake/
directory into your projectUse the following code to find the dependencies
find_package(NetCDF REQUIRED) find_package(ExodusII REQUIRED) find_package(HDF5 COMPONENTS C)
Note
ExodusII depends on NetCDF. Newer versions also depend on HDF5.
This will set the
EXODUSII_LIBRARY
variable we are using in theCMakeLists.txt
above.Do not forget to add your directory in your main
CMakeLists.txt
via:add_subdirectory(path/to/the/dir/with/exodusIIcpp/files)