Hello,
Having another go at it, I discovered that the order of libraries I had defined was incorrect, but was able to compile telemac by using the '-Xlinker --start-group' option that resolves dependencies in cyclic manner.
Obviously, that wasn't the case with 'f2py' and api compilation, thus it failed. Sorting the libraries in proper manner enabled compiling telemac without the '-Xlinker --start-group' flag.
I changed 'compil_tools.py' back to original and api compilation failed with undefined references to _gortran functions which was resolved by adding '-lgfortran' to 'ld_flags'. Compilation now completes and api remains to be tested.
I have noticed that I ask for static compilation (in systel.cfg + all my libraries are static) and hardcoded f2py command has '-shared' flag set no matter what (see below). Could that be a source for concern?
C:\msys64\mingw64\bin\gfortran.exe -Wall -g -Wall -g -shared tmp\Release\tmp\src.win-amd64-3.8\lib\_apimodule.o tmp\Release\tmp\src.win-amd64-3.8\tmp\src.win-amd64-3.8\lib\fortranobject.o tmp\Release\tmp\src.win-amd64-3.8\lib\_api-f2pywrappers2.o \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libapi.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libtelemac3d4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libtelemac2d4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libsisyphe4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libgaia4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libnestor4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libtomawac4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libartemis4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libkhione4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libwaqtel4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libgretel4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libpartel4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libbief4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libparallel4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libhermes4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libdamocles4api.a \\hydra\opentelemac\trunk\builds\gfmsmpi\lib\libspecial4api.a \\hydra\opentelemac\trunk\..\libraries\mumps-5.2.1\lib\libdmumps.a \\hydra\opentelemac\trunk\..\libraries\mumps-5.2.1\lib\libmumps_common.a \\hydra\opentelemac\trunk\..\libraries\mumps-5.2.1\lib\libpord.a \\hydra\opentelemac\trunk\..\libraries\scalapack-2.1.0\libscalapack.a \\hydra\opentelemac\trunk\..\libraries\OpenBLAS\libopenblas-r0.3.9.a \\hydra\opentelemac\trunk\..\libraries\parmetis-4.0.3\libmetis.a \\hydra\opentelemac\trunk\..\libraries\parmetis-4.0.3\libparmetis.a \\hydra\opentelemac\trunk\..\libraries\msmpi-10.1.12\Lib\x64\libmsmpi.a -LC:\msys64\mingw64\lib\gcc\x86_64-w64-mingw32\9.3.0 -LC:\Users\cyamin\WPy64-3820\python-3.8.2.amd64\libs -LC:\Users\cyamin\WPy64-3820\python-3.8.2.amd64\PCbuild\amd64 -lgfortran -lpython38 -lgfortran -o .\_api.cp38-win_amd64.pyd
Costas