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

The link interface of target "Seastar::seastar" contains: Valgrind::valgrind but the target was not found. #2180

Closed
robinchrist opened this issue Apr 13, 2024 · 1 comment
Assignees
Labels
build build system

Comments

@robinchrist
Copy link

I'm getting the following error when building b74a027 and cd8a913 (only tried those two):

cmake -DCMAKE_PREFIX_PATH="/data/dev/Kataklysmos/external/seastar/build/release;/data/dev/Kataklysmos/external/seastar/build/release/_cooking/installed" -DCMAKE_MODULE_PATH="/data/dev/Kataklysmos/external/seastar/cmake" -DCMAKE_BUILD_TYPE="Release" -GNinja /data/dev/Kataklysmos
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/include (found suitable version "1.74.0", minimum required is "1.73.0")  
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Found Boost: /usr/include (found suitable version "1.74.0", minimum required is "1.73.0") found components: filesystem program_options thread unit_test_framework chrono date_time atomic 
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") 
-- Found c-ares: /usr/lib/x86_64-linux-gnu/libcares.so (found suitable version "1.19.1", minimum required is "1.13") 
-- Checking for module 'libdpdk'
--   Found libdpdk, version 23.07.0
-- Found dpdk: /data/dev/Kataklysmos/external/seastar/build/release/_cooking/installed/include  
-- Performing Test _warning_supported_volatile
-- Performing Test _warning_supported_volatile - Success
-- Found lz4: /usr/lib/x86_64-linux-gnu/liblz4.so (found suitable version "1.9.4", minimum required is "1.7.3") 
-- Found GnuTLS: /usr/lib/x86_64-linux-gnu/libgnutls.so (found suitable version "3.8.1", minimum required is "3.3.26") 
-- Performing Test HAVE_IOURING_FEATURES
-- Performing Test HAVE_IOURING_FEATURES - Success
-- Found LibUring: /usr/lib/x86_64-linux-gnu/liburing.so (found suitable version "2.4", minimum required is "2.0") 
-- Performing Test LinuxMembarrier_FOUND
-- Performing Test LinuxMembarrier_FOUND - Success
-- Performing Test Sanitizers_ADDRESS_FOUND
-- Performing Test Sanitizers_ADDRESS_FOUND - Success
-- Performing Test Sanitizers_UNDEFINED_BEHAVIOR_FOUND
-- Performing Test Sanitizers_UNDEFINED_BEHAVIOR_FOUND - Success
-- Performing Test Sanitizers_FIBER_SUPPORT
-- Performing Test Sanitizers_FIBER_SUPPORT - Success
-- Found Sanitizers: -fsanitize=address  
-- Performing Test CxxSourceLocation_SUPPORTED
-- Performing Test CxxSourceLocation_SUPPORTED - Success
-- Performing Test CxxSourceLocation_IMPLEMENTS_CWG2631
-- Performing Test CxxSourceLocation_IMPLEMENTS_CWG2631 - Failed
-- Performing Test StdAtomic_EXPLICIT_LINK
-- Performing Test StdAtomic_EXPLICIT_LINK - Success
-- Found StdAtomic: -latomic  
-- Found SystemTap-SDT: /usr/include/x86_64-linux-gnu  
-- Found hwloc: /usr/lib/x86_64-linux-gnu/libhwloc.so (Required is at least version "1.11.2") 
-- Found lksctp-tools: /usr/lib/x86_64-linux-gnu/libsctp.so  
-- Found numactl: /usr/lib/x86_64-linux-gnu/libnuma.so  
-- Looking for getcontext
-- Looking for getcontext - found
-- Found yaml-cpp: /usr/lib/x86_64-linux-gnu/libyaml-cpp.so (Required is at least version "0.5.1") 
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (found suitable version "3.21.12", minimum required is "2.5.0") 
-- Configuring done (2.5s)
CMake Error at external/seastar/build/release/SeastarTargets.cmake:52 (set_target_properties):
  The link interface of target "Seastar::seastar" contains:

    Valgrind::valgrind

  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):
  external/seastar/build/release/SeastarConfig.cmake:36 (include)
  CMakeLists.txt:6 (find_package)

Ubuntu 23.10, using system installed dependencies.
Seastar configured with

./configure.py --mode=release --enable-dpdk
ninja -C build/release

Adding Valgrind to the _seastar_all_dependencies in SeastarDependencies.cmake seems to fix the issue?

tchaikov added a commit to tchaikov/seastar that referenced this issue Apr 15, 2024
in Seastar, valgrind library is only used at the build time, and is
used internally for accessing its header files when buildings its
internal .cc files. so we don't expect to expose it via `export()`,
for exposing it in `SeastarTargets.cmake`.

but somehow when building Seastar as a static library, valgrind is
still exposed in Seastar's CMake configuration file. if a CMake
based project consume Seastar using its CMake configuration file,
it runs into following failure when CMake generates the building
system:

```
-- Configuring done (2.5s)
CMake Error at external/seastar/build/release/SeastarTargets.cmake:52 (set_target_properties):
  The link interface of target "Seastar::seastar" contains:

    Valgrind::valgrind

  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):
  external/seastar/build/release/SeastarConfig.cmake:36 (include)
  CMakeLists.txt:6 (find_package)
```

fortunately, in CMake 3.26, `BUILD_LOCAL_INTERFACE` was introduced
this problem in specific, so that the linked library is not included
by `export()` anymore.

in this change, we include `Valgrind::valgrind` using this generator
expression if the CMake's version is greater or equal to 3.26, so that
`Valgrind` is not required for building Seastar applications.

as this generator expression is not available on CMake versions lower
than 3.26, and the minimal required CMake version for building Seastar
is 3.13, and Seastar does support static build. The issue is still not
fully addressed even with this change with older CMake and if Seastar
is built as a static library.

Refs scylladb#2180
Signed-off-by: Kefu Chai <[email protected]>
@tchaikov tchaikov self-assigned this Apr 15, 2024
@tchaikov tchaikov added the build build system label Apr 15, 2024
tchaikov added a commit to tchaikov/seastar that referenced this issue Apr 15, 2024
in Seastar, valgrind library is only used at the build time, and is
used internally for accessing its header files when buildings its
internal .cc files. so we don't expect to expose it via `export()`,
for exposing it in `SeastarTargets.cmake`.

but somehow when building Seastar as a static library, valgrind is
still exposed in Seastar's CMake configuration file. if a CMake
based project consume Seastar using its CMake configuration file,
it runs into following failure when CMake generates the building
system:

```
-- Configuring done (2.5s)
CMake Error at external/seastar/build/release/SeastarTargets.cmake:52 (set_target_properties):
  The link interface of target "Seastar::seastar" contains:

    Valgrind::valgrind

  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):
  external/seastar/build/release/SeastarConfig.cmake:36 (include)
  CMakeLists.txt:6 (find_package)
```

fortunately, in CMake 3.26, `BUILD_LOCAL_INTERFACE` was introduced
this problem in specific, so that the linked library is not included
by `export()` anymore.

in this change, we include `Valgrind::valgrind` using this generator
expression if the CMake's version is greater or equal to 3.26, so that
`Valgrind` is not required for building Seastar applications.

as this generator expression is not available on CMake versions lower
than 3.26, and the minimal required CMake version for building Seastar
is 3.13, and Seastar does support static build. The issue is still not
fully addressed even with this change with older CMake and if Seastar
is built as a static library.

previously, 372a16a intended to address this. but somehow Valgrind
is still exposed by SeastarTargets.cmake.

Refs scylladb#2180
Signed-off-by: Kefu Chai <[email protected]>
avikivity pushed a commit that referenced this issue Apr 18, 2024
in Seastar, valgrind library is only used at the build time, and is
used internally for accessing its header files when buildings its
internal .cc files. so we don't expect to expose it via `export()`,
for exposing it in `SeastarTargets.cmake`.

but somehow when building Seastar as a static library, valgrind is
still exposed in Seastar's CMake configuration file. if a CMake
based project consume Seastar using its CMake configuration file,
it runs into following failure when CMake generates the building
system:

```
-- Configuring done (2.5s)
CMake Error at external/seastar/build/release/SeastarTargets.cmake:52 (set_target_properties):
  The link interface of target "Seastar::seastar" contains:

    Valgrind::valgrind

  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):
  external/seastar/build/release/SeastarConfig.cmake:36 (include)
  CMakeLists.txt:6 (find_package)
```

fortunately, in CMake 3.26, `BUILD_LOCAL_INTERFACE` was introduced
this problem in specific, so that the linked library is not included
by `export()` anymore.

in this change, we include `Valgrind::valgrind` using this generator
expression if the CMake's version is greater or equal to 3.26, so that
`Valgrind` is not required for building Seastar applications.

as this generator expression is not available on CMake versions lower
than 3.26, and the minimal required CMake version for building Seastar
is 3.13, and Seastar does support static build. The issue is still not
fully addressed even with this change with older CMake and if Seastar
is built as a static library.

previously, 372a16a intended to address this. but somehow Valgrind
is still exposed by SeastarTargets.cmake.

Refs #2180
Signed-off-by: Kefu Chai <[email protected]>
@robinchrist
Copy link
Author

I can confirm that this issue has been fixed by #2189

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build system
Projects
None yet
Development

No branches or pull requests

2 participants