Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Use Ninja for speeding up build
Browse files Browse the repository at this point in the history
  • Loading branch information
hirofumi committed Feb 3, 2018
1 parent 8a10cc6 commit b005097
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ matrix:
osx_image: xcode9.2
env: TASK=test-mac
before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull openjdk:8-jdk ; fi
- if [[ "$TASK" == "test-fedora" ]]; then docker pull fedora:27 ; fi
- if [[ "$TASK" == "test-ubuntu" ]]; then docker pull ubuntu:16.04 ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm '/usr/local/include/c++'; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@7 sbt ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker pull openjdk:8-jdk ; fi
- if [[ "$TASK" == "test-fedora" ]]; then docker pull fedora:27 ; fi
- if [[ "$TASK" == "test-ubuntu" ]]; then docker pull ubuntu:16.04 ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then rm '/usr/local/include/c++' ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gcc@7 ninja sbt; fi
script:
- make "$TASK"
before_cache:
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM openjdk:8-jdk

RUN apt-get update && apt-get -y install cmake g++ libgomp1
RUN apt-get update && apt-get -y install cmake g++ libgomp1 ninja-build

ADD . /root
WORKDIR /root

RUN sed -i -e 's/ \${JAVA_JVM_LIBRARY}//' ./xgboost/CMakeLists.txt
RUN sed -i -e 's/maybe_generator = ""/maybe_generator = " -GNinja"/' xgboost/jvm-packages/create_jni.py

ENV CFLAGS -fvisibility=hidden -static-libgcc
ENV CXXFLAGS -fvisibility=hidden -fvisibility-inlines-hidden -static-libgcc -static-libstdc++
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ $(LIBXGBOOST4J_DYLIB):
cd xgboost/jvm-packages \
&& cat create_jni.py \
| sed -e 's!CONFIG\["USE_OPENMP"\] = "OFF"!CONFIG["USE_OPENMP"] = "ON"!' \
| sed -e 's!maybe_generator = ""!maybe_generator = " -GNinja"!' \
| sed -e 's!join(args)!join(args + ["-DOpenMP_'$(LIBGOMP_A)'_LIBRARY='$(LIBGOMP_A)'"])!' \
> create_jni.py~ \
&& CC=$(CC) CXX=$(CXX) CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS) \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ XGBoost4J with cross-version suffix

* macOS
* Docker for Mac
* Ninja
* `g++-7` (installed by Homebrew, i.e. `brew install gcc`)

### How to Build and Test
Expand Down

0 comments on commit b005097

Please sign in to comment.