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

Add specific build instructions #15

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Windows
Windows => Use precompiled binary, or compile it with VS2008/2010 (Express or pro, Pro will allow you to enable Opemp in CMVS)
=> Use CMake GUI in order to generate the Visual Studio project file (in ./program you will find the main CMakeLists.txt).

# Linux compilations (Ubuntu used as example)
```
#Prepare an empty machine for building:
sudo apt-get update -qq && sudo apt-get install -qq
sudo apt-get -y install git jpeg boost boost-graph
git clone https://github.com/pmoulon/CMVS-PMVS
mkdir CMVS-PMVS_build && cd CMVS-PMVS_build
cmake ../CMVS-PMVS/program
make
sudo make install
```
3 changes: 3 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
This is a modified version of CMVS/PMVS.

Building:
- See https://github.com/pmoulon/CMVS-PMVS/BUILD.md

Main modification:
- cross platform compilation Linux, Windows => CMake build system generator.
- added bug fix from Nghia Ho.
Expand Down
14 changes: 1 addition & 13 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,7 @@ Date : 13 July 2011
-- Compilation --
--------------------

Windows => Use precompiled binary, or compile it with VS2008/2010 (Express or pro, Pro will allow you to enable Opemp in CMVS)
=> Use CMake GUI in order to generate the Visual Studio project file (in ./program you will find the main CMakeLists.txt).

Linux => use makefile in program/main.

Or use CMake build system :
=> Install the following libraries : jpeg boost boost-graph
$ mkdir OutputLinux
$ cd OutputLinux
$ cmake . ..
$ make
=> That's all. Openmp is not activated yet. Add openmp in the cmvs link option and define the _OPENMP cxx flags

- See https://github.com/pmoulon/CMVS-PMVS/BUILD.md

--------------------
---- Notes : ----
Expand Down
27 changes: 27 additions & 0 deletions program/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ INCLUDE_DIRECTORIES(
FIND_PACKAGE(Threads REQUIRED)
SET(PMVS_LIBRARIES ${PMVS_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

# OPTIONS
OPTION(CIMG_USE_OPENMP "Enable OpenMP parallelization in cimg" ON)

# Eigen
SET( EIGEN3_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdParty/Eigen )
SET( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${EIGEN3_INCLUDE_DIR}/cmake" )
Expand Down Expand Up @@ -95,6 +98,30 @@ IF(PMVS_USE_TIFF)
ENDIF(TIFF_FOUND)
ENDIF(PMVS_USE_TIFF)

# OpenMP
# ==============================================================================
# OpenMP detection
# ==============================================================================
IF(CIMG_USE_OPENMP)
FIND_PACKAGE(OpenMP)
IF(OPENMP_FOUND)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
OPTION(CIMG_USE_OPENMP "Use OpenMP for parallelization in cimg" ON)
ADD_DEFINITIONS(-DCIMG_USE_OPENMP)
IF (NOT MSVC)
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# for those using the clang with OpenMP support
LIST(APPEND OPENMVG_LIBRARY_DEPENDENCIES iomp)
ELSE()
LIST(APPEND OPENMVG_LIBRARY_DEPENDENCIES gomp)
ENDIF()
ENDIF(NOT MSVC)
ENDIF(OPENMP_FOUND)
ELSE(CIMG_USE_OPENMP)
OPTION(OpenMVG_USE_OPENMP "Use OpenMP for parallelization in cimg" OFF)
UPDATE_CACHE_VARIABLE(CIMG_USE_OPENMP OFF)
REMOVE_DEFINITIONS(-DCIMG_USE_OPENMP)
ENDIF(CIMG_USE_OPENMP)

ADD_SUBDIRECTORY(base)
ADD_SUBDIRECTORY(main)
Expand Down