LBANN OS X (#7105)
* Added a package for the MDAnalysis toolkit. * Added some flags to fix the build RPATHs and OpenMP for LBANN on OS X. * Fixed Hydrogen branch of Elemental to find OpenMP on OS X.
This commit is contained in:
parent
60cc0b0b90
commit
06758fe5cb
3 changed files with 34 additions and 1 deletions
|
@ -24,6 +24,8 @@
|
|||
##############################################################################
|
||||
from spack import *
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
class Cnpy(CMakePackage):
|
||||
"""cnpy: library to read/write .npy and .npz files in C/C++."""
|
||||
|
@ -32,3 +34,10 @@ class Cnpy(CMakePackage):
|
|||
url = "https://github.com/rogersce/cnpy"
|
||||
|
||||
version('master', git='https://github.com/rogersce/cnpy.git', branch="master")
|
||||
|
||||
def cmake_args(self):
|
||||
args = []
|
||||
if sys.platform == 'darwin':
|
||||
args.extend(['-DCMAKE_MACOSX_RPATH=ON'])
|
||||
|
||||
return args
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import os
|
||||
import sys
|
||||
from spack import *
|
||||
from spack.spec import UnsupportedCompilerError
|
||||
|
||||
|
@ -211,6 +212,15 @@ def cmake_args(self):
|
|||
'-DHydrogen_GENERAL_LAPACK_FALLBACK=ON',
|
||||
]
|
||||
|
||||
# Add support for OS X to find OpenMP
|
||||
if (self.spec.satisfies('%clang')):
|
||||
if (sys.platform == 'darwin'):
|
||||
clang = self.compiler.cc
|
||||
clang_bin = os.path.dirname(clang)
|
||||
clang_root = os.path.dirname(clang_bin)
|
||||
args.extend([
|
||||
'-DOpenMP_DIR={0}'.format(clang_root)])
|
||||
|
||||
if 'blas=openblas' in spec:
|
||||
args.extend([
|
||||
'-DHydrogen_USE_OpenBLAS:BOOL=%s' % ('blas=openblas' in spec),
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import os
|
||||
import sys
|
||||
from spack import *
|
||||
|
||||
|
||||
|
@ -50,7 +52,7 @@ class Lbann(CMakePackage):
|
|||
values=('Debug', 'Release'))
|
||||
|
||||
depends_on('elemental +openmp_blas +shared +int64')
|
||||
depends_on('elemental +openmp_blas +shared +int64 build_type=Debug',
|
||||
depends_on('elemental +openmp_blas +shared +int64 build_type=Debug',
|
||||
when=('build_type=Debug'))
|
||||
depends_on('cuda', when='+gpu')
|
||||
depends_on('cudnn', when='+gpu')
|
||||
|
@ -93,6 +95,18 @@ def cmake_args(self):
|
|||
'-DLBANN_DATATYPE={0}'.format(spec.variants['dtype'].value),
|
||||
'-DLBANN_VERBOSE=0'])
|
||||
|
||||
# Add support for OpenMP
|
||||
if (self.spec.satisfies('%clang')):
|
||||
if (sys.platform == 'darwin'):
|
||||
clang = self.compiler.cc
|
||||
clang_bin = os.path.dirname(clang)
|
||||
clang_root = os.path.dirname(clang_bin)
|
||||
args.extend([
|
||||
'-DOpenMP_CXX_FLAGS=-fopenmp=libomp',
|
||||
'-DOpenMP_CXX_LIB_NAMES=libomp',
|
||||
'-DOpenMP_libomp_LIBRARY={0}/lib/libomp.dylib'.format(
|
||||
clang_root)])
|
||||
|
||||
if '+opencv' in spec:
|
||||
args.extend(['-DOpenCV_DIR:STRING={0}'.format(
|
||||
spec['opencv'].prefix)])
|
||||
|
|
Loading…
Reference in a new issue