From a3db79df22ace13b26e8514ce018cb9c1ad33214 Mon Sep 17 00:00:00 2001 From: Jiaming Yuan Date: Sat, 11 Apr 2020 13:25:53 +0800 Subject: [PATCH] Remove makefiles. (#5513) --- .gitignore | 1 - Makefile | 113 +--------------------------- demo/distributed-training/README.md | 6 +- doc/build.rst | 25 +----- make/config.mk | 67 ----------------- make/mingw64.mk | 27 ------- make/minimum.mk | 22 ------ make/minimum_parallel.mk | 23 ------ make/travis.mk | 30 -------- tests/ci_build/runxgb.sh | 2 - tests/cpp/xgboost_test.mk | 30 -------- 11 files changed, 8 insertions(+), 338 deletions(-) delete mode 100644 make/config.mk delete mode 100644 make/mingw64.mk delete mode 100644 make/minimum.mk delete mode 100644 make/minimum_parallel.mk delete mode 100644 make/travis.mk delete mode 100644 tests/cpp/xgboost_test.mk diff --git a/.gitignore b/.gitignore index ae9e9ec573c7..6470d40cf0c1 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,6 @@ nb-configuration* .pydevproject .settings/ build -config.mk /xgboost *.data build_plugin diff --git a/Makefile b/Makefile index 80a3e30be3a3..a49d30777ec7 100644 --- a/Makefile +++ b/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 @@ -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 @@ -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) @@ -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 @@ -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), \ @@ -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 .. diff --git a/demo/distributed-training/README.md b/demo/distributed-training/README.md index 43709021ff08..7a7a019c78b0 100644 --- a/demo/distributed-training/README.md +++ b/demo/distributed-training/README.md @@ -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 -DUSE_HDFS=ON -DUSE_S3=ON -DUSE_AZURE=ON +``` Step by Step Tutorial on AWS diff --git a/doc/build.rst b/doc/build.rst index 21141eb667c3..ec075272690c 100644 --- a/doc/build.rst +++ b/doc/build.rst @@ -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 `_, 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 `_ 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 @@ -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 =========================== diff --git a/make/config.mk b/make/config.mk deleted file mode 100644 index bf10e1b824bc..000000000000 --- a/make/config.mk +++ /dev/null @@ -1,67 +0,0 @@ -#----------------------------------------------------- -# xgboost: the configuration compile script -# -# If you want to change the configuration, please use the following -# steps. Assume you are on the root directory of xgboost. -# First copy this file so that any local changes will be ignored by git -# -# $ cp make/config.mk . -# -# Next modify the according entries in the copied file and then compile by -# -# $ make -# -# or build in parallel with 8 threads -# -# $ make -j8 -#---------------------------------------------------- - -# choice of compiler, by default use system preference. -# export CC = gcc -# export CXX = g++ -# export MPICXX = mpicxx - -# the additional link flags you want to add -ADD_LDFLAGS = - -# the additional compile flags you want to add -ADD_CFLAGS = - -# Whether enable openmp support, needed for multi-threading. -USE_OPENMP = 1 - -# whether use HDFS support during compile -USE_HDFS = 0 - -# whether use AWS S3 support during compile -USE_S3 = 0 - -# whether use Azure blob support during compile -USE_AZURE = 0 - -#---------------------------- -# Settings for power and arm arch -#---------------------------- -ARCH := $(shell uname -a) -ifneq (,$(filter $(ARCH), armv6l armv7l powerpc64le ppc64le aarch64)) - USE_SSE=0 -else - USE_SSE=1 -endif - -# Rabit library version, -# - librabit.a Normal distributed version. -# - librabit_empty.a Non distributed mock version, -LIB_RABIT = librabit.a - -# path to libjvm.so -LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server - -# whether to test with coverage measurement or not. (only used for `make cover`) -# measured with gcov and html report generated with lcov if it is installed. -# this disables optimization to ensure coverage information is correct -TEST_COVER = 0 - -# path to gtest library (only used when $BUILD_TEST=1) -# there should be an include path in $GTEST_PATH/include and library in $GTEST_PATH/lib -GTEST_PATH ?= diff --git a/make/mingw64.mk b/make/mingw64.mk deleted file mode 100644 index 966f4e3a489b..000000000000 --- a/make/mingw64.mk +++ /dev/null @@ -1,27 +0,0 @@ -#----------------------------------------------------------- -# xgboost: Configuration for MinGW(Windows 64bit) -# This allows to compile xgboost on windows by using mingw. -# You will need to get install an mingw toolchain. -# g++-4.6 or later is required. -# -# see config.mk for template. -#----------------------------------------------------------- -export CXX=g++ -m64 -export CC=gcc -m64 - -# Whether enable openmp support, needed for multi-threading. -USE_OPENMP = 1 - -# whether use HDFS support during compile -USE_HDFS = 0 - -# whether use AWS S3 support during compile -USE_S3 = 0 - -# whether use Azure blob support during compile -USE_AZURE = 0 - -# Rabit library version, -# - librabit.a Normal distributed version. -# - librabit_empty.a Non distributed mock version, -LIB_RABIT = librabit_empty.a diff --git a/make/minimum.mk b/make/minimum.mk deleted file mode 100644 index f9bef57bddbc..000000000000 --- a/make/minimum.mk +++ /dev/null @@ -1,22 +0,0 @@ -#----------------------------------------------------- -# xgboost: minumum dependency configuration, -# see config.mk for template. -#---------------------------------------------------- - -# Whether enable openmp support, needed for multi-threading. -USE_OPENMP = 0 - -# whether use HDFS support during compile -USE_HDFS = 0 - -# whether use AWS S3 support during compile -USE_S3 = 0 - -# whether use Azure blob support during compile -USE_AZURE = 0 - -# Rabit library version, -# - librabit.a Normal distributed version. -# - librabit_empty.a Non distributed mock version, -LIB_RABIT = librabit_empty.a - diff --git a/make/minimum_parallel.mk b/make/minimum_parallel.mk deleted file mode 100644 index c41158aaf01d..000000000000 --- a/make/minimum_parallel.mk +++ /dev/null @@ -1,23 +0,0 @@ -#------------------------------------------------------------------------ -# xgboost: minumum dependency configuration with Parallelization. -# This configuration is standard but cannot run distributed computing. -# -# see config.mk for template. -#------------------------------------------------------------------------ - -# Whether enable openmp support, needed for multi-threading. -USE_OPENMP = 1 - -# whether use HDFS support during compile -USE_HDFS = 0 - -# whether use AWS S3 support during compile -USE_S3 = 0 - -# whether use Azure blob support during compile -USE_AZURE = 0 - -# Rabit library version, -# - librabit.a Normal distributed version. -# - librabit_empty.a Non distributed mock version, -LIB_RABIT = librabit_empty.a diff --git a/make/travis.mk b/make/travis.mk deleted file mode 100644 index a32da2bd52f9..000000000000 --- a/make/travis.mk +++ /dev/null @@ -1,30 +0,0 @@ - -# the additional link flags you want to add -ADD_LDFLAGS = - -# the additional compile flags you want to add -ADD_CFLAGS = - -# Whether enable openmp support, needed for multi-threading. -USE_OPENMP = 1 - -# whether use HDFS support during compile -USE_HDFS = 0 - -# whether use AWS S3 support during compile -USE_S3 = 0 - -# whether use Azure blob support during compile -USE_AZURE = 0 - -# Rabit library version, -# - librabit.a Normal distributed version. -# - librabit_empty.a Non distributed mock version, -LIB_RABIT = librabit.a - -# path to libjvm.so -LIBJVM=$(JAVA_HOME)/jre/lib/amd64/server - -# path to googletest and whether to measure coverage or not -GTEST_PATH = -WITH_COVER = 1 diff --git a/tests/ci_build/runxgb.sh b/tests/ci_build/runxgb.sh index 2ed450dfa1ed..60a9cc68f66a 100755 --- a/tests/ci_build/runxgb.sh +++ b/tests/ci_build/runxgb.sh @@ -1,7 +1,5 @@ #!/bin/bash -#run make in rabit/test to generate librabit_mock -#update config.mk and build xgboost using mock export DMLC_SUBMIT_CLUSTER=local submit="python3 dmlc-core/tracker/dmlc-submit" diff --git a/tests/cpp/xgboost_test.mk b/tests/cpp/xgboost_test.mk deleted file mode 100644 index 2276ca6faac6..000000000000 --- a/tests/cpp/xgboost_test.mk +++ /dev/null @@ -1,30 +0,0 @@ -UTEST_ROOT=tests/cpp -UTEST_OBJ_ROOT=build_$(UTEST_ROOT) -UNITTEST=$(UTEST_ROOT)/xgboost_test - -UNITTEST_SRC=$(wildcard $(UTEST_ROOT)/*.cc $(UTEST_ROOT)/*/*.cc) -UNITTEST_OBJ=$(patsubst $(UTEST_ROOT)%.cc, $(UTEST_OBJ_ROOT)%.o, $(UNITTEST_SRC)) - -GTEST_LIB=$(GTEST_PATH)/lib/ -GTEST_INC=$(GTEST_PATH)/include/ - -UNITTEST_CFLAGS=$(CFLAGS) -UNITTEST_LDFLAGS=$(LDFLAGS) -L$(GTEST_LIB) -lgtest -UNITTEST_DEPS=lib/libxgboost.a $(DMLC_CORE)/libdmlc.a $(RABIT)/lib/$(LIB_RABIT) - -COVER_OBJ=$(patsubst %.o, %.gcda, $(ALL_OBJ)) $(patsubst %.o, %.gcda, $(UNITTEST_OBJ)) - -$(UTEST_OBJ_ROOT)/$(GTEST_PATH)/%.o: $(GTEST_PATH)/%.cc - @mkdir -p $(@D) - $(CXX) $(UNITTEST_CFLAGS) -I$(GTEST_INC) -I$(GTEST_PATH) -o $@ -c $< - -$(UTEST_OBJ_ROOT)/%.o: $(UTEST_ROOT)/%.cc - @mkdir -p $(@D) - $(CXX) $(UNITTEST_CFLAGS) -I$(GTEST_INC) -o $@ -c $< - -$(UNITTEST): $(UNITTEST_OBJ) $(UNITTEST_DEPS) - $(CXX) $(UNITTEST_CFLAGS) -o $@ $^ $(UNITTEST_LDFLAGS) - - -ALL_TEST=$(UNITTEST) -ALL_TEST_OBJ=$(UNITTEST_OBJ)