-
Notifications
You must be signed in to change notification settings - Fork 39
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) |
This commit introduces a new build system (still based on make files). Reasons for replacing the previous build system were: - the previous build system had a lot of duplication between the modules, both in terms of make files and shell scripts. - parallelisation was limited. The new build system parallelises better within a module, and between modules. - build scripts and output from the build ended up in the same folder. With the new system, all build output files are stored in the folder ``build`` in the repository root, making cleaning build files equivalent to deleting this folder For the details of the implementation, see the newly added documentation (Developing -> Build system). Some further notable changes: - makedepf90 has been replaced by a perl script that scans the fortran source files. This allows for better flexibility in construction the make files. - Currently, `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. - Dependencies are being discovered using pkg-config. This change makes it easier to build MESA without the SDK, as linux distributions typically ship with pkg-config files.
This commit adds the necessary pkg-config files until the SDK ships them.
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 |
It makes more sense to place the data processing script under proper version control.
Some of the preprocessor code has been modified to actually build, and to catch some errors in a cleaner way
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. |
Needed to build GYRE with the SDK
I now seem to quite consistently run into this error when I run
|
I merged the mesa frontend for GYRE with GYRE itself into a single static library. This also seems to depend on features of |
If you’re doing this sort of thing, be careful that you don’t end up including libforum into whatever libraries you create. There’s some reference counting that goes on in libforum, relating to the HDF5 library, and this breaks if there are multiple copies of libforum that end up in the final executable.
cheers,
Rich
… On Nov 14, 2024, at 5:14 PM, Vincent Vanlaer ***@***.***> wrote:
I merged the mesa frontend for GYRE with GYRE itself into a single static library. This also seems to depend on features of ar that are not consistent across linux distros (let alone with another OS). I will probably revert that change and just allow for multiple outputted libraries.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because your review was requested.Message ID: ***@***.***>
--
Rich Townsend • Professor of Astronomy
Astronomy Department • University of Wisconsin-Madison
Phone: 608-262-1752 • E-mail: ***@***.***
|
Thanks for the tip! I will double check that, but I think it should be fine. What I intend to do is the same thing MESA does currently, namely building GYRE with |
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.