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

Provide @COMPILER_NAME@ in DEPENDENCY line #1681

Open
tkittel opened this issue Aug 29, 2024 · 2 comments
Open

Provide @COMPILER_NAME@ in DEPENDENCY line #1681

tkittel opened this issue Aug 29, 2024 · 2 comments
Labels
MCPL Links to something in https://github.com/mctools/mcpl MS Windows Windows subsystem for Linux Windows

Comments

@tkittel
Copy link
Contributor

tkittel commented Aug 29, 2024

Just to summarise the discussions between me and @willend today. To support NCrystal and MCPL with MSVC we obviously can't simply use flags like -Wl,rpath,/bla in DEPENDENCY lines. So scripts like mcpl-config and ncrystal-config must be able to provide different flags for different compilers.

The first step in that, would be for changes in mccode to ensure that the compile name is made available inside the DEPENDENCY line, e.g. like:

DEPENDENCY CMD(ncrystal-config --show compilerflagswithrpath @COMPILER_NAME@)

Step two would then be to make changes in mcpl-config and ncrystal-config to ensure the @COMPILER_NAME@ is available. It should most likely be a name from those in https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html but with the caveat that it might be changed on the fly (e.g. with mcrun).

@tkittel tkittel added MS Windows Windows Windows subsystem for Linux MCPL Links to something in https://github.com/mctools/mcpl labels Aug 29, 2024
@willend
Copy link
Contributor

willend commented Aug 29, 2024

Yup. I am thinking the logic of the full adaptation of the CFLAGS line is:

  1. mcrun inserts @COMPILER_NAME@ (default is McStas build-time compiler from mccode_config, but e.g. --openacc or --mpi may influence) - perhaps also other @vars@
  2. ncrystal-config does its magic
  3. For GPU-mode, mcrun makes a second pass on this resulting, to strip off flags (e.g. found during conda build) that nvc does not understand...

@tkittel
Copy link
Contributor Author

tkittel commented Sep 24, 2024

Related to this, we should consider removing (or at least defaulting to OFF) the ENSURE_NCRYSTAL flag in McCode's CMake. Since nowadays there are easier ways to get NCrystal, so we can decouple the configuration of the two projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MCPL Links to something in https://github.com/mctools/mcpl MS Windows Windows subsystem for Linux Windows
Projects
None yet
Development

No branches or pull requests

2 participants