-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What CMake version to require #41
Comments
I think we should look at the features we want to use in our CMake builds, and then get to the lowest version that satisfies all. I anticipate that of users who have and would use CMake to build stdlib, many don't have the latest version, and some (like me) get their CMake from the OS package manager. When the OS support for CMake runs our, you stay with that CMake version. My version is 3.14.3. I don't see this as a general philosophy we should take, but rather an exception we should make for CMake -- it's changing a lot throughout versions, newest versions are not ubiquitous among systems that have CMake, and CMake itself is not ubiquitous among systems in general. For some advanced users, it may be easy to get the latest CMake on their system. For the majority it isn't, from my experience with other HPC users that I've support in the past, and for my readers it's the same. A novice Fortran programmer should have an easy time getting started with stdlib.
@zbeekman Can you write in more detail what would be suitably new CMake? What are the features that you need? We're not using MPI or submodules yet. Let's worry about updating our CMake system when we do. Also can you elaborate on what do you mean by being motivated to contribute? Do you mean you wouldn't be motivated to maintain somewhat older-version CMake builds, or you wouldn't be motivated to contribute to stdlib at all? |
I think 3.14.3 should be the minimal version due to good submodule support and other bug fixes. As I noted on the PR where @certik and I were discussing this:
While we're not currently using any submodules, separating the interface and implementation helps avoid circular dependencies and makes the builds faster once we have more SLOC.
very sad, but true
I don't think this is really true anymore...
Sorry, I was getting a little grumpy. But at the end of the day it's so frustrating as a Fortran programmer to be handicapped by lack of good Fortran support in tools, compilers, and open libraries. CMake is one of the few tools out there with GREAT, first class Fortran support. Handicapping my ability to write and build good Fortran simply because user X only has a super antiquated CMake version installed by default on their system would likely lead me to become frustrated and stop contributing all together or fork the project and maintain my own version with a suitably sophisticated build system. Especially given how easy it is to get a binary distribution of CMake and install it in your home directory. |
No worries, it happens to all of us, and I agree that CMake offers great first class Fortran support. It's the right tool to build a project like this.
I don't think anybody here in the community wants that. From knowing the community and people involved here so far, I think it's highly unlikely that we'd choose to hold back on some obvious beneficial features of CMake in order to keep one or few users happy. In the end, for users like that, there will be the manual Makefiles, and they'll be able to build one way or another. CMake is here to make a) our lives easier, and b) lives of stdlib users that have a recent-enough CMake. I believe it's part of our mission, and in stdlib's best interest, to make the scope of b) as wide as possible. We can do this by choosing to not enforce the latest CMake, but to use a reasonably recent version that delivers what we need. In summary, to broaden the scope of stdlib users that will build stdlib using CMake (ultimately, I think most of us here prefer that to manual Makefiles), we need to chose the oldest version that we can, while not handicapping any developer's work with Fortran or CMake.
We need to all get clear and explicit about what are the features we need from CMake. This is exactly what this issue is for. Let's discuss. Zaak, can you spell out exactly what you need from it so that you don't feel handicapped for Fortran development? It's important that we get clear on these so that you can get what you need for your work, and which is supported by the community. |
It's a friction between developers (who want to use the latest language, the latest compilers and the latest tools) and users, who want exactly the opposite: they want our library to work with the compilers they have and tools that they have. And we definitely want to ensure that our code is used by as many users as possible. At the same time, we want to get as many developers as possible. So we have to strike a balance. @zbeekman I think all we are asking is that you try to work with us and I think we can figure out a compromise so that you will get what you want, while our (future) users also get what they want. |
Sure, I get that users want things to just work.
And I don’t disagree with the sentiment. Sometimes you cannot adopt the
latest and greatest technology X due to stability, availability, ease of
use etc.
That’s WHY I want to use 3.14.3. I write CMake under the assumption that it
will be 3.14.3 or later because of 1) submodule support and 2) bug fixes
and features that I can’t immediately recall. I have no desire to track
these bugs & features down or re-litigate their resolution. At work I’m
responsible for the build system, CI and final integration of a large
Fortran based (with C and C++) multi-physics code used at a government
agency that is required to build and run on macOS, Linux and Windows. My
desire to use 3.14.3 or greater is born out of my experience with that
project. I don’t remember what was fixed in which particular version of
CMake, nor do I want to have to remember.
We don’t have to bump the minimum required version but I can’t promise that
I won’t accidentally contribute code that requires a newer version. It will
work on my machine. It will work during CI. But if a feature that’s not
present on an older CMake < 3.13.4 is used then it may fail if someone
attempts to build with an older CMake. Given the goal to have vanilla
Makefiles and/or bring your own build system combined with the ease of
installing CMake binaries I cant see how this could possibly be a better
outcome for users. (Kitware hosts a PPA, you can install the latest CMake
with pip or Conda, and they provide relocatable statically linked
binaries.) As a user I’d much rather have my build system tell me: go get a
newer CMake, instead of having to run down a bug in the build system itself
(in the underlying tool or the implementation).
…On Sun, Dec 22, 2019 at 10:19 PM Ondřej Čertík ***@***.***> wrote:
It's a friction between developers (who want to use the latest language,
the latest compilers and the latest tools) and users, who want exactly the
opposite: they want our library to work with the compilers they have and
tools that they have. And we definitely want to ensure that our code is
used by as many users as possible. At the same time, we want to get as many
developers as possible. So we have to strike a balance. @zbeekman
<https://github.com/zbeekman> I think all we are asking is that you try
to work with us and I think we can figure out a compromise so that you will
get what you want, while our (future) users also get what they want.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41?email_source=notifications&email_token=AACEIPE4RKHIIYW2HF37FQTQ2AU2RA5CNFSM4J6NIRVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHQC25Y#issuecomment-568339831>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACEIPCC7GPNTZMRWCPFDK3Q2AU2RANCNFSM4J6NIRVA>
.
|
So, just to summarize I advocate for using 3.14.3 because:
|
Thanks Zaak, I'm getting a bit better idea on where you are on this. My impression is that many of your concerns about this assume that you'd be the only person maintaining the build system, which I hope doesn't happen considering that we're building a community here. There's already several of us and more people will get involved in time. I also understand that Zaak, you implicitly agree that we need some CMake versions for specific features, and not just because, is that right? Your point 1) (submodules) + bug fixes is an important one. Although we're not using submodules yet, we likely will soon. It's worth it to think ahead. In this case, one of us (no pressure on you) could do the research about the minimum CMake version that we need now, and bump it up to 3.14.3 later in 2020 when we start using submodules. Btw, I can't find anything about submodules in the release notes for 3.14. Was the submodule support perhaps added before or after 3.14? @marshallward @jacobwilliams @ivan-pi @jvdp1 @scivision Do you mind weighing in here with Question for everybody: do we really need This approach only takes care of the scenario where we enforce some later CMake version that we don't yet need. If we can agree to do the proper research and determine the correct CMake version needed, then we can just require that one. |
Submodule support was added in 3.13 (IIRC) but it was broken/buggy.
You need it because:
In my opinion it's non-optional because it leads to unexpected variability. At the end of the day the goal is to make life easy on users and developers. People have a tendency to hate CMake to begin with. Providing a build system without
Well, I hope to help out a lot, and my fear is more that I will contribute code to the build system that will cause a problem for users down the road. I don't want to write buggy code, and for users to swear off this project (or CMake) because of a mistake on my part. I'm looking forward to working with all of you on the build system and every other part of this project. |
I agree, there were substantial developer and user quality-of-life improvements in CMake 3.13 and 3.14. However to start, I think 3.12 may be enough--let's see if it gets too annoying. That is, consider supporting CMake back to 3.12 until it becomes a real-life issue. Ensuring project works with minimum CMake versionThe method I use to ensure CMake 3.12 is OK is CI using Ubuntu 18.04 that has CMake 3.12. Simultaneously I have other CI images with the latest CMake release. ancient CMakeparts of stdlib that don't use Fortran submodule can be supported back to CMake 3.7, where CMake statements can be used to fence off submodule targets like if(CMAKE_VERSION VERSION_LESS 3.12) CMake older than 3.7 is substantially more difficult to support. I don't have any projects that support older than CMake 3.7. Almost all my Fortran projects require at least CMake 3.12 due to Fortran submodule. |
if cmake_minimum_required(VERSION 3.12) is omitted, CMake emits several lines of warnings and proceeds. I think this line should be included to avoid issues with CMake policies as Zaak noted above. |
So in my opinion, I would start off with minimum CMake 3.12 and then see if:
|
For the record, significant issues persisted until 3.13.4. I can try to find the bug(s) if anyone really cares, but I do not trust CMake < 3.13.4 to work reliably on all 3 oses with Fortran Submodules. |
I follow a pragmatic approach, that I recommend we follow also:
Until now this discussion was not relevant, because our CMake build system was clean and worked with old CMake. In #54 the new Windows CI would either require ugly hacks, or an upgraded CMake. As I commented there (#54 (comment)), let's upgrade CMake to 3.14. @zbeekman if I may recommend, why not to follow the approach I just outlined above? Instead of imposing tools on others that might not be necessary, let's assume that we are all reasonable and let's instead spend our energy and discussions on the actual API of stdlib and other things that actually matter to our (future) users. If some of our tools choice forces us to create complicated workarounds, let's instead upgrade our tools. We have much bigger fish to fry than a CMake version. |
To have more complete use of Fortran syntax, some of that syntax needs to be tested at build configure time as maintaining whitelists for OS and compiler versions would be an endless task. That would be another clear driver for CMake 3.14 along with the CMake bugs for modern Fortran before CMake 3.14 |
I think a lot of the text (NOT quoted here) in that comment is now outdated and conflicts with your edit, @certik. Based on discussion in #54 do we all now see a case for setting the minimum to 3.14? There are other bugs and issues in addition to the reasons mentioned above and in #54 too, but, again, I don't have the time or energy to recall and hunt them all down. (Although, given the amount of back and forth, that might have been less work: you guys are sticklers 😜.) |
(and if we're in agreement, close this issue... a new one can always be opened if someone wants to downgrade 😱 or upgrade 👿 CMake.) |
I don't follow. My question is, do you agree with my proposition in #41 (comment), or not? And if not, why not? |
IMO, no need to rush. Let's keep it open and have the discussion going. Plus, I don't want to hide this thread from the top of the issues page. It's not the specific version number that matters, but the process through which we arrive there. I'm not convinced we've nailed down the process. I agree that the Windows tests are indeed important and agree that we can go with 3.14. As a bonus, we get the bug-free submodule, which will be important when we start adding submodules. |
I agree. You may safely disregard my comment about @certik's edited post... My point was that when your comment was edited, at one point it seemed inconsistent to me. At the end of the day I agree with you. Thankfully @scivision has pointed out some compelling cases to upgrade the version, where my memory for specifics has failed me. Please accept my apology if you think I've seemed contrary, difficult, arbitrary or cantankerous, that was never my intention. At any rate, I believe we are all in agreement. I agree with everything you (@certik) and @milancurcic have said, and I'm happy that someone else pointed out a few of the concrete reasons why 3.14 should be used. I did not want to bump the minimum version solely to have newer features despite the fact that I couldn't easily point to defects it resolves or needed capabilities it added. As far as the process goes, I completely agree that it should NOT be upgraded unless there is a compelling concrete need. I don't foresee us wanting to version bump beyond 3.14 anytime soon, and should that occasion occur, it will be based on a recent bug discovery or missing feature so it will be easy to articulate & remember at the time it comes up. (In contrast to the ~2 years of running down compiler and CMake bugs for the project I contribute to for work.) So I 100% agree with the general principle of not upgrading unless there is a need. I also fully anticipate being able to express that need with concrete examples should it arise in the future as we work on stdlib. We can keep this issue open if you think it requires further discussion or want other people to weigh in. |
This has been in active for over a year and what we chose to do has been working so far. |
What minimal CMake version should we require?
The text was updated successfully, but these errors were encountered: