Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-17226

Building native libraries fails on Fedora 38

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • libhdfs++, native

    Description

      I tried to build native libraries on Fedora 38, in which gcc-c++ 13.2.1 is installed by default, and I came across the following error.

      $ cat /etc/redhat-release 
      Fedora release 38 (Thirty Eight)
      $ g++ --version
      g++ (GCC) 13.2.1 20230728 (Red Hat 13.2.1-1)
      Copyright (C) 2023 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      
      $ mvn clean package -DskipTests -Pnative
      
      ...
      
      [WARNING] /home/vagrant/hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/uri.h:60:3: error: ‘uint16_t’ does not name a type
      [WARNING]    60 |   uint16_t get_port() const;
      [WARNING]       |   ^~~~~~~~
      [WARNING] /home/vagrant/hadoop/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/uri.h:25:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
      [WARNING]    24 | #include <vector>
      [WARNING]   +++ |+#include <cstdint>
      [WARNING]    25 | #include <stdexcept>
      
      ...
      
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  07:00 min
      [INFO] Finished at: 2023-10-14T07:14:57Z
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.4.0-SNAPSHOT:cmake-compile (cmake-compile) on project hadoop-hdfs-native-client: make failed with error code 2 -> [Help 1]
      

      As described in the warning messages, adding #include <cstdint> will solve the problem.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sekikn Kengo Seki
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: