From 0e1cc4b4b0324e8831cc836badfb51e563127bbd Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Wed, 28 Mar 2018 16:57:36 -0400 Subject: [PATCH 1/4] code now builds on fedora 27, incoming commits for ubuntus --- .gitignore | 1 + CMakeLists.txt | 2 +- doc/building/building.org | 21 +++++++++++++++++++ doc/building/requirements.org | 12 +++++++++++ gts-0.7.6/CMakeLists.txt | 1 + ts-sonar/CMakeLists.txt | 1 - .../ACE/amg_eigen_computation.cpp | 2 +- vrip/src/vrip/CMakeLists.txt | 3 ++- vrip/src/vrip/strings.h | 1 + vrip/src/vrip/vripGUICmds.h | 2 +- vsfm/CMakeLists.txt | 6 ++++-- 11 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 doc/building/building.org create mode 100644 doc/building/requirements.org diff --git a/.gitignore b/.gitignore index 60c08359..014f49dc 100644 --- a/.gitignore +++ b/.gitignore @@ -186,3 +186,4 @@ structured-build/calcTexCoordBundler /VisualSFM /nv.ini /kd +/builddir diff --git a/CMakeLists.txt b/CMakeLists.txt index 20b51828..59ae7ad0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ PROJECT(threadedStereo) SET(THREADED_STEREO_LIB "ts") CMAKE_MINIMUM_REQUIRED(VERSION 2.4) - +set(CMAKE_CXX_STANDARD 98) # This can removed if the required cmake version is increased to 2.6 IF(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0003 NEW) diff --git a/doc/building/building.org b/doc/building/building.org new file mode 100644 index 00000000..47589be5 --- /dev/null +++ b/doc/building/building.org @@ -0,0 +1,21 @@ +#+title: Building + +First build requirements listed in [[file:requirements.org]]. + +#+begin_src fish + mkdir builddir + cd builddir + cmake -DCMAKE_PREFIX_PATH=$HOME/.local -GNinja .. + cmake --build . +#+end_src + + +*** notes + +There's a lot of "legacy" linking in the cmake files, that is linking a library like: +#+BEGIN_SRC cmake +target_link_libraries(whatever osg) +#+END_SRC +where osg is not a cmake target. This causes -losg to be added to the compiler command line, +which can cause unexpected symbol search issues. You can set the environment variable ~LIBRARY_PATH~ to +work around this diff --git a/doc/building/requirements.org b/doc/building/requirements.org new file mode 100644 index 00000000..2f96f5a7 --- /dev/null +++ b/doc/building/requirements.org @@ -0,0 +1,12 @@ +#+title: Requirements +#+description: build requirements for structured +#+keywords: build, dependencies, requirements +#+language: en +#+author: Charles Barto + +This file lists working versions of required libraries, +other versions may also work + ++ opencv 2.4 ++ OpenSceneGraph 3.2 + diff --git a/gts-0.7.6/CMakeLists.txt b/gts-0.7.6/CMakeLists.txt index 01324f11..fe22eaad 100644 --- a/gts-0.7.6/CMakeLists.txt +++ b/gts-0.7.6/CMakeLists.txt @@ -4,6 +4,7 @@ #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) include(CheckIncludeFile) +include(CheckFunctionExists) check_function_exists (getopt_long HAVE_GETOPT_LONG) check_function_exists (getpagesize HAVE_GETPAGESIZE) diff --git a/ts-sonar/CMakeLists.txt b/ts-sonar/CMakeLists.txt index 7a99d876..aa2cba3e 100644 --- a/ts-sonar/CMakeLists.txt +++ b/ts-sonar/CMakeLists.txt @@ -1,6 +1,5 @@ file(GLOB implem_files *.cpp) file(GLOB header_files *.h) - set(LIB_NAME ${THREADED_STEREO_LIB}-sonar) include_directories (${EIGEN3_INCLUDE_DIRS}) diff --git a/vcgapps/numeric_stuff/ACE/amg_eigen_computation.cpp b/vcgapps/numeric_stuff/ACE/amg_eigen_computation.cpp index ddb2c428..7e097eb6 100644 --- a/vcgapps/numeric_stuff/ACE/amg_eigen_computation.cpp +++ b/vcgapps/numeric_stuff/ACE/amg_eigen_computation.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include "defs.h" @@ -11,7 +12,6 @@ #include "coarsen_amg.h" #include "coarsen_match.h" #include "RQI/rqi.h" -#include /******************************************** diff --git a/vrip/src/vrip/CMakeLists.txt b/vrip/src/vrip/CMakeLists.txt index 03c50afd..2f8ac1a6 100644 --- a/vrip/src/vrip/CMakeLists.txt +++ b/vrip/src/vrip/CMakeLists.txt @@ -7,7 +7,8 @@ message(FATAL_ERROR "csh is required please install") ENDIF() SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/vrip/src/vrip) -INCLUDE_DIRECTORIES( . ${TCL_INCLUDE_PATH} ${TK_INCLUDE_PATH}) +#set(CMAKE_INCLUDE_CURRENT_DIR ON) +INCLUDE_DIRECTORIES( ${TCL_INCLUDE_PATH} ${TK_INCLUDE_PATH}) file(COPY vripnew.csh DESTINATION ${PROJECT_SOURCE_DIR}/vrip/bin/) file(COPY vripsurf.csh DESTINATION ${PROJECT_SOURCE_DIR}/vrip/bin/) file(RENAME ${PROJECT_SOURCE_DIR}/vrip/bin/vripnew.csh ${PROJECT_SOURCE_DIR}/vrip/bin/vripnew ) diff --git a/vrip/src/vrip/strings.h b/vrip/src/vrip/strings.h index d653d655..bfaf6a68 100644 --- a/vrip/src/vrip/strings.h +++ b/vrip/src/vrip/strings.h @@ -1,3 +1,4 @@ + /* module: strings.h */ /* @(#)strings.h 1.25 */ diff --git a/vrip/src/vrip/vripGUICmds.h b/vrip/src/vrip/vripGUICmds.h index a9601f0e..2a14f011 100644 --- a/vrip/src/vrip/vripGUICmds.h +++ b/vrip/src/vrip/vripGUICmds.h @@ -20,7 +20,7 @@ CONCERNING THIS SOFTWARE. No support is implied or provided. #include -#include +#include "DepthMap.h" int Vrip_PhotoSliceCmd(ClientData, Tcl_Interp *interp, int argc, const char *argv[]); diff --git a/vsfm/CMakeLists.txt b/vsfm/CMakeLists.txt index 0011ba74..955ad3ec 100644 --- a/vsfm/CMakeLists.txt +++ b/vsfm/CMakeLists.txt @@ -1,4 +1,6 @@ set(LIB_DIR ${PROJECT_SOURCE_DIR}/vsfm/lib/) -FIND_PACKAGE(GTK2 REQUIRED) +find_package(PkgConfig REQUIRED) +pkg_check_modules(x11 REQUIRED IMPORTED_TARGET x11) +pkg_check_modules(gtk2 REQUIRED IMPORTED_TARGET gtk+-2.0) add_executable(VisualSFM dummy.c) -TARGET_LINK_LIBRARIES(VisualSFM ${LIB_DIR}/VisualSFM.a ${LIB_DIR}/lapack.a ${LIB_DIR}/blas.a ${LIB_DIR}/libf2c.a ${LIB_DIR}/libjpeg.a ${GTK2_LIBRARIES} gthread-2.0) \ No newline at end of file +TARGET_LINK_LIBRARIES(VisualSFM ${LIB_DIR}/VisualSFM.a ${LIB_DIR}/lapack.a ${LIB_DIR}/blas.a ${LIB_DIR}/libf2c.a ${LIB_DIR}/libjpeg.a ${GTK2_LIBRARIES} gthread-2.0 PkgConfig::x11 PkgConfig::gtk2) From 7c8b095f817c2e4ef01d9aceaa63f1476218ee0d Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 8 May 2018 16:06:07 -0400 Subject: [PATCH 2/4] add some docs --- doc/building/#building.org# | 20 ++++++++++++++++++++ doc/building/building.org | 1 - doc/building/requirements.org | 1 - 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 doc/building/#building.org# diff --git a/doc/building/#building.org# b/doc/building/#building.org# new file mode 100644 index 00000000..4829a3cf --- /dev/null +++ b/doc/building/#building.org# @@ -0,0 +1,20 @@ +First build requirements listed in [[file:requirements.org]]. + +#+title: Building +#+begin_src fish + mkdir builddir + cd builddir + cmake -DCMAKE_PREFIX_PATH=$HOME/.local -GNinja .. + cmake --build . +#+end_src + + +*** notes + +There's a lot of "legacy" linking in the cmake files, that is linking a library like: +#+BEGIN_SRC cmake +target_link_libraries(whatever osg) +#+END_SRC +where osg is not a cmake target. This causes -losg to be added to the compiler command line, +which can cause unexpected symbol search issues. You can set the environment variable ~LIBRARY_PATH~ to +work around this diff --git a/doc/building/building.org b/doc/building/building.org index 47589be5..7ddae0cb 100644 --- a/doc/building/building.org +++ b/doc/building/building.org @@ -1,7 +1,6 @@ #+title: Building First build requirements listed in [[file:requirements.org]]. - #+begin_src fish mkdir builddir cd builddir diff --git a/doc/building/requirements.org b/doc/building/requirements.org index 2f96f5a7..ec9d91de 100644 --- a/doc/building/requirements.org +++ b/doc/building/requirements.org @@ -9,4 +9,3 @@ other versions may also work + opencv 2.4 + OpenSceneGraph 3.2 - From 3452f42bdbb5c228be8ed46759755be7b5f5d4a1 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 8 May 2018 16:12:44 -0400 Subject: [PATCH 3/4] remove redundent cmake settings --- ANNWrapper.cpp | 1 - CMakeLists.txt | 7 ------- 2 files changed, 8 deletions(-) diff --git a/ANNWrapper.cpp b/ANNWrapper.cpp index afe99637..21bbd49c 100644 --- a/ANNWrapper.cpp +++ b/ANNWrapper.cpp @@ -1,5 +1,4 @@ #include "ANNWrapper.h" - ANNWrapper::ANNWrapper() { m_anything_to_free = false; diff --git a/CMakeLists.txt b/CMakeLists.txt index 59ae7ad0..8ee9e23a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,19 +57,12 @@ ENDIF(INSOURCE) # eg. cmake . -DCMAKE_BUILD_TYPE=Release -DDEBUG_PROFILING=on -# Build types are: Release, Debug, RelWithDebInfo, MinSizeRel -IF( NOT CMAKE_BUILD_TYPE ) - SET( CMAKE_BUILD_TYPE Release ) -ENDIF( NOT CMAKE_BUILD_TYPE ) #-----------------------# # Installation Options # #-----------------------# -IF( NOT CMAKE_INSTALL_PREFIX ) - SET( CMAKE_INSTALL_PREFIX "/usr/local" ) -ENDIF( NOT CMAKE_INSTALL_PREFIX ) IF(USE_AUV_FOR_STEREO) message("Using AUV Code for Stereo") From 80501608a5b3e422fa9d1157c17ebc4eef32f965 Mon Sep 17 00:00:00 2001 From: Charles Barto Date: Tue, 8 May 2018 16:19:57 -0400 Subject: [PATCH 4/4] remove some explicit links agains zlib, remove explicit links against libm, remove setting -g always by default --- CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ee9e23a..0e155e84 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ include(ExternalProject) FIND_PACKAGE( OpenCV REQUIRED ) pkg_check_modules(GOBJ REQUIRED gobject-2.0) pkg_check_modules(GLIB2 REQUIRED glib-2.0) +pkg_check_modules(ZLIB REQUIRED zlib) set(OSG_COMPONENTS osg osgUtil osgViewer osgGA osgManipulator osgText osgDB) find_package(OpenSceneGraph REQUIRED COMPONENTS ${OSG_COMPONENTS}) #GDAL @@ -345,7 +346,6 @@ stereo_dense.cpp image_rect.cpp ANNWrapper.cpp ) -ADD_DEFINITIONS( "-g") ADD_LIBRARY( ${THREADED_STEREO_LIB} STATIC ${SRCS} ${SPINDEX_SRC}) TARGET_LINK_LIBRARIES (${THREADED_STEREO_LIB} ${THREADED_STEREO_LIB}-sonar) ADD_EXECUTABLE( ${CMAKE_PROJECT_NAME} threadedStereo.cpp ShellCmd.cpp ) @@ -379,7 +379,7 @@ ADD_EXECUTABLE(genOverlappingPoses genOverlappingPoses.cpp) #ADD_EXECUTABLE(temp temp.cpp) TARGET_LINK_LIBRARIES( genOverlappingPoses ${THREADED_STEREO_LIB} ) -SET(OGF_LIBS basic math cells numeric_stuff image z m ) +SET(OGF_LIBS basic math cells numeric_stuff image ${ZLIB_LIBRARIES} ) LINK_LIBRARIES(osgTerrain osgFX osg spindex vips vipsCC) TARGET_LINK_LIBRARIES( ${CMAKE_PROJECT_NAME} ${THREADED_STEREO_LIB} vips vipsCC vpb spindex ${THREADED_STEREO_LIB}-sonar ${OGF_LIBS}) #TARGET_LINK_LIBRARIES( engine ${THREADED_STEREO_LIB} vips vipsCC vpb spindex) @@ -405,10 +405,10 @@ TARGET_LINK_LIBRARIES( calcTexCoordDidson ${THREADED_STEREO_LIB} spindex vpb vip TARGET_LINK_LIBRARIES( singleImageTex ${THREADED_STEREO_LIB} spindex vpb vips vipsCC ${OGF_LIBS}) TARGET_LINK_LIBRARIES( borderClip ${THREADED_STEREO_LIB} spindex ) -TARGET_LINK_LIBRARIES( dumpPCD vips vipsCC ${THREADED_STEREO_LIB} z) +TARGET_LINK_LIBRARIES( dumpPCD vips vipsCC ${THREADED_STEREO_LIB} ${ZLIB_LIBRARIES}) -TARGET_LINK_LIBRARIES( dicedImage vips vipsCC ${THREADED_STEREO_LIB} z) -TARGET_LINK_LIBRARIES( sparseJoin vips vipsCC ${THREADED_STEREO_LIB} z) +TARGET_LINK_LIBRARIES( dicedImage vips vipsCC ${THREADED_STEREO_LIB} ${ZLIB_LIBRARIES}) +TARGET_LINK_LIBRARIES( sparseJoin vips vipsCC ${THREADED_STEREO_LIB} ${ZLIB_LIBRARIES}) #TARGET_LINK_LIBRARIES( threshold ${THREADED_STEREO_LIB} )