This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 6db10a4  [KUDU-1344] Part 1: cmake install for executables
6db10a4 is described below

commit 6db10a4b99e498e2927e5844cb20f6f996938d93
Author: Greg Solovyev <[email protected]>
AuthorDate: Thu Mar 21 16:53:48 2019 -0700

    [KUDU-1344] Part 1: cmake install for executables
    
    This change adds cmake install commands for
    kudu, kudu-tserver and kudu-master executables.
    
    Running 'sudo make install' installs the following:
     - kudu-tserver and kudu-master executables in /usr/local/sbin
     - Kudu client executable in /usr/local/bin
     - Kudu client library in /usr/local/lib64
     - Kudu client headers in /usr/local/include/kudu
    
    This change also adds 3 cmake flags (ON by default):
     - KUDU_CLIENT_INSTALL
     - KUDU_TSERVER_INSTALL
     - KUDU_MASTER_INSTALL
    
    setting these flags to OFF directs cmake to skip
    corresponding install commands.
    
    Update documentation to reflect these changes.
    
    Change-Id: Ic020941343efc9192bf615c0c8a30b3d9eee91d7
    Reviewed-on: http://gerrit.cloudera.org:8080/12847
    Reviewed-by: Grant Henke <[email protected]>
    Tested-by: Grant Henke <[email protected]>
---
 docs/installation.adoc          | 155 ++++++++++++++++++++++++++++------------
 src/kudu/master/CMakeLists.txt  |  12 +++-
 src/kudu/tools/CMakeLists.txt   |   6 ++
 src/kudu/tserver/CMakeLists.txt |   7 ++
 4 files changed, 133 insertions(+), 47 deletions(-)

diff --git a/docs/installation.adoc b/docs/installation.adoc
index d61f69c..8149ad3 100644
--- a/docs/installation.adoc
+++ b/docs/installation.adoc
@@ -44,7 +44,8 @@ only tolerate a single failure; two-master deployments cannot 
tolerate any failu
 
 .Operating System Requirements
 Linux::
-    - RHEL 6, RHEL 7, CentOS 6, CentOS 7, Ubuntu 14.04 (Trusty), Ubuntu 16.04 
(Xenial), Debian 8 (Jessie), or SLES 12.
+    - RHEL 6, RHEL 7, CentOS 6, CentOS 7, Ubuntu 14.04 (Trusty), Ubuntu 16.04 
(Xenial), Debian 8
+    (Jessie), or SLES 12.
     - A kernel and filesystem that support _hole punching_. Hole punching is 
the use of the
       `fallocate(2)` system call with the `FALLOC_FL_PUNCH_HOLE` option set. 
See
       link:troubleshooting.html#req_hole_punching[troubleshooting hole 
punching] for more
@@ -137,29 +138,51 @@ mkdir -p build/release
 cd build/release
 ../../build-support/enable_devtoolset.sh \
   ../../thirdparty/installed/common/bin/cmake \
-  -DCMAKE_BUILD_TYPE=release \
-  ../..
+  -DCMAKE_BUILD_TYPE=release ../..
 make -j4
 ----
++
+[NOTE]
+====
+If you need to install only a subset of Kudu executables, you can set the 
following `cmake` flags
+to OFF in order to skip any of the executables.
+
+* KUDU_CLIENT_INSTALL (set to OFF to skip installing `/usr/local/bin/kudu` 
executable)
+* KUDU_TSERVER_INSTALL (set to OFF to skip installing 
`/usr/local/sbin/kudu-tserver` executable)
+* KUDU_MASTER_INSTALL (set to OFF to skip installing 
`/usr/local/sbin/kudu-master` executable)
+
+E.g., use the following variation of `cmake` command if you need to install 
only Kudu client
+libraries and headers:
+[source,bash]
+----
+../../build-support/enable_devtoolset.sh \
+  ../../thirdparty/installed/common/bin/cmake \
+  -DKUDU_CLIENT_INSTALL=OFF \
+  -DKUDU_MASTER_INSTALL=OFF \
+  -DKUDU_TSERVER_INSTALL=OFF
+  -DCMAKE_BUILD_TYPE=release ../..
+----
+====
+. Optional: install Kudu executables, libraries and headers.
++
+[NOTE]
+====
+Running `sudo make install` installs the following:
 
-. Optional: Install Kudu client libraries and headers.
-If you do not specify an installation directory through the `DESTDIR`
-environment variable, `/usr/local/` is the default.
+* kudu-tserver and kudu-master executables in `/usr/local/sbin`
+* Kudu command line tool in `/usr/local/bin`
+* Kudu client library in `/usr/local/lib64/`
+* Kudu client headers in `/usr/local/include/kudu`
+====
++
+The default installation directory is `/usr/local`. You can customize it 
through the `DESTDIR`
+environment variable.
 +
 [source,bash]
 ----
 sudo make DESTDIR=/opt/kudu install
 ----
-NOTE: 'make install' does not copy Kudu binaries. You need to manually copy 
them
-as below:
-* Copy the `kudu-tserver`, `kudu-master`, and `kudu` binaries from within the 
`bin`
-subdirectory of your Kudu build directory.
-* We typically recommend putting `kudu` in the bin directory (e.g. `/usr/bin`)
-and the server binaries in the sbin directory (e.g. `/usr/sbin`).
-* However, if you use the default installation directory without specifying the
-`DESTDIR` environment variable, `make install` will install files into 
`/usr/local`,
-so you should copy the Kudu binaries to `/usr/local/bin` and `/usr/local/sbin`
-respectively.
++
 . Optional: Build the documentation. NOTE: This command builds local 
documentation that
 is not appropriate for uploading to the Kudu website.
 +
@@ -243,25 +266,46 @@ cd build/release
 ../../thirdparty/installed/common/bin/cmake -DCMAKE_BUILD_TYPE=release ../..
 make -j4
 ----
++
+[NOTE]
+====
+If you need to install only a subset of Kudu executables, you can set the 
following `cmake` flags
+to OFF in order to skip any of the executables.
+
+* KUDU_CLIENT_INSTALL (set to OFF to skip installing `/usr/local/bin/kudu` 
executable)
+* KUDU_TSERVER_INSTALL (set to OFF to skip installing 
`/usr/local/sbin/kudu-tserver` executable)
+* KUDU_MASTER_INSTALL (set to OFF to skip installing 
`/usr/local/sbin/kudu-master` executable)
 
-. Optional: Install Kudu client libraries and headers.
-If you do not specify an installation directory through the `DESTDIR`
-environment variable, `/usr/local/` is the default.
+E.g., use the following variation of `cmake` command if you need to install 
only Kudu client
+libraries and headers:
+[source,bash]
+----
+  ../../thirdparty/installed/common/bin/cmake \
+  -DKUDU_CLIENT_INSTALL=OFF \
+  -DKUDU_MASTER_INSTALL=OFF \
+  -DKUDU_TSERVER_INSTALL=OFF
+  -DCMAKE_BUILD_TYPE=release ../..
+----
+====
+. Optional: install Kudu executables, libraries and headers.
++
+[NOTE]
+====
+Running `sudo make install` installs the following:
+
+* kudu-tserver and kudu-master executables in `/usr/local/sbin`
+* Kudu command line tool in `/usr/local/bin`
+* Kudu client library in `/usr/local/lib64/`
+* Kudu client headers in `/usr/local/include/kudu`
+====
++
+The default installation directory is `/usr/local`. You can customize it 
through the `DESTDIR`
+environment variable.
 +
 [source,bash]
 ----
 sudo make DESTDIR=/opt/kudu install
 ----
-NOTE: 'make install' does not copy Kudu binaries. You need to manually copy 
them
-as below:
-* Copy the `kudu-tserver`, `kudu-master`, and `kudu` binaries from within the 
`bin`
-subdirectory of your Kudu build directory.
-* We typically recommend putting `kudu` in the bin directory (e.g. `/usr/bin`)
-and the server binaries in the sbin directory (e.g. `/usr/sbin`).
-* However, if you use the default installation directory without specifying the
-`DESTDIR` environment variable, `make install` will install files into 
`/usr/local`,
-so you should copy the Kudu binaries to `/usr/local/bin` and `/usr/local/sbin`
-respectively.
 
 . Optional: Build the documentation. NOTE: This command builds local 
documentation that
 is not appropriate for uploading to the Kudu website.
@@ -290,8 +334,7 @@ thirdparty/build-if-necessary.sh
 mkdir -p build/release
 cd build/release
 ../../thirdparty/installed/common/bin/cmake \
-  -DCMAKE_BUILD_TYPE=release \
-  ../..
+  -DCMAKE_BUILD_TYPE=release ../..
 make -j4
 ----
 ====
@@ -332,29 +375,49 @@ except for the `kudu` directory itself.
 mkdir -p build/release
 cd build/release
 ../../thirdparty/installed/common/bin/cmake \
-  -DCMAKE_BUILD_TYPE=release \
-  ../..
+  -DCMAKE_BUILD_TYPE=release ../..
 make -j4
 ----
++
+[NOTE]
+====
+If you need to install only a subset of Kudu executables, you can set the 
following `cmake` flags
+to OFF in order to skip any of the executables.
 
-. Optional: Install Kudu client libraries and headers.
-If you do not specify an installation directory through the `DESTDIR`
-environment variable, `/usr/local/` is the default.
+* KUDU_CLIENT_INSTALL (set to OFF to skip installing `/usr/local/bin/kudu` 
executable)
+* KUDU_TSERVER_INSTALL (set to OFF to skip installing 
`/usr/local/sbin/kudu-tserver` executable)
+* KUDU_MASTER_INSTALL (set to OFF to skip installing 
`/usr/local/sbin/kudu-master` executable)
+
+E.g., use the following variation of `cmake` command if you need to install 
only Kudu client
+libraries and headers:
+[source,bash]
+----
+  ../../thirdparty/installed/common/bin/cmake \
+  -DKUDU_CLIENT_INSTALL=OFF \
+  -DKUDU_TSERVER_INSTALL=OFF \
+  -DKUDU_MASTER_INSTALL=OFF
+  -DCMAKE_BUILD_TYPE=release ../..
+----
+====
+. Optional: install Kudu executables, libraries and headers.
++
+[NOTE]
+====
+Running `sudo make install` installs the following:
+
+* kudu-tserver and kudu-master executables in `/usr/local/sbin`
+* Kudu command line tool in `/usr/local/bin`
+* Kudu client library in `/usr/local/lib64/`
+* Kudu client headers in `/usr/local/include/kudu`
+====
++
+The default installation directory is `/usr/local`. You can customize it 
through the `DESTDIR`
+environment variable.
 +
 [source,bash]
 ----
 sudo make DESTDIR=/opt/kudu install
 ----
-NOTE: 'make install' does not copy Kudu binaries. You need to manually copy 
them
-as below:
-* Copy the `kudu-tserver`, `kudu-master`, and `kudu` binaries from within the 
`bin`
-subdirectory of your Kudu build directory.
-* We typically recommend putting `kudu` in the bin directory (e.g. `/usr/bin`)
-and the server binaries in the sbin directory (e.g. `/usr/sbin`).
-* However, if you use the default installation directory without specifying the
-`DESTDIR` environment variable, `make install` will install files into 
`/usr/local`,
-so you should copy the Kudu binaries to `/usr/local/bin` and `/usr/local/sbin`
-respectively.
 
 .SLES Build Script
 ====
diff --git a/src/kudu/master/CMakeLists.txt b/src/kudu/master/CMakeLists.txt
index ba68439..6409499 100644
--- a/src/kudu/master/CMakeLists.txt
+++ b/src/kudu/master/CMakeLists.txt
@@ -90,10 +90,20 @@ ADD_KUDU_TEST(sentry_authz_provider-test)
 ADD_KUDU_TEST(sys_catalog-test RESOURCE_LOCK "master-web-port")
 ADD_KUDU_TEST(ts_descriptor-test DATA_FILES ../scripts/first_argument.sh)
 
-# Actual master executable
+#########################################
+# kudu-master
+#########################################
+
 add_executable(kudu-master master_main.cc)
 target_link_libraries(kudu-master
   ${SANITIZER_OPTIONS_OVERRIDE}
   ${KRB5_REALM_OVERRIDE}
   master
   ${KUDU_BASE_LIBS})
+
+option(KUDU_MASTER_INSTALL "Whether to install the Kudu Master executable" ON)
+if(KUDU_MASTER_INSTALL)
+  install(TARGETS kudu-master RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
+else()
+  message(STATUS "Skipping install rule for the Kudu Master executable")
+endif()
diff --git a/src/kudu/tools/CMakeLists.txt b/src/kudu/tools/CMakeLists.txt
index ebe894c..09b058a 100644
--- a/src/kudu/tools/CMakeLists.txt
+++ b/src/kudu/tools/CMakeLists.txt
@@ -140,6 +140,12 @@ target_link_libraries(kudu
   tserver
   ${KUDU_BASE_LIBS}
 )
+option(KUDU_CLIENT_INSTALL "Whether to install the Kudu command line tool" ON)
+if(KUDU_CLIENT_INSTALL)
+  install(TARGETS kudu RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+else()
+  message(STATUS "Skipping install rule for the Kudu command line tool")
+endif()
 
 #######################################
 # kudu_tools_test_util
diff --git a/src/kudu/tserver/CMakeLists.txt b/src/kudu/tserver/CMakeLists.txt
index 810a86d..bcee01a 100644
--- a/src/kudu/tserver/CMakeLists.txt
+++ b/src/kudu/tserver/CMakeLists.txt
@@ -147,6 +147,13 @@ target_link_libraries(kudu-tserver
   tserver
   ${KUDU_BASE_LIBS})
 
+option(KUDU_TSERVER_INSTALL "Whether to install the Kudu Tablet Server 
executable" ON)
+if(KUDU_TSERVER_INSTALL)
+  install(TARGETS kudu-tserver RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
+else()
+  message(STATUS "Skipping install rule for the Kudu Tablet Server executable")
+endif()
+
 #########################################
 # tserver_test_util
 #########################################

Reply via email to