exapde / Exasim

Exasim: Generating Discontinuous Galerkin Codes For Extreme Scalable Simulations
MIT License
65 stars 19 forks source link

Compile flags to App files and core libraries #29

Closed rloekvh closed 2 years ago

rloekvh commented 2 years ago

Right now the app.cpuflags and app.gpuflags fields allow the user to add flags to the compilation of main.cpp. I think it would also be helpful to let the user add flags to compile opuApp/gpuApp and the opuCore/gpuCore libs.

The first case is helpful when using a GPU compiler that is not the default, for example using LLVM Clang. Compiling the App files requires specifying --cuda-path and --cuda-gpu-arch. We could add these to the app object, or we could just let the user specify them by something like gpuappflags.

Allowing libraries to be added to Core compilations is helpful when developing on an M1 Mac, for example. To use MPI on my machine, I've only had luck specifying everything to work on an x86 architecture. This means adding the flag "-arch x86_64" to every compilation string, including those in genlib.