cross-compiling with CMake

Hi all,

Does OpenMC v0.6.0 have support for cross-compilation environments? If not, do you have any suggestions for setting up cross-compilation with Cmake?

Right now, when I try to compile on BG/Q, cmake is auto-detecting the wrong compiler (it’s detecting the compiler for the login node). I’m considering setting up some toolchains, as described here (http://www.cmake.org/Wiki/CMake_Cross_Compiling), but I don’t have any experience with it and any suggestions would be appreciated.

Thanks and best wishes,
Ron Rahaman

Greetings,

You can tell CMake which compiler you want to use by setting the “FC” environment variable. For example, see http://mit-crpg.github.io/openmc/usersguide/install.html#compiling-with-mpi

Sterling

Hi Ron,

I don’t think anyone has tried cross-compilation environments in any serious effort. I did once make a feeble attempt to cross compile for Windows with mingw on a Linux machine – it didn’t work on the first try, and I didn’t care that much so I gave up.

As Sterling suggested, you should be able to set the compiler explicitly using FC. That should solve your current woes on BG/Q, although I would consider that separate from a discussion of cross-compilation.

Paul

Thanks, guys! I will use Sterling’s suggestion as a quick fix, and I will look into cross-compilation toolchains as a long-term solution. Looks like this issue has been addressed for other projects here at ANL ( https://wiki.alcf.anl.gov/parts/index.php/Mira_Build_System_Software_Documentation ), so I should be able to hunt down some experts.