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

Imath 3.1.1 MSVC build issues #225

Closed
michdolan opened this issue Nov 20, 2021 · 2 comments
Closed

Imath 3.1.1 MSVC build issues #225

michdolan opened this issue Nov 20, 2021 · 2 comments
Labels
bug Something isn't working build windows

Comments

@michdolan
Copy link

Imath 3.1.1
MSVC 14.2 x64 c++17

I was setting up a build with the above configuration on Windows 10 and ran into two minor build issues:

When building the Python bindings, I got several errors like:

...\imath-3.1.1\src\python\PyImath\PyImathStringTable.cpp(38,18): error C2039: 'domain_error': is not a member of 'std' [...\imath-3.1.1\src\python\PyImath\PyImath_Python3_7.vcxproj]

I resolved this by adding #include <stdexcept> to PyImathStringTable.cpp

The other issue may be more specific to my environment, but I will mention it just in case. When building with IMATH_HALF_USE_LOOKUP_TABLE=OFF I run into the following error:

...\Imath\half.h(329,14): error C3861: '__lzcnt': identifier not found [...\imath-3.1.1\src\Imath\Imath.vcxproj]

I resolved this error by specifying in CMAKE_CXX_FLAGS: /D__x86_64__=1 to force the inclusion of intrin.h in half.h, which was being bypassed otherwise.

Here's my configure and build commands:

cmake -D BUILD_TESTING=OFF -D BUILD_SHARED_LIBS=ON -D IMATH_HALF_USE_LOOKUP_TABLE=OFF -D PYTHON=ON -D Boost_ROOT=...\boost-1.76.0 -D CMAKE_CXX_FLAGS=/D__x86_64__=1 /EHsc -D CMAKE_CXX_STANDARD=17 -G Visual Studio 16 2019 -D CMAKE_BUILD_TYPE=Release -D CMAKE_POSITION_INDEPENDENT_CODE=ON -A x64 -D Python_ROOT_DIR=C:\Python37 -D PYTHON_EXECUTABLE=...\venv\Scripts\python.exe -D CMAKE_INSTALL_PREFIX=...\install\msvc142-x64-cxx17-release-py37\imath-3.1.1 -S ...\src\imath-3.1.1 -B ...\build\msvc142-x64-cxx17-release-py37\imath-3.1.1 -D Python3_ROOT_DIR=C:\Python37
cmake --build ...\build\msvc142-x64-cxx17-release-py37\imath-3.1.1 --target install --config Release --parallel 64
@meshula
Copy link
Contributor

meshula commented Nov 20, 2021

Adding that missing include would be a good PR.

Auto-detecting the need for the intrinsic include, in the header file, would be a good fix, rather than needing a command line argument.

@meshula meshula added bug Something isn't working windows build labels Nov 20, 2021
@cary-ilm
Copy link
Member

Closing this as I believe this was fixed by #215 and #190, let me know otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build windows
Projects
None yet
Development

No branches or pull requests

3 participants