-
I'm trying to link an example program against libtorch with Meson, using Torch's provided CMake modules. I'm on macOS. The original CMake-based example builds and runs fine: # Configure with: cmake -DCMAKE_PREFIX_PATH=(python3 -c "import torch; print(torch.utils.cmake_prefix_path)") -B build
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(libtorch-example)
find_package(Torch REQUIRED)
add_executable(example-app-cmake example-app.cpp)
message("${TORCH_LIBRARIES}")
target_link_libraries(example-app-cmake "${TORCH_LIBRARIES}")
set_property(TARGET example-app-cmake PROPERTY CXX_STANDARD 14) I try to build the same code with Meson in the following way: # Configure with: meson build --cmake-prefix-path=(python3 -c "import torch; print(torch.utils.cmake_prefix_path)")
project('libtorch-example', ['c', 'cpp'], default_options : ['cpp_std=c++14'])
torch = dependency('Torch', version : '>=1.10', method : 'cmake')
message(torch.get_variable(cmake : 'TORCH_LIBRARIES'))
executable('example-app-meson', 'example-app.cpp', dependencies : torch) The program produced by meson fails to load libc10 that Torch provides, and I guess libtorch_cpu would follow. The difference of linking in-between the two programs:
In meson, The build seems to find c10 however:
Would you have any suggestions on how I could understand what's not working with the meson build? I'd like to recover some messages from the underlying |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
My issue was specifically linked to #3882, not sure what the motive is behind this feature. |
Beta Was this translation helpful? Give feedback.
My issue was specifically linked to #3882, not sure what the motive is behind this feature.
Regarding debugging a dependency, it seems that there is barely anything outside of a few prints in
meson-logs/
andmeson-private/
: #4563