mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.37k stars 856 forks source link

Problem got when trying to build OpenSfM on centos #378

Open allenChn opened 5 years ago

allenChn commented 5 years ago

Hello, dear friends in mapillary. I got a problem when I tried to build OpenSfM on CentOS. This is the screenshot of the problem. image The compiling env is like this:

It's not over.............................................................................................................. I didn't give up. I tried another solution. I ran 'docker build' using Dockerfile.python3 on a server of centos7(with docker and python3 and pip3 installed). However, the problem still exists. I have no idea whether I am still misssing some dependencies, or I just can't use centos to build. Since We use CentOS(rather than Ubuntu) in most of our cluster servers, we have to build opensfm with commands like 'yum' and searching for the replacing requirements in Dockerfile one by one. It's complicated to verify whether I install the right one. Hoping for your solution! Thank you.

paulinus commented 5 years ago

Hi @allenChn, We've not tried installing on CentOS, so thanks for reporting and helping getting it running. The error message complains about missing Pybind11 commands. We are getting pybind11 as a git submodule. You make sure that you get the submodules updated by running

git submodule update --init --recursive

If not done already, could you please try this command and check if the error remain? thanks

allenChn commented 5 years ago

I will try that. Thank you very much.

allenChn commented 5 years ago

Hello, dear paulinus. I run the git command following your instuction and it works. But I encountered another strange problem. It says: image

It looks like I need to upgrade my gcc. But actually I have already installed gcc 6.4, which seems like to support c++11. image So, what should I do to fix that. Counting on your help.

JakeSmarter commented 5 years ago

Looks like your GCC's C++ cmake module may be lacking some checks which should populate either PYBIND11_CPP_STANDARD or CMAKE_CXX_STANDARD variables.

You can try running

cmake -D PYBIND11_CPP_STANDARD='-std=c++11'

or you can modify your CMakeCache.txt file and set PYBIND11_CPP_STANDARD to -std=c++11.

Alternatively, you can try

cmake -D HAS_CPP11_FLAG

and pybind will set the PYBIND11_CPP_STANDARD variable for you.

allenChn commented 5 years ago

Thanks a lot for your suggestion. If I succeed in building OpenSfM on centos, I will contribute my dockerfile.

allenChn commented 5 years ago

Actually I succeeded in building OpenSfM on a new centos7 server with your 'Dockerfile.python3' provided in project. I ran berlin example and no problem arose. It seems that there's no need to build opensfm on centos all by myself, since I can use opensfm in a docker container. Is that right?

paulinus commented 5 years ago

That is right. If you use the docker container, then there's no need to build the lib locally.