]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
do_cmake.sh: Add CEPH_GIT_DIR 30863/head
authorMatthew Oliver <moliver@suse.com>
Fri, 25 Oct 2019 05:20:22 +0000 (05:20 +0000)
committerMatthew Oliver <moliver@suse.com>
Mon, 4 Nov 2019 00:30:09 +0000 (00:30 +0000)
This patch adds a new env variables that users can set to define the
location of the checked out ceph git repo.

The documentation mentions having to go edit the script directly to
point to the ceph git directory if the build dir isn't in the
top directory of the checked out git repo. This patch changes the '..'
into an env variable, CEPH_GIT_DIR, that defaults to '..'. To make it
easy to script and change.

This allows someone to do things like:

 export CEPH_GIT_DIR=~/git/ceph
 ./do_cmake.sh

or

 CEPH_GIT_DIR=~/git/ceph ./do_cmake.sh

Which is much better then editing the script directly.
The README.md has been modified to mention this variable and also
includes a drive by to mention `make -j` for new contributors to
build ceph quicker.

Signed-off-by: Matthew Oliver <moliver@suse.com>
README.md
do_cmake.sh

index 2db7458450ea4ed6e5e404d62cd8047c8778f1cd..fd66a06f3815aa9d19d05a83bc0cccac7bf5b497 100644 (file)
--- a/README.md
+++ b/README.md
@@ -61,13 +61,17 @@ Build instructions:
 
 (Note: do_cmake.sh now defaults to creating a debug build of ceph that can
 be up to 5x slower with some workloads. Please pass 
-"-DCMAKE_BUILD_TYPE=RelWithDebInfo" to do_cmake.sh to create a non-debug 
+"-DCMAKE_BUILD_TYPE=RelWithDebInfo" to do_cmake.sh to create a non-debug
 release.)
 
+(Note: `make` alone will use only one CPU thread, this could take a while. use
+the `-j` option to use more threads. Something like `make -j$(nproc)` would be
+a good start.
+
 This assumes you make your build dir a subdirectory of the ceph.git
-checkout. If you put it elsewhere, just replace `..` in do_cmake.sh with a
-correct path to the checkout. Any additional CMake args can be specified
-setting ARGS before invoking do_cmake. See [cmake options](#cmake-options) 
+checkout. If you put it elsewhere, just point `CEPH_GIT_DIR`to the correct
+path to the checkout. Any additional CMake args can be specified setting ARGS
+before invoking do_cmake. See [cmake options](#cmake-options)
 for more details. Eg.
 
     ARGS="-DCMAKE_C_COMPILER=gcc-7" ./do_cmake.sh
index ad5d41f330c8c8d096eed93739111974cf89c6e9..931a5ee0a368dab7fb8e45aad70685b6a0431df7 100755 (executable)
@@ -3,7 +3,8 @@ set -x
 
 git submodule update --init --recursive
 
-[ -z "$BUILD_DIR" ] && BUILD_DIR=build
+: ${BUILD_DIR:=build}
+: ${CEPH_GIT_DIR:=..}
 
 if [ -e $BUILD_DIR ]; then
     echo "'$BUILD_DIR' dir already exists; either rm -rf '$BUILD_DIR' and re-run, or set BUILD_DIR env var to a different directory name"
@@ -54,7 +55,7 @@ if type cmake3 > /dev/null 2>&1 ; then
 else
     CMAKE=cmake
 fi
-${CMAKE} $ARGS "$@" .. || exit 1
+${CMAKE} $ARGS "$@" $CEPH_GIT_DIR || exit 1
 set +x
 
 # minimal config to find plugins