Adds lulesh package (#1887)

This commit is contained in:
Ivo Jimenez 2016-10-04 01:28:23 -07:00 committed by Todd Gamblin
parent e546d6246f
commit 2c701d372e
2 changed files with 115 additions and 0 deletions

View File

@ -0,0 +1,55 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
import os
class Lulesh(Package):
"""Livermore Unstructured Lagrangian Explicit Shock Hydrodynamics (LULESH)
"""
homepage = "https://codesign.llnl.gov/lulesh.php"
url = "https://codesign.llnl.gov/lulesh/lulesh2.0.3.tgz"
version("2.0.3", "336644a8750f71c7c6b9d2960976e7aa")
patch("remove_defaults.patch")
variant('mpip', default=False)
depends_on("mpi", type="build")
depends_on("mpip", when="+mpip")
def install(self, spec, prefix):
if '+mpip' in spec:
os.environ["LDFLAGS"] = " -lmpiP -ldwarf -lelf"
if os.uname()[4] == "x86_64":
os.environ["LDFLAGS"] += " -lunwind"
os.environ["CXX"] = spec['mpi'].mpicxx + " -DUSE_MPI=1"
os.environ["PREFIX"] = prefix
make()
make("install")

View File

@ -0,0 +1,60 @@
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,9 @@
#default build suggestion of MPI + OPENMP with gcc on Livermore machines you might have to change the compiler name
-SHELL = /bin/sh
.SUFFIXES: .cc .o
LULESH_EXEC = lulesh2.0
-MPI_INC = /opt/local/include/openmpi
-MPI_LIB = /opt/local/lib
-
-SERCXX = g++ -DUSE_MPI=0
-MPICXX = mpig++ -DUSE_MPI=1
-CXX = $(MPICXX)
-
SOURCES2.0 = \
lulesh.cc \
lulesh-comm.cc \
@@ -20,28 +12,6 @@
lulesh-init.cc
OBJECTS2.0 = $(SOURCES2.0:.cc=.o)
-#Default build suggestions with OpenMP for g++
-CXXFLAGS = -g -O3 -fopenmp -I. -Wall
-LDFLAGS = -g -O3 -fopenmp
-
-#Below are reasonable default flags for a serial build
-#CXXFLAGS = -g -O3 -I. -Wall
-#LDFLAGS = -g -O3
-
-#common places you might find silo on the Livermore machines.
-#SILO_INCDIR = /opt/local/include
-#SILO_LIBDIR = /opt/local/lib
-#SILO_INCDIR = ./silo/4.9/1.8.10.1/include
-#SILO_LIBDIR = ./silo/4.9/1.8.10.1/lib
-
-#If you do not have silo and visit you can get them at:
-#silo: https://wci.llnl.gov/codes/silo/downloads.html
-#visit: https://wci.llnl.gov/codes/visit/download.html
-
-#below is and example of how to make with silo, hdf5 to get vizulization by default all this is turned off. All paths are Livermore specific.
-#CXXFLAGS = -g -DVIZ_MESH -I${SILO_INCDIR} -Wall -Wno-pragmas
-#LDFLAGS = -g -L${SILO_LIBDIR} -Wl,-rpath -Wl,${SILO_LIBDIR} -lsiloh5 -lhdf5
-
.cc.o: lulesh.h
@echo "Building $<"
$(CXX) -c $(CXXFLAGS) -o $@ $<
@@ -56,6 +26,7 @@
/bin/rm -f *.o *~ $(OBJECTS) $(LULESH_EXEC)
/bin/rm -rf *.dSYM
-tar: clean
- cd .. ; tar cvf lulesh-2.0.tar LULESH-2.0 ; mv lulesh-2.0.tar LULESH-2.0
-
+install: lulesh2.0
+ @echo "Installing"
+ mkdir -p $(PREFIX)/bin
+ install --mode=755 lulesh2.0 $(PREFIX)/bin/