I avoid CMake on Windows, where trying to get it to work has been an exercise in frustration. I can use fpm or a manual makefile on Windows. I like having both options, but I don’t know how much work goes into maintaining the manual make files.
From the cross-platform and cross-compiler point of view, the makefile does not seem to be flexible enough.
CMake is a good choice.
The interesting thing is that xmake-io/xmake: A cross-platform build utility based on Lua (github.com) also supports compiling fortran code, description:
Compared with makefile/CMakeLists.txt, the configuration syntax is more concise and intuitive. It is very friendly to novices and can quickly get started in a short time. Let users focus more on actual project development.
The the issue seems that CMake’s default build backend on Windows are VS project files, but those are hardly a good fit to build a Fortran project unfortunately. I have switched to ninja as build backend for all platforms with CMake (use -G Ninja in the configure stage or export CMAKE_GENERATOR=Ninja in your bash profile). Also, if CMake is not picking up the Fortran compiler correctly, you can set the environment variable FC with the absolute path to your Fortran compiler to give CMake the correct hint.
I use the makefile (CMake and I really don’t get along). I actually didn’t know that stdlib supported fpm (or would it be the other way around), is that a somewhat recent development?
@hsnyder support for fpm in the stdlib main repository is a very recent addition, it’s only present since two days now. This change is also the motivation to reevaluate the supported build systems for stdlib.
From the perspective of stdlib development, it seems that we should stop using makefiles. I also think that there are many configuration files for makefiles and CMake, and they are really tiring. (We are prone to omissions, leading to CI failure)
From the user’s point of view, it seems that make is simpler, just make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4. In fact, I don’t know CMake very well, I just can simply compile the code. But for some people who have never contacted CMake and fpm, using them requires simple tutorials. Otherwise, all they can do is: compile fails and stop trying stdlib.
Once we decide to stop supporting makefiles, we need to find a way to explain CMake’s instructions for compiling stdlib to be more user-friendly.
Wait for the time to come, and encourage users to use fpm to compile stdlib. (fpm is very simple, but it is a new thing and users need to adapt.) (I believe that as the fortran-lang community grows, Fortraner will gradually know fpm enough)
To say something naive, who can even record an instructional video, briefly introduce fpm and stdlib, and conduct compiling teaching. Put the link of the video on the README.md or fortran-lang official website.
Sorry for nitpicking, but I have two problems with this poll and, in particular, with this question
It does not align with the title that seem to ask how do I build now or usuallystdlib (not in the future).
IMO it is ambiguous: I used both the make and CMake but now that I can use fpm I will definitely start using it as my only tool (BTW many many thanks for doing it! )
Well, that’s a different poll now. How I intend to build stdlib is with fpm. How I currently build it is with cmake. So I voted both cmake and stdlib. I am just going to leave my vote.
It’s the same poll. The body didn’t change. Only the title changed to be more consistent with the body.
Yes, it captures two pieces of information, both of which I wanted to know about. I voted for CMake because I use it and plan to use it, and fpm because I will use it for stdlib as a dependency.
Let’s revive this conversation again. We just discussed it on the monthly call, and hope to make a decision soon whether to remove Makefile support from stdlib.