Commit 7ce0734c authored by Ashwin Vishnu's avatar Ashwin Vishnu
Browse files

Support for Numpy installations with Intel single dynamic library `mkl_rt`, more verbose setup

parent dd161bbde380
......@@ -44,6 +44,9 @@ def get_config():
if os.path.exists('site.cfg'):
print('Parsing site.cfg.')
config.read('site.cfg')
else:
print('Using default configuration. Copy site.cfg.default -> '
'site.cfg to specify site specific libraries.')
config_dict = {}
for section in config.sections():
......@@ -55,14 +58,19 @@ def get_config():
value = config.get(section, option)
if option == 'use':
value = value.lower()
if not (section == 'fftw3' and value == 'mkl'):
if not (section == 'fftw3' and value in ('mkl', 'mkl_rt')):
if value not in ['true', 'false']:
raise ValueError('"use" should be "True" of "False".')
value = value == 'true'
else:
value = os.path.expandvars(value)
section_dict[option] = value
config_dict[section] = section_dict
if section_dict['use']:
print(section + ': ')
for k, v in section_dict.items():
print('{}: '.format(k).rjust(25) + v)
return config_dict
......@@ -82,9 +90,12 @@ def parse_config():
lib_flags_dict = {}
# See https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
if config['fftw3']['use'] == 'mkl':
lib_flags_dict['fftw3'] = [
'mkl_intel_ilp64', 'mkl_sequential', 'mkl_core']
elif config['fftw3']['use'] == 'mkl_rt':
lib_flags_dict['fftw3'] = ['mkl_rt', 'pthread', 'm', 'dl']
lib_dirs_dict = {}
for lib in sections_libs:
......
......@@ -102,13 +102,13 @@ def check_deps():
print('{} installed: '.format(pkg).rjust(25) + repr(result))
print('*' * 40)
print('*' * 50)
check_and_print('numpy')
check_and_print('mpi4py', can_import_mpi4py)
check_and_print('cython', can_import_cython)
check_and_print('pythran')
check_and_print('mako')
print('*' * 40)
print('*' * 50)
check_deps()
......
......@@ -36,9 +36,10 @@ except ImportError:
try:
use_mkl_intel_lp64 = 'mkl_intel_lp64' in get_info('mkl')['libraries']
mkl_libs = get_info('mkl')['libraries']
use_mkl_intel = 'mkl_intel_lp64' in mkl_libs or 'mkl_rt' in mkl_libs
except KeyError:
use_mkl_intel_lp64 = False
use_mkl_intel = False
make_pyx_files()
......@@ -132,7 +133,7 @@ if config['fftw3']['use']:
'fft3d_with_fftw3d', 'fft3dmpi_with_fftw1d'])
if config['fftw3_mpi']['use']:
if use_mkl_intel_lp64:
if use_mkl_intel:
warn('When numpy uses mkl (as for example with conda), '
'there are symbol conflicts between mkl and fftw. '
'This can lead to a segmentation fault '
......@@ -145,7 +146,7 @@ if config['cufft']['use']:
base_names.extend(['fft2d_with_cufft'])
base_names.extend(['fft3d_with_cufft'])
if config['pfft']['use'] and not use_mkl_intel_lp64:
if config['pfft']['use'] and not use_mkl_intel:
base_names.extend(['fft3dmpi_with_pfft'])
if config['p3dfft']['use']:
......
[fftw3]
# Set `use = mkl` or `use = mkl_rt` to link dynamic or single-dynamic
# libraries respectively. Run `fluidinfo -v` to decide which one to use.
use = mkl
dir =
include_dir = /opt/software/common/intel/compilers_and_libraries_2017.2.174/linux/mkl/include/fftw
library_dir = /opt/software/common/intel/compilers_and_libraries_2017.2.174/linux/mkl/lib/intel64
include_dir = $MKLROOT/include/fftw
library_dir = $MKLROOT/lib/intel64
[fftw3_mpi]
use = False
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment