From 7c32721e1d54e962d94cc2ccd4f6d9e01227a5e5 Mon Sep 17 00:00:00 2001 From: Jay Gu Date: Thu, 7 Apr 2016 17:11:34 -0700 Subject: [PATCH] Tweak build script - add TEST_GPU environment variable to control unittest with gpu - strip symbol on linux --- scripts/build.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 24b2ee26ca65..f7182b0c9a28 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -3,6 +3,7 @@ ########## # Environment variables: # CUDA_PATH: set to build with cuda at particular location +# TEST_GPU: set to run gpu unittest # BUILD_NUMBER: the build number of the final artifact ########## @@ -83,6 +84,9 @@ fi set -x cp -r python/mxnet ${TARGET_DIR}/python/ cp -r lib/libmxnet.${dll_ext} ${TARGET_DIR}/python/${LIB_NAME}.${dll_ext} +if [[ $OSTYPE == linux* ]]; then + strip -s ${TARGET_DIR}/python/${LIB_NAME}.${dll_ext} +fi set +x echo "=====================================" } @@ -117,19 +121,22 @@ rm -rf ${TARGET_DIR}/*.tar.gz # Cleanup previous build ## clean_target_dir -## Standard build ## -build -unittest -LIB_NAME='libmxnet' -copy_artifact - -## CUDA build ## +## Build ## if [[ ! -z "$CUDA_PATH" ]]; then build_with_cuda - unittest_with_cuda LIB_NAME='libmxnet.cuda' - copy_artifact +else + build + LIB_NAME='libmxnet' +fi + +## Test ## +if [[ ! -z "$TEST_GPU" ]]; then + unittest_with_cuda +else + unittest fi -## Package everything into tarball +## Copy artifacts and package into tar ball ## +copy_artifact package