I did it by hand with a simple file and it works, I also saw here how to do it with ifort https://community.intel.com/t5/Intel-Fortran-Compiler/Creating-dll-from-fortran-file/m-p/1182026 from a single source file. I guess that is more or less what CMake is currently doing for me? the goal was to see if it could be easily doable within a fpm build. Just out of curiosity