From a5086f474e9ca546692acd06ce9e49bf1c9cea26 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 18 Jun 2016 18:03:09 -0400 Subject: [PATCH] New package lrslib --- .../packages/lrslib/Makefile.spack.patch | 58 +++++++++++++++++++ .../repos/builtin/packages/lrslib/package.py | 56 ++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 var/spack/repos/builtin/packages/lrslib/Makefile.spack.patch create mode 100644 var/spack/repos/builtin/packages/lrslib/package.py diff --git a/var/spack/repos/builtin/packages/lrslib/Makefile.spack.patch b/var/spack/repos/builtin/packages/lrslib/Makefile.spack.patch new file mode 100644 index 0000000000..2a76316fe2 --- /dev/null +++ b/var/spack/repos/builtin/packages/lrslib/Makefile.spack.patch @@ -0,0 +1,58 @@ +--- old/Makefile.spack ++++ new/Makefile.spack +@@ -0,0 +1,55 @@ ++# Set PREFIX to the install location for both building and installing ++# Set BOOST_PREFIX to the location where BOOST is installed ++# Set GMP_PREFIX to the location where GMP is installed ++ ++all: liblrsgmp.la 2nash lrs lrs1 lrsnash redund redund1 setnash setnash2 ++ ++liblrsgmp.la: lrslib-GMP.lo lrsgmp-GMP.lo ++ libtool --mode=link --tag=CC cc -g -O3 \ ++ -rpath $(PREFIX)/lib -o $@ $^ \ ++ -L$(GMP_PREFIX)/lib -lgmp ++ ++lrs1: lrs-LONG.lo lrslib-LONG.lo lrslong-LONG.lo ++ libtool --mode=link --tag=CC cc -g -O3 -o $@ $^ ++redund1: redund-LONG.lo lrslib-LONG.lo lrslong-LONG.lo ++ libtool --mode=link --tag=CC cc -g -O3 -o $@ $^ ++setnash: setupnash.lo lrslib.lo lrsmp.lo ++ libtool --mode=link --tag=CC cc -g -O3 -o $@ $^ ++setnash2: setupnash2.lo lrslib.lo lrsmp.lo ++ libtool --mode=link --tag=CC cc -g -O3 -o $@ $^ ++lrs: lrs.lo lrslib.lo lrsmp.lo ++ libtool --mode=link --tag=CC cc -g -O3 -o $@ $^ \ ++ -L$(GMP_PREFIX)/lib -lgmp ++redund: redund.lo lrslib.lo lrsmp.lo ++ libtool --mode=link --tag=CC cc -g -O3 -o $@ $^ \ ++ -L$(GMP_PREFIX)/lib -lgmp ++lrsnash: lrsnash.lo lrsnashlib.lo lrslib.lo lrsmp.lo ++ libtool --mode=link --tag=CC cc -g -O3 -o $@ $^ \ ++ -L$(GMP_PREFIX)/lib -lgmp ++2nash: 2nash.lo ++ libtool --mode=link --tag=CC cc -g -O3 -o $@ $^ ++ ++%.lo: %.c ++ libtool --mode=compile --tag=CC cc -g -O3 -o $@ -c $*.c ++%-GMP.lo: %.c ++ libtool --mode=compile --tag=CC cc -g -O3 -o $@ -DGMP -c $*.c ++%-LONG.lo: %.c ++ libtool --mode=compile --tag=CC cc -g -O3 -o $@ -DLRSLONG -c $*.c ++%-SIGNALS.lo: %.c ++ libtool --mode=compile --tag=CC cc -g -O3 -o $@ \ ++ -DTIMES -DSIGNALS -c $*.c ++ ++install: ++ mkdir -p $(PREFIX)/bin ++ mkdir -p $(PREFIX)/lib ++ libtool --mode=install cp 2nash $(PREFIX)/bin/2nash ++ libtool --mode=install cp lrs $(PREFIX)/bin/lrs ++ libtool --mode=install cp lrs1 $(PREFIX)/bin/lrs1 ++ libtool --mode=install cp lrsnash $(PREFIX)/bin/lrsnash ++ libtool --mode=install cp redund $(PREFIX)/bin/redund ++ libtool --mode=install cp redund1 $(PREFIX)/bin/redund1 ++ libtool --mode=install cp setnash $(PREFIX)/bin/setnash ++ libtool --mode=install cp setnash2 $(PREFIX)/bin/setnash2 ++ libtool --mode=install cp liblrsgmp.la $(PREFIX)/lib/liblrsgmp.la ++ ++.PHONY: all install diff --git a/var/spack/repos/builtin/packages/lrslib/package.py b/var/spack/repos/builtin/packages/lrslib/package.py new file mode 100644 index 0000000000..9f02d7c979 --- /dev/null +++ b/var/spack/repos/builtin/packages/lrslib/package.py @@ -0,0 +1,56 @@ +############################################################################## +# 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 * + +class Lrslib(Package): + """lrslib Ver 6.2 is a self-contained ANSI C implementation of the + reverse search algorithm for vertex enumeration/convex hull + problems and comes with a choice of three arithmetic packages""" + homepage = "http://cgm.cs.mcgill.ca/~avis/C/lrs.html" + url = "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/lrslib-062.tar.gz" + + version('062', 'be5da7b3b90cc2be628dcade90c5d1b9') + version('061', '0b3687c8693cd7d1f234a3f65e147551') + version('060', 'd600a2e62969ad03f7ab2f85f1b3709c') + version('051', 'cca323eee8bf76f598a13d7bf67cc13d') + version('043', '86dd9a45d20a3a0069f77e61be5b46ad') + + # Note: lrslib can also be built with Boost, and probably without gmp + + # depends_on("boost") + depends_on("gmp") + depends_on("libtool") + + patch("Makefile.spack.patch") + + def install(self, spec, prefix): + # The Makefile isn't portable; use our own instead + makeargs = ["-f", "Makefile.spack", + "PREFIX=%s" % prefix, + # "BOOST_PREFIX=%s" % spec["boost"].prefix, + "GMP_PREFIX=%s" % spec["gmp"].prefix] + make(*makeargs) + make("install", *makeargs)