From d069f34cb5537ad44e14c20f44c95cac785db2bc Mon Sep 17 00:00:00 2001 From: fis Date: Wed, 1 Apr 2020 18:08:35 +0800 Subject: [PATCH 1/2] Update dmlc-core. --- dmlc-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmlc-core b/dmlc-core index 552f7de748fb..981b1c32f916 160000 --- a/dmlc-core +++ b/dmlc-core @@ -1 +1 @@ -Subproject commit 552f7de748fbff34f2708b03f930a47ded45d78e +Subproject commit 981b1c32f91668e669ee376856f92f36cfd2a351 From 50c7761c9a0f1c14f4d6f34602129c069bcd6383 Mon Sep 17 00:00:00 2001 From: fis Date: Wed, 1 Apr 2020 19:07:28 +0800 Subject: [PATCH 2/2] Port dmlc travis script to XGBoost. --- .travis.yml | 4 +-- tests/travis/travis_before_cache.sh | 3 +++ tests/travis/travis_setup_env.sh | 40 +++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100755 tests/travis/travis_before_cache.sh create mode 100644 tests/travis/travis_setup_env.sh diff --git a/.travis.yml b/.travis.yml index e51e4a03f9da..8b1f82732398 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ addons: update: true before_install: - - source dmlc-core/scripts/travis/travis_setup_env.sh + - source tests/travis/travis_setup_env.sh - if [ "${TASK}" != "python_sdist_test" ]; then export PYTHONPATH=${PYTHONPATH}:${PWD}/python-package; fi - echo "MAVEN_OPTS='-Xmx2g -XX:MaxPermSize=1024m -XX:ReservedCodeCacheSize=512m -Dorg.slf4j.simpleLogger.defaultLogLevel=error'" > ~/.mavenrc @@ -60,7 +60,7 @@ cache: - ${HOME}/.cache/pip before_cache: - - dmlc-core/scripts/travis/travis_before_cache.sh + - tests/travis/travis_before_cache.sh after_failure: - tests/travis/travis_after_failure.sh diff --git a/tests/travis/travis_before_cache.sh b/tests/travis/travis_before_cache.sh new file mode 100755 index 000000000000..6789ae08ef43 --- /dev/null +++ b/tests/travis/travis_before_cache.sh @@ -0,0 +1,3 @@ +#!/bin/bash +# do nothing for now +ls -alLR ${CACHE_PREFIX} \ No newline at end of file diff --git a/tests/travis/travis_setup_env.sh b/tests/travis/travis_setup_env.sh new file mode 100644 index 000000000000..7f4af313e138 --- /dev/null +++ b/tests/travis/travis_setup_env.sh @@ -0,0 +1,40 @@ +# script to be sourced in travis yml +# setup all enviroment variables + +export CACHE_PREFIX=${HOME}/.cache/usr +export PATH=${HOME}/.local/bin:${PATH} +export PATH=${PATH}:${CACHE_PREFIX}/bin +export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:${CACHE_PREFIX}/include +export C_INCLUDE_PATH=${C_INCLUDE_PATH}:${CACHE_PREFIX}/include +export LIBRARY_PATH=${LIBRARY_PATH}:${CACHE_PREFIX}/lib +export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CACHE_PREFIX}/lib +export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${CACHE_PREFIX}/lib + +alias make="make -j4" + +# setup the cache prefix folder +if [ ! -d ${HOME}/.cache ]; then + mkdir ${HOME}/.cache +fi + +if [ ! -d ${CACHE_PREFIX} ]; then + mkdir ${CACHE_PREFIX} +fi +if [ ! -d ${CACHE_PREFIX}/include ]; then + mkdir ${CACHE_PREFIX}/include +fi +if [ ! -d ${CACHE_PREFIX}/lib ]; then + mkdir ${CACHE_PREFIX}/lib +fi +if [ ! -d ${CACHE_PREFIX}/bin ]; then + mkdir ${CACHE_PREFIX}/bin +fi + +# setup CUDA path if NVCC_PREFIX exists +if [ ! -z "$NVCC_PREFIX" ]; then + export PATH=${PATH}:${NVCC_PREFIX}/usr/local/cuda-7.5/bin + export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}:${NVCC_PREFIX}/usr/local/cuda-7.5/include + export C_INCLUDE_PATH=${C_INCLUDE_PATH}:${NVCC_PREFIX}/usr/local/cuda-7.5/include + export LIBRARY_PATH=${LIBRARY_PATH}:${NVCC_PREFIX}/usr/local/cuda-7.5/lib64:${NVCC_PREFIX}/usr/lib/x86_64-linux-gnu + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NVCC_PREFIX}/usr/local/cuda-7.5/lib64:${NVCC_PREFIX}/usr/lib/x86_64-linux-gnu +fi