Installation Guide
October 9, 2017 ยท View on GitHub
Home | Installation Guide | User Guide | Command Line Reference | Developer Guide
Installation Guide
This page describes how to obtain GRNBoost on different operating systems.
1 Download Pre-built Artifacts
TODO
2 Build GRNBoost from Source
Building GRNBoost from source requires additional software, make sure you have these installed on your system.
- Git for checking out the code bases from their Github repository.
- SBT for building GRNBoost from source.
- Maven for building the xgboost Java bindings.
- A C++ compiler.
Linux (Ubuntu)
On Ubuntu or Debian, using the classic apt-get routine is the best option.
-
Git: https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-14-04
sudo apt-get update sudo apt-get install git -
SBT: http://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html
$ echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list $ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823 $ sudo apt-get update $ sudo apt-get install sbt -
Maven: https://www.mkyong.com/maven/how-to-install-maven-in-ubuntu/
$ sudo apt-get update $ sudo apt-get install maven
MacOS
On Mac, we recommend the handy Homebrew package manager. Other installation options are available, please refer to the software packages' documentation for more info.
-
Git: https://git-scm.com/book/en/v1/Getting-Started-Installing-Git#Installing-on-Mac
$ brew install git -
SBT: http://www.scala-sbt.org/0.13/docs/Installing-sbt-on-Mac.html
$ brew install sbt -
Maven: http://brewformulas.org/Maven
$ brew install maven -
GCC: https://gcc.gnu.org/
$ brew install gcc --without-multilib
2.1 Build xgboost
GRNBoost depends upon xgboost, so we build this first. Xgboost is essentially a C++ library with Java, Scala, R and Python wrappers. We first compile the C++ core component and then build and install the Java components using Maven.
The following instructions contains excerpts from the xgboost build guide:
-
Using git, clone the xgboost Github repository (recursively! -- we need the sub-projects as well) :
$ git clone --recursive https://github.com/dmlc/xgboost -
Go the xgboost directory and build the xgboost C++ components:
-
Linux (Ubuntu)
$ cd xgboost $ make -j4 -
MacOS
$ cd xgboost $ ./build.sh
-
-
Go to the
xgboost/jvm-packagesdirectory and build the Java components using Maven.$ cd jvm-packages $ mvn -DskipTests install -
Maven installs .jar artifacts in the local Maven repository, typically found at
~/.m2/. Check whether you can find thexgboost4j-0.7.jarartifact.$ ls ~/.m2/repository/ml/dmlc/xgboost4j/0.7/You should see something like:
$ _remote.repositories xgboost4j-0.7-jar-with-dependencies.jar xgboost4j-0.7-sources.jar xgboost4j-0.7.jar xgboost4j-0.7.pom
2.2 Build GRNBoost
Now we installed xgboost4j-0.7.jar into our local Maven repository, we can proceed to building GRNBoost.
Note: unless breaking changes are introduced, GRNBoost should work with higher versions than 0.7 in the future.
-
Clone the GRNBoost repository:
$ git clone https://github.com/aertslab/GRNBoost/ -
Go to the GRNBoost directory and build it using SBT:
$ cd GRNBoost $ sbt assembly -
We're done! Find the
GRNBoost.jarartifact in thetargetdirectory.$ ls target/scala-2.11/ # you should see: $ classes GRNBoost.jar
3 Troubleshooting
3.1 Compiling on MacOS
Compiling the xgboost C++ components can be a tricky affair (especially on MacOS). As a GRNBoost user, you will typically launch GRNBoost Spark jobs on a linux machine. If you are a developer and want to be able to test things on a Mac, for example launch unit tests using xgboost from an IDE, you may want (or need) to suffer through compiling xgboost on MacOS. Following are some notes that helped troubleshoot compilation on MacOS.
-
Problems installing XGBoost with multithreaded support on Mac OS:
-
issue 1: making xgboost requires gcc-6
- https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_on_Mac_OSX?lang=en
- uncomment and fix the 2 lines in the
make/config.mkfile as described in the blog post above
-
issue 2: the default compiler is clang, which doesn't have openmp support needed for xgboost
- remedy:
brew install gcc --without-multilib
- remedy:
-
issue 3: the above doesn't work, error message:
Last 15 lines from /Users/tmo/Library/Logs/Homebrew/gcc/01.configure: checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking for libatomic support... yes checking for libcilkrts support... yes checking for libitm support... yes checking for libsanitizer support... yes checking for libvtv support... no checking for libmpx support... no checking for gcc... clang checking for C compiler default output file name... configure: error: in `/private/tmp/gcc-20170217-49092-1n2yfeq/gcc-6.3.0/build': configure: error: C compiler cannot create executables See `config.log' for more details. READ THIS: http://docs.brew.sh/Troubleshooting.html These open issues may also help: gcc: unable to complete the make process https://github.com/Homebrew/homebrew-core/issues/4883 `brew upgrade gcc` takes over 10 hours on 2014 MBP, core i5 https://github.com/Homebrew/homebrew-core/issues/8796Start Xcode, select 'Preferences', then 'Locations'. You'll notice a dropdown control at 'Command Line Tools'. Select the newest version, close the dialog window, then call brew again.
-
issue 4: installation can take a LONG time!
-
brew complains about manually (un)linking stuff: do as instructed
-
-
check gcc installations:
dhcp-10-33-234-169:xgboost tmo$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin15.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin dhcp-10-33-234-169:xgboost tmo$ gcc-6 --version gcc-6 (Homebrew GCC 6.3.0_1 --without-multilib) 6.3.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dhcp-10-33-234-169:xgboost tmo$ g++-6 --version g++-6 (Homebrew GCC 6.3.0_1 --without-multilib) 6.3.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -
solution:
config.mk
# choice of compiler, by default use system preference. # !!! uncommented and adapted following 2 lines !!! # See: https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_on_Mac_OSX?lang=en export CC = gcc-6 export CXX = g++-6 # export MPICXX = mpicxx # export LDFLAGS = -pthread -lm -mmacosx-version-min=10.9 # the additional link flags you want to add ADD_LDFLAGS =- then clean and make again:
make clean_all make -j4 cd jvm-packages/ mvn clean mvn -DskipTests intall