Add a cmake or autotools build system? #1395
Replies: 8 comments 7 replies
-
We have an autotools build system which is documented here: https://github.com/NOAA-GFDL/MOM6/blob/dev/gfdl/ac/README.md It does not exactly follow usual autoconf builds:
But overall we feel it suits our current workflows. We would like to integrate this better into coupled builds so that is somewhere we could work together. A CMake build was developed by @aerorahul but I believe there were a few blockers to integration (possibly FMS2 migration, but I can't recall the details). Hopefully he can provide an update here. We would like to support both autotool and CMake builds. |
Beta Was this translation helpful? Give feedback.
-
A standalone MOM6 cmake build that uses the latest FMS cmake from NOAA-GFDL is still there and can be resurrected quickly enough. I had given a presentation and demo of CMake with MOM6 on this topic on July 1, 2020. |
Beta Was this translation helpful? Give feedback.
-
The point of an autotools build is to follow the usual rules. ;-) How about we upgrade this to not use mkmf. I am very familiar with mkmf, as I generated the FMS build. mkmf is an old-timey tool, not fit for purpose in the modern world. I understand your Fortran programmers are comfortable with it, but it also forces many bad choices on your build, and it's really holding you back. Retire mkmf, as a tool that has done a fine job for many years. It is time to move on. The FMS team made this transition and is happy with it. I'm happy to help by giving you a working set of Makefile.am files, which I can generate with my python script. Can we also get @aerorahul 's CMake build merged? That would be very helpful. What blocked its adoption? Building the UFS stack with a bunch of components which don't test for their dependent libraries is unstable. We need MOM6 to keep up with our build requirements, and that means CMake and/or autotools. |
Beta Was this translation helpful? Give feedback.
-
I'm afraid we're not quite yet ready to abandon mkmf. We found that the automake build of FMS is much slower than makefiles generated by mkmf, and it also eliminates the burden of maintaining So we have no plan to retire mkmf until we see evidence that it will improve our builds. I think we've produced an effective synthesis of autoconf and mkmf, and I would encourage you to look before passing judgement. If you'd like to discuss this in person, then feel free to reach out to me outside of the issue. |
Beta Was this translation helpful? Give feedback.
-
Your automake build slowness is probably a bug in the Makefile.am files which can be found and fixed. There's no reason your make files should be faster. mkmf is holding you back because it requires one module file in each directory, and then causes your programmers to put their F90 code into include files, instead of F90 files. At least, this was the case with FMS. This makes it harder for code analysis tools to work (for example, I never did figure out how to turn on code coverage analysis for FMS, even though that's trivial in a normal build system). I have absolutely looked at and worked with mkmf more than I wanted to or ever plan to again. When I say that it is a legacy tool that has served beyond its time, I am not rushing to judgement. ;-) |
Beta Was this translation helpful? Give feedback.
-
To answer the original question: Yes, we do have an autotools build, and a CMake build does exist although we do not maintain it. There seem to be followup questions as to whether the current available options are suited to UFS, and if a UFS-compatible solution should reside in this repository, but we need more information to answer these questions. I think discussions about the relative merits of mkmf vs automake should take a backseat for now. (Again, I invite you to reach out to me if you want to discuss our design decisions.) Given that the scope of this issue is starting to shift in unpredictable ways, I'm going to move it to discussions where we can hash out ideas and plans. As specific issues arise, we can open new issues. |
Beta Was this translation helpful? Give feedback.
-
We've discussed the build process quite a lot recently. One challenge is that many people think MOM6 could be built like a library but it cannot. The MOM6 object files depend on the optional software being compiled and MOM6 sits between that optional software and the coupler that the coupler also knows about. This is not how we would design things now but it is the way the original models were set up. Personally, I would like to be compatible with multiple build strategies and I do not think we will ever adopt just one. The current autotools is in For what it's worth, the mkmf approach is working for everyone who doesn't have root access to upgrade/install cmake. I also think it's valuable to expose to users what the build process is doing, rather than provide a black box that just works by magic. The current instructions for building do use mkmf, but they also try to explain what is happening and you can build quite easily without mkmf, and many people do. |
Beta Was this translation helpful? Give feedback.
-
@aerorahul how do we build MOM6 now? Did we create a wrapper project with your CMake build? @adcroft I have heard of the unusual build problems of MOM6 for some time. I don't think you will solve them with home-rolled build tools. Instead I suggest you adopt more standard solutions. |
Beta Was this translation helpful? Give feedback.
-
Is there any interest in a CMake or Autotools build system?
I converted the FMS from mkmf to Autotools - I have a python script that does most of the heavy lifting.
We could also do a CMake build, which is what we use for everything else in the UFS.
We are installing this as part of the UFS at NOAA, and would greatly prefer to have a standard build system. I'm willing to help get there...
Beta Was this translation helpful? Give feedback.
All reactions