Skip to content

Build fails on windows with ARROW_PYTHON=ON #29133

Closed as not planned
Closed as not planned

Description

@asfimport

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:

Original Issue Attachments:

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

Activity

  1. asfimport commented on Jul 27, 2021

    @asfimport
    Author

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

  2. asfimport commented on Jul 28, 2021

    @asfimport
    Author

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

  3. asfimport commented on Jul 29, 2021

    @asfimport
    Author

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

    Could you also show full CMake command line?

  4. asfimport commented on Jan 22, 2022

    @asfimport
    Author

    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:

    "$<BUILD_INTERFACE:${ARG_SHARED_LINK_LIBS}>"

  5. thisisnic commented on Oct 22, 2026

    @thisisnic
    Member

    Closing as obsolete, since ARROW_PYTHON is deprecated and nothing in the C++ build mentions NumPy any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions