HADOOP-14670. Increase minimum cmake version for all platforms
Signed-off-by: Chris Douglas <cdouglas@apache.org>
This commit is contained in:
parent
ce79f7be29
commit
71bbb86d69
|
@ -7,7 +7,7 @@ Requirements:
|
|||
* JDK 1.8+
|
||||
* Maven 3.3 or later
|
||||
* ProtocolBuffer 2.5.0
|
||||
* CMake 2.6 or newer (if compiling native code), must be 3.0 or newer on Mac
|
||||
* CMake 3.1 or newer (if compiling native code)
|
||||
* Zlib devel (if compiling native code)
|
||||
* openssl devel (if compiling native hadoop-pipes and to get the best HDFS encryption performance)
|
||||
* Linux FUSE (Filesystem in Userspace) version 2.6 or above (if compiling fuse_dfs)
|
||||
|
@ -345,7 +345,7 @@ Requirements:
|
|||
* JDK 1.8+
|
||||
* Maven 3.0 or later
|
||||
* ProtocolBuffer 2.5.0
|
||||
* CMake 2.6 or newer
|
||||
* CMake 3.1 or newer
|
||||
* Windows SDK 7.1 or Visual Studio 2010 Professional
|
||||
* Windows SDK 8.1 (if building CPU rate control for the container executor)
|
||||
* zlib headers (if building native code bindings for zlib)
|
||||
|
|
|
@ -35,7 +35,6 @@ ENV DEBCONF_TERSE true
|
|||
RUN apt-get -q update && apt-get -q install --no-install-recommends -y \
|
||||
build-essential \
|
||||
bzip2 \
|
||||
cmake \
|
||||
curl \
|
||||
doxygen \
|
||||
fuse \
|
||||
|
@ -89,11 +88,22 @@ RUN apt-get -q update && apt-get -q install --no-install-recommends -y ant
|
|||
######
|
||||
RUN mkdir -p /opt/maven && \
|
||||
curl -L -s -S \
|
||||
http://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \
|
||||
https://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \
|
||||
-o /opt/maven.tar.gz && \
|
||||
tar xzf /opt/maven.tar.gz --strip-components 1 -C /opt/maven
|
||||
ENV MAVEN_HOME /opt/maven
|
||||
ENV PATH "$PATH:/opt/maven/bin"
|
||||
ENV PATH "${PATH}:/opt/maven/bin"
|
||||
|
||||
######
|
||||
# Install cmake
|
||||
######
|
||||
RUN mkdir -p /opt/cmake && \
|
||||
curl -L -s -S \
|
||||
https://cmake.org/files/v3.1/cmake-3.1.0-Linux-x86_64.tar.gz \
|
||||
-o /opt/cmake.tar.gz && \
|
||||
tar xzf /opt/cmake.tar.gz --strip-components 1 -C /opt/cmake
|
||||
ENV CMAKE_HOME /opt/cmake
|
||||
ENV PATH "${PATH}:/opt/cmake/bin"
|
||||
|
||||
######
|
||||
# Install findbugs
|
||||
|
@ -104,6 +114,7 @@ RUN mkdir -p /opt/findbugs && \
|
|||
-o /opt/findbugs.tar.gz && \
|
||||
tar xzf /opt/findbugs.tar.gz --strip-components 1 -C /opt/findbugs
|
||||
ENV FINDBUGS_HOME /opt/findbugs
|
||||
ENV PATH "${PATH}:/opt/findbugs/bin"
|
||||
|
||||
####
|
||||
# Install shellcheck
|
||||
|
|
|
@ -117,19 +117,25 @@ macro(hadoop_set_find_shared_library_without_version)
|
|||
endif()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Configuration.
|
||||
#
|
||||
|
||||
# Initialise the shared gcc/g++ flags if they aren't already defined.
|
||||
if(NOT DEFINED GCC_SHARED_FLAGS)
|
||||
set(GCC_SHARED_FLAGS "-g -O2 -Wall -pthread -D_FILE_OFFSET_BITS=64")
|
||||
# set the shared compiler flags
|
||||
# support for GNU C/C++, add other compilers as necessary
|
||||
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
if(NOT DEFINED GCC_SHARED_FLAGS)
|
||||
find_package(Threads REQUIRED)
|
||||
if(CMAKE_USE_PTHREADS_INIT)
|
||||
set(GCC_SHARED_FLAGS "-g -O2 -Wall -pthread -D_FILE_OFFSET_BITS=64")
|
||||
else()
|
||||
set(GCC_SHARED_FLAGS "-g -O2 -Wall -D_FILE_OFFSET_BITS=64")
|
||||
endif()
|
||||
endif()
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
|
||||
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||
set(GCC_SHARED_FLAGS "-g -O2 -Wall -D_FILE_OFFSET_BITS=64")
|
||||
endif()
|
||||
|
||||
# Add in support other compilers here, if necessary,
|
||||
# the assumption is that GCC or a GCC-compatible compiler is being used.
|
||||
|
||||
# Set the shared GCC-compatible compiler and linker flags.
|
||||
# Set the shared linker flags.
|
||||
hadoop_add_compiler_flags("${GCC_SHARED_FLAGS}")
|
||||
hadoop_add_linker_flags("${LINKER_SHARED_FLAGS}")
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
# CMake configuration.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/..)
|
||||
include(HadoopCommon)
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
|
||||
#include "org_apache_hadoop.h"
|
||||
|
||||
#ifndef HADOOP_BZIP2_LIBRARY
|
||||
#define HADOOP_BZIP2_LIBRARY "libbz2.so.1"
|
||||
#endif
|
||||
|
||||
|
||||
/* A helper macro to convert the java 'stream-handle' to a bz_stream pointer. */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
enable_testing()
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
set(CMAKE_SKIP_RPATH TRUE)
|
||||
|
||||
# Flatten a list into a string.
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../libhdfs/include
|
||||
${GENERATED_JAVAH}
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
add_definitions(-DLIBHDFS_DLL_EXPORT)
|
||||
|
||||
include_directories(
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../../../../hadoop-common-project/hadoop-common/)
|
||||
include(HadoopCommon)
|
||||
|
|
|
@ -96,8 +96,6 @@ public class CompileMojo extends AbstractMojo {
|
|||
validatePlatform();
|
||||
runCMake();
|
||||
runMake();
|
||||
runMake(); // The second make is a workaround for HADOOP-9215. It can be
|
||||
// removed when cmake 2.6 is no longer supported.
|
||||
long end = System.nanoTime();
|
||||
getLog().info("cmake compilation finished successfully in " +
|
||||
TimeUnit.MILLISECONDS.convert(end - start, TimeUnit.NANOSECONDS) +
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# limitations under the License.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../../../hadoop-common-project/hadoop-common)
|
||||
include(HadoopCommon)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../../../../../hadoop-common-project/hadoop-common)
|
||||
include(HadoopCommon)
|
||||
|
@ -29,25 +29,7 @@ set(GTEST_SRC_DIR ${CMAKE_SOURCE_DIR}/../../../../../hadoop-common-project/hadoo
|
|||
string(REGEX MATCH . HCD_ONE "${HADOOP_CONF_DIR}")
|
||||
string(COMPARE EQUAL ${HCD_ONE} / HADOOP_CONF_DIR_IS_ABS)
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS "3.1")
|
||||
# subset of CMAKE_<LANG>_COMPILER_ID
|
||||
# https://cmake.org/cmake/help/v3.0/variable/CMAKE_LANG_COMPILER_ID.html
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
|
||||
CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
|
||||
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
|
||||
set (CMAKE_C_FLAGS "-std=c99 -Wall -pedantic-errors ${CMAKE_C_FLAGS}")
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel")
|
||||
set (CMAKE_C_FLAGS "-std=c99 -Wall ${CMAKE_C_FLAGS}")
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "SunPro")
|
||||
set (CMAKE_C_FLAGS "-xc99 ${CMAKE_C_FLAGS}")
|
||||
endif ()
|
||||
else ()
|
||||
set (CMAKE_C_STANDARD 99)
|
||||
endif ()
|
||||
|
||||
# Note: can't use -D_FILE_OFFSET_BITS=64, see MAPREDUCE-4258
|
||||
string(REPLACE "-D_FILE_OFFSET_BITS=64" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
string(REPLACE "-D_FILE_OFFSET_BITS=64" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
set (CMAKE_C_STANDARD 99)
|
||||
|
||||
include(CheckIncludeFiles)
|
||||
check_include_files("sys/types.h;sys/sysctl.h" HAVE_SYS_SYSCTL_H)
|
||||
|
|
|
@ -35,7 +35,9 @@ docker build -t "hadoop-build-${USER_ID}" - <<UserSpecificDocker
|
|||
FROM hadoop-build
|
||||
RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME}
|
||||
RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
|
||||
RUN echo "${USER_NAME}\tALL=NOPASSWD: ALL" > "/etc/sudoers.d/hadoop-build-${USER_ID}"
|
||||
ENV HOME /home/${USER_NAME}
|
||||
|
||||
UserSpecificDocker
|
||||
|
||||
# By mapping the .m2 directory you can do an mvn install from
|
||||
|
|
Loading…
Reference in New Issue