mapillary / mapillary/OpenSfM

Build Error in Conda env on Windows

Open
#963 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.8k
Forks
899
PR merge metrics
No merged PRs in 30d

Description

Hello, I am pretty new to all this, so bear with me. I'm trying to build this package and every step before I run "python setup.py build" works fine with no errors. However, the build command results in these errors near the end of the output. Other info that may or may not be relevant is that I am doing this in a conda environment on Windows. I manually ran pip install cmake in addition to the usual setup steps given in the docs because I didn't have it installed. Any help would be greatly appreciated.

Here is the end of the output from "python setup.py build"

C:/Users/ToppLab/Photogrammetry/OpenSfM/vcpkg/installed/x64-windows/include\glog/log_severity.h(57,1): fatal error C11
89: #error: ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document
for detail. [C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\geometry\pygeometry.vcxproj]
Building Custom Rule C:/Users/ToppLab/Photogrammetry/OpenSfM/opensfm/src/map/CMakeLists.txt
landmark.cc
map.cc
rig.cc
shot.cc
dataviews.cc
observation.cc
tracks_manager.cc
The contents of are available only with C++17 or later.
C:\Users\ToppLab\Photogrammetry\OpenSfM\opensfm\src\map\src\tracks_manager.cc(206,69): warning C4267: 'return': convers
ion from 'size_t' to 'int', possible loss of data [C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\map\map.vcxproj]
C:\Users\ToppLab\Photogrammetry\OpenSfM\opensfm\src\map\src\tracks_manager.cc(208,70): warning C4267: 'return': convers
ion from 'size_t' to 'int', possible loss of data [C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\map\map.vcxproj]
C:\Users\ToppLab\Photogrammetry\OpenSfM\opensfm\src\map\src\tracks_manager.cc(376,34): warning C4267: 'argument': conve
rsion from 'size_t' to '_Ty', possible loss of data [C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\map\map.vcxpro
j]
with
[
_Ty=int
]
Generating Code...
map.vcxproj -> C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\map\Release\map.lib
Building Custom Rule C:/Users/ToppLab/Photogrammetry/OpenSfM/opensfm/src/map/CMakeLists.txt
pybind.cc
C:\Users\ToppLab\Photogrammetry\OpenSfM\opensfm\src\map\python\pybind.cc(46,1): warning C4996: 'sscanf': This function
or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See on
line help for details. [C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\map\pymap.vcxproj]
Creating library C:/Users/ToppLab/Photogrammetry/OpenSfM/cmake_build/map/Release/pymap.lib and object C:/Users/Top
pLab/Photogrammetry/OpenSfM/cmake_build/map/Release/pymap.exp
Generating code
Finished generating code
pymap.vcxproj -> C:\Users\ToppLab\Photogrammetry\OpenSfM\opensfm\pymap.cp39-win_amd64.pyd
Building Custom Rule C:/Users/ToppLab/Photogrammetry/OpenSfM/opensfm/src/robust/CMakeLists.txt
absolute_pose_model.cc
absolute_pose_known_rotation_model.cc
relative_rotation_model.cc
relative_pose_model.cc
C:/Users/ToppLab/Photogrammetry/OpenSfM/vcpkg/installed/x64-windows/include\glog/log_severity.h(57,1): fatal error C11
89: #error: ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document
for detail. [C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\robust\robust.vcxproj]
line_model.cc
instanciations.cc
C:/Users/ToppLab/Photogrammetry/OpenSfM/vcpkg/installed/x64-windows/include\glog/log_severity.h(57,1): fatal error C11
89: #error: ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document
for detail. [C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\robust\robust.vcxproj]
Generating Code...
Building Custom Rule C:/Users/ToppLab/Photogrammetry/OpenSfM/opensfm/src/sfm/CMakeLists.txt
retriangulation.cc
ba_helpers.cc
C:/Users/ToppLab/Photogrammetry/OpenSfM/vcpkg/installed/x64-windows/include\glog/log_severity.h(57,1): fatal error C11
89: #error: ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document
for detail. [C:\Users\ToppLab\Photogrammetry\OpenSfM\cmake_build\sfm\sfm.vcxproj]
tracks_helpers.cc
Generating Code...
Traceback (most recent call last):
File "C:\Users\ToppLab\Photogrammetry\OpenSfM\setup.py", line 60, in
build_c_extension()
File "C:\Users\ToppLab\Photogrammetry\OpenSfM\setup.py", line 50, in build_c_extension
subprocess.check_call(
File "C:\Users\ToppLab\Miniconda3\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release']' returned non-zero exit status 1.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The failure occurs during python setup.py build in the CMake projects under opensfm/src, with glog/log_severity.h named in the compiler output. Start by reproducing the Windows Conda build and inspect the geometry, map, robust, and sfm CMakeLists.txt files around the reported compiler failures. Done means the Release build completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.