summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Krafczyk <krafczyk.matthew@gmail.com>2017-01-03 15:23:14 -0600
committerMatthew Krafczyk <krafczyk.matthew@gmail.com>2017-01-16 11:29:37 -0500
commit190bd6ca65ae724abd409d644a18689bec433063 (patch)
tree5886c19e7b40758b41e40f2644ae43d21adfceaf
parentaa3cc0ea817ffee8ebf292c8f15eb8eb0fc26866 (diff)
downloadspack-190bd6ca65ae724abd409d644a18689bec433063.tar.gz
spack-190bd6ca65ae724abd409d644a18689bec433063.tar.bz2
spack-190bd6ca65ae724abd409d644a18689bec433063.tar.xz
spack-190bd6ca65ae724abd409d644a18689bec433063.zip
Create rockstar package
rockstar is a halo finding algorithm
-rw-r--r--var/spack/repos/builtin/packages/rockstar/adjust_buildscript.patch13
-rw-r--r--var/spack/repos/builtin/packages/rockstar/package.py37
2 files changed, 50 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/rockstar/adjust_buildscript.patch b/var/spack/repos/builtin/packages/rockstar/adjust_buildscript.patch
new file mode 100644
index 0000000000..e9a18e4ee4
--- /dev/null
+++ b/var/spack/repos/builtin/packages/rockstar/adjust_buildscript.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index fafba4b..a21ef9e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -6,7 +6,7 @@ PROFFLAGS = -lm -g -pg -O2 -std=c99
+ CC = gcc
+ CFILES = rockstar.c check_syscalls.c fof.c groupies.c subhalo_metric.c potential.c nfw.c jacobi.c fun_times.c interleaving.c universe_time.c hubble.c integrate.c distance.c config_vars.c config.c bounds.c inthash.c io/read_config.c client.c server.c merger.c inet/socket.c inet/rsocket.c inet/address.c io/meta_io.c io/io_internal.c io/io_ascii.c io/stringparse.c io/io_gadget.c io/io_generic.c io/io_art.c io/io_tipsy.c io/io_bgc2.c io/io_util.c io/io_arepo.c io/io_hdf5.c
+ DIST_FLAGS =
+-HDF5_FLAGS = -DH5_USE_16_API -lhdf5 -DENABLE_HDF5 -I/opt/local/include -L/opt/local/lib
++HDF5_FLAGS = -DH5_USE_16_API -lhdf5 -DENABLE_HDF5 -I$(HDF5_INC_DIR) -L$(HDF5_LIB_DIR)
+
+ all:
+ @make reg EXTRA_FLAGS="$(OFLAGS)"
diff --git a/var/spack/repos/builtin/packages/rockstar/package.py b/var/spack/repos/builtin/packages/rockstar/package.py
new file mode 100644
index 0000000000..7d430f3aec
--- /dev/null
+++ b/var/spack/repos/builtin/packages/rockstar/package.py
@@ -0,0 +1,37 @@
+from spack import *
+
+class Rockstar(Package):
+ """Description"""
+
+ homepage = "https://bitbucket.org/gfcstanford/rockstar"
+ url = "https://bitbucket.org/gfcstanford/rockstar"
+
+ version('develop', git='https://bitbucket.org/gfcstanford/rockstar.git')
+ version('yt', hg='https://bitbucket.org/MatthewTurk/rockstar')
+
+ variant('hdf5', description='Build rockstar with HDF5 support')
+
+ patch('adjust_buildscript.patch')
+
+ depends_on('hdf5', when='+hdf5')
+
+ def install(self, spec, prefix):
+ # Set environment appropriately for HDF5
+ if '+hdf5' in spec:
+ os.environ['HDF5_INC_DIR'] = os.environ['HDF5_DIR']+"/include"
+ os.environ['HDF5_LIB_DIR'] = os.environ['HDF5_DIR']+"/lib"
+
+ # Build depending on whether hdf5 is to be used
+ if '+hdf5' in spec:
+ make('with_hdf5')
+ else:
+ make()
+
+ # Build rockstar library
+ make('lib')
+
+ mkdir(join_path(prefix.bin))
+ mkdir(join_path(prefix.lib))
+
+ install('rockstar', join_path(prefix.bin, 'rockstar'))
+ install('librockstar.so', join_path(prefix.lib, 'librockstar.so'))