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

shouldn't be status-code in CMakeLists.txt too? #45

Closed
wants to merge 1 commit into from

Conversation

jose-d
Copy link
Contributor

@jose-d jose-d commented Dec 9, 2024

I'm not very good with cmake, so when trying to analyze this error:

(coming from command cmake .. in operon/build )

-- Disabled features:
 * USE_JEMALLOC, Link against jemalloc, a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support [default=OFF].
 * USE_CERES, Use the non-linear least squares optimizer from Ceres solver to tune model coefficients (if OFF, Eigen::LevenbergMarquardt will be used instead).

-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Configuring done (8.4s)
CMake Error at /cvmfs/2024a.phoebe.lan/software/lbfgs/20240601-GCCcore-13.3.0/share/lbfgs/lbfgsTargets.cmake:60 (set_target_properties):
  The link interface of target "lbfgs::lbfgs" contains:

    status-code::hl

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /cvmfs/2024a.phoebe.lan/software/lbfgs/20240601-GCCcore-13.3.0/share/lbfgs/lbfgsConfig.cmake:1 (include)
  CMakeLists.txt:96 (find_package)


-- Generating done (0.0s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

I found that adding find_package(status-code REQUIRED) into CMakeLists.txt fixes this problem.
I'd be happy if anybody knowledgeable with cmake could take look at this.

@foolnotion
Copy link
Member

I'm not really sure what's going on here. On my side, status-code is found correctly:

$ cmake -S . -B build-linux --preset build-linux -DCMAKE_BUILD_TYPE=Release -Doperon_DEVELOPER_MODE=1 -DCMAKE_CXX_FLAGS="-ferror-limit=1 -march=x86-64-v3 -fsized-deallocation" -DBUILD_SHARED_LIBS=0  
Preset CMake variables:

  CMAKE_CXX_EXTENSIONS="OFF"
  CMAKE_CXX_STANDARD="20"
  CMAKE_CXX_STANDARD_REQUIRED="ON"

Preset environment variables:

  CXX_OPT="-fsized-deallocation -fno-math-errno -march=x86-64-v3"
  CXX_WARNINGS="-Wall -Wextra -Werror -pedantic"

-- The CXX compiler identification is Clang 19.1.4
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/vf3hd7i68qxi735vl51mn1zwmyd0g7ip-clang-wrapper-19.1.4/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /nix/store/1zgzrsbq3b0f06k76pha0r8hmfwvjvc0-git-2.47.0/bin/git (found version "2.47.0")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Taskflow found. Headers: /nix/store/sljci11prirkjjnj9nqjrnjfs2mjsh2p-taskflow-3.8.0/include/
-- Found zstd: /nix/store/8pys6a47askf0g75a1k73p3rx2wim7m6-zstd-1.5.6/lib/libzstd.so
-- Found Zstd: /nix/store/8pys6a47askf0g75a1k73p3rx2wim7m6-zstd-1.5.6/lib/libzstd.so
-- Found status-code: /nix/store/2p8mh67fmzq0qn9my71y3lnfp0zlaj3d-ned14-status-code-0.1.0.0/lib/cmake/status-code/status-codeConfig.cmake
-- MATH: Eigen
-- Using Eigen backend
-- Enabled features:
 * USE_SINGLE_PRECISION, Perform model evaluation using floats (single precision) instead of doubles. Great for reducing runtime, might not be appropriate for all purposes [default=OFF].
 * MATH_BACKEND, Math library for tree evaluation (defaults to Eigen)

-- Disabled features:
 * USE_JEMALLOC, Link against jemalloc, a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support [default=OFF].
 * USE_CERES, Use the non-linear least squares optimizer from Ceres solver to tune model coefficients (if OFF, Eigen::LevenbergMarquardt will be used instead).

-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Configuring done (0.9s)
-- Generating done (0.0s)
-- Build files have been written to: /home/bogdb/src/operon-main/build-linux

Could you post the full CMake log? Are you building inside a nix dev shell or in some other way?

It may be that the lbfgs project (or its CMake) needs some updates.

@jose-d
Copy link
Contributor Author

jose-d commented Dec 11, 2024

This is my full output of cmake:

[jose@login1 operon]$ cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Taskflow found. Headers: /cvmfs/2024a.phoebe.lan/software/taskflow/3.8.0-GCCcore-13.3.0/include/
-- Found zstd: /cvmfs/2024a.phoebe.lan/software/zstd/1.5.6-GCCcore-13.3.0/lib/libzstd.so
-- Found Zstd: /cvmfs/2024a.phoebe.lan/software/zstd/1.5.6-GCCcore-13.3.0/lib/libzstd.so
-- Found ZLIB: /cvmfs/2024a.phoebe.lan/software/zlib/1.3.1-GCCcore-13.3.0/lib/libz.so (found version "1.3.1")
CMake Warning at CMakeLists.txt:103 (find_package):
  By not providing "FindxxHash.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "xxHash", but
  CMake did not find one.

  Could not find a package configuration file provided by "xxHash" with any
  of the following names:

    xxHashConfig.cmake
    xxhash-config.cmake

  Add the installation prefix of "xxHash" to CMAKE_PREFIX_PATH or set
  "xxHash_DIR" to a directory containing one of the above files.  If "xxHash"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2")
-- Checking for module 'xxhash'
--   Package 'xxhash', required by 'virtual:world', not found
-- Checking for module 'libxxhash'
--   Found libxxhash, version 0.8.2
-- MATH: Eigen
-- Using Eigen backend
-- Enabled features:
 * USE_SINGLE_PRECISION, Perform model evaluation using floats (single precision) instead of doubles. Great for reducing runtime, might not be appropriate for all purposes [default=OFF].
 * MATH_BACKEND, Math library for tree evaluation (defaults to Eigen)

-- Disabled features:
 * USE_JEMALLOC, Link against jemalloc, a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support [default=OFF].
 * USE_CERES, Use the non-linear least squares optimizer from Ceres solver to tune model coefficients (if OFF, Eigen::LevenbergMarquardt will be used instead).

-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Configuring done (8.5s)
CMake Error at /cvmfs/2024a.phoebe.lan/software/lbfgs/20240601-GCCcore-13.3.0/share/lbfgs/lbfgsTargets.cmake:60 (set_target_properties):
  The link interface of target "lbfgs::lbfgs" contains:

    status-code::hl

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /cvmfs/2024a.phoebe.lan/software/lbfgs/20240601-GCCcore-13.3.0/share/lbfgs/lbfgsConfig.cmake:1 (include)
  CMakeLists.txt:96 (find_package)


-- Generating done (0.3s)
CMake Generate step failed.  Build files cannot be regenerated correctly.
[jose@login1 operon]$

Are you building inside a nix dev shell or in some other way?

Above I ran the cmake manually from hand in bash terminal, dependencies are loaded using module load.

It may be that the lbfgs project (or its CMake) needs some updates.

yes... thank you for confirming that cmake works well for you.
I'll focus into direction of lbfgs.

I'm closing this PR because if current cmake setup works properly at your primary build platform, no need to fix it here and I should investigate where the issue is coming from.

@jose-d
Copy link
Contributor Author

jose-d commented Dec 11, 2024

it seems it is not bug in cmake of operon itself.

@jose-d jose-d closed this Dec 11, 2024
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

Successfully merging this pull request may close these issues.

2 participants