Why do I get linker errors when building ArrayFire examples

61 views Asked by At

I am using the ArrayFire binaries provided by my Linux distro (Artix Linux, i.e. Arch Linux without Systemd). I want to build the examples, and I get linker errors.

The library is installed here:

> ls /usr/lib/libaf*
/usr/lib/libaf.debug  /usr/lib/libaf.so.3.9.0  /usr/lib/libafcpu.so.3      /usr/lib/libafcuda.so        /usr/lib/libafopencl.debug  /usr/lib/libafopencl.so.3.9.0
/usr/lib/libaf.so     /usr/lib/libafcpu.debug  /usr/lib/libafcpu.so.3.9.0  /usr/lib/libafcuda.so.3      /usr/lib/libafopencl.so
/usr/lib/libaf.so.3   /usr/lib/libafcpu.so     /usr/lib/libafcuda.debug    /usr/lib/libafcuda.so.3.9.0  /usr/lib/libafopencl.so.3

I copy the examples directory in my home, and setup an out-of-source build:

~/examples
~/examples_build

I run cmake specifying the library path:

examples_build> cmake -DArrayFire_DIR=/usr/lib/ ../examples/
-- The CXX compiler identification is GNU 13.2.1
-- 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
-- Configuring done (0.9s)
-- Generating done (0.4s)
-- Build files have been written to: /home/pietrom/Documents/arrayfire_examples/examples_build

When I run make I have linker errors:

examples_build> make
[  0%] Building CXX object benchmarks/CMakeFiles/blas_cpu.dir/blas.cpp.o
[  0%] Linking CXX executable blas_cpu
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::basic_data<void>::signs'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::basic_data<void>::hex_digits'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::format_error::~format_error()'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `vtable for fmt::v8::format_error'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `int fmt::v8::detail::snprintf_float<long double>(long double, int, fmt::v8::detail::float_specs, fmt::v8::detail::buffer<char>&)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::assert_fail(char const*, int, char const*)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::dragonbox::decimal_fp<double> fmt::v8::detail::dragonbox::to_decimal<double>(double)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `int fmt::v8::detail::format_float<double>(double, int, fmt::v8::detail::float_specs, fmt::v8::detail::buffer<char>&)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::error_handler::on_error(char const*)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `int fmt::v8::detail::format_float<long double>(long double, int, fmt::v8::detail::float_specs, fmt::v8::detail::buffer<char>&)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `int fmt::v8::detail::snprintf_float<double>(double, int, fmt::v8::detail::float_specs, fmt::v8::detail::buffer<char>&)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::basic_data<void>::left_padding_shifts'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `typeinfo for fmt::v8::format_error'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::vformat[abi:cxx11](fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::basic_data<void>::right_padding_shifts'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `spdlog::details::log_msg::log_msg(spdlog::source_loc, fmt::v8::basic_string_view<char>, spdlog::level::level_enum, fmt::v8::basic_string_view<char>)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `char fmt::v8::detail::decimal_point_impl<char>(fmt::v8::detail::locale_ref)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::thousands_sep_result<char> fmt::v8::detail::thousands_sep_impl<char>(fmt::v8::detail::locale_ref)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::dragonbox::decimal_fp<float> fmt::v8::detail::dragonbox::to_decimal<float>(float)'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::basic_data<void>::prefixes'
/usr/bin/ld: /usr/lib/libafcpu.so.3.9.0: undefined reference to `fmt::v8::detail::basic_data<void>::digits'
collect2: error: ld returned 1 exit status
make[2]: *** [benchmarks/CMakeFiles/blas_cpu.dir/build.make:98: benchmarks/blas_cpu] Error 1
make[1]: *** [CMakeFiles/Makefile2:576: benchmarks/CMakeFiles/blas_cpu.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Is it possible that these errors are due to missing features in my distro build of ArrayFire?

What else could be the problem?

0

There are 0 answers