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

Enable toolchain build for a generic target #1854

Merged
merged 1 commit into from Jan 2, 2022
Merged

Conversation

mkrack
Copy link
Member

@mkrack mkrack commented Jan 2, 2022

  • Merge GNU arch files for generic and static serial binaries
  • Make arch file sourceable
  • Sync compiler flags with toolchain

- Merge GNU arch files for generic and static serial binaries
- Make arch file sourceable
- Sync compiler flags with toolchain
@mkrack mkrack merged commit 5da5e8e into cp2k:master Jan 2, 2022
@alazzaro
Copy link
Member

@mkrack This PR is very very clever. I see you did for the ARM system (?)
I had a similar problem when building a container for a cross-platform (effectively a cross-compile).
In the past I tried to make a toolchain version within the container to be portable, but I found several places where we take current system flags to compile. For instance, in FFTW we do the following:

grep '\bavx\b' /proc/cpuinfo 1> /dev/null && FFTW_FLAGS="${FFTW_FLAGS} --enable-avx"
grep '\bavx2\b' /proc/cpuinfo 1> /dev/null && FFTW_FLAGS="${FFTW_FLAGS} --enable-avx2"
grep '\bavx512f\b' /proc/cpuinfo 1> /dev/null && FFTW_FLAGS="${FFTW_FLAGS} --enable-avx512"

This is something we should not use, suppose I want to build a container on my laptop (AVX2) to run on a different system (AVX512)... I will try to extend your "generic" flag idea.

@mkrack
Copy link
Member Author

mkrack commented Jan 10, 2022

Indeed, a (better) cross-compilation support of the CP2K toolchain is missing. The --generic flag could be extended to a --target=<platform> flag including for instance --target=x86-64-generic as generalization.

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

Successfully merging this pull request may close these issues.

None yet

2 participants