Merge pull request #418 from dmlc/travis
Travis OSX support and unfinished appveyor
This commit is contained in:
commit
ebdcd94bf5
6
Makefile
6
Makefile
@ -11,6 +11,12 @@ ifeq ($(OS), Windows_NT)
|
|||||||
export CC = gcc -m64
|
export CC = gcc -m64
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
UNAME= $(shell uname)
|
||||||
|
|
||||||
|
ifeq ($(UNAME), Linux)
|
||||||
|
LDFLAGS += -lrt
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(no_omp),1)
|
ifeq ($(no_omp),1)
|
||||||
CFLAGS += -DDISABLE_OPENMP
|
CFLAGS += -DDISABLE_OPENMP
|
||||||
else
|
else
|
||||||
|
|||||||
35
appveyor.yml
Normal file
35
appveyor.yml
Normal 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
|
||||||
@ -5,7 +5,9 @@ if [ ${TRAVIS_OS_NAME} != "osx" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
brew update
|
brew update
|
||||||
brew install unzip
|
|
||||||
brew install python-numpy
|
if [ ${TASK} == "python-package" ]; then
|
||||||
brew install python-scipy
|
brew install python git
|
||||||
brew install python-nose
|
easy_install pip
|
||||||
|
pip install numpy scipy nose
|
||||||
|
fi
|
||||||
|
|||||||
@ -7,8 +7,9 @@ if [ ${TASK} == "lint" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${TRAVIS_OS_NAME} != "osx" ]; then
|
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
|
||||||
export no_omp=1
|
export no_omp=1
|
||||||
|
export NO_OPENMP=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ${TASK} == "build" ]; then
|
if [ ${TASK} == "build" ]; then
|
||||||
@ -18,7 +19,11 @@ fi
|
|||||||
if [ ${TASK} == "build-with-dmlc" ]; then
|
if [ ${TASK} == "build-with-dmlc" ]; then
|
||||||
cd dmlc-core
|
cd dmlc-core
|
||||||
cp make/config.mk .
|
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
|
make all CXX=${CXX}|| exit -1
|
||||||
cd ..
|
cd ..
|
||||||
make dmlc=dmlc-core CXX=${CXX} || exit -1
|
make dmlc=dmlc-core CXX=${CXX} || exit -1
|
||||||
@ -33,7 +38,10 @@ if [ ${TASK} == "python-package" ]; then
|
|||||||
nosetests tests/python || exit -1
|
nosetests tests/python || exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# only test java under linux for now
|
||||||
if [ ${TASK} == "java-package" ]; then
|
if [ ${TASK} == "java-package" ]; then
|
||||||
make java CXX=${CXX} || exit -1
|
if [ ${TRAVIS_OS_NAME} != "osx" ]; then
|
||||||
scripts/travis_java_script.sh || exit -1
|
make java CXX=${CXX} || exit -1
|
||||||
|
scripts/travis_java_script.sh || exit -1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -7,10 +7,10 @@
|
|||||||
#ifndef XGBOOST_UTILS_OMP_H_
|
#ifndef XGBOOST_UTILS_OMP_H_
|
||||||
#define XGBOOST_UTILS_OMP_H_
|
#define XGBOOST_UTILS_OMP_H_
|
||||||
|
|
||||||
#if defined(_OPENMP)
|
#if defined(_OPENMP) && !defined(DISABLE_OPENMP)
|
||||||
#include <omp.h>
|
#include <omp.h>
|
||||||
#else
|
#else
|
||||||
#ifndef DISABLE_OPENMP
|
#if !defined(DISABLE_OPENMP)
|
||||||
// use pragma message instead of warning
|
// use pragma message instead of warning
|
||||||
#pragma message("Warning: OpenMP is not available,"\
|
#pragma message("Warning: OpenMP is not available,"\
|
||||||
"xgboost will be compiled into single-thread code."\
|
"xgboost will be compiled into single-thread code."\
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user