Skip to content
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

Clean compilation scripts and document compilation procedure #39

Open
mathrack opened this issue Apr 6, 2022 · 7 comments
Open

Clean compilation scripts and document compilation procedure #39

mathrack opened this issue Apr 6, 2022 · 7 comments
Milestone

Comments

@mathrack
Copy link
Collaborator

mathrack commented Apr 6, 2022

Currently, compilation of the code can be performed using the provided

  • Makefile
  • cmake scripts
  • autotools scripts

On the one hand, keeping the Makefile is probably a good idea so that one (not very familiar with the cmake syntax) can quickly test the code on new architectures. On the other hand, keeping both the cmake and autotools is probably a bad idea, and the autotools should be removed later on (v3).

It could be interesting to have a Makefile with explicit file dependencies so that parallel make would work with both Makefile and cmake.

The compilation using cmake should be clearly documented. Some clusters have support for cmake but no support for ccmake or cmake-gui. Thus, it is important to document clearly all the cmake options one can use from the command-line.

@mathrack mathrack added this to the v3 milestone Apr 6, 2022
@mathrack
Copy link
Collaborator Author

mathrack commented Apr 6, 2022

A nice addition to the cmake build could be taken from the autotools scripts : in addition to the hash of the last commit, check if the code is modified or if the source tree is clean. See https://github.com/xcompact3d/x3div/blob/hack_DC_TGV/configure.ac#L203

@tlestang
Copy link

tlestang commented Apr 6, 2022

On the one hand, keeping the Makefile is probably a good idea so that one (not very familiar with the cmake syntax) can quickly test the code on new architectures

CMake is cross platform, so it's a single definition to build them all. This means you shouldn't have to write any CMake to build the code on different/new architectures. All you need to type is

mkdir build && cd build
cmake ../ # Generate the Makefile if on *nix
make install

Happy to leave the Makefile until the CMake definitions can deal with just as much cases, but after this I think it should go. This would be redundant since CMake will generate the Makefile.

@tlestang
Copy link

tlestang commented Apr 6, 2022

Does this overlap with #33 ?

@mathrack
Copy link
Collaborator Author

mathrack commented Apr 6, 2022

Usually, new architectures are associated with specific compiler / linker options, and can even be associated with different compilers. Changing the compiler or the compiler / linker options in the Makefile is relatively simple, although not documented. In my opinion, the Makefile could be removed only if the cmake script allow users to easily change the compiler and the compiler / linker options. Currently, this might be possible, but it is not documented at all.

@mathrack mathrack changed the title Installation / compilation Clean compilation scripts and document compilation procedure Apr 6, 2022
@mathrack
Copy link
Collaborator Author

mathrack commented Apr 6, 2022

It does overlap with #33 , I have tried to clarify the present issue.

@tlestang
Copy link

tlestang commented Apr 6, 2022

only if the cmake script allow users to easily change the compiler and the compiler / linker options.

I see your point. Yes, it should do. Most options (like compiler or link/compile flags) can be defined at configure or build time. This is a fairly typical use of CMake.

@pbartholomew08
Copy link
Member

We could use makedepf90 with the Makefile to sort out the dependencies. I'd rather keep the makefile around as I can generally figure out what's going wrong/what I want to change, CMake either works out of the box or doesn't for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants