Skip to content

Commit

Permalink
Tweak build script
Browse files Browse the repository at this point in the history
- add TEST_GPU environment variable to control unittest with gpu
- strip symbol on linux
  • Loading branch information
Jay Gu committed Apr 8, 2016
1 parent 8d05c0b commit 7c32721
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
##########

Expand Down Expand Up @@ -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 "====================================="
}
Expand Down Expand Up @@ -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

0 comments on commit 7c32721

Please sign in to comment.