mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
First try to build pip package with mpi wrapper
This commit is contained in:
parent
b7a3eb5a2b
commit
61f568d8e9
29
setup.py
29
setup.py
@ -59,6 +59,7 @@ if 'NETGEN_CCACHE' in os.environ:
|
||||
|
||||
packages = ['netgen', 'pyngcore']
|
||||
|
||||
have_mpi = False
|
||||
if 'darwin' in sys.platform:
|
||||
cmake_args += [
|
||||
'-DNG_INSTALL_DIR_LIB=netgen',
|
||||
@ -68,6 +69,11 @@ if 'darwin' in sys.platform:
|
||||
'-DNG_INSTALL_DIR_INCLUDE=netgen/include',
|
||||
'-DNG_INSTALL_DIR_RES=share',
|
||||
]
|
||||
if os.path.exists('/usr/local/include/mpi.h'):
|
||||
have_mpi = True
|
||||
cmake_args += [
|
||||
'-DOPENMPI_INCLUDE_DIR=/usr/local/include',
|
||||
]
|
||||
elif 'win' in sys.platform:
|
||||
cmake_args += [
|
||||
'-A Win64',
|
||||
@ -77,6 +83,12 @@ elif 'win' in sys.platform:
|
||||
'-DNG_INSTALL_DIR_CMAKE=netgen/cmake',
|
||||
'-DNG_INSTALL_DIR_INCLUDE=netgen/include',
|
||||
]
|
||||
if os.path.exists('C:/python/312/Library/lib/impi.lib'):
|
||||
have_mpi = True
|
||||
cmake_args += [
|
||||
'-DINTEL_MPI_INCLUDE_DIR=C:/python/312/Library/include',
|
||||
'-DINTEL_MPI_LIBRARY=C:/python/312/Library/lib/impi.lib',
|
||||
]
|
||||
elif 'linux' in sys.platform:
|
||||
name_dir = name.replace('-','_')
|
||||
cmake_args += [
|
||||
@ -86,8 +98,25 @@ elif 'linux' in sys.platform:
|
||||
'-DTCL_INCLUDE_PATH=/usr/include',
|
||||
'-DTK_INCLUDE_PATH=/usr/include',
|
||||
]
|
||||
mpich_include = '/usr/include/mpich-3.2-x86_64'
|
||||
openmpi_include = '/usr/include/openmpi-x86_64'
|
||||
if os.path.exists(mpich_include+'/mpi.h'):
|
||||
have_mpi = True
|
||||
cmake_args += [
|
||||
f'-DMPICH_INCLUDE_DIR={mpich_include}',
|
||||
]
|
||||
if os.path.exists(openmpi_include+'/mpi.h'):
|
||||
have_mpi = True
|
||||
cmake_args += [
|
||||
f'-DOPENMPI_INCLUDE_DIR={mpich_include}',
|
||||
]
|
||||
packages = []
|
||||
|
||||
if have_mpi:
|
||||
cmake_args += [
|
||||
'-DUSE_MPI=ON',
|
||||
]
|
||||
|
||||
cmake_args += [
|
||||
'-DUSE_SUPERBUILD:BOOL=ON',
|
||||
'-DUSE_CCACHE:BOOL=ON',
|
||||
|
@ -1,7 +1,7 @@
|
||||
set -e
|
||||
ulimit -n 1024000 # lower open file limit, seems to affect performance
|
||||
yum -y update
|
||||
yum -y install ninja-build fontconfig-devel tk-devel tcl-devel libXmu-devel mesa-libGLU-devel ccache
|
||||
yum -y install ninja-build fontconfig-devel tk-devel tcl-devel libXmu-devel mesa-libGLU-devel ccache mpich-3.2-devel openmpi-devel
|
||||
|
||||
rm -rf wheelhouse
|
||||
export NETGEN_CCACHE=1
|
||||
|
Loading…
Reference in New Issue
Block a user