Skip to content

Commit

Permalink
Version 7.11.1. Python3 used by default, without explicit request.
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles PIGNEROL committed Nov 26, 2024
1 parent e0cd575 commit c6e519c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 23 deletions.
1 change: 0 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"name": "ci",
"cacheVariables":
{
"USE_PYTHON_3": "ON",
"MACHINE_TYPES": "OFF",
"FORMAT_MLI": "OFF",
"SUMESH": "OFF"
Expand Down
30 changes: 14 additions & 16 deletions cmake/python_binding.cmake
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
# Version 0.5 (21/6/23, support Python 2/Python 3, répertoire d'installation des modules python fourni par le python utilisé)
# Version 0.7 (26/11/24, support Python 2/Python 3, répertoire d'installation des modules python fourni par le python utilisé)

# Par défaut on utilise Python 2
# On utilise Python 3 sauf si python 2 est demandé

include (GNUInstallDirs)
find_package (SWIG 3 REQUIRED)


#find_package (Python REQUIRED COMPONENTS Interpreter Development) # Rem : Python3 a la priorité => inutilisé car empêche l'accès à Python2
if (USE_PYTHON_3)
message (STATUS "========================================= UTILISATION DE PYTHON 3 =========================================")
set (Python3_FIND_STRATEGY LOCATION) # Nécessaire pour python >= 3.10
find_package (Python3 REQUIRED COMPONENTS Interpreter Development)
set (Python_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
set (Python_EXECUTABLE ${Python3_EXECUTABLE})
set (Python_VERSION ${Python3_VERSION})
set (Python_LIBRARIES ${Python3_LIBRARIES})
set (Python_LIBRARY_DIRS ${Python3_LIBRARY_DIRS})
set (PYTHON_MAJOR_VERSION 3)
elseif (USE_PYTHON_2)
if (USE_PYTHON_2)
message (STATUS "========================================= UTILISATION DE PYTHON 2 =========================================")
find_package (Python2 REQUIRED COMPONENTS Interpreter Development)
set (Python_INCLUDE_DIRS ${Python2_INCLUDE_DIRS})
Expand All @@ -27,9 +17,17 @@ elseif (USE_PYTHON_2)
set (Python_LIBRARY_DIRS ${Python2_LIBRARY_DIRS})
set (PYTHON_MAJOR_VERSION 2)
else ( )
message (STATUS "========================================= VERSION DE PYTHON NON DEFINIE =========================================")
message (FATAL_ERROR "==> UTILISEZ -DUSE_PYTHON_2 OU -DUSE_PYTHON_3 A LA LIGNE DE COMMANDE")
endif (USE_PYTHON_3)
message (STATUS "========================================= UTILISATION DE PYTHON 3 =========================================")
set (USE_PYTHON_3 ON)
set (Python3_FIND_STRATEGY LOCATION) # Nécessaire pour python >= 3.10
find_package (Python3 REQUIRED COMPONENTS Interpreter Development)
set (Python_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
set (Python_EXECUTABLE ${Python3_EXECUTABLE})
set (Python_VERSION ${Python3_VERSION})
set (Python_LIBRARIES ${Python3_LIBRARIES})
set (Python_LIBRARY_DIRS ${Python3_LIBRARY_DIRS})
set (PYTHON_MAJOR_VERSION 3)
endif (USE_PYTHON_2)


# Recherche du répertoire d'installation des modules (procédure spack organizer) :
Expand Down
2 changes: 1 addition & 1 deletion cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

set (LIMA_MAJOR_VERSION "7")
set (LIMA_MINOR_VERSION "11")
set (LIMA_RELEASE_VERSION "0")
set (LIMA_RELEASE_VERSION "1")
set (LIMA_VERSION ${LIMA_MAJOR_VERSION}.${LIMA_MINOR_VERSION}.${LIMA_RELEASE_VERSION})


10 changes: 5 additions & 5 deletions installation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Installation minimale recommandée :
cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran -DCMAKE_CXX_FLAGS="-std=c++11" -DCMAKE_Fortran_FLAGS="-fdefault-integer-8 -fdefault-real-8 -fdefault-double-8" \
-DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_XLMLIMA=ON -DBUILD_TESTS:BOOL=ON -DBUILD_SCRIPTING:BOOL=ON -DMACHINE_TYPES:BOOL=OFF -DSUMESH:BOOL=OFF -DFORMAT_MLI:BOOL=OFF -DFORMAT_MLI2:BOOL=ON -DFORMAT_MLI2:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON -DINT_8:BOOL=ON -DREAL_8:BOOL=ON \
-DSWIG_EXECUTABLE=/opt/swig/4.1.1/bin/swig -DPython2_ROOT_DIR=/usr/lib/python2.7 -DHDF5_ROOT=/opt/HDF5/1.12.0 \
-B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.11.0
-DSWIG_EXECUTABLE=/opt/swig/4.1.1/bin/swig -DPython3_ROOT_DIR=/usr/lib/python3 -DHDF5_ROOT=/opt/HDF5/1.12.0 \
-B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.11.1
cmake --build /tmp/lima_build_dir
cmake --install /tmp/lima_build_dir

Expand All @@ -31,8 +31,8 @@ Installation avec options :
cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran -DCMAKE_CXX_FLAGS="-std=c++11" -DCMAKE_Fortran_FLAGS="-fdefault-integer-8 -fdefault-real-8 -fdefault-double-8" \
-DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_XLMLIMA=ON -DBUILD_TESTS:BOOL=ON -DBUILD_SCRIPTING:BOOL=ON -DMACHINE_TYPES:BOOL=ON -DSUMESH:BOOL=ON -DFORMAT_MLI:BOOL=ON -DFORMAT_MLI2:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON -DINT_8:BOOL=ON -DREAL_8:BOOL=ON \
-DSWIG_EXECUTABLE=/opt/swig/4.1.1/bin/swig -DPython2_ROOT_DIR=/usr/lib/python2.7 -DHDF5_ROOT=/opt/HDF5/1.12.0 -DHDF145_INCLUDE_DIR=/opt/hdf145/1.3.0/include -DHDF145CPP_LIBRARY=/opt/hdf145/1.3.0/lib/libhdf145_cpp.so -DHDF145_LIBRARY=/opt/hdf145/1.3.0/lib/libhdf145.so \
-B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.11.0
-DSWIG_EXECUTABLE=/opt/swig/4.1.1/bin/swig -DPython3_ROOT_DIR=/usr/lib/python3 -DHDF5_ROOT=/opt/HDF5/1.12.0 -DHDF145_INCLUDE_DIR=/opt/hdf145/1.3.0/include -DHDF145CPP_LIBRARY=/opt/hdf145/1.3.0/lib/libhdf145_cpp.so -DHDF145_LIBRARY=/opt/hdf145/1.3.0/lib/libhdf145.so \
-B /tmp/lima_build_dir -DCMAKE_INSTALL_PREFIX=/opt/Lima/7.11.1
cmake --build /tmp/lima_build_dir
cmake --install /tmp/lima_build_dir

Expand Down Expand Up @@ -104,5 +104,5 @@ Affecter Python2_ROOT_DIR (testé avec swig v 3.0.12/Python 2.7.*)
Binding python 3 :
-------------------

Affecter Python3_ROOT_DIR (testé avec swig v 3.0.12/Python 3.7.3) et transmettre à cmake l'option -DUSE_PYTHON_3:BOOL=ON.
Affecter Python3_ROOT_DIR (testé avec swig v 3.0.12/Python 3.7.3).

0 comments on commit c6e519c

Please sign in to comment.