]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #24377 : compilation cminpack apply patch for cblas
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 30 Aug 2021 12:09:02 +0000 (14:09 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 30 Aug 2021 12:09:02 +0000 (14:09 +0200)
products/cminpack.pyconf [new file with mode: 0644]
products/env_scripts/cminpack.py [new file with mode: 0644]
products/env_scripts/openturns.py
products/patches/cminpack-1.3.6-cblas.patch [new file with mode: 0644]

diff --git a/products/cminpack.pyconf b/products/cminpack.pyconf
new file mode 100644 (file)
index 0000000..2fbca76
--- /dev/null
@@ -0,0 +1,29 @@
+default :
+{
+    name : "cminpack"
+    build_source : "cmake"
+    cmake_options : " -DUSE_BLAS=ON -DUSE_FPIC=ON -DBUILD_SHARED_LIBS=ON"
+    compil_script :  $name + $VARS.scriptExtension
+    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"
+    }
+}
+
+version_1_3_6 :
+{
+    patches : ['cminpack-1.3.6-cblas.patch']
+}
\ No newline at end of file
diff --git a/products/env_scripts/cminpack.py b/products/env_scripts/cminpack.py
new file mode 100644 (file)
index 0000000..a27bbce
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+import os.path
+
+def set_env(env, prereq_dir, version):
+    env.set('CMINPACK_ROOT_DIR', 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
index 48708145dbb42e0e1f89868e160b63767553c19f..3527208a37fe043c0d4b9d0eadbcafe1f23ea2a4 100644 (file)
@@ -2,7 +2,7 @@
 import os.path
 
 def set_env(env, prereq_dir, version):
-    env.set('OPENTURN_ROOT_DIR', prereq_dir)
+    env.set('OPENTURNS_ROOT_DIR', prereq_dir)
     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')
diff --git a/products/patches/cminpack-1.3.6-cblas.patch b/products/patches/cminpack-1.3.6-cblas.patch
new file mode 100644 (file)
index 0000000..fcf0913
--- /dev/null
@@ -0,0 +1,28 @@
+diff -Naur cminpack-1.3.6_ref/CMakeLists.txt cminpack-1.3.6_dev/CMakeLists.txt
+--- cminpack-1.3.6_ref/CMakeLists.txt  2017-02-24 16:09:31.000000000 +0100
++++ cminpack-1.3.6_dev/CMakeLists.txt  2021-08-30 14:02:27.425683737 +0200
+@@ -69,12 +69,23 @@
+ # Link with a BLAS library if requested
+ if (USE_BLAS)
++  SET(LAPACK_ROOT_DIR $ENV{LAPACK_ROOT_DIR} CACHE PATH "Path to the LAPACK.")
++  IF(LAPACK_ROOT_DIR)
++    LIST(APPEND CMAKE_PREFIX_PATH "${LAPACK_ROOT_DIR}")
++  ENDIF(LAPACK_ROOT_DIR)
+   if (NOT BUILD_SHARED_LIBS)
+     set(BLA_STATIC True)
+   endif()
+   find_package(BLAS)
+   if (BLAS_FOUND)
+-    target_link_libraries(cminpack PUBLIC ${BLAS_LIBRARIES})
++    MESSAGE(STATUS "Searching for C-BLAS library...")
++    FIND_LIBRARY(CBLAS_LIBRARIES NAMES cblas
++      HINTS ${LAPACK_ROOT_DIR}
++      PATH_SUFFIXES lib
++      PATHS ${LAPACK_ROOT_DIR}
++    )
++
++    target_link_libraries(cminpack PUBLIC ${BLAS_LIBRARIES} ${CBLAS_LIBRARIES})
+     set_target_properties(cminpack PROPERTIES LINK_FLAGS "${BLAS_LINKER_FLAGS}")
+     target_compile_definitions(cminpack PUBLIC -DUSE_CBLAS)
+   endif()