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

CMake Build Failure ["debug" argument must be followed by a library] #145

Closed
acxz opened this issue Oct 12, 2019 · 5 comments
Closed

CMake Build Failure ["debug" argument must be followed by a library] #145

acxz opened this issue Oct 12, 2019 · 5 comments

Comments

@acxz
Copy link
Contributor

acxz commented Oct 12, 2019

Description

gtsam does not build, in fact cmake fails.

Steps to reproduce

  1. Clone gtsam
  2. cd gtsam && mkdir build && cd build
  3. cmake ..

Error Message:

-- The CXX compiler identification is GNU 9.2.0
-- The C compiler identification is GNU 9.2.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- GTSAM_SOURCE_ROOT_DIR: [/home/acxz/vcs/github/borglab/og/gtsam]
-- Found Boost: /usr/lib64/cmake/Boost-1.71.0/BoostConfig.cmake (found suitable version "1.71.0", minimum required is "1.43") found components:  serialization system filesystem thread program_options date_time timer chrono regex 
-- GTSAM_BOOST_LIBRARIES: optimized;/usr/lib64/libboost_serialization.so.1.71.0;optimized;/usr/lib64/libboost_system.so.1.71.0;optimized;/usr/lib64/libboost_filesystem.so.1.71.0;optimized;/usr/lib64/libboost_thread.so.1.71.0;optimized;/usr/lib64/libboost_date_time.so.1.71.0;optimized;/usr/lib64/libboost_regex.so.1.71.0;debug;debug;debug;debug;debug;debug
-- Found TBB: /usr/include (found suitable version "2019.0", minimum required is "4.4") found components:  tbb tbbmalloc 
-- Could NOT find MKL (missing: MKL_INCLUDE_DIR MKL_LIBRARIES) 
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Found Eigen version: 3.3.7
CMake Error at wrap/CMakeLists.txt:32 (target_link_libraries):
  The "debug" argument must be followed by a library.


-- Configuring incomplete, errors occurred!

Expected behavior

cmake command should not error out and finish successfully.

Environment

gtsam: develop branch
cmake: 3.15.4
boost: 1.71.0
OS: ArchLinux

Additional information

After some prelim debugging, it seems as tho in the latest cmake version (or the latest boost version), you cannot have empty fields after library identifies such as debug. Since I am not building gtsam in debug mode, the following variables are empty for me and as such when calling ${WRAP_BOOST_LIBRARIES} further in the CMakeLists.txt, the above error triggers. This happens not just in the wrap/CMakeLists.txt but also in other locations where debug is specified in the variable name, but no debug libraries are included. Another case is with ${GTSAM_BOOST_LIBRARIES} here with the relevant definition happening here.

@jlblancoc
Copy link
Member

I think PR #135 should fix this one too.
Please, give a try to that PR and confirm it to us.

@acxz
Copy link
Contributor Author

acxz commented Oct 12, 2019

Just checked the PR and cmake works fine! Hopefully this PR can get merged ASAP and a new release made, so ArchLinux users can have a working gtsam package.

EDIT: I'll go ahead and close this issue once the PR is merged.

@dellaert
Copy link
Member

I merged #135 and will close this issue for you :-) Thanks for helping to make GTSAM better!

@acxz
Copy link
Contributor Author

acxz commented Oct 12, 2019

Thanks for the super quick response, really means a lot!

@shaoxh
Copy link

shaoxh commented Oct 19, 2021

Hi, I was using tag 4.0.0 but this problem is still there.
Error message like ...
CMake Warning (dev) at wrap/CMakeLists.txt:29 (target_link_libraries):
Link library type specifier "optimized" is followed by specifier "debug"
instead of a library name. The first specifier will be ignored.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at wrap/CMakeLists.txt:29 (target_link_libraries):
The "debug" argument must be followed by a library.

Could you tell me which tag has fixed your error? @acxz

varunagrawal added a commit that referenced this issue Feb 2, 2022
56e7c0c81 Merge pull request #145 from borglab/matlab/raw_ptr
2e82cd38d address review
58ff3b0a1 update tests and fixtures
dcb6ef80f fix matlab wrapper to properly handle raw pointers
2377b330f refactor argument list generation

git-subtree-dir: wrap
git-subtree-split: 56e7c0c81c6df4e08c3496cc6cc8e48d881c2a8c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants