apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.34k stars 3.48k forks source link

Build fails on windows with ARROW_PYTHON=ON #29133

Open asfimport opened 3 years ago

asfimport commented 3 years ago

The build fails with the following error when ARROW_PYTHON=ON.

 


LINK : fatal error LNK1104: cannot open file 'optimized.lib'

Possible cause:

Cmake's target_link_libararies accepts optimized as a build config.


target_link_libraries(<target> [item1 [item2 [...]]] [[debug|optimized|general] <item>] ...)

Seems this flag is considered as a library name in the build.

 

Environment: OS: Windows 10 Windows SDK version 10.0.19041.0 to target Windows 10.0.19043. System processor: AMD64 Generator: Visual Studio 16 2019

Reporter: Chathura Widanage / @chathurawidanage

Related issues:

Note: This issue was originally created as ARROW-13470. Please see the migration documentation for further details.

asfimport commented 3 years ago

Kouhei Sutou / @kou: Could you show all CMake log?

asfimport commented 3 years ago

Chathura Widanage / @chathurawidanage: @kou  Please check the attachments of the main post.

asfimport commented 3 years ago

Kouhei Sutou / @kou: Thanks. But I didn't know why this is occurred from log...

Could you also show full CMake command line?

asfimport commented 2 years ago

Will Jones / @wjones127: I've just encountered this on Windows too. Adding message("Python libs: ${PYTHON_LIBRARIES}") to line 73 in cpp/src/arrow/python yields this on Windows:


[cmake] Python libs: optimized;C:/Users/voltron/AppData/Local/Programs/Python/Python310/libs/python310.lib;debug;C:/Users/voltron/AppData/Local/Programs/Python/Python310/libs/python310_d.lib

But this on my Mac:


[cmake] Python libs: /Users/willjones/.pyenv/versions/3.8.12/lib/libpython3.8.a

I installed Python on Windows with debug symbols and debug library, and it seems that CMake is wanting to pass both the the linker. (I was getting an error trying to do a debug build on Windows without the Python debug library, which is why I reinstalled Python with that included.) However, I don't think this line of add_arrow_lib() is prepared for that: https://github.com/apache/arrow/blob/e291d0f408df588048b6971819fc4e65b0093154/cpp/cmake_modules/BuildUtils.cmake#L373