Merge pull request #418 from dmlc/travis

Travis OSX support and unfinished appveyor
This commit is contained in:
Tianqi Chen 2015-07-29 22:36:24 -07:00
commit ebdcd94bf5
5 changed files with 61 additions and 10 deletions

View File

@ -11,6 +11,12 @@ ifeq ($(OS), Windows_NT)
export CC = gcc -m64
endif
UNAME= $(shell uname)
ifeq ($(UNAME), Linux)
LDFLAGS += -lrt
endif
ifeq ($(no_omp),1)
CFLAGS += -DDISABLE_OPENMP
else

35
appveyor.yml Normal file
View File

@ -0,0 +1,35 @@
environment:
global:
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\python-appveyor-demo\\appveyor\\run_with_env.cmd"
DISABLE_OPENMP: 1
matrix:
- PYTHON: "C:\\Python27-x64"
PYTHON_VERSION: "2.7.x" # currently 2.7.9
PYTHON_ARCH: "64"
- PYTHON: "C:\\Python33-x64"
PYTHON_VERSION: "3.3.x" # currently 3.3.5
PYTHON_ARCH: "64"
platform:
- x64
configuration:
- Release
install:
- cmd: git clone https://github.com/ogrisel/python-appveyor-demo
- ECHO "Filesystem root:"
- ps: "ls \"C:/\""
- ECHO "Installed SDKs:"
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""
- ps: python-appveyor-demo\appveyor\install.ps1
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "python --version"
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
build:
project: windows\xgboost.sln

View File

@ -5,7 +5,9 @@ if [ ${TRAVIS_OS_NAME} != "osx" ]; then
fi
brew update
brew install unzip
brew install python-numpy
brew install python-scipy
brew install python-nose
if [ ${TASK} == "python-package" ]; then
brew install python git
easy_install pip
pip install numpy scipy nose
fi

View File

@ -7,8 +7,9 @@ if [ ${TASK} == "lint" ]; then
fi
fi
if [ ${TRAVIS_OS_NAME} != "osx" ]; then
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
export no_omp=1
export NO_OPENMP=1
fi
if [ ${TASK} == "build" ]; then
@ -18,7 +19,11 @@ fi
if [ ${TASK} == "build-with-dmlc" ]; then
cd dmlc-core
cp make/config.mk .
echo "USE_S3=1" >> config.mk
if [ ${TRAVIS_OS_NAME} != "osx" ]; then
echo "USE_S3=1" >> config.mk
else
echo "USE_S3=0" >> config.mk
fi
make all CXX=${CXX}|| exit -1
cd ..
make dmlc=dmlc-core CXX=${CXX} || exit -1
@ -33,7 +38,10 @@ if [ ${TASK} == "python-package" ]; then
nosetests tests/python || exit -1
fi
# only test java under linux for now
if [ ${TASK} == "java-package" ]; then
make java CXX=${CXX} || exit -1
scripts/travis_java_script.sh || exit -1
if [ ${TRAVIS_OS_NAME} != "osx" ]; then
make java CXX=${CXX} || exit -1
scripts/travis_java_script.sh || exit -1
fi
fi

View File

@ -7,10 +7,10 @@
#ifndef XGBOOST_UTILS_OMP_H_
#define XGBOOST_UTILS_OMP_H_
#if defined(_OPENMP)
#if defined(_OPENMP) && !defined(DISABLE_OPENMP)
#include <omp.h>
#else
#ifndef DISABLE_OPENMP
#if !defined(DISABLE_OPENMP)
// use pragma message instead of warning
#pragma message("Warning: OpenMP is not available,"\
"xgboost will be compiled into single-thread code."\