]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
YDEFX: integration
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 29 Nov 2021 19:43:50 +0000 (20:43 +0100)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 29 Nov 2021 19:43:50 +0000 (20:43 +0100)
applications/SALOME-9.8.0-MPI.pyconf
applications/SALOME-9.8.0-int32.pyconf
applications/SALOME-9.8.0-native.pyconf
applications/SALOME-9.8.0.pyconf
products/PY2CPP.pyconf
products/YDEFX.pyconf [new file with mode: 0644]
products/compil_scripts/YDEFX.sh [new file with mode: 0755]
products/env_scripts/PY2CPP.py [new file with mode: 0644]
products/env_scripts/Python.py
products/patches/YDEFX-CMakeLists.patch [new file with mode: 0644]

index 7d04f74f8bd952fbc11a1e61fc7e6fddc8ff9c44..f334fdb9215529c086ba6d0406bf976b6d9db15d 100644 (file)
@@ -162,6 +162,7 @@ APPLICATION :
         'ADAO' : {tag: 'V9_8_0b1'}
         'ADAO_INTERFACE': {tag: 'V9_8_0b1'}
         'PARAVISADDONS' : {tag: 'V9_8_0b1'}
+        'YDEFX' : {tag : 'V9_8_0b1'}
         'TESTBASE': {tag: 'master'}
         'CEATESTBASE' : {tag: 'SSL'}
     }
index c4aafd30b29818c8b38666dd42507c86e50a44d2..252d86a90928fa5f8c49b29a62dcac800fe65ee3 100644 (file)
@@ -158,6 +158,7 @@ APPLICATION :
         'ADAO' : {tag: 'V9_8_0b1'}
         'ADAO_INTERFACE': {tag: 'V9_8_0b1'}
         'PARAVISADDONS' : {tag: 'V9_8_0b1'}
+        'YDEFX' : {tag : 'V9_8_0b1'}
         'TESTBASE': {tag: 'master'}
         'CEATESTBASE' : {tag: 'SalomeV9'}
     }
index 015acd7bc27e04444d77648098b12871dd44ede7..3f1bbca22ee0ca3a52cd59a5fed40fc98e6bac3a 100644 (file)
@@ -162,6 +162,7 @@ APPLICATION :
         'ADAO' : {tag: 'V9_8_0b1'}
         'ADAO_INTERFACE': {tag: 'V9_8_0b1'}
         'PARAVISADDONS' : {tag: 'V9_8_0b1'}
+        'YDEFX' : {tag : 'V9_8_0b1'}
         'TESTBASE': {tag: 'master'}
         'CEATESTBASE' : {tag: 'SSL'}
     }
index 94dd8ba14956b8ba5f367fc5bdbdb37c2e2f2f65..4771ae02d4e9ae5128684e7952495639bfc08c17 100644 (file)
@@ -160,6 +160,7 @@ APPLICATION :
         'ADAO' : {tag: 'V9_8_0b1'}
         'ADAO_INTERFACE': {tag: 'V9_8_0b1'}
         'PARAVISADDONS' : {tag: 'V9_8_0b1'}
+        'YDEFX' : {tag : 'V9_8_0b1'}
         'TESTBASE': {tag: 'master'}
         'CEATESTBASE' : {tag: 'SSL'}
     }
index e58646868451a63abe9e2e1e66c1d0782acc61f1..2cf4e2d0d8b023890683bb58e55ea39b5ac1d3e6 100644 (file)
@@ -11,7 +11,7 @@ default :
     }
     environ :
     {
-        PY2CPP_ROOT_DIR : $install_dir
+        env_script : $name + ".py"
     }
     depend : [
               "CONFIGURATION",
diff --git a/products/YDEFX.pyconf b/products/YDEFX.pyconf
new file mode 100644 (file)
index 0000000..75971b2
--- /dev/null
@@ -0,0 +1,36 @@
+default :
+{
+    name : "YDEFX"
+    build_source : "cmake"
+    #build_source : "script"
+    compil_script  : $name + $VARS.scriptExtension
+    get_source : "git"
+    git_info:
+    {
+        repo : $PROJECTS.projects.salome.git_info.default_git_server + "tools/ydefx.git"
+        repo_dev : $PROJECTS.projects.salome.git_info.default_git_server_dev + "ydefx.git"
+    }
+    environ :
+    {
+    }
+    depend : [
+              "CONFIGURATION",
+              "Python",
+              "KERNEL",
+              "PY2CPP",
+              "YACS"
+              ]
+    opt_depend: []
+    build_depend : ["cmake", "cppunit"]
+    source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
+    build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name
+    properties:
+    {
+        incremental : "yes"
+        is_SALOME_module : "yes"
+
+    }
+    # prescription de EDF ne fonctionne pas en dehors de YAMS
+    # solution temporaire pour utiliser l'approche standard de SALOME
+    patches : ['YDEFX-CMakeLists.patch']
+}
diff --git a/products/compil_scripts/YDEFX.sh b/products/compil_scripts/YDEFX.sh
new file mode 100755 (executable)
index 0000000..c856ce2
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+echo "##########################################################################"
+echo "YDEFX" $VERSION
+echo "##########################################################################"
+
+CMAKE_OPTIONS=""
+CMAKE_OPTIONS+=" -DCONFIGURATION_ROOT_DIR=${CONFIGURATION_ROOT_DIR}"
+CMAKE_OPTIONS+=" -DKERNEL_ROOT_DIR=${KERNEL_ROOT_DIR}"
+CMAKE_OPTIONS+=" -DCMAKE_PREFIX_PATH=\"$KERNEL_ROOT_DIR/salome_adm/cmake_files;$PY2CPP_ROOT_DIR/lib/cmake/py2cpp/;\" "
+CMAKE_OPTIONS+=" -DPYTHON_EXECUTABLE=${PYTHONBIN}"
+CMAKE_OPTIONS+=" -DPYTHON_ROOT_DIR=${PYTHON_ROOT_DIR}"
+CMAKE_OPTIONS+=" -DPYTHON_INCLUDE_DIR=${PYTHON_ROOT_DIR}/include/python${PYTHON_VERSION}"
+CMAKE_OPTIONS+=" -DPYTHON_LIBRARY=${PYTHON_ROOT_DIR}/lib/libpython${PYTHON_VERSION}.so"
+CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_INSTALL}"
+CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release"
+
+echo
+echo "*** cmake" ${CMAKE_OPTIONS}
+cmake ${CMAKE_OPTIONS} $SOURCE_DIR
+if [ $? -ne 0 ]
+then
+    echo "ERROR on cmake"
+    exit 1
+fi
+
+MAKE_OPTIONS="VERBOSE=1 "$MAKE_OPTIONS
+echo
+echo "*** make" $MAKE_OPTIONS
+make $MAKE_OPTIONS
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make"
+    exit 2
+fi
+
+make install
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make install"
+    exit 3
+fi
diff --git a/products/env_scripts/PY2CPP.py b/products/env_scripts/PY2CPP.py
new file mode 100644 (file)
index 0000000..5b0b76c
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+import os
+import platform
+
+def set_env(env, product_dir, version):
+    env.set('PY2CPP_ROOT_DIR', product_dir)
+    env.set('Py2cpp_DIR', os.path.join(product_dir, 'lib', 'cmake', 'py2cpp'))
+    env.prepend('LD_LIBRARY_PATH', os.path.join(product_dir, 'lib'))
+
+def set_nativ_env(env):
+    pass
index cec24e3d9a7ab3b7806c580191be94e8903594d4..78390962f175f5d92809027c8bae70f286f53724 100644 (file)
@@ -8,6 +8,8 @@ def set_env(env,prereq_dir,version,forBuild=None):
         
     # [CMake KERNEL] Nouveau nom pour PYTHONHOME = PYTHON_ROOT_DIR 22/03/2013
     env.set('PYTHON_ROOT_DIR', prereq_dir)
+    # EDF uses this environment variable
+    env.set('PYTHON_INSTALL_DIR', prereq_dir)
 
     # keep only the first two version numbers
     version = '.'.join(version.replace('-', '.').split('.')[:2])
diff --git a/products/patches/YDEFX-CMakeLists.patch b/products/patches/YDEFX-CMakeLists.patch
new file mode 100644 (file)
index 0000000..b40afe0
--- /dev/null
@@ -0,0 +1,42 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8959cac..e5d03fc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -23,14 +23,33 @@ SET (CMAKE_CXX_STANDARD 11)
+ ENABLE_TESTING()
+ SET(BUILD_SHARED_LIBS TRUE)
++SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
++IF(EXISTS ${CONFIGURATION_ROOT_DIR})
++  LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
++  INCLUDE(SalomeMacros NO_POLICY_SCOPE)
++ELSE()
++  MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
++ENDIF()
++
++SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
++IF(EXISTS ${KERNEL_ROOT_DIR})
++  FIND_PACKAGE(SalomeKERNEL REQUIRED)
++  ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
++  INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
++ELSE(EXISTS ${KERNEL_ROOT_DIR})
++  MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
++ENDIF(EXISTS ${KERNEL_ROOT_DIR})
++
++# Platform setup
++# ==============
++INCLUDE(SalomeSetupPlatform)   # From CONFIGURATION
++# Always build libraries as shared objects:
++SET(BUILD_SHARED_LIBS TRUE)
++
+ OPTION(YDEFX_BUILD_GUI "Generate widgets" ON)
+ FIND_PACKAGE(Py2cpp REQUIRED)
+-# SalomeKERNEL can be useful in order to define SALOME_INSTALL directories and
+-# for using salome test, but it is not a c++ dependency.
+-FIND_PACKAGE(SalomeKERNEL NO_MODULE)
+-
+ IF(NOT SalomeKERNEL_FOUND)
+   MESSAGE("SalomeKERNEL not found. Salome installation paths will not be used")
+ ELSE()