-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add new build system #724
base: main
Are you sure you want to change the base?
Add new build system #724
Conversation
c3d879d
to
3369f7a
Compare
I've just started chipping away at this and started off with the error
for both I'll see how far I get with the SDK (the build feels faster) and then give it a try with my system libraries, which includes GCC 14.2.1, and then the ifort build on the local cluster. It'll take me at least 2-3 weeks to work through but is my MESA priority. |
7465ce1
to
c483a59
Compare
I noticed this was an issue with CI, but worked locally. I think at some point tags for the releases got moved and renamed, and the main branch therefore contains no tags when you do a clean checkout. It should be fixed now (still have to cleanup the mess I made of the commits for testing) |
b239b1e
to
50046fb
Compare
I apologize, I should have recognized that error above was due to missing tags. Yes, we unfortunately had to rename tags and move them around to tips of branches get readthedocs to auto-detect the versions, render the right docs, and create banners. Sounds like this caused a headache, but I am glad it is sorted out. At some point I'd like to go back to branch-based docs builds but that will require renaming branches to follow PEP440 standards to get readthedocs to auto-detect versions |
Looking good! I am able to install without problems. What is the status and plan for this PR, @VincentVanlaer ? |
This can be merged as is in principle, since it builds. However, I would not yet merge this to main (maybe to a separate branch), but first:
I would like to have a review of the new documentation and the system in general. What are show stoppers, things that should be improved, ... |
I'm hopefully getting back on top of enough other things that I've had a look back at some MESA things, and this is my MESA priority. I just checked out out your For anyone else who tries all this, note that a top-level I'd like to push to get the whole of MESA under the new build before we merge. I don't think it makes sense to have some modules build one way and other modules build another. The first thing I want to try is to update another module, to see how that process works. I'm not sure if the modules have to be updated in order because of their dependencies but looks like A lower-priority goal is to see how easy it is to switch away from the SDK as the build backend but I don't think that has to be in this PR. |
Awesome 😄
👍
Yes,
I am doing my local development without the SDK. There are some dependencies which are not readily available in my package manager, but otherwise it works well. I have also been messing around with the |
I just pulled your branch again and now seem to be hitting an issue in the GYRE build when installing (with
I'm building with MESA SDK 24.7.1 on Fedora 40. I can look into this when I next get a chance, which might be over the weekend. (I compiled on one thread to isolate the error properly.) |
🚀 |
Ah right, that's because I forgot to add a pkg-config file to |
For building on Mac, |
It is worth noting that this transformation is not required, it just makes the resulting path a bit cleaner to look at in log messages and such. |
I now seem to quite consistently run into this error when I run
|
Work directories require a bit more massaging to work: - The compilation of the work directory needs to be able to find the compiled artefacts in the main mesa build directory, but store its own output in the build directory in the work directory. This is accomplished by keeping the main build directory pointed to the MESA directory, and only set BUILD_DIRECTORY_MODULE to the work dir build directory, as only this one is used for the generated files. - The binary module needs to refer to sources in the MESA directory. this is because these sources cannot be compiled in during the installation, as they depend on functions in the work directory sources. From a user perspective, the main changes are: - The removal of the `clean` and `mk` scripts. These are replaced by `make clean` and `make` respectively. - The star executable will always be built before it is ran. This will eliminate issues where the one forgets to rebuild the executable.
This has the following benefits: - Remove effectively duplicated code, since pgplot supports the same thing. - Support more locations for rgb.txt, as given by the pgplot library (e.g. loading from a system default folder, if pgplot has been installed system wide)
dd1ee57
to
6315ff1
Compare
Otherwise one could get warnings from the compiler
6315ff1
to
28b80bb
Compare
…arlier versions of MESA
Main commit message
Reasons for replacing the previous build system were:
build
in the repository root, making cleaning build files equivalent to deleting this folderFor the details of the implementation, see the newly added documentation (Developing -> Build system).
Some further notable changes:
pymesa
does not work with the new build system, as the new system does not provide a way to build shared libraries for every module.Draft status
Draft status of this PR will be removed once a decision has been mode about #712 and #723, after which I will rebase.
Reviewing this PR
I recommend to first take a test drive of the new system, especially if you use some special setup (e.g. a non-sdk build). Install instructions haven't changed. I have written relatively detailed documentation on how the new system works, which I recommend reviewers of this PR to read before diving into the Makefiles and scripts. Let me know if something is unclear or missing in the documentation! The first few commits are just #712 and #723, so those can be skipped (if #712 and #723 don't end up being merged, it is an easy change to add the files back). The other commits are truly part of this PR, with the first two introducing the new build system. The other commits are porting of individual modules.
Remarks
$MESA_DIR/lib
and$MESA_DIR/include
. Once all modules have been ported, this will no longer be needed for a normal install, except for the data files. Internally, the different modules that have been ported don't use those files.git describe --tags
which generates (in my opinion) nicer version numbers than just using the commit hash. However, this requires the version tags to be on the main branch (currently running this command onmain
givesr15140-2084-ge29ed74d
rather than something liker24.08.1-NNNN-ge29ed74d
).pymesa
currently doesn't work. This is because I think it would make more sense to build one single shared library after the main build as a separate step, rather than a bunch of little libraries which need to be able to refer to each other. I intend to do this anyway for the output of the star/binary module, such that building the actually star binary can proceed faster, and allow for things such as experimenting with link-time optimization.Future iterations
I have thought about some future iterations of the build system after this, but I have not implemented those things since otherwise I would keep iterating forever on this build system trying to design the perfect build system. Hence, writing this down to at least have it documented somewhere.
I have probably forgotten some things I wanted to mention, but this should be most of it.