You should link against libcolmap.a.
--
You received this message because you are subscribed to the Google Groups "COLMAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/5a0342f8-42dc-4e09-bc07-d4db50b6d4d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You should link against libcolmap.a.
From: <col...@googlegroups.com> on behalf of <anhdu...@gmail.com>
Reply-To: <col...@googlegroups.com>
Date: Friday, May 4, 2018 at 10:03 AM
To: COLMAP <col...@googlegroups.com>
Subject: [COLMAP] Use COLMAP as static library
I created a CMake project and link to static library "libbase.a" but it seems it is impossible because it requires a lot of dependencies. Anyone knows how to deal with that problem? I spent a whole day but got nothing.
Thank you for your help.
--
You received this message because you are subscribed to the Google Groups "COLMAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+unsubscribe@googlegroups.com.
To post to this group, send email to
To view this discussion on the web visit
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/8354c966-f8ef-4caa-9e70-ac43fd8d776d%40googlegroups.com.
In file included from /usr/local/include/colmap/util/option_manager.h:39:0,
from /home/dzungdoan/DzungDoan/codes/COLMAP-test/test.cc:4:
/usr/local/share/colmap/../../include/colmap/util/logging.h: In function ‘bool colmap::__CheckOptionOpImpl(const char*, int, bool, const T1&, const T2&, const char*, const char*, const char*)’:
/usr/local/share/colmap/../../include/colmap/util/logging.h:84:49: error: ‘to_string’ is not a member of ‘std’
op_str, val2_str, std::to_string(val1).c_str(),
^
/usr/local/share/colmap/../../include/colmap/util/logging.h:85:31: error: ‘to_string’ is not a member of ‘std’
std::to_string(val2).c_str())
^
In file included from /home/dzungdoan/DzungDoan/codes/COLMAP-test/test.cc:4:0:
/usr/local/include/colmap/util/option_manager.h: At global scope:
/usr/local/include/colmap/util/option_manager.h:115:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<std::string> project_path;
^
/usr/local/include/colmap/util/option_manager.h:116:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<std::string> database_path;
^
/usr/local/include/colmap/util/option_manager.h:117:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<std::string> image_path;
^
/usr/local/include/colmap/util/option_manager.h:119:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<ImageReaderOptions> image_reader;
^
/usr/local/include/colmap/util/option_manager.h:120:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<SiftExtractionOptions> sift_extraction;
^
/usr/local/include/colmap/util/option_manager.h:122:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<SiftMatchingOptions> sift_matching;
^
/usr/local/include/colmap/util/option_manager.h:123:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<ExhaustiveMatchingOptions> exhaustive_matching;
^
/usr/local/include/colmap/util/option_manager.h:124:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<SequentialMatchingOptions> sequential_matching;
^
/usr/local/include/colmap/util/option_manager.h:125:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<VocabTreeMatchingOptions> vocab_tree_matching;
^
/usr/local/include/colmap/util/option_manager.h:126:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<SpatialMatchingOptions> spatial_matching;
^
/usr/local/include/colmap/util/option_manager.h:127:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<TransitiveMatchingOptions> transitive_matching;
^
/usr/local/include/colmap/util/option_manager.h:129:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<BundleAdjustmentOptions> bundle_adjustment;
^
/usr/local/include/colmap/util/option_manager.h:130:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<IncrementalMapperOptions> mapper;
^
/usr/local/include/colmap/util/option_manager.h:132:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<mvs::PatchMatchOptions> dense_stereo;
^
/usr/local/include/colmap/util/option_manager.h:133:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
std::shared_ptr<mvs::StereoFusionOptions> dense_fusion;set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") CMakeLists.txt, then the compilation was succesfull.
However, I got another error (it seems it is the linking error) as follows:
[ 50%] Building CXX object CMakeFiles/test.dir/test.cc.o
[100%] Linking CXX executable test
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `__device_stub__ZN3pba20jte_point_vec_kernelILi2ELi2EEEviiPf(int, int, float*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x1d): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x40): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x56): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x66): undefined reference to `cudaLaunch'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o):
In function
`__device_stub__ZN3pba20jte_point_vec_kernelILi2ELi1EEEviiPf(int, int,
float*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x8d): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0xb0): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0xc6): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0xd6): undefined reference to `cudaLaunch'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `__device_stub__ZN3pba23jtjd_point_block_kernelILi2EEEviiffP6float4S2_(int, int, float, float, float4*, float4*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x10e): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x130): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x148): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x160): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x178): undefined reference to `cudaSetupArgument'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o):tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x18e):
more undefined references to `cudaSetupArgument' follow
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o):
In function
`__device_stub__ZN3pba23jtjd_point_block_kernelILi2EEEviiffP6float4S2_(int,
int, float, float, float4*, float4*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x19e): undefined reference to `cudaLaunch'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `__device_stub__ZN3pba23jtjd_point_block_kernelILi1EEEviiffP6float4S2_(int, int, float, float, float4*, float4*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x1de): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x200): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x218): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x230): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x248): undefined reference to `cudaSetupArgument'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o):tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x25e):
more undefined references to `cudaSetupArgument' follow
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o):
In function
`__device_stub__ZN3pba23jtjd_point_block_kernelILi1EEEviiffP6float4S2_(int,
int, float, float, float4*, float4*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x26e): undefined reference to `cudaLaunch'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `__device_stub__ZN3pba28jtjd_cam_block_invert_kernelILi8EEEviP6float4(int, float4*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x299): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x2be): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x2ce): undefined reference to `cudaLaunch'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o):
In function
`__device_stub__ZN3pba28jtjd_cam_block_invert_kernelILi7EEEviP6float4(int,
float4*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x2f9): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x31e): undefined reference to `cudaSetupArgument'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x32e): undefined reference to `cudaLaunch'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `pba::ProgramCU::CheckErrorCUDA(char const*)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x3a8): undefined reference to `cudaGetLastError'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x3e2): undefined reference to `cudaGetErrorString'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `pba::ProgramCU::ResetCurrentDevice()':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x462): undefined reference to `cudaGetDevice'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x467): undefined reference to `cudaDeviceReset'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x474): undefined reference to `cudaSetDevice'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `pba::ProgramCU::GetCudaMemoryCap()':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x4c0): undefined reference to `cudaGetDevice'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x4f2): undefined reference to `cudaGetDeviceProperties'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `pba::ProgramCU::SetCudaDevice(int)':
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x54c): undefined reference to `cudaGetDeviceCount'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x57a): undefined reference to `cudaGetDevice'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x5e3): undefined reference to `cudaSetDevice'
tmpxft_00001371_00000000-5_ProgramCU.cudafe1.cpp:(.text+0x608): undefined reference to `cudaGetDeviceProperties'
/usr/local/share/colmap/../../lib/colmap/libpba.a(pba_generated_ProgramCU.cu.o): In function `pba::ProgramCU::ComputeJacobian(pba::CuTexImage&,
pba::CuTexImage&, pba::CuTexImage&, pba::CuTexImage&,
pba::CuTexImage&, pba::CuTexImage&, pba::CuTexImage&,
pba::CuTexImage&, bool, int, bool)':
Here is the result I got when doing cmake ..
-- Found installed version of Eigen: /usr/lib/cmake/eigen3
-- Found required Ceres dependency: Eigen version 3.2.92 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.14.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- program_options
-- filesystem
-- regex
-- system
-- unit_test_framework
-- Found Eigen
-- Includes : /usr/include/eigen3
-- Found FreeImage
-- Includes : /usr/include
-- Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so
-- Found Glog
-- Includes : /usr/include
-- Libraries : /usr/lib/x86_64-linux-gnu/libglog.so
-- Found Glew
-- Includes : /usr/include
-- Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so
CMake Warning (dev) at CMakeLists.txt:11 (add_executable):
Policy CMP0037 is not set: Target names should not be reserved and should
match a validity pattern. Run "cmake --help-policy CMP0037" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
The target name "test" is reserved or not valid for certain CMake features,
such as generator expressions, and may result in undefined behavior.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
Could you please help me with my error? Thank you very much for your assistanceTo unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/8354c966-f8ef-4caa-9e70-ac43fd8d776d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/527f6dbf-c100-497d-96d2-d682709f7ad1%40googlegroups.com.
Hi,
This should be fixed now with the latest commit in the dev branch: https://github.com/colmap/colmap/commit/f03d165bd9503ebedacfdd5f6c2f541faa692cb1
Thanks again and let me know if this works for you.
Cheers, Johannes
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/5a0342f8-42dc-4e09-bc07-d4db50b6d4d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "COLMAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/8354c966-f8ef-4caa-9e70-ac43fd8d776d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "COLMAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/527f6dbf-c100-497d-96d2-d682709f7ad1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "COLMAP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to colmap+un...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/colmap/8E7E611F-4208-4684-B37D-082630D25AA3%40demuc.de.