From 8a5f524d0dd2346b153dc63231643278261b79e7 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Thu, 26 Jul 2018 01:57:28 +0200 Subject: [PATCH] Sometimes C and fortran compiler family differs... Try to get around that.. Ugly for now. --- CMakeLists.txt | 3 +++ src/smpi/internals/smpi_global.cpp | 12 ++++++------ tools/cmake/src/internal_config.h.in | 5 ++++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31f04052a2..25cd68fa92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,12 +87,15 @@ if ((NOT DEFINED enable_smpi) OR enable_smpi) if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") 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_LIBS "\"-lifcore\"") + set(SMPI_IFORT 1) elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI|Flang") # flang set(SMPI_Fortran_FLAGS "\"-fPIC\"") set(SMPI_Fortran_LIBS "") + set(SMPI_FLANG 1) endif() set(SMPI_FORTRAN 1) diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 98b935377b..66a4be23ca 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -42,12 +42,12 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (ke #include #include /* trim_right / trim_left */ -#if defined(__INTEL_COMPILER) || defined(__ICC) +#if SMPI_IFORT extern "C" void for_rtl_init_ (int *, char **); -#elif defined(__FLANG) +#elif SMPI_FLANG extern "C" void __io_set_argc(int); extern "C" void __io_set_argv(char **); -#elif defined(__GNUC__) +#elif SMPI_GFORTRAN extern "C" void _gfortran_set_args(int, char **); #endif @@ -433,12 +433,12 @@ static int smpi_run_entry_point(smpi_entry_point_type entry_point, std::vector