Mentions légales du service

Skip to content

[CMake] Split compilation libraries

name: Feature
about: New features or wider changes, 

Description This Closes #3 (closed)

Changelog

  • This separates the compilation (again) of the libraries.

In order to use it just add FOLDERS_TO_COMPILE in the configure.sh as follows:

#!/bin/sh

# Set variables
export FELISCE_SOURCE="${FELISCE_SOURCE:-"$( cd "$(dirname "$0")" ; pwd -P )"/..}"
export FELISCE_BUILD="${FELISCE_SOURCE}/build"

# Set basic configuration
export FELISCE_BUILD_TYPE=${FELISCE_BUILD_TYPE:-"Release"}

# If building package
export BUILD_FOR_CPACK=false

# Folders to compile
#export FOLDERS_TO_COMPILE=""
export FOLDERS_TO_COMPILE="Core;DegreeOfFreedom;FiniteElement;Gamma;Geometry;Hyperelasticity;HyperelasticityLaws;InputOutput;Model;Solver;CurveGenerator"

# Clean
clear
rm -rf "${FELISCE_BUILD}/${FELISCE_BUILD_TYPE}/cmake_install.cmake"
rm -rf "${FELISCE_BUILD}/${FELISCE_BUILD_TYPE}/CMakeCache.txt"
rm -rf "${FELISCE_BUILD}/${FELISCE_BUILD_TYPE}/CMakeFiles"

# Configure
cmake --no-warn-unused-cli ..                                                                       \
-H"${FELISCE_SOURCE}"                                                                               \
-B"${FELISCE_BUILD}/${FELISCE_BUILD_TYPE}"                                                          \
-DUSE_COTIRE=ON                                                                                     \
-DBUILD_TESTING=ON                                                                                  \
-DPETSC_DIR="$HOME/src/petsc"                                                                       \
-DNSINRIA_DIR="$HOME/src/felisce-ns/"                                                               \
-DFELISCE_WITH_CURVEGEN=ON                                                                          \
-DFELISCE_DATA_DIR="$HOME/src/felisce_data/"                                                        \
-DFOLDERS_TO_COMPILE=${FOLDERS_TO_COMPILE}                                                          \

# Compile with Cotire
cmake --build "${FELISCE_BUILD}/${FELISCE_BUILD_TYPE}" --target all_unity    -- -j$(nproc)
cmake --build "${FELISCE_BUILD}/${FELISCE_BUILD_TYPE}" --target install/fast -- -j$(nproc)

The folders are separated with semicolon. If FOLDERS_TO_COMPILE is equal to "" (empty) will compile in an unitary library, which is the default

Edited by Vicente Mataix Ferrándiz

Merge request reports