Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update XGBoost #655

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 19 additions & 38 deletions X/XGBoost/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using BinaryBuilder, Pkg

# Collection of sources required to build Nettle
# Collection of sources required to build XGBoost
name = "XGBoost"
version = v"0.82"
version = v"1.0.2"
sources = [
"https://github.com/dmlc/xgboost.git"=>
"3f83dcd50286d7c8d22e552942bd6572547c32b9",
"./bundled",
GitSource("https://github.com/dmlc/xgboost.git", "917b0a7b46954e9be36cbc430a1727bb093234bb")
]

# Bash recipe for building across all platforms
Expand All @@ -16,64 +14,47 @@ cd ${WORKSPACE}/srcdir/xgboost
git submodule init
git submodule update

# Patch dmlc-core to use case-sensitive windows.h includes
(cd dmlc-core && atomic_patch -p1 "${WORKSPACE}/srcdir/patches/dmlc_windows_h.patch")
#if [[ ${target} == *mingw* ]]; then
# Target Windows specifically
#EXTRA_FLAGS=(UNAME=Windows)
#fi

# Because we're using OpenMP, we must use `gcc`
export CC=gcc
export CXX=g++

# For Linux, build using CMake
if [[ ${target} == *linux* ]]; then
(mkdir build; cd build; cmake .. -DCMAKE_INSTALL_PREFIX=${prefix})
make -C build -j ${nproc}
else
if [[ ${target} == *mingw* ]]; then
# Target Windows specifically
EXTRA_FLAGS=(UNAME=Windows)
fi

# Otherwise, build with `make`, and do a minimal build
cp make/minimum.mk config.mk
make -j ${nproc} USE_OPENMP=1 ${EXTRA_FLAGS[@]}
fi
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_TOOLCHAIN_FILE="${CMAKE_TARGET_TOOLCHAIN}"
make -j ${nproc} USE_OPENMP=0 USE_HDFS=0 USE_S3=0 USE_AZURE=0 LIB_RABIT=librabit_empty.a ${EXTRA_FLAGS[@]}
make install

# Install
mkdir -p ${prefix}/{bin,include,lib}
cp -ra include/xgboost ${prefix}/include/
cp -a xgboost ${prefix}/bin/xgboost${exeext}
#mkdir -p ${prefix}/{bin,include,lib}
#cp -ra include/xgboost ${prefix}/include/
#cp -a xgboost ${prefix}/bin/xgboost${exeext}

# Not every platform has a libxgboost.a
cp -a lib/libxgboost.a ${prefix}/lib || true
#cp -a lib/libxgboost.a ${prefix}/lib || true

# We also need to bundle `libgomp`, so snarf it from the
# compiler support directory while we copy our main bundle of joy
if [[ ${target} == *mingw* ]]; then
cp -a lib/xgboost.dll ${prefix}/bin
cp -a /opt/${target}/${target}/lib*/libgomp*.${dlext} ${prefix}/bin
else
cp -a lib/libxgboost.${dlext} ${prefix}/lib
cp -a /opt/${target}/${target}/lib*/libgomp*.${dlext} ${prefix}/lib
fi
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = expand_cxxstring_abis(supported_platforms())

# Disable FreeBSD for now, because freebsd doesn't have backtrace()
# Disable various platforms that do not build
platforms = [p for p in platforms if !(typeof(p) <: FreeBSD)]
platforms = [p for p in platforms if !(arch(p) == :powerpc64le)]
platforms = [p for p in platforms if !(libc(p) == :musl)]

# The products that we will ensure are always built
products = [
LibraryProduct(["libxgboost", "xgboost"], :libxgboost),
]

# Dependencies that must be installed before this package can be built
dependencies = [
]
dependencies = Dependency[]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)

build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"5")
26 changes: 0 additions & 26 deletions X/XGBoost/bundled/patches/dmlc_windows_h.patch

This file was deleted.