-
Notifications
You must be signed in to change notification settings - Fork 441
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
Build systems #488
Comments
To add to the list, CMake builds currently (appear to) support the option to build only select parts of the library (REAL, DOUBLE, COMPLEX and/or DOUBLE COMPLEX), while Makefile-only builds do not. (I have changed the Makefiles in the copy we distribute with OpenBLAS and could produce a PR if desired - would need to rediff to leave out some changes not relevant here) |
This option worked the last time I tried it (around May 2020). The CMake build has several options, I list the most important ones for me here:
|
Good idea. Builds working on my machine with make but not on the ci with CMake has driven me crazy a few times. Technically, i think the Makefile also supports a lot of those options (you can just edit your make.inc). If you want a build without the tests you can build with If we end up going for it, I suggest we add some extra build instructions to the readme. How to build and run the tests, how to add flags, especially the frecursive flag. Perhaps even some small note on how to use the shared library. |
I suspect there will be many patches floating around already (e.g. in linux distributions that package lapack) to build shared libraries with gmake. Should not be too complicated to add a BUILD_SHARED option to make.inc like the BUILD_DEPRECATED that is already there (and both are pretty obscure in the CMake build unless one already knows that ccmake and cmake-gui exist). |
There is no need to work with
|
You certainly can, my point is that there is no obvious documentation except reading the CMakelists.txt (whereas the README points one to the preconfigured make.inc files for gmake). ccmake and cmake-gui show a list of available options, but this will be lost on anyone new to cmake. |
If we write a documentation on how to use CMAKE, we can use me as the guinea pig user since I have never used CMAKE. Reading the whole conversation, I feel that the Makefile is in LAPACK there only for me. ;) Well, I do not know. Yes: maintaining several build system leads to inconsistencies. So I see the argument to only have one. (Whether it be CMAKE, make or meson.) (Oh yes, I have never used meson either, if you wonder.) I am worried about moving to CMAKE because, not only do I not know how to use it, I do not know how maintain it. However it seems like we have a wonderful community who can help, so me not being able to work on this part of the project does not seem an issue, in addition, I probably should learn CMAKE. All: Please express your opinion in this thread. It seems that most of us would like to (1) remove make and remove meson; (2) move to CMAKE only; (3) add some good documentation on how to use CMAKE. Fine with me. I am going to send a few emails to other package maintainers here and there to ask how they are doing and what their opinion on this issue is. @martin-frbg: how is this done in OpenBLAS? |
OpenBLAS has Makefiles as its "traditional" build system that is "known to work", and CMAKE as an originally user-contributed alternative that still spits out a warning that the files it generates may not correspond exactly to what a Makefile build would do. |
The Meson build was parachuted into LAPACK in PR #311. |
Hm. If it got accepted into 3.9.0 (even if just as a proof of concept), it would look a bit strange to throw it out again with the very next release... |
I contacted @therault so that he can give us his opinion, here is what @therault says. Thanks @therault!
|
I am happy to contribute said configure-to-cmake glue script to LAPACK if that's something you are interested in. |
LAPACK does not even use configure - and I agree it would probably be a pain to keep an autoconf/automake/configure-based system concurrent with cmake, with the autotools themselves constantly "evolving" and being dependent on m4 macros and whatnot. |
This is a major reason to stick to Makefiles.
The Meson build should be removed. No one is using it, no one knows how to maintain it, the original author submitted an incomplete build, and never came back after his changes were merged. How many people knew there was a Meson build before I opened this issue? CMake is a portable build system with simple syntax and fully configurable builds. One can set file-specific, compiler-specific, or target-specific options (e.g., to selectively enable functions that are not in the C standard library like The first time I used CMake was in 2016 and I have used it continuously ever since to build code for Linux, Mac, iOS, and Android systems, on x86, x86-64, armv7, and aarch64 instruction set architectures. It is available on all major Linux distributions and on all supercomputers that I have access to (Grid 5000, Jean Zay, JUWELS, GRICAD, Eagle II). The supercomputers usually have multiple versions available including old releases and very recent ones (3.18+). The only platform where I struggled with CMake availability is CentOS 7 but you can always download a CMake tarball and use the bootstrap script inside the tarball to build CMake only with GNU Make. CMake just works for me. My experience with other build systems is as follows:
|
Great, Ninja could not compile Fortran in the past, cf. ninja #1265, i.e., on some distributions this will not work (Debian 9?). |
I would definitely say regular makefiles are easier and sufficient in this case.
On the other hand, cmake also does nice things:
However, for LAPACK's very simple build system I don't think there is a good and bad. The current build system has worked for decades, and people are used to it. I don't really have a preference, but it should be absolutely clear which options are supported by which build-system if more are supported... |
I feel like i'm a similar situation as you are @langou . I don't know cmake. I only managed to use it for this project because all the configuration was already in place and by opening the travis config and copy pasting the lines it executes. I don't think its just because I'm inexperienced. A Makefile is a little less magical and feels more low level. That's something that likely resonates with the kind of people that tend to work on this project. However, i can't ignore all the nice features cmake seems to offer. Ultimately, i think either cmake or gmake will do fine. We just need to pick one. |
I am an an outside voice, but as someone who helps maintain lapack in conda-forge, having the build system be CMake would have several advantages (less hacky, native windows support, etc.). It takes some getting used to the CMake syntax, but my impression is that it is a well-maintained and well-documented piece of software that has successfully solved / abstracted away a lot of gnarly build problems. I am involved in packaging other libraries as well, and (subjectively) see more and more of a move to CMake. |
Just another data point from outside; in our work which involves quite a bit of C/C++ building, we are moving to Meson after struggling too much with CMake. The long list of issues with it are well-documented elsewhere so I'm skipping those. In SciPy project we will also try to use CMake or Meson at some point since Python |
I agree maintaining three build systems leads to inconsistencies and/or extra work for the maintainers. However, based on the comments above and in my opinion, each user has their own way to build the code. Particularly, I agree with @therault's comment:
One idea to circumvent the problem with multiple build systems is:
As far as I understand, the issue with the
|
Slight misunderstanding w.r.t |
so here is the why. So if we have to pick one build system: this has to be Cmake... unfortunately for the present but fortunately for the future. My vote: following @abouteiller and @@therault 's advice and have only one build system, thus cmake. |
I opened this issue and proposed to have just one build system. My assumption was that Makefile and CMake skills are about evenly distributed. Please correct if I am wrong but my impression is that this is not true among the regular LAPACK contributors: Makefiles seem to be popular and CMake knowledge seem not to be strong. Moreover, after two days of discussion, the (My judgement about who is a regular contributor is based on looking at the first five pages of accepted pull requests.) |
Agree.. BTW, the recursive flags are in the default CMake and Makefile configurations with #492. So, I think we just need to include the Makefile build in the Travis CI. |
PR #500 mitigates the inconsistencies between the Makefile and CMake build systems reported here. See #500 (comment) |
Hi @ilayn. Thanks for the Meson / CMake / Makefile information. It is great to have outside feedback, and get information on what other projects are doing. We cannot support all three systems and we prefer CMake and Makefile for now, so we will likely decommissioned Meson. Not saying that we will never use Meson, but for now, we do not have the resource to maintain it. This is my opinion. I think we will submit a PR soon decommissioning Meson. Julien. |
I really wish people would stop using these abstraction oriented build systems. Bazel in particular is a security vulnerability mass propagation system, and is never designed to support air-gapped/dark-site development in ANY project its used for. The expectation of internet connectivity to build code is a recipe for disaster. Can we stick to good ol make....and stop trying to reinvent the wheel with all of these poorly designed build systems? |
As of today, there are three different build systems in LAPACK:
The Meson build is incomplete and unmaintained since its introduction in January 2019. The CMake and the Makefile-only build are not identical: The
-frecursive
flag is missing. Having more than one build system has at least three effects:-frecursive
in PR #486.Especially the last point is great because even if someone delivers an accurate problem report, it is impossible to retrace the issue when you built with Makefiles.
I strongly suggest to stick with one build system.
The text was updated successfully, but these errors were encountered: