forked from gregreen/galstar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source reorganized, product renamed to galstar
- Loading branch information
Showing
12 changed files
with
387 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Files that will not show up in git status listings | ||
# | ||
*.[oa] | ||
*~ | ||
# For Joe editor lovers | ||
DEADJOE | ||
# For SM users | ||
.smhist | ||
# staging subdirectory | ||
/staging | ||
# Other stuff | ||
workspace/* | ||
# CMake build system directories/files | ||
/Makefile | ||
/optimized | ||
/debug | ||
/build | ||
/.cpackignore | ||
/.version | ||
/.version.fn | ||
/Debug | ||
/Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
galstar | ||
======= | ||
|
||
Setup and Build | ||
=============== | ||
|
||
./configure --with-libpeyton=../libpeyton/optimized --optimized --prefix=`pwd`/staging | ||
make -j install | ||
|
||
This will configure and build an optimized version of galstar in | ||
./optimized and install it in directory ./staging linking against | ||
an optimized version of libpeyton from ../libpeyton/optimized | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
#!/bin/bash | ||
# | ||
# A configure stub for people used to that syntax | ||
# Do ./configure --help for usage instructions | ||
# | ||
|
||
usage() | ||
{ | ||
tee -a $CONFIGLOG <<-EOF | ||
Configure and prepare the source code for building. | ||
Usage: | ||
$0 [flags] [CMAKE_VAR1=VALUE [CMAKE_VAR2=VALUE2 [...]]] | ||
Available flags: | ||
--prefix=<prefix> # will install the code into <prefix> | ||
--optimized # configure the 'Release' build | ||
--debug # configure the 'Debug' build | ||
--env=<VAR=VALUE> # set VAR=VALUE environment variable | ||
# before running CMAKE | ||
--with-gcc=<gcc_root> # use gcc from <gcc_root> directory | ||
--with-cuda=<cuda_root> # use CUDA toolkit from <cuda_root> | ||
--with-boost=<boost_root> # use boost from <boost_root> directory | ||
--with-libpeyton=<lp_root> # use libpeyton from <lp_root> directory | ||
--devemu # target CUDA code for device emulation | ||
If ran from the top level source directory, it will configure the build | ||
directory in build/optimized/debug (depending on whether --optimized or | ||
--debug flags were present), as well as generate a simple Makefile to | ||
allowing the user to build the code directly from the top-level directory. | ||
Otherwise, it will configure the source in the current directory (assuming | ||
it's meant to be the build directory). | ||
This build system uses CMake. If your CMake executable is in | ||
nonstandard location, you may specify it via the CMAKE environment | ||
variable. | ||
Written by Mario Juric <[email protected]> | ||
EOF | ||
} | ||
|
||
xecho() | ||
{ | ||
echo "== $@" | tee -a $CONFIGLOG | ||
} | ||
|
||
oecho() | ||
{ | ||
echo "** $@" >> $CONFIGLOG | ||
} | ||
|
||
configlog() | ||
{ | ||
CONFIGLOG_FINAL="$CONFIGLOG" | ||
CONFIGLOG="$CONFIGLOG.tmp" | ||
cat > $CONFIGLOG <<-EOF | ||
This file contains any messages produced by CMake while | ||
running configure, to aid debugging if configure makes a mistake. | ||
It was created by configure, an Autoconf-like script for CMake | ||
written by Mario Juric <[email protected]>. Invocation command line | ||
was: | ||
\$ $0 $@ | ||
## --------- ## | ||
## Platform. ## | ||
## --------- ## | ||
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` | ||
uname -m = `(uname -m) 2>/dev/null || echo unknown` | ||
uname -r = `(uname -r) 2>/dev/null || echo unknown` | ||
uname -s = `(uname -s) 2>/dev/null || echo unknown` | ||
uname -v = `(uname -v) 2>/dev/null || echo unknown` | ||
CMAKE = $CMAKE | ||
which \$CMAKE = `(which "$CMAKE") 2>/dev/null || echo not found` | ||
\$CMAKE --version = `("$CMAKE" --version) 2>/dev/null || echo not found` | ||
## ------------------ ## | ||
## Configuration log. ## | ||
## ------------------ ## | ||
EOF | ||
# If CONFIGLOG_FINAL is defined, move $CONFIGLOG to $CONFIGLOG_FINAL (and delete $CONFIGLOG) | ||
# In case you're wondering, CONFIGLOG_FINAL becomes undefined if --help was given on the command line | ||
trap "{ test \"x\$CONFIGLOG_FINAL\" != x && mv '$CONFIGLOG' '$CONFIGLOG_FINAL'; rm -f '$CONFIGLOG'; }" EXIT | ||
} | ||
|
||
# Defaults | ||
CMAKE=${CMAKE:-cmake} | ||
ENV=${env} | ||
|
||
# Store invocation information | ||
CONFIGLOG="`pwd`/config.log" | ||
configlog "$@" | ||
|
||
# Quick check for CMake | ||
which $CMAKE 2>&1 > /dev/null || { | ||
CML=`dirname $0`"/CMakeLists.txt" | ||
xecho "No usable CMake found (tried looking for executable \`$CMAKE')" | ||
test -f "$CML" && { | ||
CMV=`grep -i cmake_minimum_required "$CML" | perl -e '$_=<>; ($v) = /^cmake_minimum_required\s*\(\s*version\s+([0-9.]+)\s*\)/i; print $v'`; | ||
test "x$CMV" != "x" && xecho "CMake $CMV or greater is needed to build this code."; | ||
} || { | ||
xecho "CMake is needed to build this code."; | ||
} | ||
xecho "If your CMake executable is in nonstandard location, you may specify" | ||
xecho "it via the CMAKE environment variable." | ||
exit -1; | ||
} | ||
|
||
BUILDDIR='build' | ||
|
||
# | ||
# Project-specific command-line argument parsing | ||
# | ||
TEMP=`getopt -o hp: -l help,prefix:,debug,optimized,devemu,env:,with-gcc:,with-cuda:,with-boost:,with-libpeyton: -- "$@"` || { xecho "Try $0 --help"; exit $?; } | ||
eval set -- "$TEMP" | ||
while true ; do | ||
case "$1" in | ||
-p|--prefix) | ||
xecho "Setting install path to '$2'" | ||
CMAKE="$CMAKE -DCMAKE_INSTALL_PREFIX='$2'" | ||
shift 2 ;; | ||
--env) | ||
xecho "Setting environment variable '$2'" | ||
ENV="$ENV '$2'" | ||
shift 2 ;; | ||
--devemu) | ||
xecho "Targeting CUDA code for device emulation" | ||
CMAKE="$CMAKE -DCUDA_BUILD_EMULATION=ON" | ||
shift 1 ;; | ||
--debug) | ||
xecho "Setting build type to 'Debug'" | ||
BUILDDIR='debug' | ||
CMAKE="$CMAKE -DCMAKE_BUILD_TYPE='Debug'" | ||
shift 1 ;; | ||
--optimized) | ||
xecho "Setting build type to 'Release'" | ||
BUILDDIR='optimized' | ||
CMAKE="$CMAKE -DCMAKE_BUILD_TYPE='Release'" | ||
shift 1 ;; | ||
--with-boost) | ||
xecho "Using Boost from '$2'" | ||
CMAKE="$CMAKE -DBOOST_ROOT='$2'" | ||
shift 2 ;; | ||
--with-cuda) | ||
xecho "Using CUDA Toolkit from '$2'" | ||
CMAKE="$CMAKE -DCUDA_TOOLKIT_ROOT_DIR='$2'" | ||
shift 2 ;; | ||
--with-gcc) | ||
xecho "Using gcc suite from '$2'" | ||
CMAKE="$CMAKE -DCMAKE_CXX_COMPILER='$2/bin/g++'" | ||
CMAKE="$CMAKE -DCMAKE_C_COMPILER='$2/bin/gcc'" | ||
CMAKE="$CMAKE -DGCC_ROOT='$2'" | ||
ENV="$ENV LDFLAGS='-L$2/lib -L$2/lib64'" | ||
shift 2 ;; | ||
--with-libpeyton) | ||
xecho "Using libpeyton from '$2'" | ||
CMAKE="$CMAKE -Dlibpeyton_ROOT='$2'" | ||
shift 2 ;; | ||
-h|--help) | ||
usage; | ||
CONFIGLOG_FINAL= | ||
exit 0 ;; | ||
--) shift ; break ;; | ||
*) xecho "Internal error!" ; exit 1 ;; | ||
esac | ||
done | ||
|
||
# Figure out the build dir -- if we're in the same directory as the | ||
# configure script, make a subdirectory based on the choice of BUILD_TYPE | ||
test -x ./configure && { | ||
mkdir -p "$BUILDDIR" && cd "$BUILDDIR" && SOURCEDIR=".." || { | ||
xecho "Error creating build directory."; exit -1; | ||
} | ||
|
||
# A flag meaning we're configuring from in-source | ||
BDSET=1 | ||
|
||
xecho "Build directory is '$BUILDDIR'" | ||
} || { | ||
BUILDDIR="." | ||
SOURCEDIR=`dirname $0` | ||
} | ||
|
||
# Assume all extra arguments are CMAKE variable definitions | ||
for arg do | ||
CMAKE="$CMAKE '-D$arg'" | ||
done | ||
CMAKE="$CMAKE $SOURCEDIR" | ||
|
||
# Delete old CMakeCache.txt if it exists | ||
test -f CMakeCache.txt && rm -f CMakeCache.txt | ||
|
||
# Run cmake | ||
xecho "Invoking CMake to configure the source" | ||
oecho "$ENV $CMAKE" | ||
eval $ENV $CMAKE | tee -a $CONFIGLOG; | ||
test "x${PIPESTATUS[0]}" == "x0" && { | ||
if [ "$BDSET" == "1" ]; then | ||
# Generate a stub makefile that will hand-off compilation to the real makefile | ||
# This happens only when configure is run in-source | ||
cat > ../Makefile <<EOT | ||
all: | ||
tidy: | ||
@ rm -rf $BUILDDIR | ||
%: | ||
@ test -f $BUILDDIR/Makefile || { echo "$BUILDDIR directory not configured. Run configure first." && false; } | ||
@ cd $BUILDDIR && \$(MAKE) \$@ | ||
EOT | ||
fi; | ||
xecho "Source configured in directory '$BUILDDIR'. Run \`make' to compile." | ||
} || { | ||
xecho "Error configuring source." | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
../scripts/plotpdf.py prob_ArMr.txt A_r M_r prob_ArMr.png | ||
../scripts/plotpdf.py prob_MrFeH.txt M_r "[Fe/H]" prob_MrFeH.png | ||
../scripts/plotpdf.py prob_DMAr.txt DM "A_r" prob_DMAr.png |
Oops, something went wrong.