From 68da225c2b31fdc13a7951da8a2e1c6ced3bdc5d Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Mon, 30 Aug 2021 14:48:53 +0200 Subject: [PATCH] spns #24377 : FMILibrary + PyFMI --- products/FMILibrary.pyconf | 41 +++++++++++++++++++ products/PyFMI.pyconf | 27 ++++++++++++ products/env_scripts/FMILibrary.py | 11 +++++ products/env_scripts/PyFMI.py | 11 +++++ .../patches/FMILibrary-2.0.3-installdir.patch | 12 ++++++ 5 files changed, 102 insertions(+) create mode 100644 products/FMILibrary.pyconf create mode 100644 products/PyFMI.pyconf create mode 100644 products/env_scripts/FMILibrary.py create mode 100644 products/env_scripts/PyFMI.py create mode 100644 products/patches/FMILibrary-2.0.3-installdir.patch diff --git a/products/FMILibrary.pyconf b/products/FMILibrary.pyconf new file mode 100644 index 0000000..1ac79b5 --- /dev/null +++ b/products/FMILibrary.pyconf @@ -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 index 0000000..d0ecc76 --- /dev/null +++ b/products/PyFMI.pyconf @@ -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 index 0000000..a999de9 --- /dev/null +++ b/products/env_scripts/FMILibrary.py @@ -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 index 0000000..7e83f24 --- /dev/null +++ b/products/env_scripts/PyFMI.py @@ -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 index 0000000..d113967 --- /dev/null +++ b/products/patches/FMILibrary-2.0.3-installdir.patch @@ -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" ) + -- 2.39.2