你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
mkl fix
这个提交包含在:
@@ -12,8 +12,8 @@ import sys
|
|||||||
# There is a bug with threading and MKL on macOS
|
# There is a bug with threading and MKL on macOS
|
||||||
# (https://github.com/gprMax/gprMax/issues/195) . Setting the MKL threading
|
# (https://github.com/gprMax/gprMax/issues/195) . Setting the MKL threading
|
||||||
# layer to sequential solves it, but must be done before numpy is imported.
|
# layer to sequential solves it, but must be done before numpy is imported.
|
||||||
if sys.platform == 'darwin':
|
#if sys.platform == 'darwin':
|
||||||
os.environ["MKL_THREADING_LAYER"] = 'sequential'
|
# os.environ["MKL_THREADING_LAYER"] = 'sequential'
|
||||||
|
|
||||||
from ._version import __version__
|
from ._version import __version__
|
||||||
from .cmds_single_use import Discretisation
|
from .cmds_single_use import Discretisation
|
||||||
|
4
setup.py
4
setup.py
@@ -180,6 +180,7 @@ if sys.platform == 'win32':
|
|||||||
compile_args = ['/O2', '/openmp', '/w'] # No static linking as no static version of OpenMP library; /w disables warnings
|
compile_args = ['/O2', '/openmp', '/w'] # No static linking as no static version of OpenMP library; /w disables warnings
|
||||||
linker_args = []
|
linker_args = []
|
||||||
extra_objects = []
|
extra_objects = []
|
||||||
|
libraries=[]
|
||||||
# macOS - needs gcc (usually via HomeBrew) because the default compiler LLVM (clang) does not support OpenMP
|
# macOS - needs gcc (usually via HomeBrew) because the default compiler LLVM (clang) does not support OpenMP
|
||||||
# - with gcc -fopenmp option implies -pthread
|
# - with gcc -fopenmp option implies -pthread
|
||||||
elif sys.platform == 'darwin':
|
elif sys.platform == 'darwin':
|
||||||
@@ -192,12 +193,14 @@ elif sys.platform == 'darwin':
|
|||||||
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.')
|
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'
|
compile_args = ['-O3', '-w', '-fopenmp', '-march=native'] # Sometimes worth testing with '-fstrict-aliasing', '-fno-common'
|
||||||
linker_args = ['-fopenmp', '-Wl,-rpath,' + rpath]
|
linker_args = ['-fopenmp', '-Wl,-rpath,' + rpath]
|
||||||
|
libraries=['iomp5', 'pthread']
|
||||||
extra_objects = []
|
extra_objects = []
|
||||||
# Linux
|
# Linux
|
||||||
elif sys.platform == 'linux':
|
elif sys.platform == 'linux':
|
||||||
compile_args = ['-O3', '-w', '-fopenmp', '-march=native']
|
compile_args = ['-O3', '-w', '-fopenmp', '-march=native']
|
||||||
linker_args = ['-fopenmp']
|
linker_args = ['-fopenmp']
|
||||||
extra_objects = []
|
extra_objects = []
|
||||||
|
libraries=[]
|
||||||
|
|
||||||
# Build a list of all the extensions
|
# Build a list of all the extensions
|
||||||
extensions = []
|
extensions = []
|
||||||
@@ -213,6 +216,7 @@ for file in cythonfiles:
|
|||||||
include_dirs=[np.get_include()],
|
include_dirs=[np.get_include()],
|
||||||
extra_compile_args=compile_args,
|
extra_compile_args=compile_args,
|
||||||
extra_link_args=linker_args,
|
extra_link_args=linker_args,
|
||||||
|
libraries=libraries,
|
||||||
extra_objects=extra_objects)
|
extra_objects=extra_objects)
|
||||||
extensions.append(extension)
|
extensions.append(extension)
|
||||||
|
|
||||||
|
在新工单中引用
屏蔽一个用户