Fix fftw_libs for MKL without interface libraries.#2171
Merged
boegel merged 2 commits intoeasybuilders:developfrom Mar 17, 2017
Merged
Fix fftw_libs for MKL without interface libraries.#2171boegel merged 2 commits intoeasybuilders:developfrom
boegel merged 2 commits intoeasybuilders:developfrom
Conversation
PR easybuilders#2082 allowed the use of MKL without interface libraries (useful if neither FFTW2 nor MPI are needed in compiler+linalg toolchains without MPI). However I forgot to adjust fftw_libs and so the LIBFFT environment variable still included the non-existing interface libraries. This patch corrects this issue.
boegel
requested changes
Mar 17, 2017
| # The cluster interface libs (libfftw3x_cdft*) can be omitted if the toolchain does not provide MPI-FFTW | ||
| # interfaces. | ||
| check_fftw_libs = [l for l in check_fftw_libs if l not in [interface_lib, cluster_interface_lib]] | ||
| fftw_libs = [l for l in fftw_libs if l not in [interface_lib, cluster_interface_lib]] |
Member
There was a problem hiding this comment.
@bartoldeman We're doing the exact same thing to both check_fftw_libs and fftw_libs, so let's refactor things a bit and pull down the definition of check_fftw_libs to right above where it is used:
fftw_lib_exists = lambda x: any([os.path.exists(os.path.join(d, "lib%s.a" % x)) for d in fft_lib_dirs])
if not fftw_lib_exists(interface_lib) and LooseVersion(imklver) >= LooseVersion("10.2"):
# interface libs can be optional:
# ...
fftw_libs = [l for l in fftw_libs if l not in [interface_lib, cluster_interface_lib]]
# filter out libraries from list of FFTW libraries to check for if they are not provided by Intel MKL
check_fftw_libs = [lib for lib in fftw_libs if lib not in ['dl', 'gfortran']]
if all([fftw_lib_exists(lib) for lib in check_fftw_libs]):
self.FFT_LIB = fftw_libs
else:
...pull down the definition of check_fftw_libs to right above where it is used
boegel
approved these changes
Mar 17, 2017
Member
|
lgtm, thanks @bartoldeman! |
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.
PR #2082 allowed the use of MKL without interface libraries
(useful if neither FFTW2 nor MPI are needed in compiler+linalg
toolchains without MPI). However I forgot to adjust fftw_libs
and so the LIBFFT environment variable still included the
non-existing interface libraries.
This patch corrects this issue.