seastar icon indicating copy to clipboard operation
seastar copied to clipboard

Can't build example application with CMakeLists.txt from readme: /usr/bin/ld: cannot find -lValgrind::valgrind

Open enedil opened this issue 2 years ago • 2 comments

Problem:

~/c/t/build $ cat ../CMakeLists.txt
find_package (Seastar REQUIRED)

add_executable (my_app
  my_app.cc)
  
target_link_libraries (my_app
  Seastar::seastar)
~/c/t/build $ cmake -GNinja -DCMAKE_PREFIX_PATH="$seastar_dir/build/dev;$seastar_dir/build/dev/_cooking/installed" -DCMAKE_MODULE_PATH=$seastar_dir/cmake ..
(output omitted)
~/c/t/build $ ninja
[1/1] Linking CXX executable my_app
FAILED: my_app 
: && /usr/bin/c++  -rdynamic CMakeFiles/my_app.dir/my_app.o -o my_app -L/home/enedil/code/seastar/build/dev /home/enedil/code/seastar/build/dev/libseastar.a  /usr/lib64/libboost_program_options.so  /usr/lib64/libboost_thread.so  /usr/lib64/libboost_chrono.so  /usr/lib64/libboost_date_time.so  /usr/lib64/libboost_atomic.so  /usr/lib64/libcares.so  /usr/lib64/libcryptopp.so  /usr/lib64/libfmt.so.7.1.3  -Wl,--as-needed  /usr/lib64/liblz4.so  -ldl  /usr/lib64/libgnutls.so  -latomic  /usr/lib64/libsctp.so  -lrt  /usr/lib64/libyaml-cpp.so  -lValgrind::valgrind  -lpthread  /usr/lib64/libhwloc.so  /usr/lib64/libnuma.so && :
/usr/bin/ld: cannot find -lValgrind::valgrind
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

This commit probably broke something

commit 7f79aa6819cfd4266fcc2cc104b9ffbecdc58e0a
Author: Kefu Chai <[email protected]>
Date:   Thu Apr 28 11:28:55 2022 +0800

    cmake: add FindValgrind.cmake

enedil avatar May 15 '22 14:05 enedil

Hi, I dont know how to fix the actual issue introduced by this commit, but made cmake happy by adding an extra line add_library(Valgrind::valgrind INTERFACE IMPORTED) after find_package (Seastar REQUIRED)

JasonYuchen avatar Jul 31 '22 13:07 JasonYuchen

fixed by this commit in master, I think we can close this issue

JasonYuchen avatar Aug 05 '22 03:08 JasonYuchen