From e93db10fef776a623fff46fc65b64122de12f026 Mon Sep 17 00:00:00 2001 From: jasminium Date: Wed, 28 Aug 2019 10:25:18 +0100 Subject: [PATCH 1/3] remove mkl fix --- gprMax/gprMax.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gprMax/gprMax.py b/gprMax/gprMax.py index 0ebf3f06..8538d228 100644 --- a/gprMax/gprMax.py +++ b/gprMax/gprMax.py @@ -25,12 +25,6 @@ import sys from enum import Enum -# There is a bug with threading and MKL on macOS -# (https://github.com/gprMax/gprMax/issues/195) . Setting the MKL threading -# layer to sequential solves it, but must be done before numpy is imported. -if sys.platform == 'darwin': - os.environ["MKL_THREADING_LAYER"] = 'sequential' - import h5py import numpy as np From d4b44e0128904d9a0189383f18282d03662383c6 Mon Sep 17 00:00:00 2001 From: jasminium Date: Wed, 28 Aug 2019 10:25:53 +0100 Subject: [PATCH 2/3] remove -fopenmp from linker args --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e659c8b3..666437ad 100644 --- a/setup.py +++ b/setup.py @@ -123,7 +123,7 @@ elif sys.platform == 'darwin': else: raise('Cannot find gcc 4-9 in /usr/local/bin. gprMax requires gcc to be installed - easily done through the Homebrew package manager (http://brew.sh). Note: gcc with OpenMP support is required.') compile_args = ['-O3', '-w', '-fopenmp', '-march=native'] # Sometimes worth testing with '-fstrict-aliasing', '-fno-common' - linker_args = ['-fopenmp', '-Wl,-rpath,' + rpath] + linker_args = ['-Wl,-rpath,' + rpath] extra_objects = [] # Linux elif sys.platform == 'linux': From 71c86d152bbf24dbecf585ee4704b2a67d1b1461 Mon Sep 17 00:00:00 2001 From: jasminium Date: Wed, 28 Aug 2019 17:06:04 +0100 Subject: [PATCH 3/3] replace linker args and libraries --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 666437ad..f2e9a65a 100644 --- a/setup.py +++ b/setup.py @@ -106,12 +106,14 @@ if 'cleanall' in sys.argv: # Now do a normal clean sys.argv[1] = 'clean' # this is what distutils understands + # Set compiler options # Windows if sys.platform == 'win32': compile_args = ['/O2', '/openmp', '/w'] # No static linking as no static version of OpenMP library; /w disables warnings linker_args = [] extra_objects = [] + libraries=[] # Mac OS X - needs gcc (usually via HomeBrew) because the default compiler LLVM (clang) does not support OpenMP # - with gcc -fopenmp option implies -pthread elif sys.platform == 'darwin': @@ -123,13 +125,15 @@ elif sys.platform == 'darwin': else: raise('Cannot find gcc 4-9 in /usr/local/bin. gprMax requires gcc to be installed - easily done through the Homebrew package manager (http://brew.sh). Note: gcc with OpenMP support is required.') compile_args = ['-O3', '-w', '-fopenmp', '-march=native'] # Sometimes worth testing with '-fstrict-aliasing', '-fno-common' - linker_args = ['-Wl,-rpath,' + rpath] + linker_args = ['-fopenmp', '-Wl,-rpath,' + rpath] + libraries = ['iomp5', 'pthread'] extra_objects = [] # Linux elif sys.platform == 'linux': compile_args = ['-O3', '-w', '-fopenmp', '-march=native'] linker_args = ['-fopenmp'] extra_objects = [] + libraries=[] # Build a list of all the extensions extensions = [] @@ -143,6 +147,7 @@ for file in cythonfiles: [tmp[0] + fileext], language='c', include_dirs=[np.get_include()], + libraries=libraries, extra_compile_args=compile_args, extra_link_args=linker_args, extra_objects=extra_objects)