From: Augustin Degomme Date: Wed, 25 Jul 2018 23:57:28 +0000 (+0200) Subject: Sometimes C and fortran compiler family differs... X-Git-Tag: v3_21~355^2~24^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8a5f524d0dd2346b153dc63231643278261b79e7?ds=sidebyside Sometimes C and fortran compiler family differs... Try to get around that.. Ugly for now. --- 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