You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Alessandro Molina (Jira)" <ji...@apache.org> on 2021/04/28 16:44:00 UTC

[jira] [Commented] (ARROW-12589) [C++] Compiling on windows doesn't work when -DARROW_WITH_BACKTRACE=OFF

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

Alessandro Molina commented on ARROW-12589:
-------------------------------------------

Seems the issue started with this change -> https://github.com/apache/arrow/commit/8f5df459c7c77c38730b9543ed96d6d28d9ac64a as previously the {{target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING)}} was always executed

> [C++] Compiling on windows doesn't work when -DARROW_WITH_BACKTRACE=OFF
> -----------------------------------------------------------------------
>
>                 Key: ARROW-12589
>                 URL: https://issues.apache.org/jira/browse/ARROW-12589
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>            Reporter: Alessandro Molina
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> It seems that when compiling with {{-DARROW_WITH_BACKTRACE=OFF}} we don't add anymore the {{-DARROW_EXPORTING}} definition.
> That definition is what makes {{ARROW_EXPORT}} switch between {{dllimport}} and {{dllexport}}.
> The result is thus that the build fails with errors like
> {code}
> [4/116] Building CXX object src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx.obj
> FAILED: src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx.obj
> C:/msys64/mingw64/bin/ccache.exe C:\msys64\mingw64\bin\c++.exe -DARROW_HAVE_RUNTIME_AVX2 -DARROW_HAVE_RUNTIME_BMI2 -DARROW_HAVE_RUNTIME_SSE4_2 -DARROW_HAVE_SSE4_2 -DARROW_HDFS -DARROW_WITH_RE2 -DARROW_WITH_UTF8PROC -DARROW_WITH_ZLIB -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=8 -DAWS_SDK_VERSION_PATCH=149 -DAWS_USE_IO_COMPLETION_PORTS -DURI_STATIC_BUILD -DUSE_IMPORT_EXPORT -DUSE_IMPORT_EXPORT=1 -DUSE_WINDOWS_DLL_SEMANTICS -D_CRT_SECURE_NO_WARNINGS -Darrow_shared_EXPORTS -Isrc -Isrc/generated -isystem thirdparty/flatbuffers/include -isystem /mingw64/include -isystem xsimd_ep/src/xsimd_ep-install/include -isystem thirdparty/hadoop/include -Wno-noexcept-type -Wno-subobject-linkage  -fdiagnostics-color=always -O3 -DNDEBUG  -Wa,-mbig-obj -Wall -fno-semantic-interposition -mxsave -msse4.2 -w -O3 -DNDEBUG -std=c++11 -MD -MT src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx.obj -MF src\arrow\CMakeFiles\arrow_shared.dir\Unity\unity_17_cxx.cxx.obj.d -o src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx.obj -c src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx
> In file included from src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_17_cxx.cxx:3:
> C:/msys64/home/javan/arrow/arrow-master/cpp/src/arrow/filesystem/filesystem.cc:81:28: error: function 'std::ostream& arrow::fs::operator<<(std::ostream&, arrow::fs::FileType)' definition is marked dllimport
>    81 | ARROW_EXPORT std::ostream& operator<<(std::ostream& os, FileType ftype) {
>       |                            ^~~~~~~~
> [5/116] Building CXX object src/arrow/CMakeFiles/arrow_shared.dir/Unity/unity_2_cxx.cxx.obj
> {code}
> The issue seems to be related to this code block in {{CMakeLists.txt}}
> {code}
> if(ARROW_WITH_BACKTRACE)
>   find_package(Backtrace)
>   foreach(LIB_TARGET ${ARROW_LIBRARIES})
>     target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING)
>     if(Backtrace_FOUND AND ARROW_WITH_BACKTRACE)
>       target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_WITH_BACKTRACE)
>     endif()
>   endforeach()
> endif()
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)