How do you intend to build the Fortran stdlib?

See #526 for context. We’d like to decide whether it’s worth it to continue maintaining manual Makefiles for building Fortran stdlib.

Which system do you use, or plan to use in the future, to build the Fortran stdlib?

  • fpm
  • CMake
  • Makefile
  • Other (please specify in comments)

0 voters

4 Likes

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.

1 Like

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: :fire: 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.

You probably referring to

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.

1 Like

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?

1 Like

@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.

To build stdlib, I use CMake as described in the README. But I don’t understand it (e.g. expect I would struggle if I had to change anything).

To compile programs that use stdlib, I use either makefiles or shell-scripts that refer to STDLIB_CFLAGS and STDLIB_LIBS.

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. :grin:

1 Like

Sorry for nitpicking, but I have two problems with this poll and, in particular, with this question

  1. It does not align with the title that seem to ask how do I build now or usually stdlib (not in the future).
  2. 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! :clap: )
2 Likes

There is a video Fortran Package Manager (fpm) for Visual Studio by @everythingfunctional . FortranCon will be held online on Sep 23-24, and @nshaffer will give a talk on What’s new in the Fortran Standard Library?. The video last year’s talk on stdlib is online.

Thanks @epagone, I edited the title, how is it now?

1 Like

It is perfect, thanks for considering my comment (and apologies for my OCD :face_with_hand_over_mouth:)

How was the use of fypp addressed in the FPM version? It looks like it was just rendered out and committed, is that right?

1 Like

Now it is the stdlib-fpm branch implemented through GitHub-CI/CD, see build with fpm and stdlib-fpm branch.

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.

1 Like

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.

Does anybody here still use Make to build stdlib?

1 Like