mapillary / mapillary/OpenSfM

Issue locating gflags header file on Fedora

Open
#690 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Trying to build OpenSfM on my local Fedora (32) system.

python setup.py build

Results the following error:

...
-- Found installed version of gflags: /usr/lib64/cmake/gflags
-- Detected gflags version: 2.2.2
CMake Error at cmake/FindGflags.cmake:118 (message):
  Failed to find gflags - Could not find file: //include/gflags/gflags.h
  containing namespace information in gflags install located at: //include.
Call Stack (most recent call first):
  cmake/FindGflags.cmake:215 (gflags_report_not_found)
  cmake/FindGflags.cmake:398 (gflags_check_gflags_namespace_using_regex)
  CMakeLists.txt:39 (find_package)
...

Like you can see gflags was detected, however the header file cannot be found.
The header file is located on the system in the following location: /usr/include/gflags/gflags.h

This issue can be solved by adding the following line under regex detect section:

function(GFLAGS_CHECK_GFLAGS_NAMESPACE_USING_REGEX)
...
  set(GFLAGS_INCLUDE_DIR /usr/include/)

But that of course will break other things and should properly fixed.

It's worth to mention that /usr/include is added to GFLAGS_CHECK_INCLUDE_DIRS but only when if (NOT GFLAGS_FOUND), however in my case, it was found.

Should be easy fix, but I didn't manage to figure this out yet.

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

Start with cmake/FindGflags.cmake, especially the regex detection function and the GFLAGS_CHECK_INCLUDE_DIRS handling described in the issue. Reproduce the failure with python setup.py build on Fedora and compare the detected gflags installation with /usr/include/gflags/gflags.h. Done means the build locates the header without a Fedora-specific hardcoded path.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, fedora, python
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.