From 9a45c6aa0e794aacdc67ca7a0f1aa1517a8dafb7 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 6 Dec 2022 17:19:01 +0100 Subject: [PATCH] spns #32377: detect embedded cgns for GMSH build if cgns is embedded otherwise will collide with cgns system library if any --- products/compil_scripts/gmsh-4.10.3.sh | 10 +++++++++- products/env_scripts/cgns.py | 1 + products/gmsh.pyconf | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/products/compil_scripts/gmsh-4.10.3.sh b/products/compil_scripts/gmsh-4.10.3.sh index 493d3a5..2eacc23 100755 --- a/products/compil_scripts/gmsh-4.10.3.sh +++ b/products/compil_scripts/gmsh-4.10.3.sh @@ -24,7 +24,15 @@ CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_ONELAB_METAMODEL=OFF" CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_PARSER=ON" CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_PETSC=OFF" CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_PRIVATE_API=ON" -CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_CGNS=ON" +if [ -n "$CGNS_ROOT_DIR" ]; then + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_CGNS=ON" + if [ "${SAT_cgns_IS_NATIVE}" != "1" ]; then + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCGNS_INCLUDE_DIR:PATH=${CGNS_ROOT_DIR}/include" + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCGNS_LIBRARY:PATH=${CGNS_ROOT_DIR}/lib/libcgns.so" + fi +else + CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_CGNS=OFF" +fi CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_INSTALL_LIBDIR=${PRODUCT_INSTALL}/lib" # strangely on Ubuntu GMSH installs the .so in lib instead of lib/lib64 - so force to lib64 CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_PREFIX_PATH=${LAPACK_ROOT_DIR};${HDF5_ROOT_DIR};${MEDFILE_ROOT_DIR};" # set path of third libraries to our associated internal products CMAKE_OPTIONS="${CMAKE_OPTIONS} -DENABLE_OPENMP=ON" # get OpenMP based parallelism working diff --git a/products/env_scripts/cgns.py b/products/env_scripts/cgns.py index 576d8f3..ecc65e0 100644 --- a/products/env_scripts/cgns.py +++ b/products/env_scripts/cgns.py @@ -4,6 +4,7 @@ import os.path, platform def set_env(env, prereq_dir, version): + env.set('CGNS_ROOT', prereq_dir) env.set('CGNS_ROOT_DIR', prereq_dir) env.set('CGNS_INCLUDE_DIR',os.path.join(prereq_dir,'include')) env.prepend('PATH', os.path.join(prereq_dir, 'bin')) diff --git a/products/gmsh.pyconf b/products/gmsh.pyconf index ce678ce..33b8c5f 100644 --- a/products/gmsh.pyconf +++ b/products/gmsh.pyconf @@ -33,16 +33,19 @@ default_win: version_4_10_3: { compil_script : "gmsh-4.10.3.sh" + depend : ["CAS","lapack","hdf5","medfile", "cgns"] } version_4_10_3_win: { compil_script : "gmsh-4.10.3.bat" patches: ['gmsh-4.10.3-windows.patch'] + depend : ["CAS","lapack","hdf5","medfile", "cgns"] } version_4_10_3_win_dbg: { + depend : ["CAS","lapack","hdf5","medfile", "cgns"] compil_script : "gmsh-4.10.3.bat" patches: ['gmsh-4.10.3-windows.patch'] properties : -- 2.39.2