From 54a4fd325040b15dc595472e47954765f585e01a Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Thu, 6 Oct 2022 12:15:37 +0200 Subject: [PATCH] ttk- patch implementation -otherwise blind to graphviz/embree --- products/TTK.pyconf | 7 ++++++- products/compil_scripts/TTK.sh | 7 ++++++- products/env_scripts/TTK.py | 13 +++++++++--- products/patches/ttk-f8dafde2d7-p01.patch | 24 +++++++++++++++++++++++ 4 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 products/patches/ttk-f8dafde2d7-p01.patch diff --git a/products/TTK.pyconf b/products/TTK.pyconf index f87d196..5fff2f0 100644 --- a/products/TTK.pyconf +++ b/products/TTK.pyconf @@ -8,7 +8,7 @@ default : { env_script : "TTK.py" } - depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'matplotlib', 'ParaView', 'boost', 'qt', 'embree'] + depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'matplotlib', 'ParaView', 'boost', 'qt', 'embree', "graphviz"] build_depend : ["cmake", "swig"] opt_depend : ['openmpi'] patches : [] @@ -21,3 +21,8 @@ default : incremental : "yes" } } + +version_f8dafde2d7 : +{ + patches: ['ttk-f8dafde2d7-p01.patch'] +} diff --git a/products/compil_scripts/TTK.sh b/products/compil_scripts/TTK.sh index a77a094..d836986 100755 --- a/products/compil_scripts/TTK.sh +++ b/products/compil_scripts/TTK.sh @@ -7,8 +7,13 @@ echo "########################################################################## CMAKE_OPTIONS="" CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_INSTALL}" CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" -CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi CMAKE_OPTIONS+=" -DTK_BUILD_PARAVIEW_PLUGINS=ON" +CMAKE_OPTIONS+=" -Dembree_DIR:PATH=${EMBREE_ROOT_DIR}/lib/cmake/embree-${EMBREE_VERSION}" echo echo "*** cmake" $CMAKE_OPTIONS diff --git a/products/env_scripts/TTK.py b/products/env_scripts/TTK.py index d1168cb..0154875 100644 --- a/products/env_scripts/TTK.py +++ b/products/env_scripts/TTK.py @@ -1,14 +1,21 @@ #!/usr/bin/env python import os.path +import platform def set_env(env, prereq_dir, version): env.set('TTK_ROOT_DIR', prereq_dir) env.set('TTK_HOME', prereq_dir) env.set('TTK_VERSION',version) - env.prepend('PATH', os.path.join(prereq_dir,'bin')) - env.prepend('LD_LIBRARY_PATH',os.path.join(prereq_dir, 'lib')) pyver = 'python' + env.get('PYTHON_VERSION') - env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + if platform.system() == "Windows" : + env.prepend('PATH', os.path.join(prereq_dir,'bin')) + env.prepend('PV_PLUGIN_PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + else: + env.prepend('PATH', os.path.join(prereq_dir,'bin')) + env.prepend('LD_LIBRARY_PATH',os.path.join(prereq_dir, 'lib')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + env.prepend('PV_PLUGIN_PATH',os.path.join(prereq_dir,'lib','plugins') def set_nativ_env(env): pass diff --git a/products/patches/ttk-f8dafde2d7-p01.patch b/products/patches/ttk-f8dafde2d7-p01.patch new file mode 100644 index 0000000..c6a76f8 --- /dev/null +++ b/products/patches/ttk-f8dafde2d7-p01.patch @@ -0,0 +1,24 @@ +--- ttk_ref/CMake/config.cmake 2022-10-06 12:09:21.179305232 +0200 ++++ ttk_dev/CMake/config.cmake 2022-10-06 12:08:43.950092714 +0200 +@@ -160,6 +160,10 @@ + message(STATUS "Zlib not found, disabling Zlib support in TTK.") + endif() + ++SET(EMBREE_ROOT_DIR $ENV{EMBREE_ROOT_DIR} CACHE PATH "Path to the EMBREE.") ++IF(EMBREE_ROOT_DIR) ++ LIST(APPEND CMAKE_PREFIX_PATH "${EMBREE_ROOT_DIR}") ++ENDIF(EMBREE_ROOT_DIR) + find_package(EMBREE 3.4 QUIET) + if(EMBREE_FOUND) + option(TTK_ENABLE_EMBREE "Enable embree raytracing for ttkCinemaImaging" ON) +@@ -169,6 +173,10 @@ + message(STATUS "EMBREE library not found, disabling embree support in TTK.") + endif() + ++SET(GRAPHVIZ_ROOT_DIR $ENV{GRAPHVIZ_ROOT_DIR} CACHE PATH "Path to the GRAPHVIZ.") ++IF(GRAPHVIZ_ROOT_DIR) ++ LIST(APPEND CMAKE_PREFIX_PATH "${GRAPHVIZ_ROOT_DIR}") ++ENDIF(GRAPHVIZ_ROOT_DIR) + find_package(Graphviz QUIET) + if(Graphviz_FOUND) + option(TTK_ENABLE_GRAPHVIZ "Enable GraphViz support" ON) -- 2.39.2