From fba2ddd5d6c9907ce1a4e64405beee92a1f447a1 Mon Sep 17 00:00:00 2001 From: Izaak Beekman Date: Mon, 7 Dec 2015 15:39:13 -0500 Subject: [PATCH] GASNet 1.26.0 (new formula) Closes Homebrew/homebrew#46772. Signed-off-by: Mike McQuaid --- Formula/gasnet.rb | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Formula/gasnet.rb diff --git a/Formula/gasnet.rb b/Formula/gasnet.rb new file mode 100644 index 0000000000..26759fd262 --- /dev/null +++ b/Formula/gasnet.rb @@ -0,0 +1,49 @@ +class Gasnet < Formula + desc "Global-Address Space Networking layer and communication primitives" + homepage "http://gasnet.lbl.gov" + url "http://gasnet.lbl.gov/GASNet-1.26.0.tar.gz" + mirror "https://bitbucket.org/berkeleylab/gasnet/downloads/GASNet-1.26.0.tar.gz" + sha256 "32b84c47910c36137db198a9c5396dd0a87c29ad72f2040493aa9e8b2a24f929" + + head do + url "https://bitbucket.org/berkeleylab/gasnet.git" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + depends_on "pkg-config" => :build + end + + option "without-test", "Skip build time tests (requires properly configured MPI and firewall settings)" + + depends_on :mpi => [:cc, :cxx] + + def install + system "./bootstrap" if build.head? + system "./configure", "--disable-debug", + "--disable-dependency-tracking", + "--disable-silent-rules", + "--prefix=#{prefix}" + system "make", "all" + system "make", "run-tests" if build.with? "test" + (pkgshare/"test").install "tests/testhello.c" + system "make", "install" + end + + test do + # GASNet requires us to use makefiles specialized for each "conduit" + # On MAC OS X we have an MPI implementation so write a makefile to + # test the above program over that conduit + (testpath/"makefile").write <<-EOS.undent + include #{opt_include}/mpi-conduit/mpi-par.mak + test: testhello + \t#{bin}/gasnetrun_mpi -n 3 $^ + .PHONY: test + testhello.o: #{pkgshare}/test/testhello.c + \t$(GASNET_CC) $(GASNET_CPPFLAGS) $(GASNET_CFLAGS) -c -o $@ $< + testhello: testhello.o + \t$(GASNET_LD) $(GASNET_LDFLAGS) -o $@ $< $(GASNET_LIBS) + EOS + system "make", "test" + end +end