gadomski / cpd

C++ implementation of the Coherent Point Drift point set registration algorithm.
http://www.gadom.ski/cpd
GNU General Public License v2.0
395 stars 124 forks source link

Error in building example #37

Closed xinkang closed 9 years ago

xinkang commented 9 years ago

Hi,

There is an error when building the example, the error message is "ld: library not found for -lcpd-lib".

I have successfully built the CPD and run the "bin/cpd-test"; everything went quit smoothly. I also did "make install" as shown below (note the message is the second time running "make install"):

Install the project... -- Install configuration: "" -- Up-to-date: /usr/local/lib/cpd/cmake/CpdConfig.cmake -- Up-to-date: /usr/local/lib/cpd/cmake/CpdConfigVersion.cmake -- Up-to-date: /usr/local/lib/cpd/cmake/CpdTargets.cmake -- Up-to-date: /usr/local/lib/cpd/cmake/CpdTargets-noconfig.cmake -- Up-to-date: /usr/local/include/cpd -- Up-to-date: /usr/local/include/cpd/defaults.hpp -- Up-to-date: /usr/local/include/cpd/nonrigid.hpp -- Up-to-date: /usr/local/include/cpd/nonrigid_lowrank.hpp -- Up-to-date: /usr/local/include/cpd/registration.hpp -- Up-to-date: /usr/local/include/cpd/rigid.hpp -- Up-to-date: /usr/local/include/cpd/version.hpp -- Installing: /usr/local/lib/libcpd.0.2.2-60-gcd64321.dylib -- Up-to-date: /usr/local/lib/libcpd.0.dylib -- Up-to-date: /usr/local/lib/libcpd.dylib -- Installing: /usr/local/bin/cpd

Then, I followed exactly the commands in the README.txt under "example" folder as

mkdir build cd build cmake .. make

Then, the aforementioned error appeared. Any idea why this happened? Should the lib being linked be "libcpd"? I changed "cpd-lib" to "libcpd", but did not get any luck. Please kindly help me on this. Thanks!

Best, Ben PS. I am using Mac OS X 10.10.5 and CMake 3.3.1, for your reference.

gadomski commented 9 years ago

Thanks for the report. I've updated example/CMakeLists.txt to fix an outdated reference. Can you delete your example/build and try again?

xinkang commented 9 years ago

Something wrong happened with "Fgt::Library"...

mkdir build cd build cmake .. -- The CXX compiler identification is AppleClang 6.1.0.6020053 -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done CMake Warning (dev) at CMakeLists.txt:6 (add_executable): Policy CMP0028 is not set: Double colon in target name means ALIAS or IMPORTED target. Run "cmake --help-policy CMP0028" for policy details. Use the cmake_policy command to set the policy and suppress this warning.

Target "cpd-example-project" links to target "Fgt::Library" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done

make Scanning dependencies of target cpd-example-project [ 50%] Building CXX object CMakeFiles/cpd-example-project.dir/main.cpp.o [100%] Linking CXX executable cpd-example-project ld: library not found for -lFgt::Library clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: * [cpd-example-project] Error 1 make[1]: * [CMakeFiles/cpd-example-project.dir/all] Error 2 make: *\ [all] Error 2

gadomski commented 9 years ago

Hm, the Fgt::Library should be set as an IMPORTED library by the cpd configuration scripts. Can you paste the contents of {your install prefix}/lib/cpd/cmake/CpdTargets-{your build configuration}.cmake? It should have a line that's something like:

IMPORTED_LINK_DEPENDENT_LIBRARIES_RELWITHDEBINFO "Fgt::Library"

or some such.

xinkang commented 9 years ago

Hi Pete, there was no a line like you provided. But it appeared after I redo the build-from-source and installation. Now it is working. Thanks a lot!

One question beyond this issue: do you have a figure or chart showing the performance of the implementation? I am thinking of using your implementation in a real-time application. Let me know if you have another convenient channel for talking about this.

gadomski commented 9 years ago

But it appeared after I redo the build-from-source and installation.

Perfect, glad it worked out. Closing as fixed.

do you have a figure or chart showing the performance of the implementation? I am thinking of using your implementation in a real-time application. Let me know if you have another convenient channel for talking about this.

I don't have hard benchmarks that I'm comfortable publishing. In general I'd say that this implementation is more performant than the original Matlab code from Myronenko, particularly if you take advantage of some of the parallelization in the fgt library. Depending on the size of the point clouds in question you could try to use it in a real time application, but for most real-world datasets I'd hazard to say that the performance wouldn't be good enough for real-time use. I can't speak for your specific use-case though.

Thanks for asking, I don't really have a convenient channel other than these issues. Library's not quite used enough to warrant an IRC channel :-P. So yeah, keep the tickets coming if you have more questions, etc!