summaryrefslogtreecommitdiff
path: root/setup_environment
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2012-07-24 11:18:38 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:47:34 -0700
commit00406ce229d75dea2034ad285b4941d071552d4d (patch)
tree116f08b996d671f2ef720b4b8c50d50ed2fa799f /setup_environment
parent8260e72a7acd58f7eb83baead00c1ce92d59a497 (diff)
additional checking for setup_environment...
attempting to get GPGPU-Sim to run on MacOSX again (no joy) [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 13509]
Diffstat (limited to 'setup_environment')
-rw-r--r--setup_environment20
1 files changed, 18 insertions, 2 deletions
diff --git a/setup_environment b/setup_environment
index ff089dc..0e2fe1c 100644
--- a/setup_environment
+++ b/setup_environment
@@ -9,6 +9,11 @@ if [ ! -d "$CUDA_INSTALL_PATH" ]; then
return;
fi
+# for MacOS X
+if [ `uname` = "Darwin" ]; then
+ echo "Detected MacOS X platform..."
+fi
+
# to run the debug build of GPGPU-Sim run:
# source setup_environment debug
if [ $# == '1' ] ;
@@ -40,7 +45,11 @@ fi
# native CUDA and OpenCL applications. GPGPU-Sim is dynamically linked
# against instead of the CUDA toolkit. This replaces this cumbersome
# static link setup in prior GPGPU-Sim releases.
-export LD_LIBRARY_PATH=`echo $LD_LIBRARY_PATH | sed -re 's/.*gpgpu_sim.*(release|debug)://'`
+if [ `uname` = "Darwin" ]; then
+ export LD_LIBRARY_PATH=`echo $LD_LIBRARY_PATH | sed -Ee 's/.*gpgpu_sim.*(release|debug)://'`
+else
+ export LD_LIBRARY_PATH=`echo $LD_LIBRARY_PATH | sed -re 's/.*gpgpu_sim.*(release|debug)://'`
+fi
export LD_LIBRARY_PATH=$GPGPUSIM_ROOT/lib/$GPGPUSIM_CONFIG:$LD_LIBRARY_PATH
export PATH=`echo $PATH | sed "s#$GPGPUSIM_ROOT/bin:$CUDA_INSTALL_PATH/bin:##"`
export PATH=$GPGPUSIM_ROOT/bin:$CUDA_INSTALL_PATH/bin:$PATH
@@ -59,7 +68,12 @@ fi
# SSH to remote node to generate PTX for OpenCL kernels when running on
# a node that does not have an NVIDIA driver installed.
# The remote node should have GPGPU-Sim installed at the same path
-HOSTNAME_DOMAIN=`hostname -d`
+if [ `uname` = "Darwin" ]; then
+ HOSTNAME_PREFIX=`hostname -s`;
+ export HOSTNAME_DOMAIN=`hostname | sed s/$HOSTNAME_PREFIX\.//`;
+else
+ HOSTNAME_DOMAIN=`hostname -d`
+fi
if [ "x$HOSTNAME_DOMAIN" == "xece.ubc.ca" -a "$OPENCL_REMOTE_GPU_HOST" == "" ]; then
export OPENCL_REMOTE_GPU_HOST=aamodt-pc05.ece.ubc.ca
fi
@@ -67,3 +81,5 @@ HOSTNAME_F=`hostname -f`
if [ "x$HOSTNAME_F" == "x$OPENCL_REMOTE_GPU_HOST" ]; then
unset OPENCL_REMOTE_GPU_HOST
fi
+
+export GPGPUSIM_SETUP_ENVIRONMENT_WAS_RUN=1