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

Imperfect build systems #5

Open
ivan-pi opened this issue May 11, 2023 · 3 comments
Open

Imperfect build systems #5

ivan-pi opened this issue May 11, 2023 · 3 comments

Comments

@ivan-pi
Copy link

ivan-pi commented May 11, 2023

Hi Jeff,

I really enjoyed your blog post on imperfect Fortran compilers. It had me wondering how would one do this with CMake. According to StackOverflow, CMake wouldn't be able to handle a project where two different compilers are used for the same language (although Make can do it easily in principle).

Essentially I just wanted to say, Fortran projects using CMake will need to compile their GPU kernels as a separate CMake library project, if they are to exploit this mixed CUDA + host compiler, so more duct tape.

Ciao,

Ivan

Reference:

@jeffhammond
Copy link
Owner

https://www.epcc.ed.ac.uk/whats-happening/articles/asimov-ccs-uk-national-gpu-hackathon is the only group that has used this in a serious code, and I don't know if they used CMake.

I have no idea how one would do this in CMake. I am not a big fan of CMake (looks awkwardly at https://twitter.com/CmakeHate) so I'm the last person you should ask for guidance on how to solve problems with it.

@ivan-pi
Copy link
Author

ivan-pi commented May 11, 2023

I know CMake reasonably well so I'm not looking for guidance. Essentially one would write custom script to compile the CUDA parts (or vice-versa), or split the program into two separate CMake projects (each with their own compiler toolchain).

It was just a comment from my side, that the approach may require some "hacks" in popular build systems.

Thanks for the link to the EPCC article.

@jeffhammond
Copy link
Owner

Yeah, you make a good point and unfortunately I don't have the answers. I'm not sure whether I'll bet who will solve this first: CMake supporting multiple compilers, or one Fortran compiler to rule them all.

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

2 participants