From d3380f06e239a27f95510b834cb2bb0d8c7a77b7 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Wed, 9 Oct 2024 21:40:50 +0200 Subject: [PATCH] spns #43020: Fix compilation issues (wip) --- applications/SALOME-master-native.pyconf | 7 +- products/cgal.pyconf | 5 +- products/compil_scripts/cgal-v5.6.1.sh | 50 +++- products/compil_scripts/cork.sh | 27 +- products/compil_scripts/irmb.sh | 32 ++- products/compil_scripts/libigl-v2.5.0.sh | 14 +- products/compil_scripts/mcut.sh | 27 +- products/compil_scripts/meshbooleanplugin.sh | 233 +----------------- products/cork.pyconf | 7 +- products/env_scripts/cgal.py | 1 + products/env_scripts/cork.py | 1 + products/env_scripts/irmb.py | 1 + products/env_scripts/libigl.py | 2 + products/env_scripts/mcut.py | 2 + products/irmb.pyconf | 10 +- products/libigl.pyconf | 2 +- products/mcut.pyconf | 7 +- products/meshbooleanplugin.pyconf | 14 +- products/patches/cgal-p01.patch | 79 ++++++ products/patches/cork-5987de5_off.patch | 6 +- .../libigl-v2.5.0-p01_609_Boolean.patch | 4 +- .../patches/mcut-b5b0ec6-p01_cgsboolean.patch | 6 +- .../patches/mcut-b5b0ec6-p02_cgsboolean.patch | 8 +- 23 files changed, 258 insertions(+), 287 deletions(-) mode change 100644 => 100755 products/compil_scripts/irmb.sh create mode 100644 products/patches/cgal-p01.patch diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index 09146aa..2ce5639 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -45,12 +45,14 @@ APPLICATION : C3PO: 'v2.3' certifi : 'native' cftime: 'native' + cgal : 'v5.6.1' cgns : '4.2.0' chardet : 'native' click : 'native' cmake : '3.25.2' cppunit : 'native' cminpack: '1.3.6' + cork : '5987de5' cycler : 'native' Cython : 'native' dateutil : 'native' @@ -70,14 +72,17 @@ APPLICATION : hdf5 : '1.10.3' idna : 'native' imagesize : 'native' + irmb : '67d77b4' ispc : '1.15.0' Jinja2 : 'native' kiwisolver : 'native' lapack : 'native' + libigl : 'v2.5.0' libxml2 : 'native' llvm : 'native' markupsafe : 'native' matplotlib : 'native' + mcut : 'b5b0ec6' mdurl : 'native' markdown_it_py : '3.0.0' medfile : '4.1.1' @@ -165,7 +170,7 @@ APPLICATION : 'MEDCOUPLING' : {tag:'master', base: 'no', section: 'default_MPI', hpc: 'yes'} 'GUI' 'GEOM' - 'SMESH' + 'SMESH' : 'spns/43020' 'NETGENPLUGIN' 'BLSURFPLUGIN' 'GHS3DPLUGIN' diff --git a/products/cgal.pyconf b/products/cgal.pyconf index b7d54c5..8d1997e 100644 --- a/products/cgal.pyconf +++ b/products/cgal.pyconf @@ -43,6 +43,7 @@ default : version_v5_6_1: { - build_source : "script" - compil_script : "cgal-v5.6.1" + $VARS.scriptExtension + build_source : "script" + compil_script : "cgal-v5.6.1" + $VARS.scriptExtension + patches : ["cgal-p01.patch"] } diff --git a/products/compil_scripts/cgal-v5.6.1.sh b/products/compil_scripts/cgal-v5.6.1.sh index cf6064c..bb783e6 100755 --- a/products/compil_scripts/cgal-v5.6.1.sh +++ b/products/compil_scripts/cgal-v5.6.1.sh @@ -9,9 +9,12 @@ mkdir $BUILD_DIR cd $BUILD_DIR CMAKE_OPTIONS= -# common settings CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" -CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" CMAKE_OPTIONS+=" -DWITH_examples=ON" CMAKE_OPTIONS+=" -DWITH_tests=ON" @@ -20,7 +23,6 @@ CMAKE_OPTIONS+=" -DCGAL_ENABLE_TESTING=ON" echo "*** cmake" $CMAKE_OPTIONS cmake $CMAKE_OPTIONS $SOURCE_DIR - if [ $? -ne 0 ]; then echo "ERROR on CMake" exit 1 @@ -42,14 +44,42 @@ if [ $? -ne 0 ]; then exit 3 fi +echo "##########################################################################" +echo "Building cgal_test" +echo "##########################################################################" + +mkdir $BUILD_DIR/cgal_test +cd $BUILD_DIR/cgal_test +CMAKE_OPTIONS= +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi +CMAKE_OPTIONS+=" -DCGAL_DIR=${PRODUCT_INSTALL}/lib/cmake" +CMAKE_OPTIONS+=" -DEXECUTABLE_OUTPUT_PATH=${PRODUCT_INSTALL}/bin" +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR/cgal_test +if [ $? -ne 0 ]; then + echo "ERROR on CMake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ]; then + echo "ERROR on make" + exit 2 +fi + echo -echo "*** make tests" -#make tests -#if [ $? -ne 0 ]; then -# echo "ERROR on make tests" -# exit 4 -#fi +echo "*** make install" +make install +if [ $? -ne 0 ]; then + echo "ERROR on make install" + exit 3 +fi echo echo "########## END" - diff --git a/products/compil_scripts/cork.sh b/products/compil_scripts/cork.sh index aa7dfc6..7c85ad4 100755 --- a/products/compil_scripts/cork.sh +++ b/products/compil_scripts/cork.sh @@ -19,12 +19,31 @@ fi echo echo "*** make install" mkdir -p ${PRODUCT_INSTALL}/bin -cp bin/cork ${PRODUCT_INSTALL}/bin +for f in $(ls $BUILD_DIR/bin); do + echo "INFO: next file: $f" + F=${PRODUCT_INSTALL}/bin/$(basename $f) + mv $BUILD_DIR/bin/$f $F + if [ $? -ne 0 ]; then + echo "ERROR on make install for file: $f" + exit 4 + fi + if [ ! -L "$F" ]; then + chmod 755 $F + fi +done + +cd $PRODUCT_INSTALL/bin +mv cork cork_bin +if [ $? -ne 0 ]; then + echo "ERROR on make install for file: $f" + exit 5 +fi + +cp -r ${BUILD_DIR}/include ${PRODUCT_INSTALL}/include if [ $? -ne 0 ]; then - echo "ERROR on make install" - exit 3 + echo "ERROR on make install: could not copy include directory..." + exit 5 fi -chmod 755 ${PRODUCT_INSTALL}/bin/cork echo echo "########## END" diff --git a/products/compil_scripts/irmb.sh b/products/compil_scripts/irmb.sh old mode 100644 new mode 100755 index 17ab7ff..428cd45 --- a/products/compil_scripts/irmb.sh +++ b/products/compil_scripts/irmb.sh @@ -9,18 +9,16 @@ mkdir $BUILD_DIR cd $BUILD_DIR CMAKE_OPTIONS= -# common settings CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" -CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" -CMAKE_OPTIONS+=" -DWITH_examples=ON" -CMAKE_OPTIONS+=" -DWITH_tests=ON" -CMAKE_OPTIONS+=" -DWITH_demos=ON" -CMAKE_OPTIONS+=" -DCGAL_ENABLE_TESTING=ON" echo "*** cmake" $CMAKE_OPTIONS cmake $CMAKE_OPTIONS $SOURCE_DIR - if [ $? -ne 0 ]; then echo "ERROR on CMake" exit 1 @@ -43,12 +41,20 @@ if [ $? -ne 0 ]; then fi echo -echo "*** make tests" -#make tests -#if [ $? -ne 0 ]; then -# echo "ERROR on make tests" -# exit 4 -#fi +echo "*** make install" +mkdir -p ${PRODUCT_INSTALL}/bin +for f in $(ls |grep mesh_booleans); do + echo "INFO: next file: $f" + F=${PRODUCT_INSTALL}/bin/$f + mv ${BUILD_DIR}/$f $F + if [ $? -ne 0 ]; then + echo "ERROR on make install for file: $f" + exit 4 + fi + if [ ! -L "$F" ]; then + chmod 755 $F + fi +done echo echo "########## END" diff --git a/products/compil_scripts/libigl-v2.5.0.sh b/products/compil_scripts/libigl-v2.5.0.sh index 4cbc477..f21e4fb 100755 --- a/products/compil_scripts/libigl-v2.5.0.sh +++ b/products/compil_scripts/libigl-v2.5.0.sh @@ -9,9 +9,12 @@ mkdir $BUILD_DIR cd $BUILD_DIR CMAKE_OPTIONS= -# common settings CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" -CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" echo "*** cmake" $CMAKE_OPTIONS @@ -41,6 +44,11 @@ if [ $? -ne 0 ]; then fi chmod 755 ${PRODUCT_INSTALL}/bin/609_Boolean +cp -r ${SOURCE_DIR}/include ${PRODUCT_INSTALL}/include +if [ $? -ne 0 ]; then + echo "ERROR on make install: could not copy include directory..." + exit 4 +fi + echo echo "########## END" - diff --git a/products/compil_scripts/mcut.sh b/products/compil_scripts/mcut.sh index 99beb5f..20fcb39 100755 --- a/products/compil_scripts/mcut.sh +++ b/products/compil_scripts/mcut.sh @@ -9,11 +9,15 @@ mkdir $BUILD_DIR cd $BUILD_DIR CMAKE_OPTIONS= -# common settings CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" -CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE=Release" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" -CMAKE_OPTIONS+=" -DLIBIGL_ROOT_DIR=${LIBIGL_ROOT_DIR}" +CMAKE_OPTIONS+=" -DLIBIGL_INCLUDE_DIR=${LIBIGL_INCLUDE_DIR}" + echo "*** cmake" $CMAKE_OPTIONS cmake $CMAKE_OPTIONS $SOURCE_DIR @@ -39,5 +43,20 @@ if [ $? -ne 0 ]; then fi echo -echo "########## END" +echo "*** make install" +mkdir -p ${PRODUCT_INSTALL}/bin +for f in $(ls ${BUILD_DIR}/bin); do + echo "INFO: next file: $f" + F=${PRODUCT_INSTALL}/bin/$f + mv ${BUILD_DIR}/bin/$f $F + if [ $? -ne 0 ]; then + echo "ERROR on make install for file: $f" + exit 4 + fi + if [ ! -L "$F" ]; then + chmod 755 $F + fi +done +echo +echo "########## END" diff --git a/products/compil_scripts/meshbooleanplugin.sh b/products/compil_scripts/meshbooleanplugin.sh index 9f571c6..67c32ce 100755 --- a/products/compil_scripts/meshbooleanplugin.sh +++ b/products/compil_scripts/meshbooleanplugin.sh @@ -4,234 +4,22 @@ echo "########################################################################## echo "meshboolean" $VERSION echo "##########################################################################" +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + rm -rf $BUILD_DIR mkdir $BUILD_DIR +cd $BUILD_DIR -LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" - -CMAKE_OPTIONS_COMMON= -CMAKE_OPTIONS_COMMON+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" +CMAKE_OPTIONS= +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX=${PRODUCT_INSTALL}" if [ -n "$SAT_DEBUG" ]; then - CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Debug" + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Debug" else - CMAKE_OPTIONS_COMMON+=" -DCMAKE_BUILD_TYPE:STRING=Release" + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" fi - -echo "##########################################################################" -echo "Building cgal" -echo "##########################################################################" - -mkdir $BUILD_DIR/cgal -cd $BUILD_DIR/cgal - -CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" -CMAKE_OPTIONS+=" -DWITH_examples=OFF" -CMAKE_OPTIONS+=" -DWITH_tests=OFF" -CMAKE_OPTIONS+=" -DWITH_demos=OFF" -CMAKE_OPTIONS+=" -DCGAL_ENABLE_TESTING=OFF" - -echo "*** cmake" $CMAKE_OPTIONS -cmake $CMAKE_OPTIONS $SOURCE_DIR/cgal/cgal - -if [ $? -ne 0 ]; then - echo "ERROR on CMake" - exit 1 -fi - -echo -echo "*** make" $MAKE_OPTIONS -make $MAKE_OPTIONS -if [ $? -ne 0 ]; then - echo "ERROR on make" - exit 2 -fi - -echo -echo "*** make install" -make install -if [ $? -ne 0 ]; then - echo "ERROR on make install" - exit 3 -fi - -echo "##########################################################################" -echo "Building cgal_test" -echo "##########################################################################" - -mkdir $BUILD_DIR/cgal_test -cd $BUILD_DIR/cgal_test -CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON -CMAKE_OPTIONS+=" -DCGAL_DIR=${PRODUCT_INSTALL}/lib/cmake" -CMAKE_OPTIONS+=" -DEXECUTABLE_OUTPUT_PATH=${PRODUCT_INSTALL}/bin" +CMAKE_OPTIONS+=" -DUSE_SAT=ON" -echo "*** cmake" $CMAKE_OPTIONS -cmake $CMAKE_OPTIONS $SOURCE_DIR/cgal -if [ $? -ne 0 ]; then - echo "ERROR on CMake" - exit 1 -fi - -echo -echo "*** make" $MAKE_OPTIONS -make $MAKE_OPTIONS -if [ $? -ne 0 ]; then - echo "ERROR on make" - exit 2 -fi - -echo -echo "*** make install" -make install -if [ $? -ne 0 ]; then - echo "ERROR on make install" - exit 3 -fi - -echo "##########################################################################" -echo "libigl" $VERSION -echo "##########################################################################" - -mkdir $BUILD_DIR/libigl -cd $BUILD_DIR/libigl - -CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON -CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" - -# overwrite the main.cpp -cp -f $SOURCE_DIR/libigl/main.cpp $SOURCE_DIR/libigl/libigl/tutorial/609_Boolean/main.cpp - -echo "*** cmake" $CMAKE_OPTIONS -cmake $CMAKE_OPTIONS $SOURCE_DIR/libigl/libigl - -if [ $? -ne 0 ]; then - echo "ERROR on CMake" - exit 1 -fi - -echo -echo "*** make" $MAKE_OPTIONS -cd $BUILD_DIR/libigl/tutorial -make $MAKE_OPTIONS tutorial/CMakeFiles/609_Boolean.dir/rule -if [ $? -ne 0 ]; then - echo "ERROR on make" - exit 2 -fi - -echo -echo "*** make install" -mkdir -p ${PRODUCT_INSTALL}/bin -cp $BUILD_DIR/libigl/bin/609_Boolean ${PRODUCT_INSTALL}/bin -if [ $? -ne 0 ]; then - echo "ERROR on make install" - exit 3 -fi -chmod 755 ${PRODUCT_INSTALL}/bin/609_Boolean -cp -r $SOURCE_DIR/libigl/libigl/include/igl $PRODUCT_INSTALL/include/igl -export LIBIGL_INCLUDE_DIR=${PRODUCT_INSTALL}/include - -echo "##########################################################################" -echo "Building mcut" -echo "##########################################################################" - -# -cp -f $SOURCE_DIR/mcut/CSGBoolean.cpp $SOURCE_DIR/mcut/mcut/tutorials/CSGBoolean/CSGBoolean.cpp - -mkdir $BUILD_DIR/mcut -cd $BUILD_DIR/mcut - -CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON -CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" -CMAKE_OPTIONS+=" -DLIBIGL_INCLUDE_DIR=${PRODUCT_INSTALL}/include" - -echo "*** cmake" $CMAKE_OPTIONS -cmake $CMAKE_OPTIONS $SOURCE_DIR/mcut/mcut - -if [ $? -ne 0 ]; then - echo "ERROR on CMake" - exit 1 -fi - -echo -echo "*** make" $MAKE_OPTIONS -make $MAKE_OPTIONS - -if [ $? -ne 0 ]; then - echo "ERROR on make" - exit 2 -fi - -echo -echo "*** make install" -mv $BUILD_DIR/mcut/bin/CSGBoolean ${PRODUCT_INSTALL}/bin/ -if [ $? -ne 0 ]; then - echo "ERROR on make install" - exit 3 -fi - -echo "##########################################################################" -echo "irmb" $VERSION -echo "##########################################################################" - -mkdir $BUILD_DIR/irmb -cd $BUILD_DIR/irmb - -CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON -CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" - -echo "*** cmake" $CMAKE_OPTIONS -cmake $CMAKE_OPTIONS $SOURCE_DIR/irmb/irmb -if [ $? -ne 0 ]; then - echo "ERROR on CMake" - exit 1 -fi - -echo -echo "*** make" $MAKE_OPTIONS -make $MAKE_OPTIONS all -if [ $? -ne 0 ]; then - echo "ERROR on make" - exit 2 -fi - -mv mesh_booleans ${PRODUCT_INSTALL}/bin - -echo "##########################################################################" -echo "cork" $VERSION -echo "##########################################################################" - -cp -r $SOURCE_DIR/cork/cork $BUILD_DIR/ -cd $BUILD_DIR/cork -cp $SOURCE_DIR/cork/off.cpp $BUILD_DIR/cork/src/file_formats/off.cpp -if [ $? -ne 0 ]; then - echo "ERROR on copy" - exit 1 -fi - -echo -echo "*** make" $MAKE_OPTIONS -make $MAKE_OPTIONS -if [ $? -ne 0 ]; then - echo "ERROR on make" - exit 2 -fi - -echo -echo "*** make install" -cp bin/cork ${PRODUCT_INSTALL}/bin -if [ $? -ne 0 ]; then - echo "ERROR on make install" - exit 3 -fi -chmod 755 ${PRODUCT_INSTALL}/bin/cork - -echo "##########################################################################" -echo "MESH BOOLEAN PLUGIN" $VERSION -echo "##########################################################################" - -cd $BUILD_DIR -CMAKE_OPTIONS=$CMAKE_OPTIONS_COMMON -CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" echo "*** cmake" $CMAKE_OPTIONS cmake $CMAKE_OPTIONS $SOURCE_DIR if [ $? -ne 0 ]; then @@ -260,8 +48,13 @@ if [ -f ${PRODUCT_INSTALL}/plugins/meshbooleanplugin/MyPlugDialog_ui.py ]; then echo "from qwt import QwtPlot" >> ${BUILD_DIR}/MyPlugDialog_ui.py echo >> ${BUILD_DIR}/MyPlugDialog_ui.py mv ${BUILD_DIR}/MyPlugDialog_ui.py ${PRODUCT_INSTALL}/plugins/meshbooleanplugin/MyPlugDialog_ui.py + if [ $? -ne 0 ]; then + echo "could not overwrite MyPlugDialog_ui.py" + exit 1 + fi else echo "ERROR: could not find MyPlugDialog_ui.py" + exit 1 fi echo diff --git a/products/cork.pyconf b/products/cork.pyconf index d6d26eb..eaab7dc 100644 --- a/products/cork.pyconf +++ b/products/cork.pyconf @@ -8,7 +8,7 @@ default : { repositories : { - github : "git@github.com:gilbo/cork.git" + github : "https://github.com/gilbo/cork.git" } } patches : [''] @@ -28,7 +28,10 @@ default : "PyQt", "Python", "numpy", - "cgal" + "cgal", + "libigl", + "mcut", + "irmb" ] build_depend : ["cmake", "cppunit"] opt_depend : [] diff --git a/products/env_scripts/cgal.py b/products/env_scripts/cgal.py index 106c0d4..f657252 100644 --- a/products/env_scripts/cgal.py +++ b/products/env_scripts/cgal.py @@ -6,6 +6,7 @@ import platform def set_env(env, prereq_dir, version): env.set('CGAL_ROOT_DIR', prereq_dir) + env.set('CGAL_VERSION', version) env.set('CGAL_DIR', os.path.join(prereq_dir, 'lib', 'cmake')) def set_nativ_env(env): diff --git a/products/env_scripts/cork.py b/products/env_scripts/cork.py index 590d6a6..415787f 100644 --- a/products/env_scripts/cork.py +++ b/products/env_scripts/cork.py @@ -7,6 +7,7 @@ import platform def set_env(env, prereq_dir, version): env.set('CORK_ROOT_DIR', prereq_dir) env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.set('CORK_VERSION', version) def set_nativ_env(env): pass diff --git a/products/env_scripts/irmb.py b/products/env_scripts/irmb.py index f19fda1..5a65f4c 100644 --- a/products/env_scripts/irmb.py +++ b/products/env_scripts/irmb.py @@ -7,6 +7,7 @@ import platform def set_env(env, prereq_dir, version): env.set('IRMB_ROOT_DIR', prereq_dir) env.set('IRMB_DIR', os.path.join(prereq_dir, 'lib', 'cmake')) + env.set('IRMB_VERSION', version) def set_nativ_env(env): pass diff --git a/products/env_scripts/libigl.py b/products/env_scripts/libigl.py index 216e9a1..e8993ae 100644 --- a/products/env_scripts/libigl.py +++ b/products/env_scripts/libigl.py @@ -6,7 +6,9 @@ import platform def set_env(env, prereq_dir, version): env.set('LIBIGL_ROOT_DIR', prereq_dir) + env.set('LIBIGL_VERSION', version) env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.set('LIBIGL_INCLUDE_DIR', os.path.join(prereq_dir, 'include')) def set_nativ_env(env): pass diff --git a/products/env_scripts/mcut.py b/products/env_scripts/mcut.py index e50baa2..859e1a3 100644 --- a/products/env_scripts/mcut.py +++ b/products/env_scripts/mcut.py @@ -6,6 +6,8 @@ import platform def set_env(env, prereq_dir, version): env.set('MCUT_ROOT_DIR', prereq_dir) + env.set('MCUT_VERSION', version) + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) def set_nativ_env(env): pass diff --git a/products/irmb.pyconf b/products/irmb.pyconf index def68ab..c04870f 100644 --- a/products/irmb.pyconf +++ b/products/irmb.pyconf @@ -1,14 +1,14 @@ default : { name : "irmb" - build_source : "cmake" - cmake_options : "-DCMAKE_INSTALL_LIBDIR:STRING=lib" + build_source: "script" + compil_script: "irmb" + $VARS.scriptExtension get_source : "git" git_info: { repositories : { - github : "git@github.com:gcherchi/InteractiveAndRobustMeshBooleans.git" + github : "https://github.com/gcherchi/InteractiveAndRobustMeshBooleans.git" } } patches : [] @@ -28,7 +28,9 @@ default : "PyQt", "Python", "numpy", - "cgal" + "cgal", + "libigl", + "mcut" ] build_depend : ["cmake", "cppunit"] opt_depend : [] diff --git a/products/libigl.pyconf b/products/libigl.pyconf index fe2caff..e1fbfa6 100644 --- a/products/libigl.pyconf +++ b/products/libigl.pyconf @@ -8,7 +8,7 @@ default : { repositories : { - github : "git@github.com:libigl/libigl.git" + github : "https://github.com/libigl/libigl.git" } } patches : [] diff --git a/products/mcut.pyconf b/products/mcut.pyconf index ce6f08d..076100b 100644 --- a/products/mcut.pyconf +++ b/products/mcut.pyconf @@ -8,7 +8,7 @@ default : { repositories : { - github : "git@github.com:cutdigital/mcut.git" + github : "https://github.com/cutdigital/mcut.git" } } patches : [] @@ -29,6 +29,7 @@ default : "Python", "numpy", "eigen", + "cgal", "libigl" ] build_depend : ["cmake", "cppunit"] @@ -47,5 +48,7 @@ version_b5b0ec6: { build_source: "script" compil_script: "mcut" + $VARS.scriptExtension - patches : ['mcut-b5b0ec6-p01_cgsboolean.patch'] + patches : ['mcut-b5b0ec6-p01_cgsboolean.patch', + 'mcut-b5b0ec6-p02_cgsboolean.patch' + ] } diff --git a/products/meshbooleanplugin.pyconf b/products/meshbooleanplugin.pyconf index 186c0f2..257cff0 100644 --- a/products/meshbooleanplugin.pyconf +++ b/products/meshbooleanplugin.pyconf @@ -8,16 +8,11 @@ default : { repositories : { +# github : $PROJECTS.projects.salome.git_info.git_server.github.url + "meshbooleanplugin.git" github : "https://github.com/nitawa/meshbooleanplugin.git" } - git_options : ' --recurse-submodules' } - patches: [ - 'libigl-v2.5.0-p01_609_Boolean.patch', - 'mcut-b5b0ec6-p01_cgsboolean.patch', - 'mcut-b5b0ec6-p02_cgsboolean.patch', - 'cork-5987de5_off.patch' - ] + patches: [] system_info : { rpm : [] @@ -29,7 +24,8 @@ default : { env_script : $name + ".py" } - depend : ["SMESH", + depend : ["CONFIGURATION", + "SMESH", "PyQt", "Python", "numpy", @@ -37,7 +33,7 @@ default : "qtpy" ] build_depend : ["cmake", "cppunit"] - opt_depend : [] + opt_depend : ["cgal", "libigl", "mcut", "irmb", "cork"] source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name install_dir : 'base' diff --git a/products/patches/cgal-p01.patch b/products/patches/cgal-p01.patch new file mode 100644 index 0000000..79bdd64 --- /dev/null +++ b/products/patches/cgal-p01.patch @@ -0,0 +1,79 @@ +diff --git a/cgal_test/CMakeLists.txt b/cgal_test/CMakeLists.txt +new file mode 100644 +index 00000000000..13be5cfe196 +--- /dev/null ++++ b/cgal_test/CMakeLists.txt +@@ -0,0 +1,21 @@ ++cmake_minimum_required(VERSION 3.12) ++project(cgal) ++ ++option(CGAL_DIR "Path to CGAL installation" ${CMAKE_CURRENT_SOURCE_DIR}/cgal) ++option(EXECUTABLE_OUTPUT_PATH "Installation directory" ${CMAKE_CURRENT_SOURCE_DIR}) ++ ++# Find CGAL package ++IF(CGAL_DIR) ++ LIST(APPEND CMAKE_PREFIX_PATH "${CGAL_DIR}") ++ENDIF(CGAL_DIR) ++find_package(CGAL REQUIRED COMPONENTS Core) ++ ++# Add executable ++add_executable(exec_cgal exec_cgal.cc) ++ ++# Link CGAL libraries ++target_link_libraries(exec_cgal PRIVATE CGAL::CGAL) ++ ++# Enable C++11 features ++target_compile_features(exec_cgal PRIVATE cxx_std_11) ++INSTALL (TARGETS exec_cgal RUNTIME DESTINATION ${EXECUTABLE_OUTPUT_PATH}) +diff --git a/cgal_test/exec_cgal.cc b/cgal_test/exec_cgal.cc +new file mode 100644 +index 00000000000..b46213e4bb3 +--- /dev/null ++++ b/cgal_test/exec_cgal.cc +@@ -0,0 +1,46 @@ ++#include ++#include ++#include ++#include ++ ++#include ++ ++typedef CGAL::Exact_predicates_exact_constructions_kernel K; ++typedef CGAL::Surface_mesh Mesh; ++ ++namespace PMP = CGAL::Polygon_mesh_processing; ++ ++int main(int argc, const char** argv) ++{ ++ const std::string filename1 = argv[2]; ++ const std::string filename2 = argv[3]; ++ ++ Mesh mesh1, mesh2; ++ ++ if(!PMP::IO::read_polygon_mesh(filename1, mesh1) || !PMP::IO::read_polygon_mesh(filename2, mesh2)) ++ { ++ std::cerr << "Invalid input." << std::endl; ++ return 1; ++ } ++ ++ bool valid_op; ++ Mesh result; ++ ++ if (!strcmp(argv[1], "union")) { ++ valid_op = PMP::corefine_and_compute_union(mesh1, mesh2, result); ++ } else if (!strcmp(argv[1], "intersection")) { ++ valid_op = PMP::corefine_and_compute_intersection(mesh1, mesh2, result); ++ } else { ++ valid_op = PMP::corefine_and_compute_difference(mesh1, mesh2, result); ++ } ++ ++ if(valid_op) ++ { ++ std::cout << "Union was successfully computed\n"; ++ CGAL::IO::write_polygon_mesh(argv[4], result, CGAL::parameters::stream_precision(17)); ++ return 0; ++ } ++ ++ std::cout << "Union could not be computed\n"; ++ return 1; ++} diff --git a/products/patches/cork-5987de5_off.patch b/products/patches/cork-5987de5_off.patch index be900e6..6fd0c33 100644 --- a/products/patches/cork-5987de5_off.patch +++ b/products/patches/cork-5987de5_off.patch @@ -1,7 +1,7 @@ -diff --git a/cork/cork/src/file_formats/off.cpp b/cork/cork/src/file_formats/off.cpp +diff --git a/src/file_formats/off.cpp b/src/file_formats/off.cpp index 3b12571..2a52bf4 100644 ---- a/cork/cork/src/file_formats/off.cpp -+++ b/cork/cork/src/file_formats/off.cpp +--- a/src/file_formats/off.cpp ++++ b/src/file_formats/off.cpp @@ -50,6 +50,7 @@ int readOFF(string filename, FileMesh *data) in >> filetype; if(filetype != "OFF") return 1; diff --git a/products/patches/libigl-v2.5.0-p01_609_Boolean.patch b/products/patches/libigl-v2.5.0-p01_609_Boolean.patch index 6bf2b19..256ca45 100644 --- a/products/patches/libigl-v2.5.0-p01_609_Boolean.patch +++ b/products/patches/libigl-v2.5.0-p01_609_Boolean.patch @@ -1,5 +1,5 @@ ---- libigl-v2.5.0_ref/libigl/libigl/tutorial/609_Boolean/main.cpp 2024-05-24 17:16:22.793731575 +0200 -+++ libigl-v2.5.0_dev/libigl/libigl/tutorial/609_Boolean/main.cpp 2024-05-24 17:17:14.666323894 +0200 +--- libigl-v2.5.0_ref/tutorial/609_Boolean/main.cpp 2024-05-24 17:16:22.793731575 +0200 ++++ libigl-v2.5.0_dev/tutorial/609_Boolean/main.cpp 2024-05-24 17:17:14.666323894 +0200 @@ -1,4 +1,5 @@ -#include +#include diff --git a/products/patches/mcut-b5b0ec6-p01_cgsboolean.patch b/products/patches/mcut-b5b0ec6-p01_cgsboolean.patch index 8de30f4..160f54b 100644 --- a/products/patches/mcut-b5b0ec6-p01_cgsboolean.patch +++ b/products/patches/mcut-b5b0ec6-p01_cgsboolean.patch @@ -1,7 +1,7 @@ -diff --git a/mcut/mcut/tutorials/CSGBoolean/CSGBoolean.cpp b/mcut/mcut/tutorials/CSGBoolean/CSGBoolean.cpp +diff --git a/tutorials/CSGBoolean/CSGBoolean.cpp b/tutorials/CSGBoolean/CSGBoolean.cpp index d73472a..9ffbd66 100644 ---- a/mcut/mcut/tutorials/CSGBoolean/CSGBoolean.cpp -+++ b/mcut/mcut/tutorials/CSGBoolean/CSGBoolean.cpp +--- a/tutorials/CSGBoolean/CSGBoolean.cpp ++++ b/tutorials/CSGBoolean/CSGBoolean.cpp @@ -1,54 +1,25 @@ -/*************************************************************************** - * This file is part of the MCUT project, which is comprised of a library diff --git a/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch b/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch index e68d8e0..b30b60a 100644 --- a/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch +++ b/products/patches/mcut-b5b0ec6-p02_cgsboolean.patch @@ -1,5 +1,5 @@ ---- a/mcut/mcut/CMakeLists.txt 2024-10-08 22:04:07.763300956 +0200 -+++ b/mcut/mcut/CMakeLists.txt 2024-10-07 15:25:44.107901112 +0200 +--- a/CMakeLists.txt 2024-10-08 22:04:07.763300956 +0200 ++++ b/CMakeLists.txt 2024-10-07 15:25:44.107901112 +0200 @@ -42,7 +42,8 @@ set(MCUT_MAJOR 1) set(MCUT_MINOR 2) @@ -35,8 +35,8 @@ add_subdirectory(${mio_SOURCE_DIR} build) # ---- a/mcut/mcut/tutorials/CMakeLists.txt 2024-10-08 22:04:07.775300917 +0200 -+++ b/mcut/mcut/tutorials/CMakeLists.txt 2024-10-07 12:57:28.643032926 +0200 +--- a/tutorials/CMakeLists.txt 2024-10-08 22:04:07.775300917 +0200 ++++ b/tutorials/CMakeLists.txt 2024-10-07 12:57:28.643032926 +0200 @@ -3,7 +3,7 @@ function(create_tutorial_target tutorial_name) add_executable(${tutorial_name} "${CMAKE_CURRENT_SOURCE_DIR}/${tutorial_name}/${tutorial_name}.cpp") -- 2.39.2