summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Van Essen <vanessen1@llnl.gov>2018-01-31 10:38:53 -0700
committerbecker33 <becker33@llnl.gov>2018-01-31 09:38:53 -0800
commit06758fe5cbcbf631959ffc459ccaf372345231cf (patch)
tree93c112f42b9210a4952805462a933a8bce81356d
parent60cc0b0b903a37612025459eb4952d7568958355 (diff)
downloadspack-06758fe5cbcbf631959ffc459ccaf372345231cf.tar.gz
spack-06758fe5cbcbf631959ffc459ccaf372345231cf.tar.bz2
spack-06758fe5cbcbf631959ffc459ccaf372345231cf.tar.xz
spack-06758fe5cbcbf631959ffc459ccaf372345231cf.zip
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.
-rw-r--r--var/spack/repos/builtin/packages/cnpy/package.py9
-rw-r--r--var/spack/repos/builtin/packages/elemental/package.py10
-rw-r--r--var/spack/repos/builtin/packages/lbann/package.py16
3 files changed, 34 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/cnpy/package.py b/var/spack/repos/builtin/packages/cnpy/package.py
index 7c868b62b4..6677d8800c 100644
--- a/var/spack/repos/builtin/packages/cnpy/package.py
+++ b/var/spack/repos/builtin/packages/cnpy/package.py
@@ -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
diff --git a/var/spack/repos/builtin/packages/elemental/package.py b/var/spack/repos/builtin/packages/elemental/package.py
index c661e073cb..2b6de080f6 100644
--- a/var/spack/repos/builtin/packages/elemental/package.py
+++ b/var/spack/repos/builtin/packages/elemental/package.py
@@ -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 @@ class Elemental(CMakePackage):
'-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),
diff --git a/var/spack/repos/builtin/packages/lbann/package.py b/var/spack/repos/builtin/packages/lbann/package.py
index 6a32a53d8b..4b1a80c2b5 100644
--- a/var/spack/repos/builtin/packages/lbann/package.py
+++ b/var/spack/repos/builtin/packages/lbann/package.py
@@ -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 @@ class Lbann(CMakePackage):
'-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)])