Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker cannot find "boost_python-vc140-mt-x64-1_66.lib" on Windows. #573

Closed
KelSolaar opened this issue Sep 26, 2019 · 9 comments · Fixed by #596
Closed

Linker cannot find "boost_python-vc140-mt-x64-1_66.lib" on Windows. #573

KelSolaar opened this issue Sep 26, 2019 · 9 comments · Fixed by #596
Labels
Needs Discussion To be discussed in the technical steering committee
Milestone

Comments

@KelSolaar
Copy link

This relates directly to #572.

So first it seems like irrespective of whether I use -DOPENEXR_BUILD_PYTHON_LIBS=0, the Python bindings are being built and then I get a few linker errors:

LINK : fatal error LNK1104: cannot open file 'boost_python-vc140-mt-x64-1_66.lib' [***\openexr\build\platform-windows\arch-AMD64\openexr\PyIlmBase\PyIex\iex_python2.vcxproj]
[...]
LINK : fatal error LNK1104: cannot open file 'boost_python-vc140-mt-x64-1_66.lib' [***\openexr\build\platform-windows\arch-AMD64\openexr\PyIlmBase\PyImath\imath_python2.vcxproj]

I'm not sure where it tries to get the library from but I can see it here along with the shared version and a name variation:

  • ***\boost\1.66.0.rf1\platform-windows\arch-AMD64\python-2.7.14\boost\stage\lib\boost_python-vc140-mt-x64-1_66.lib
  • ***\boost\1.66.0.rf1\platform-windows\arch-AMD64\python-2.7.14\boost\stage\lib\boost_python-vc140-mt-x64-1_66.dll
  • ***\boost\1.66.0.rf1\platform-windows\arch-AMD64\python-2.7.14\boost\stage\lib\libboost_python-vc140-mt-x64-1_66.lib

Here is a doctored configuration log if that helps:

-- Selecting Windows SDK version  to target Windows 10.0.17763.
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configure ILMBASE Version: 2.4.0 Lib API: 24.0.0
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Looking for include file ucontext.h
-- Looking for include file ucontext.h - not found
NOTICE-- WARNING pkg-config generation disabled
-- Configure OpenEXR Version: 2.4.0 Lib API: 24.0.0
CMake Warning (dev) at CMakeLists.txt:29 (_find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  CMake variable ZLIB_ROOT is set to:

    ***\zlib\1.2.11.rf1\platform-windows\arch-AMD64\zlib

  For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
  OpenEXR/config/OpenEXRSetup.cmake:136 (find_package)
  OpenEXR/CMakeLists.txt:30 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found ZLIB: ***/zlib/1.2.11.rf1/platform-windows/arch-AMD64/zlib/lib/zlib.lib (found version "1.2.11")
-- Performing Test OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN
-- Performing Test OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN - Failed
-- Performing Test OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
-- Performing Test OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX - Failed
-- Configure PyIlmBase Version: 2.4.0 Lib API: 24.0.2
CMake Warning (dev) at CMakeLists.txt:29 (_find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  Environment variable Python_ROOT is set to:

    C:\Python27

  For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
  PyIlmBase/CMakeLists.txt:34 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Python: C:/Python27/python.exe (found version "2.7.14") found components:  Interpreter Development
-- Found Python2: C:/Python27/python.exe (found version "2.7.14") found components:  Interpreter Development
-- Could NOT find Python3: Found unsuitable major version "2", but required major version is exact version "3"
NOTICE: Found Python 2.7.14
-- Found Python2 libraries: 27
-- Boost version: 1.66.0
-- Found the following Boost libraries:
--   python
CMake Warning at PyIlmBase/CMakeLists.txt:104 (message):
  Ambiguous boost python module found, assuming python 2


-- Found NumPy 1.13.3 for Python 2.7.14: ***/numpy/1.13.3/numpy/Lib/site-packages/numpy/core/include
-- Configure OpenEXR Viewers Version: 2.4.0 Lib API: 24.0.1
-- Found OpenGL: opengl32
-- Could NOT find FLTK (missing: FLTK_LIBRARIES FLTK_INCLUDE_DIR)
CMake Warning at OpenEXR_Viewers/CMakeLists.txt:36 (message):
  FLTK not found, exrdisplay will not be built


NOTICE: Disabling playexr, not yet ported to WIN32 platforms
-- Configuring done
-- Generating done
-- Build files have been written to: ***/openexr/build/platform-windows/arch-AMD64/openexr
@KelSolaar
Copy link
Author

Random related thoughts, what about using pybind11? :)

@kdt3rd
Copy link
Contributor

kdt3rd commented Sep 27, 2019 via email

@meshula
Copy link
Contributor

meshula commented Sep 30, 2019

cmake, boost, and python are having a contest to thwart each other's naming conventions recently. Have you tried setting, from the command line

-DBOOST_ROOT=c:/blah/.../blah/boost/1.66.0.rf1/platform-windows/arch-AMD64/python-2.7.14/boost/stage

and if that isn't good enough, setting instead the boost trifecta of BOOST_DIR, BOOST_LIBRARYDIR, and BOOST_INCLUDE_DIR should work or it might be BOOST_INCLUDEDIR, depending on alternate Thursdays. The FindBoost.cmake script is frightening.

@KelSolaar
Copy link
Author

Hi @meshula / Nick,

I don't think I changed our DBOOST_ROOT value at all, my assumption was that if it works for OIIO it should work for OpenEXR but maybe it is an assumption I should not make :] I will try!

Cheers,

Thomas

@meshula
Copy link
Contributor

meshula commented Oct 1, 2019

FindBoost.cmake is complex and savage to tame. Let us know how your experiment goes.

@cary-ilm
Copy link
Member

Checking back on this - any update? Given that the longer-term direction of the project is to move to pybind11, the technical steering group has limited bandwidth to invest in the current approach. If you or someone else from the community would possibly investigate further and propose a patch, we'd be happy to review it.

@JenusL
Copy link
Contributor

JenusL commented Oct 21, 2019

The issue seems to be that Boost was forgotten in PyImx/CMakeLists.txt and PyImath/CMakeLists.txt when PyIlmBase was refactored here 4d97270

PyImathNumpy/CMakeLists.txt was however updated so PyImathNumpy builds nicely.

@JenusL
Copy link
Contributor

JenusL commented Oct 21, 2019

On further inspection, here's (0eff972) where all code got removed from PyImx/CMakeLists.txt and PyImath/CMakeLists.txt.
Commit message doesn't say why...

@JenusL
Copy link
Contributor

JenusL commented Oct 21, 2019

Ok upon further investigation I think I've found the real error.
PyIex and PyImath is being built twice. One is a .dll and the other is a .pyd Python module.
Only the .dll has Boost added. The python module is missing it.
I'll create a PR asap.

@cary-ilm cary-ilm added the Needs Discussion To be discussed in the technical steering committee label Oct 24, 2019
@cary-ilm cary-ilm added this to the v2.5.0 milestone Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion To be discussed in the technical steering committee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants