hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Muttscheller (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HADOOP-9320) Hadoop native build failure on ARM hard-float
Date Sun, 21 May 2017 15:51:04 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-9320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16018862#comment-16018862
] 

Andreas Muttscheller edited comment on HADOOP-9320 at 5/21/17 3:50 PM:
-----------------------------------------------------------------------

This problem still exist with Hadoop 2.8. Unfortunatelly, the patch doesn't work for this
version. I updated the patch to work with Hadoop 2.8:

{code:title=HADOOP-9320-v2.8.patch|borderStyle=solid}
diff -Naur a/hadoop-common-project/hadoop-common/HadoopCommon.cmake b/hadoop-common-project/hadoop-common/HadoopCommon.cmake
--- a/hadoop-common-project/hadoop-common/HadoopCommon.cmake	2017-03-16 19:43:23.000000000
+0000
+++ b/hadoop-common-project/hadoop-common/HadoopCommon.cmake	2017-05-21 15:22:32.832162322
+0000
@@ -154,35 +154,6 @@
         endif()
     endif()
 
-    # Determine float ABI of JVM on ARM.
-    if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
-        find_program(READELF readelf)
-        if(READELF MATCHES "NOTFOUND")
-            message(WARNING "readelf not found; JVM float ABI detection disabled")
-        else(READELF MATCHES "NOTFOUND")
-            execute_process(
-                COMMAND ${READELF} -A ${JAVA_JVM_LIBRARY}
-                OUTPUT_VARIABLE JVM_ELF_ARCH
-                ERROR_QUIET)
-            if(NOT JVM_ELF_ARCH MATCHES "Tag_ABI_VFP_args: VFP registers")
-                # Test compilation with -mfloat-abi=softfp using an arbitrary libc function
-                # (typically fails with "fatal error: bits/predefs.h: No such file or directory"
-                # if soft-float dev libraries are not installed)
-                message("Soft-float JVM detected")
-                include(CMakePushCheckState)
-                cmake_push_check_state()
-                set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfloat-abi=softfp")
-                include(CheckSymbolExists)
-                check_symbol_exists(exit stdlib.h SOFTFP_AVAILABLE)
-                if(NOT SOFTFP_AVAILABLE)
-                    message(FATAL_ERROR "Soft-float dev libraries required (e.g. 'apt-get
install libc6-dev-armel' on Debian/Ubuntu)")
-                endif()
-                cmake_pop_check_state()
-                hadoop_add_compiler_flags("-mfloat-abi=softfp")
-            endif()
-        endif()
-    endif()
-
 #
 # Solaris-specific configuration.
 #
diff -Naur a/hadoop-common-project/hadoop-common/HadoopJNI.cmake b/hadoop-common-project/hadoop-common/HadoopJNI.cmake
--- a/hadoop-common-project/hadoop-common/HadoopJNI.cmake	2017-01-11 19:33:37.000000000 +0000
+++ b/hadoop-common-project/hadoop-common/HadoopJNI.cmake	2017-05-21 15:23:01.612140922 +0000
@@ -95,3 +95,38 @@
 else()
     find_package(JNI REQUIRED)
 endif()
+
+# Determine float ABI of JVM on ARM Linux
+if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    find_program(READELF readelf)
+    if (READELF MATCHES "NOTFOUND")
+        message(WARNING "readelf not found; JVM float ABI detection disabled")
+    else (READELF MATCHES "NOTFOUND")
+        message(STATUS "Checking float ABI of ${JAVA_JVM_LIBRARY}")
+        execute_process(
+            COMMAND ${READELF} -A ${JAVA_JVM_LIBRARY}
+            OUTPUT_VARIABLE JVM_ELF_ARCH
+            ERROR_QUIET)
+        if (JVM_ELF_ARCH MATCHES "Tag_ABI_VFP_args: VFP registers")
+           message(STATUS "Hard-float JVM detected")
+        else ()
+            message(STATUS "Soft-float JVM detected")
+
+            # Test compilation with -mfloat-abi=softfp using an arbitrary libc function
+            # (typically fails with "fatal error: bits/predefs.h: No such file or directory"
+            # if soft-float dev libraries are not installed)
+            include(CMakePushCheckState)
+            cmake_push_check_state()
+            set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfloat-abi=softfp")
+            include(CheckSymbolExists)
+            check_symbol_exists(exit stdlib.h SOFTFP_AVAILABLE)
+            if (NOT SOFTFP_AVAILABLE)
+                message(FATAL_ERROR "Soft-float dev libraries required (e.g. 'apt-get install
libc6-dev-armel' on Debian/Ubuntu)")
+            endif (NOT SOFTFP_AVAILABLE)
+            cmake_pop_check_state()
+
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=softfp")
+        endif ()
+    endif (READELF MATCHES "NOTFOUND")
+endif (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
+
{code}

I added a Pull Request on github: https://github.com/apache/hadoop/pull/224



was (Author: amuttsch):
This problem still exist with Hadoop 2.8. Unfortunatelly, the patch doesn't work for this
version. I updated the patch to work with Hadoop 2.8:

{code:title=HADOOP-9320-v2.8.patch|borderStyle=solid}
diff -Naur a/hadoop-common-project/hadoop-common/HadoopCommon.cmake b/hadoop-common-project/hadoop-common/HadoopCommon.cmake
--- a/hadoop-common-project/hadoop-common/HadoopCommon.cmake	2017-03-16 19:43:23.000000000
+0000
+++ b/hadoop-common-project/hadoop-common/HadoopCommon.cmake	2017-05-21 15:22:32.832162322
+0000
@@ -154,35 +154,6 @@
         endif()
     endif()
 
-    # Determine float ABI of JVM on ARM.
-    if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
-        find_program(READELF readelf)
-        if(READELF MATCHES "NOTFOUND")
-            message(WARNING "readelf not found; JVM float ABI detection disabled")
-        else(READELF MATCHES "NOTFOUND")
-            execute_process(
-                COMMAND ${READELF} -A ${JAVA_JVM_LIBRARY}
-                OUTPUT_VARIABLE JVM_ELF_ARCH
-                ERROR_QUIET)
-            if(NOT JVM_ELF_ARCH MATCHES "Tag_ABI_VFP_args: VFP registers")
-                # Test compilation with -mfloat-abi=softfp using an arbitrary libc function
-                # (typically fails with "fatal error: bits/predefs.h: No such file or directory"
-                # if soft-float dev libraries are not installed)
-                message("Soft-float JVM detected")
-                include(CMakePushCheckState)
-                cmake_push_check_state()
-                set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfloat-abi=softfp")
-                include(CheckSymbolExists)
-                check_symbol_exists(exit stdlib.h SOFTFP_AVAILABLE)
-                if(NOT SOFTFP_AVAILABLE)
-                    message(FATAL_ERROR "Soft-float dev libraries required (e.g. 'apt-get
install libc6-dev-armel' on Debian/Ubuntu)")
-                endif()
-                cmake_pop_check_state()
-                hadoop_add_compiler_flags("-mfloat-abi=softfp")
-            endif()
-        endif()
-    endif()
-
 #
 # Solaris-specific configuration.
 #
diff -Naur a/hadoop-common-project/hadoop-common/HadoopJNI.cmake b/hadoop-common-project/hadoop-common/HadoopJNI.cmake
--- a/hadoop-common-project/hadoop-common/HadoopJNI.cmake	2017-01-11 19:33:37.000000000 +0000
+++ b/hadoop-common-project/hadoop-common/HadoopJNI.cmake	2017-05-21 15:23:01.612140922 +0000
@@ -95,3 +95,38 @@
 else()
     find_package(JNI REQUIRED)
 endif()
+
+# Determine float ABI of JVM on ARM Linux
+if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    find_program(READELF readelf)
+    if (READELF MATCHES "NOTFOUND")
+        message(WARNING "readelf not found; JVM float ABI detection disabled")
+    else (READELF MATCHES "NOTFOUND")
+        message(STATUS "Checking float ABI of ${JAVA_JVM_LIBRARY}")
+        execute_process(
+            COMMAND ${READELF} -A ${JAVA_JVM_LIBRARY}
+            OUTPUT_VARIABLE JVM_ELF_ARCH
+            ERROR_QUIET)
+        if (JVM_ELF_ARCH MATCHES "Tag_ABI_VFP_args: VFP registers")
+           message(STATUS "Hard-float JVM detected")
+        else ()
+            message(STATUS "Soft-float JVM detected")
+
+            # Test compilation with -mfloat-abi=softfp using an arbitrary libc function
+            # (typically fails with "fatal error: bits/predefs.h: No such file or directory"
+            # if soft-float dev libraries are not installed)
+            include(CMakePushCheckState)
+            cmake_push_check_state()
+            set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -mfloat-abi=softfp")
+            include(CheckSymbolExists)
+            check_symbol_exists(exit stdlib.h SOFTFP_AVAILABLE)
+            if (NOT SOFTFP_AVAILABLE)
+                message(FATAL_ERROR "Soft-float dev libraries required (e.g. 'apt-get install
libc6-dev-armel' on Debian/Ubuntu)")
+            endif (NOT SOFTFP_AVAILABLE)
+            cmake_pop_check_state()
+
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=softfp")
+        endif ()
+    endif (READELF MATCHES "NOTFOUND")
+endif (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
+
{code}


> Hadoop native build failure on ARM hard-float
> ---------------------------------------------
>
>                 Key: HADOOP-9320
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9320
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: native
>    Affects Versions: 2.0.3-alpha
>         Environment: $ uname -a
> Linux 3.5.0-1000-highbank #154-Ubuntu SMP Thu Jan 10 09:13:40 UTC 2013 armv7l armv7l
armv7l GNU/Linux
> $ java -version
> java version "1.8.0-ea"
> Java(TM) SE Runtime Environment (build 1.8.0-ea-b36e)
> Java HotSpot(TM) Client VM (build 25.0-b04, mixed mode)
>            Reporter: Trevor Robinson
>            Assignee: Trevor Robinson
>              Labels: BB2015-05-TBR, build-failure
>         Attachments: HADOOP-9320.patch
>
>
> ARM JVM float ABI detection is failing in JNIFlags.cmake because JAVA_JVM_LIBRARY is
not set at that point. The failure currently causes CMake to assume a soft-float JVM. This
causes the build to fail with hard-float OpenJDK (but don't use that) and [Oracle Java 8 Preview
for ARM|http://jdk8.java.net/fxarmpreview/]. Hopefully the April update of Oracle Java 7 will
support hard-float as well.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message