fix two bugs in GROMACS easyblock when using GCC & MKL for FFT and BLAS/LAPACK#2212
Merged
akesandgren merged 3 commits intoeasybuilders:developfrom Nov 23, 2020
Merged
Conversation
akesandgren
reviewed
Nov 11, 2020
boegel
reviewed
Nov 12, 2020
| libs = os.getenv('LAPACK_STATIC_LIBS').split(',') | ||
| mkl_libs = [os.path.join(os.getenv('LAPACK_LIB_DIR'), lib) for lib in libs if lib != 'libgfortran.a'] | ||
| mkl_libs = ['-Wl,--start-group'] + mkl_libs + ['-Wl,--end-group'] | ||
| mkl_libs = ['-Wl,--start-group'] + mkl_libs + ['-Wl,--end-group -lpthread -lm -ldl'] |
Member
There was a problem hiding this comment.
Is it OK to always include -lpthread -lm -ldl here?
Can you clarify which error this fixes exactly?
Contributor
Author
There was a problem hiding this comment.
When trying to compile GROMACS 2020.4 with the gomkl-2020a (GCC + MKL) toolchain (which we found to produce an mdrun that runs a bit faster than the foss-toolchain), cmake wasn't finding the FFT provided by MKL unless I added the -lpthread -lm -ldl flags:
Linking with MKL was requested, but was not successful: The include path to
mkl.h in MKL_INCLUDE_DIR, and the link libraries in
MKL_LIBRARIES=-Wl,--start-group;/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/imkl/2020.1.217/mkl/lib/intel64/libmkl_gf_lp64.a;/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/imkl/2020.1.217/mkl/lib/intel64/libmkl_sequential.a;/cvmfs/soft.computecanada.ca/easybuild/software/2020/Core/imkl/2020.1.217/mkl/lib/intel64/libmkl_core.a;-Wl,--end-group
need to match what the MKL documentation says you need for your system: Use
full paths to library files, in the right order, and separated by
semicolons.
Call Stack (most recent call first):
CMakeLists.txt:716 (include)I used the MKL advisor to suggest the linker-flags, which is how I came to try adding -lpthread -lm -ldl, which solved the above error.
Contributor
|
Going in, thanks @ostueker! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First change eliminates the (wrong) variable
$EBROOTMKLfrom the easyblock as per discussion of @boegel and @mboisson on EasyBuild Slack.Secondly GROMACS 2020.4' cmake was refusing to use MKL as FFT library (using the
gomkl-2020atoolchain), which was fixed by appending-lpthread -lm -ldlto-DMKL_LIBRARIES.