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

Link OpenSSL lib for CMake deps check

    XMLWordPrintableJSON

Details

    Description

      CMake checks whether the required components of OpenSSL are available prior to building HDFS native client - https://github.com/apache/hadoop/blob/fac895828f714b5587b57900d588acac69880c1e/hadoop-hdfs-project/hadoop-hdfs-native-client/src/CMakeLists.txt#L130

      check_c_source_compiles("#include \"${OPENSSL_INCLUDE_DIR}/openssl/evp.h\"\nint main(int argc, char **argv) { return !EVP_aes_256_ctr; }" HAS_NEW_ENOUGH_OPENSSL)
      

      This check compiles but fails while linking on Windows -

      src.obj : error LNK2019: unresolved external symbol EVP_aes_256_ctr referenced in function main [H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\CMakeFiles\CMakeTmp\cmTC_e391b.vcxproj]
      
      H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\CMakeFiles\CMakeTmp\Debug\cmTC_e391b.exe : fatal error LNK1120: 1 unresolved externals [H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\CMakeFiles\CMakeTmp\cmTC_e391b.vcxproj]
      
      Source file was:
      #include <openssl/evp.h>
      int main(int argc, char **argv) { return !EVP_aes_256_ctr; }
      

      Thus, we need to link to the OpenSSL library prior to running this check. Please note that this check doesn't fail on Linux since CMake is able to pick it up from the standard location where libs are installed.

      Attachments

        Issue Links

          Activity

            People

              gaurava Gautham Banasandra
              gaurava Gautham Banasandra
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h
                  2h