arrayfire/arrayfire-rust

[Build] error: linking with `cc` failed: exit code: 1

bokutotu opened this issue · 3 comments

Description

I am having a problem with arrayfire path and setting LD_LIBRATY_PATH and AF_PATH and still getting the error.

Build Environment

Compiler version: gcc 9.2.0
Operating system: CentOS Linux release 7.5.1804 (Core)
Build environment: LD_LIBRARY_PATH,

/opt/pkg/gcc/9.2.0/lib:/opt/pkg/gcc/9.2.0/lib64:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/compiler/lib/intel64_lin:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/mpi/intel64/libfabric/lib:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/mpi/intel64/lib/release:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/mpi/intel64/lib:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/ipp/lib/intel64:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/compiler/lib/intel64_lin:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/mkl/lib/intel64_lin:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/tbb/lib/intel64/gcc4.7:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/tbb/lib/intel64/gcc4.7:/opt/pkg/intel/parallel_studio_xe_2019/update3/debugger_2019/libipt/intel64/lib:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/daal/lib/intel64_lin:/opt/pkg/intel/parallel_studio_xe_2019/update3/compilers_and_libraries_2019.3.199/linux/daal/../tbb/lib/intel64_lin/gcc4.4:lustre7/home/hikarukondo/Rust/arrayfire/lib64:/home/hikarukondo/Rust/arrayfire/lib64

AF_PATH

/home/hikarukondo/Rust/arrayfire

Error Log

   Compiling arrayfire v3.8.0 (/lustre7/home/hikarukondo/Rust/test/arrayfire-rust)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.10vg575guxxpeer9.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.18nvftzehhai9nc4.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.1y71ch0gizeit8ys.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.1y7541contmf9bqk.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.22tll676u0iybwil.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.26lzzkbb71hofm51.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.276bmyzrquuhso8g.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.2a9syjlqza6zom30.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.2dq92jlabib2qiio.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.2fnfwfhvzohou9at.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.2gotqz8o5enyjhq0.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.2jgz889qw07q50xk.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.2jssbc1tqk520gml.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.2lkpag54jwj9xadb.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.34kwag0gw3momf6q.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.3g1saxvrrhmgq458.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.3oqu6ihld6iy4yau.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.3q7gt6a766gxgse7.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.419d31o5erxev2kw.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.4gev8y6slfmoi9xw.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.4nz0tl5likfnq0jv.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.4qrm9hulwe93vl6b.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.abhiazzu5x89lmg.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.eryo9kbl4hqmqco.rcgu.o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.j6qusv6con5oz0d.rcgu.o" "-o" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.ozfl9fw4gn6crem.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps" "-L" "/opt/arrayfire/lib" "-L" "/opt/arrayfire/lib64" "-L" "/usr/local/lib" "-L" "/usr/lib" "-L" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libarrayfire-cbf3f295b394aeff.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libhalf-900cab17cb1487ba.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/liblibc-2482d91fc748c95a.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libnum-7b2ce4551dc8d06a.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libnum_rational-a73c65e7ad393436.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libnum_iter-497a041a47e7b7df.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libnum_complex-4df5938d12dcee94.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libnum_bigint-75797e43b28734ce.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libnum_integer-5cd64c3f3f2f1436.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libnum_traits-db3949e8ef97b6c9.rlib" "/lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/liblazy_static-7895c92c6d278491.rlib" "-Wl,--start-group" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e12de7683a34c500.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-446a53c2e468675f.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-86fef9fb252a2d33.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-3bed9bfd30304751.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-0e38eeb474a7b386.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-a846ed547b824740.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-c9540f0a4fb9265d.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-7d2ca66c92c356eb.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-147e2c808f949493.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-bd2a4369506670e9.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-74bfdd0ce7d0ed48.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-6777f47f1c491841.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-b104f1790174f2be.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-db37898996f45c13.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-25b7435131fc4938.rlib" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-9d4b6f3c097e876e.rlib" "-Wl,--end-group" "/lustre7/home/hikarukondo/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-3f953ad652ab829a.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
  = note: /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.2lkpag54jwj9xadb.rcgu.o: In function `arrayfire::signal::fft::hf3c21df216f6ae19':
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/src/signal/mod.rs:511: undefined reference to `af_fft'
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.419d31o5erxev2kw.rcgu.o: In function `arrayfire::core::array::Array$LT$T$GT$::new::h9e218d21bd8ca7b2':
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/src/core/array.rs:240: undefined reference to `af_create_array'
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.419d31o5erxev2kw.rcgu.o: In function `arrayfire::core::array::print_gen::h5584e778c1aae375':
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/src/core/array.rs:826: undefined reference to `af_print_array_gen'
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/examples/fft-c63caf626a2c8ebc.4nz0tl5likfnq0jv.rcgu.o: In function `_$LT$arrayfire..core..array..Array$LT$T$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::h54f1eca5bc43605a':
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/src/core/array.rs:744: undefined reference to `af_release_array'
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libarrayfire-cbf3f295b394aeff.rlib(arrayfire-cbf3f295b394aeff.2y0qlffx53noqsrk.rcgu.o): In function `arrayfire::core::device::info::heec7ccd764d16abc':
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/src/core/device.rs:82: undefined reference to `af_info'
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libarrayfire-cbf3f295b394aeff.rlib(arrayfire-cbf3f295b394aeff.2y0qlffx53noqsrk.rcgu.o): In function `arrayfire::core::device::set_device::h600a48f5b319d324':
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/src/core/device.rs:190: undefined reference to `af_set_device'
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libarrayfire-cbf3f295b394aeff.rlib(arrayfire-cbf3f295b394aeff.5917q24kvex2q4s4.rcgu.o): In function `arrayfire::core::error::get_last_error::hf525673dd34784b0':
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/src/core/error.rs:104: undefined reference to `af_get_last_error'
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/target/debug/deps/libarrayfire-cbf3f295b394aeff.rlib(arrayfire-cbf3f295b394aeff.g9aa7wz916xgonq.rcgu.o): In function `arrayfire::core::util::free_host::ha463e760c759e9ee':
          /lustre7/home/hikarukondo/Rust/test/arrayfire-rust/src/core/util.rs:68: undefined reference to `af_free_host'
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: could not compile `arrayfire`

To learn more, run the command again with --verbose.

@bokutotu Have you tried cargo clean followed by cargo build ?

@9prady9 Thanks for answering!
It's resolved.
I'm sorry for raising the issue, even though such a solution was available in other issues.

That is alright, Cargo doesn't pickup environment variables changes in the same session without a clean rebuild.

Closing the issue.