From aeea04ff71af31741c638cfe8abd3bc33b445938 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 23 Feb 2021 18:40:31 +0100 Subject: [PATCH] spns #23875: URANIE - TODO: test, Windows, cleanup environment variables --- applications/SALOME-master.pyconf | 3 +- products/URANIE.pyconf | 22 ++++++++++ products/compil_scripts/URANIE.sh | 45 ++++++++++++++++++++ products/env_scripts/URANIE.py | 70 +++++++++++++++++++++++++++++++ products/root.pyconf | 7 ++-- 5 files changed, 143 insertions(+), 4 deletions(-) create mode 100644 products/URANIE.pyconf create mode 100755 products/compil_scripts/URANIE.sh create mode 100644 products/env_scripts/URANIE.py diff --git a/applications/SALOME-master.pyconf b/applications/SALOME-master.pyconf index 788e66e..10c24a7 100644 --- a/applications/SALOME-master.pyconf +++ b/applications/SALOME-master.pyconf @@ -87,6 +87,7 @@ APPLICATION : qt : '5.9.1' qwt : '6.1.2' requests : '2.19.1' + #root: '6.22.02' scipy : '0.19.1' scotch : '6.0.4' setuptools : '38.4.0' @@ -102,7 +103,7 @@ APPLICATION : tcl : '8.6.0' tk : '8.6.0' urllib3 : '1.23' - + #URANIE : '4.5.0' # SALOME MODULES : 'CONFIGURATION' 'SALOME' diff --git a/products/URANIE.pyconf b/products/URANIE.pyconf new file mode 100644 index 0000000..f807db2 --- /dev/null +++ b/products/URANIE.pyconf @@ -0,0 +1,22 @@ +default : +{ + name : "URANIE" + build_source : "script" + compil_script : $name + $VARS.scriptExtension + get_source : "archive" + environ : + { + env_script : $name + ".py" + } + depend : ['Python', 'root','nlopt','lapack', 'boost'] + build_depend : ["cmake", 'swig', 'cppunit'] + 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 : + { + incremental : "yes" + } +} + diff --git a/products/compil_scripts/URANIE.sh b/products/compil_scripts/URANIE.sh new file mode 100755 index 0000000..b2b5340 --- /dev/null +++ b/products/compil_scripts/URANIE.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +echo "##########################################################################" +echo "URANIE " $VERSION +echo "##########################################################################" + +CMAKE_OPTIONS="" +CMAKE_OPTIONS=$CMAKE_OPTIONS" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_INSTALL}" +CMAKE_OPTIONS=$CMAKE_OPTIONS" -DCMAKE_BUILD_TYPE:STRING=Release" +CMAKE_OPTIONS=$CMAKE_OPTIONS" -DWITH-OPT++:BOOL=ON" +CMAKE_OPTIONS=$CMAKE_OPTIONS" -DWITH-JSONCPP:BOOL=ON" +CMAKE_OPTIONS=$CMAKE_OPTIONS" -D--enable-doc:BOOL=ON" + +rm -rf $BUILD_DIR +mkdir -p $BUILD_DIR +cd $BUILD_DIR + +cmake $CMAKE_OPTIONS $SOURCE_DIR + +if [ $? -ne 0 ] +then + echo "ERROR on CMake" + exit 2 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ] +then + echo "ERROR on make" + exit 3 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ] +then + echo "ERROR on make install" + exit 4 +fi + +echo +echo "########## END" diff --git a/products/env_scripts/URANIE.py b/products/env_scripts/URANIE.py new file mode 100644 index 0000000..fb8dae1 --- /dev/null +++ b/products/env_scripts/URANIE.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path, platform + +def set_env(env, prereq_dir, version, forBuild=None): + version = '.'.join(version.replace('-', '.').split('.')[:2]) + env.set('URANIE_VERSION', version) + + if platform.system()=="Windows" : + # URANIE + uranie_root = os.path.join(prereq_dir, 'uranie-3.9.0') + env.set('URANIE_ROOT_DIR', uranie_root) + env.set('URANIESYS', uranie_root) + env.prepend('PATH', os.path.join(uranie_root, 'bin')) + env.prepend('PATH', os.path.join(uranie_root, 'lib')) + + # ROOT + root_dir = os.path.join(prereq_dir, 'root5.34.14') + env.set('ROOT_ROOT_DIR', root_dir) + env.set('ROOTSYS', root_dir) + env.set('ROOTSYSLIB', os.path.join(root_dir, 'lib')) + env.prepend('PATH', os.path.join(root_dir, 'bin')) + + env.prepend('PATH', os.path.join(prereq_dir, 'zlib-1.2.5', 'bin')) + env.prepend('PATH', os.path.join(prereq_dir, 'libxml2-2.7.8.win32', 'bin')) + env.prepend('PATH', os.path.join(prereq_dir, 'libxml2-2.7.8.win32', 'lib')) + env.prepend('PATH', os.path.join(prereq_dir, 'iconv-1.9.2.win32', 'bin')) + env.prepend('PATH', os.path.join(prereq_dir, 'libxslt-1.1.26.win32', 'bin')) + env.prepend('PATH', os.path.join(prereq_dir, 'fftw-3.3.3-dll32')) + env.prepend('PATH', os.path.join(prereq_dir, 'nlopt-2.4.2-dll32')) + env.prepend('PATH', os.path.join(prereq_dir, 'pcl-1.10-modified', 'debug')) + env.prepend('PATH', os.path.join(prereq_dir, 'optpp-2.4', 'lib')) + env.prepend('PATH', os.path.join(prereq_dir, 'pthread-win32', 'Pre-built.2', 'dll', 'x86')) + else : + env.set('URANIE_ROOT_DIR', prereq_dir) + uranie = env.get('URANIE_ROOT_DIR') + + ### + # FORMAT URANIE + + # URANIE PATH + env.set('URANIESYS', prereq_dir) + + # PYTHON PATH + env.prepend('PYTHONPATH', os.path.join(uranie, 'lib', 'python')) + + # LD LIBRARY PATH + env.prepend('LD_LIBRARY_PATH', os.path.join(uranie, 'lib')) + + # ROOT PATH + root_env = env.get('ROOT_ROOT_DIR') + env.set('ROOTSYS', root_env) + + root_lib_env = os.path.join(root_env,'lib','root') + if os.path.isdir(root_lib_env): + env.prepend('ROOTSYSLIB', root_lib_env) + else: + env.prepend('ROOTSYSLIB', os.path.join(root_env,'lib')) + + # PATH + env.prepend('PATH', os.path.join(uranie,'bin')) + env.prepend('PATH', os.path.join(root_env,'bin')) + + # OPT + opt_env = os.path.join(uranie, 'OPT++','optpp-2.4','lib') + env.prepend('LD_LIBRARY_PATH', opt_env) + +def set_nativ_env(env): + pass diff --git a/products/root.pyconf b/products/root.pyconf index f80009d..ecdb45c 100644 --- a/products/root.pyconf +++ b/products/root.pyconf @@ -2,14 +2,14 @@ default : { name : "root" build_source : "cmake" - cmake_options : "" + cmake_options : " -Dgminimal:BOOL=ON -Dmathmore:BOOL=ON -Ddataframe:BOOL=ON -Dmlp:BOOL=ON -Dfftw3:BOOL=ON -Dminuit2:BOOL=ON -Dxml:BOOL=ON -Dasimage:BOOL=ON -Dpyroot:BOOL=ON -Dsoversion:BOOL=ON -Ddataframe:BOOL=ON -DPYTHON_EXECUTABLE:STRING=${PYTHONBIN} -DPYTHON_INCLUDE_DIR:STRING=${PYTHON_INCLUDE} " get_source : "archive" environ : { env_script : $name + ".py" } - depend : ['Python'] - build_depend : ['cmake'] + depend : ['Python', 'boost', 'freetype', 'freeimage'] + build_depend : ['cmake', 'libxml2', 'doxygen'] source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name install_dir : 'base' @@ -18,6 +18,7 @@ default : incremental : "yes" } } + version_6_16_00: {} -- 2.39.2