]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #24377 : FMILibrary + PyFMI
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 30 Aug 2021 12:48:53 +0000 (14:48 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 30 Aug 2021 12:48:53 +0000 (14:48 +0200)
products/FMILibrary.pyconf [new file with mode: 0644]
products/PyFMI.pyconf [new file with mode: 0644]
products/env_scripts/FMILibrary.py [new file with mode: 0644]
products/env_scripts/PyFMI.py [new file with mode: 0644]
products/patches/FMILibrary-2.0.3-installdir.patch [new file with mode: 0644]

diff --git a/products/FMILibrary.pyconf b/products/FMILibrary.pyconf
new file mode 100644 (file)
index 0000000..1ac79b5
--- /dev/null
@@ -0,0 +1,41 @@
+default :
+{
+    name : "FMILibrary"
+    build_source : "cmake"
+    cmake_options : " -DFMILIB_GENERATE_DOXYGEN_DOC=OFF"
+    get_source : "archive"
+    environ :
+    {
+       env_script : $name + ".py"
+    }
+    depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'matplotlib']
+    build_depend : ["cmake", "swig"]
+    opt_depend : ['openmpi']
+    patches : []
+    source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
+    build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name
+    install_dir : 'base'
+    properties :
+    {
+      single_install_dir : "no"
+      incremental : "yes"
+    }
+}
+
+default_win :
+{
+    compil_script :  'pip_install' + $VARS.scriptExtension
+    properties :
+    {
+      single_install_dir : "yes"
+      incremental : "yes"
+      pip : "yes"
+    }
+    depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'pthreads']
+    opt_depend : []
+}
+
+version_2_0_3 :
+{
+   patches : ['FMILibrary-2.0.3-installdir.patch']
+}
\ No newline at end of file
diff --git a/products/PyFMI.pyconf b/products/PyFMI.pyconf
new file mode 100644 (file)
index 0000000..d0ecc76
--- /dev/null
@@ -0,0 +1,27 @@
+default :
+{
+    name : "PyFMI"
+    build_source : "script"
+    compil_script : "pip_install" + $VARS.scriptExtension
+    get_source : "archive"
+    system_info : 
+    {
+        rpm : []
+        rpm_dev : []
+        apt : []
+        apt_dev : []
+    }
+    environ :
+    {
+       env_script : $name + ".py"
+    }
+    depend : ["Python", "setuptools", "FMILibrary"]
+    source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
+    build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name
+    install_dir : 'base'
+    properties:
+    {
+      incremental : "yes"
+      pip : "yes"
+    }
+}
diff --git a/products/env_scripts/FMILibrary.py b/products/env_scripts/FMILibrary.py
new file mode 100644 (file)
index 0000000..a999de9
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+import os.path
+
+def set_env(env, prereq_dir, version):
+    env.set('FMILIBRARY_ROOT_DIR', prereq_dir)
+    env.set('FMIL_HOME',prereq_dir)
+    env.prepend('PATH', os.path.join(prereq_dir,'bin'))
+    env.prepend('LD_LIBRARY_PATH',os.path.join(prereq_dir, 'lib'))
+
+def set_nativ_env(env):
+    pass
diff --git a/products/env_scripts/PyFMI.py b/products/env_scripts/PyFMI.py
new file mode 100644 (file)
index 0000000..7e83f24
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/env python
+#-*- coding:utf-8 -*-
+
+import os.path
+import platform
+
+def set_env(env, prereq_dir, version):
+    env.set('PYFMI_ROOT_DIR', prereq_dir)
+
+def set_nativ_env(env):
+    pass
diff --git a/products/patches/FMILibrary-2.0.3-installdir.patch b/products/patches/FMILibrary-2.0.3-installdir.patch
new file mode 100644 (file)
index 0000000..d113967
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Naur FMILibrary-2.0.3_ref/CMakeLists.txt FMILibrary-2.0.3_new/CMakeLists.txt
+--- FMILibrary-2.0.3_ref/CMakeLists.txt        2017-09-13 08:13:54.000000000 +0200
++++ FMILibrary-2.0.3_new/CMakeLists.txt        2021-08-30 14:32:32.100995247 +0200
+@@ -26,7 +26,7 @@
+ set(FMILIBRARYBUILD ${FMILibrary_BINARY_DIR})
+ # User configuration options and parameters
+-SET(FMILIB_INSTALL_PREFIX ${FMILibrary_BINARY_DIR}/../install CACHE PATH "Prefix prepended to install directories")
++SET(FMILIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH "Prefix prepended to install directories")
+ set(FMILIB_THIRDPARTYLIBS  ${FMILibrary_SOURCE_DIR}/ThirdParty CACHE PATH "Path to the ThirdParty library dir" )
+ set(FMILIB_FMI_STANDARD_HEADERS  ${FMILIB_THIRDPARTYLIBS}/FMI/default CACHE PATH "Path to the FMI standard headers dir" )