-
Notifications
You must be signed in to change notification settings - Fork 38
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
No code in MESA makes use of this
None of this code is used in the other parts of MESA.
It is only used for non-sdk builds, and other required libraries (such as HDF5) are not included for non-sdk builds as well. Furthermore, this prevents the vendored version from being out of date with the SDK version.
b229c58
to
c3d879d
Compare
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.
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. |
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.