Skip to content

Commit

Permalink
Remove makefiles. (#5513)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivialfis committed Apr 11, 2020
1 parent 093e222 commit a3db79d
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 338 deletions.
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -65,7 +65,6 @@ nb-configuration*
.pydevproject
.settings/
build
config.mk
/xgboost
*.data
build_plugin
Expand Down
113 changes: 1 addition & 112 deletions Makefile
@@ -1,11 +1,3 @@
ifndef config
ifneq ("$(wildcard ./config.mk)","")
config = config.mk
else
config = make/config.mk
endif
endif

ifndef DMLC_CORE
DMLC_CORE = dmlc-core
endif
Expand All @@ -30,16 +22,6 @@ ifndef MAKE_OK
endif
$(warning MAKE [$(MAKE)] - $(if $(MAKE_OK),checked OK,PROBLEM))

ifeq ($(OS), Windows_NT)
UNAME="Windows"
else
UNAME=$(shell uname)
endif

include $(config)
ifeq ($(USE_OPENMP), 0)
export NO_OPENMP = 1
endif
include $(DMLC_CORE)/make/dmlc.mk

# set compiler defaults for OSX versus *nix
Expand All @@ -62,75 +44,21 @@ export CXX = g++
endif
endif

export LDFLAGS= -pthread -lm $(ADD_LDFLAGS) $(DMLC_LDFLAGS)
export CFLAGS= -DDMLC_LOG_CUSTOMIZE=1 -std=c++11 -Wall -Wno-unknown-pragmas -Iinclude $(ADD_CFLAGS)
CFLAGS += -I$(DMLC_CORE)/include -I$(RABIT)/include -I$(GTEST_PATH)/include
#java include path
export JAVAINCFLAGS = -I${JAVA_HOME}/include -I./java

ifeq ($(TEST_COVER), 1)
CFLAGS += -g -O0 -fprofile-arcs -ftest-coverage
else
CFLAGS += -O3 -funroll-loops
ifeq ($(USE_SSE), 1)
CFLAGS += -msse2
endif
endif

ifndef LINT_LANG
LINT_LANG= "all"
endif

ifeq ($(UNAME), Windows)
XGBOOST_DYLIB = lib/xgboost.dll
JAVAINCFLAGS += -I${JAVA_HOME}/include/win32
else
ifeq ($(UNAME), Darwin)
XGBOOST_DYLIB = lib/libxgboost.dylib
CFLAGS += -fPIC
else
XGBOOST_DYLIB = lib/libxgboost.so
CFLAGS += -fPIC
endif
endif

ifeq ($(UNAME), Linux)
LDFLAGS += -lrt
JAVAINCFLAGS += -I${JAVA_HOME}/include/linux
endif

ifeq ($(UNAME), Darwin)
JAVAINCFLAGS += -I${JAVA_HOME}/include/darwin
endif

OPENMP_FLAGS =
ifeq ($(USE_OPENMP), 1)
OPENMP_FLAGS = -fopenmp
else
OPENMP_FLAGS = -DDISABLE_OPENMP
endif
CFLAGS += $(OPENMP_FLAGS)

# specify tensor path
.PHONY: clean all lint clean_all doxygen rcpplint pypack Rpack Rbuild Rcheck java pylint

all: lib/libxgboost.a $(XGBOOST_DYLIB) xgboost

$(DMLC_CORE)/libdmlc.a: $(wildcard $(DMLC_CORE)/src/*.cc $(DMLC_CORE)/src/*/*.cc)
+ cd $(DMLC_CORE); "$(MAKE)" libdmlc.a config=$(ROOTDIR)/$(config); cd $(ROOTDIR)

$(RABIT)/lib/$(LIB_RABIT): $(wildcard $(RABIT)/src/*.cc)
+ cd $(RABIT); "$(MAKE)" lib/$(LIB_RABIT) USE_SSE=$(USE_SSE); cd $(ROOTDIR)

jvm: jvm-packages/lib/libxgboost4j.so

SRC = $(wildcard src/*.cc src/*/*.cc)
ALL_OBJ = $(patsubst src/%.cc, build/%.o, $(SRC))
AMALGA_OBJ = amalgamation/xgboost-all0.o
LIB_DEP = $(DMLC_CORE)/libdmlc.a $(RABIT)/lib/$(LIB_RABIT)
ALL_DEP = $(filter-out build/cli_main.o, $(ALL_OBJ)) $(LIB_DEP)
CLI_OBJ = build/cli_main.o
include tests/cpp/xgboost_test.mk
.PHONY: clean all lint clean_all doxygen rcpplint pypack Rpack Rbuild Rcheck

build/%.o: src/%.cc
@mkdir -p $(@D)
Expand All @@ -141,27 +69,6 @@ build/%.o: src/%.cc
amalgamation/xgboost-all0.o: amalgamation/xgboost-all0.cc
$(CXX) -c $(CFLAGS) $< -o $@

# Equivalent to lib/libxgboost_all.so
lib/libxgboost_all.so: $(AMALGA_OBJ) $(LIB_DEP)
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.o %.a, $^) $(LDFLAGS)

lib/libxgboost.a: $(ALL_DEP)
@mkdir -p $(@D)
ar crv $@ $(filter %.o, $?)

lib/xgboost.dll lib/libxgboost.so lib/libxgboost.dylib: $(ALL_DEP)
@mkdir -p $(@D)
$(CXX) $(CFLAGS) -shared -o $@ $(filter %.o %a, $^) $(LDFLAGS)

jvm-packages/lib/libxgboost4j.so: jvm-packages/xgboost4j/src/native/xgboost4j.cpp $(ALL_DEP)
@mkdir -p $(@D)
$(CXX) $(CFLAGS) $(JAVAINCFLAGS) -shared -o $@ $(filter %.cpp %.o %.a, $^) $(LDFLAGS)


xgboost: $(CLI_OBJ) $(ALL_DEP)
$(CXX) $(CFLAGS) -o $@ $(filter %.o %.a, $^) $(LDFLAGS)

rcpplint:
python3 dmlc-core/scripts/lint.py xgboost ${LINT_LANG} R-package/src

Expand All @@ -172,16 +79,6 @@ lint: rcpplint
python-package/xgboost/src --pylint-rc ${PWD}/python-package/.pylintrc xgboost \
${LINT_LANG} include src python-package

pylint:
flake8 --ignore E501 python-package
flake8 --ignore E501 tests/python

test: $(ALL_TEST)
$(ALL_TEST)

check: test
./tests/cpp/xgboost_test

ifeq ($(TEST_COVER), 1)
cover: check
@- $(foreach COV_OBJ, $(COVER_OBJ), \
Expand All @@ -202,14 +99,6 @@ clean_all: clean
cd $(DMLC_CORE); "$(MAKE)" clean; cd $(ROOTDIR)
cd $(RABIT); "$(MAKE)" clean; cd $(ROOTDIR)

doxygen:
doxygen doc/Doxyfile

# create standalone python tar file.
pypack: ${XGBOOST_DYLIB}
cp ${XGBOOST_DYLIB} python-package/xgboost/lib
cd python-package; tar cf xgboost.tar xgboost; cd ..

# create pip source dist (sdist) pack for PyPI
pippack: clean_all
cd python-package; python setup.py sdist; mv dist/*.tar.gz ..; cd ..
Expand Down
6 changes: 5 additions & 1 deletion demo/distributed-training/README.md
Expand Up @@ -8,7 +8,11 @@ if you are interested in contributing.
Build XGBoost with Distributed Filesystem Support
-------------------------------------------------
To use distributed xgboost, you only need to turn the options on to build
with distributed filesystems(HDFS or S3) in ```xgboost/make/config.mk```.
with distributed filesystems(HDFS or S3) in cmake.

```
cmake <path/to/xgboost> -DUSE_HDFS=ON -DUSE_S3=ON -DUSE_AZURE=ON
```


Step by Step Tutorial on AWS
Expand Down
25 changes: 2 additions & 23 deletions doc/build.rst
Expand Up @@ -173,27 +173,6 @@ This specifies an out of source build using the Visual Studio 64 bit generator.

After the build process successfully ends, you will find a ``xgboost.dll`` library file inside ``./lib/`` folder.

Compile XGBoost using MinGW
---------------------------
After installing `Git for Windows <https://git-for-windows.github.io/>`_, you should have a shortcut named ``Git Bash``. You should run all subsequent steps in ``Git Bash``.

In MinGW, ``make`` command comes with the name ``mingw32-make``. You can add the following line into the ``.bashrc`` file:

.. code-block:: bash
alias make='mingw32-make'
(On 64-bit Windows, you should get `MinGW64 <https://sourceforge.net/projects/mingw-w64/>`_ instead.) Make sure
that the path to MinGW is in the system PATH.

To build with MinGW, type:

.. code-block:: bash
cp make/mingw64.mk config.mk; make -j4
See :ref:`mingw_python` for buildilng XGBoost for Python.

.. _build_gpu_support:

Building with GPU support
Expand Down Expand Up @@ -252,8 +231,8 @@ To speed up compilation, run multiple jobs in parallel by appending option ``--
Makefiles
=========

It's only used for submitting R CRAN package and creating shorthands for running linters,
performing packaging tasks etc. So the remaining makefiles are legacy.
It's only used for creating shorthands for running linters, performing packaging tasks
etc. So the remaining makefiles are legacy.

Python Package Installation
===========================
Expand Down
67 changes: 0 additions & 67 deletions make/config.mk

This file was deleted.

27 changes: 0 additions & 27 deletions make/mingw64.mk

This file was deleted.

22 changes: 0 additions & 22 deletions make/minimum.mk

This file was deleted.

23 changes: 0 additions & 23 deletions make/minimum_parallel.mk

This file was deleted.

30 changes: 0 additions & 30 deletions make/travis.mk

This file was deleted.

0 comments on commit a3db79d

Please sign in to comment.