Skip to content

Conversation

@bartoldeman
Copy link
Contributor

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.

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.
# 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]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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:
    ...

@boegel boegel added this to the 3.1.2 milestone Mar 17, 2017
pull down the definition of check_fftw_libs to right above where it is used
@boegel
Copy link
Member

boegel commented Mar 17, 2017

lgtm, thanks @bartoldeman!

@boegel boegel merged commit dc474f5 into easybuilders:develop Mar 17, 2017
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.

2 participants