Permalink
Browse files

tweak launch to adapt to more machines

  • Loading branch information...
1 parent 8963682 commit 00ef9cee320302db360ed30bb650d56003268c0e @mtravers mtravers committed Feb 23, 2012
Showing with 30 additions and 2 deletions.
  1. +30 −2 setup/launch
View
@@ -1,6 +1,34 @@
#!/bin/sh
-# based on ccl/scripts/ccl64, which is too stupid to figure out where it is being run from
+# based on ccl/scripts/ccl64, which is too stupid to figure out where it is being run from or whether it is 32/64 bit
export CCL_DEFAULT_DIRECTORY=$PWD/ccl
-OPENMCL_KERNEL=lx86cl64
+
+if [ -z "$OPENMCL_KERNEL" ]; then
+ case `uname -s` in
+ Darwin)
+ case `arch` in
+ i386)
+ OPENMCL_KERNEL=dx86cl ;;
+ x86_64)
+ OPENMCL_KERNEL=dx86cl64 ;;
+ esac
+ ;;
+ Linux)
+ case `uname -m` in
+ x86_64)
+ OPENMCL_KERNEL=lx86cl64 ;;
+ *86*)
+ OPENMCL_KERNEL=lx86cl ;;
+ *)
+ echo "Can't determine machine architecture. Fix this."
+ exit 1
+ ;;
+ esac ;;
+ *)
+ echo "Can't determine host OS. Fix this."
+ exit 1
+ ;;
+ esac
+fi
+
exec ${CCL_DEFAULT_DIRECTORY}/${OPENMCL_KERNEL} "$@"

0 comments on commit 00ef9ce

Please sign in to comment.