Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-18149

[C++] Failed to compile join_example without `-DARROW_CSV=ON` option

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 9.0.0
    • 11.0.0
    • C++
    • % uname -a
      Linux XXX 5.4.0-70-generic #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

    Description

      Reproducing the bug

      cd cpp
      mkdir build-release
      cd build-release
      cmake .. \
        -DARROW_BUILD_EXAMPLES=ON \
        -DARROW_DATASET=ON \
        -DARROW_PARQUET=ON
      make -j
      [ 95%] Linking CXX executable ../../release/join-example /usr/bin/ld: CMakeFiles/join-example.dir/join_example.cc.o: in function `CreateDataSetFromCSVData(bool)': join_example.cc:(.text+0x2fd): undefined reference to `arrow::csv::ReadOptions::Defaults()' /usr/bin/ld: join_example.cc:(.text+0x30d): undefined reference to `arrow::csv::ParseOptions::Defaults()' /usr/bin/ld: join_example.cc:(.text+0x322): undefined reference to `arrow::csv::ConvertOptions::Defaults()' /usr/bin/ld: join_example.cc:(.text+0x3bf): undefined reference to `arrow::csv::TableReader::Make(arrow::io::IOContext, std::shared_ptr<arrow::io::InputStream>, arrow::csv::ReadOptions const&, arrow::csv::ParseOptions const&, arrow::csv::ConvertOptions const&)' collect2: error: ld returned 1 exit status make[2]: *** [examples/arrow/CMakeFiles/join-example.dir/build.make:90: release/join-example] Error 1 make[1]: *** [CMakeFiles/Makefile2:1909: examples/arrow/CMakeFiles/join-example.dir/all] Error 2 make: *** [Makefile:141: all] Error 2
      

      Workaround

      Add `-DARROW_CSV=ON` option.

      cmake .. \
        -DARROW_BUILD_EXAMPLES=ON \
        -DARROW_DATASET=ON \
        -DARROW_PARQUET=ON \
        -DARROW_CSV=ON
      make -j
      

      How to fix

      Put these lines in an additional condition.

      https://github.com/apache/arrow/blob/1ae666c31356fd9cb0bc54a32943e25454874f25/cpp/examples/arrow/CMakeLists.txt#L140-L141

      if(ARROW_CSV)
        add_arrow_example(join_example EXTRA_LINK_LIBS ${DATASET_EXAMPLES_LINK_LIBS})
        add_dependencies(join-example parquet) 
      endif()

      Attachments

        Issue Links

          Activity

            People

              laysakura Sho Nakatani
              laysakura Sho Nakatani
              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 - 40m
                  40m