diff options
-rw-r--r-- | README.md | 22 | ||||
-rwxr-xr-x | bootstrap-cpp.sh | 34 |
2 files changed, 41 insertions, 15 deletions
diff --git a/README.md b/README.md index 7c71edec6d8..5988bad6787 100644 --- a/README.md +++ b/README.md @@ -34,21 +34,13 @@ Java modules can be built on any environment having Java and Maven: mvn install ### Build C++ modules -`<builddir>` should be replaced with the name of the directory in which you'd like to build Vespa. `<sourcedir>` should be replaced with the directory in which you've cloned/unpacked the source tree. - - source /opt/rh/devtoolset-6/enable - sh bootstrap.sh full - mkdir <builddir> - cd <builddir> - cmake3 -DCMAKE_INSTALL_PREFIX=/opt/vespa \ - -DJAVA_HOME=/usr/lib/jvm/java-openjdk \ - -DEXTRA_LINK_DIRECTORY="/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm3.9/lib" \ - -DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-boost/include;/opt/vespa-libtorrent/include;/opt/vespa-zookeeper-c-client/include;/opt/vespa-cppunit/include;/usr/include/llvm3.9" \ - -DCMAKE_INSTALL_RPATH="/opt/vespa/lib64;/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/include/llvm3.9" \ - -DCMAKE_BUILD_RPATH=/opt/vespa/lib64 \ - <sourcedir> - make - ctest3 +Replace `<build-dir>` with the name of the directory in which you'd like to build Vespa. +Replace `<source-dir>` with the directory in which you've cloned/unpacked the source tree. + + sh bootstrap-cpp.sh <source-dir> <build-dir> + cd <build-dir> + make -j <num-threads> + ctest3 -j <num-threads> ### Create RPM packages sh dist.sh VERSION && rpmbuild -ba ~/rpmbuild/SPECS/vespa-VERSION.spec diff --git a/bootstrap-cpp.sh b/bootstrap-cpp.sh new file mode 100755 index 00000000000..9edac9c5602 --- /dev/null +++ b/bootstrap-cpp.sh @@ -0,0 +1,34 @@ +#!/bin/bash -e +# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +usage() { + echo "Usage: $0 <source-dir> <build-dir>" >&2 +} + +if [ $# -eq 2 ]; then + SOURCE_DIR=$1 + BUILD_DIR=$2 +elif [[ $# -eq 1 && ( "$1" = "-h" || "$1" = "--help" )]]; then + usage + exit 0 +else + echo "Wrong number of arguments: expected 2, was $#" >&2 + usage + exit 1 +fi + +mkdir -p "${BUILD_DIR}" + +source /opt/rh/devtoolset-6/enable || true +cd "${SOURCE_DIR}" +sh ./bootstrap.sh full +cd "${BUILD_DIR}" +cmake3 \ + -DCMAKE_INSTALL_PREFIX=/opt/vespa \ + -DJAVA_HOME=/usr/lib/jvm/java-openjdk \ + -DEXTRA_LINK_DIRECTORY="/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib64/llvm3.9/lib" \ + -DEXTRA_INCLUDE_DIRECTORY="/opt/vespa-boost/include;/opt/vespa-libtorrent/include;/opt/vespa-zookeeper-c-client/include;/opt/vespa-cppunit/include;/usr/include/llvm3.9" \ + -DCMAKE_INSTALL_RPATH="/opt/vespa/lib64;/opt/vespa-boost/lib;/opt/vespa-libtorrent/lib;/opt/vespa-zookeeper-c-client/lib;/opt/vespa-cppunit/lib;/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server;/usr/include/llvm3.9" \ + -DCMAKE_BUILD_RPATH=/opt/vespa/lib64 \ + -DVALGRIND_UNIT_TESTS=no \ + "${SOURCE_DIR}" |