# customizable installation directories
include(GNUInstallDirs)
-## Save compiler flags preset with environment variables CFLAGS or CXXFLAGS;
-## they will used within smpicc, smpicxx.
-## Do it early so that we get their genuine values. The same will be done later for Fortran.
-string(REGEX REPLACE " *-f[a-z]+-prefix-map=[^ ]*" "" SMPI_C_FLAGS "${CMAKE_C_FLAGS}")
-string(REGEX REPLACE " *-f[a-z]+-prefix-map=[^ ]*" "" SMPI_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Check for the compiler #
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Set flags/libs to be used in smpiff
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
- set(SMPI_Fortran_FLAGS "\"-fpic\" \"-ff2c\" \"-fno-second-underscore\"")
+ set(SMPI_Fortran_FLAGS_ "\"-fpic\" \"-ff2c\" \"-fno-second-underscore\"")
set(SMPI_Fortran_LIBS "\"-lgfortran\"")
set(SMPI_GFORTRAN 1)
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
- set(SMPI_Fortran_FLAGS "\"-fPIC\" \"-nofor-main\"")
+ set(SMPI_Fortran_FLAGS_ "\"-fPIC\" \"-nofor-main\"")
set(SMPI_Fortran_LIBS "\"-lifcore\"")
set(SMPI_IFORT 1)
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI|Flang") # flang
- set(SMPI_Fortran_FLAGS "\"-fPIC\"")
+ set(SMPI_Fortran_FLAGS_ "\"-fPIC\"")
set(SMPI_Fortran_LIBS "")
set(SMPI_FLANG 1)
endif()
- string(REGEX REPLACE " *-f[a-z]+-prefix-map=[^ ]*" "" SMPI_Fortran_FLAGS "${SMPI_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS}")
+ set(SMPI_Fortran_FLAGS "${SMPI_Fortran_FLAGS_} ${SMPI_Fortran_FLAGS}")
## Request debugging flags for Fortran too
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g")
- Fixed a bug where Activity::wait_for() killed the activity on timeout.
Explicitly cancel the activity to get back to previous behavior.
+SMPI:
+ - The default SMPI compiler flags are no more taken from the environment.
+ They can be explicitly set through cmake parameters SMPI_C_FLAGS,
+ SMPI_CXX_FLAGS, or SMPI_Fortran_FLAGS.
+
LUA:
- Lua platform files are deprecated. Their support will be dropped after v3.31.
Take as few optional dependencies as possible, to get minimal
library bindings in Java and Python.
+SMPI_C_FLAGS (string)
+SMPI_CXX_FLAGS (string)
+SMPI_Fortran_FLAGS (string)
+ Default compiler options to use in smpicc, smpicxx, or smpiff.
+ This can be useful to set options like "-m32" or "-m64".
+
Reset the build configuration
"""""""""""""""""""""""""""""
CFLAGS=-m32 \
CXXFLAGS=-m32 \
+ FFLAGS=-m32 \
PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig/ \
cmake . \
-DCMAKE_SYSTEM_PROCESSOR=i386 \
-DCMAKE_Fortran_COMPILER=/some/path/to/i686-linux-gnu-gfortran \
-DGFORTRAN_EXE=/some/path/to/i686-linux-gnu-gfortran \
- -DCMAKE_Fortran_FLAGS=-m32
+ -DSMPI_C_FLAGS=-m32 \
+ -DSMPI_CXX_FLAGS=-m32 \
+ -DSMPI_Fortran_FLAGS=-m32
If needed, implement ``i686-linux-gnu-gfortran`` as a script: