blog
blog copied to clipboard
Imperfect build systems
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:
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.
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.
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.