From: Augustin Degomme Date: Wed, 25 Jul 2018 22:09:08 +0000 (+0200) Subject: send argv and argc to fortran runtimes, to allow using getarg X-Git-Tag: v3_21~355^2~24^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/37a44313f5760bc8cb95573360805cc42730e770?hp=4713af90ef9c023d84da321abc1f387d195b8d48 send argv and argc to fortran runtimes, to allow using getarg --- diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 5e70fb2eb6..021bb078da 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -42,6 +42,15 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_kernel, smpi, "Logging specific to SMPI (ke #include #include /* trim_right / trim_left */ +#if defined(__GNUC__) + extern "C" void _gfortran_set_args(int, char **); +#elif defined(__FLANG) + extern "C" void __io_set_argc(int); + extern "C" void __io_set_argv(char **); +#elif defined(__INTEL_COMPILER) || defined(__ICC) + extern "C" void for_rtl_init_ (int *, char **); +#endif + #ifndef RTLD_DEEPBIND /* RTLD_DEEPBIND is a bad idea of GNU ld that obviously does not exist on other platforms * See https://www.akkadia.org/drepper/dsohowto.pdf @@ -423,9 +432,15 @@ static int smpi_run_entry_point(smpi_entry_point_type entry_point, std::vector