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

Problems building on Arch Linux - undefined reference to `clang_CXXMethod_isDeleted' etc. #8

Open
expenses opened this issue Jan 29, 2023 · 4 comments

Comments

@expenses
Copy link

Hi! I started looking into babble to build the rust bindings for USD but I ran into an error during the linking step of cargo test. Here's the output with the long compilation commands edited down:

warning: `bbl-write` (lib) generated 1 warning
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustc1JiFUq/symbols.o" <snip>
  = note: /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxx_method_is_deleted':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:311: undefined reference to `clang_CXXMethod_isDeleted'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_default_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:387: undefined reference to `clang_CXXRecord_needsImplicitDefaultConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:391: undefined reference to `clang_CXXRecord_needsImplicitCopyConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:395: undefined reference to `clang_CXXRecord_needsImplicitMoveConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:399: undefined reference to `clang_CXXRecord_needsImplicitCopyAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:403: undefined reference to `clang_CXXRecord_needsImplicitMoveAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_destructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:407: undefined reference to `clang_CXXRecord_needsImplicitDestructor'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

warning: `bbl-extract` (lib test) generated 4 warnings (3 duplicates)
error: could not compile `bbl-extract` due to previous error; 4 warnings emitted
warning: build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustcRS7Qts/symbols.o" <snip>
  = note: /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxx_method_is_deleted':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:311: undefined reference to `clang_CXXMethod_isDeleted'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_default_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:387: undefined reference to `clang_CXXRecord_needsImplicitDefaultConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:391: undefined reference to `clang_CXXRecord_needsImplicitCopyConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:395: undefined reference to `clang_CXXRecord_needsImplicitMoveConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:399: undefined reference to `clang_CXXRecord_needsImplicitCopyAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:403: undefined reference to `clang_CXXRecord_needsImplicitMoveAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_destructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:407: undefined reference to `clang_CXXRecord_needsImplicitDestructor'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

warning: `bbl-write` (lib test) generated 1 warning (1 duplicate)
error: could not compile `bbl-write` due to previous error; 1 warning emitted
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustcO8opIu/symbols.o" <snip>
  = note: /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxx_method_is_deleted':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:311: undefined reference to `clang_CXXMethod_isDeleted'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_default_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:387: undefined reference to `clang_CXXRecord_needsImplicitDefaultConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:391: undefined reference to `clang_CXXRecord_needsImplicitCopyConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:395: undefined reference to `clang_CXXRecord_needsImplicitMoveConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:399: undefined reference to `clang_CXXRecord_needsImplicitCopyAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:403: undefined reference to `clang_CXXRecord_needsImplicitMoveAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_destructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:407: undefined reference to `clang_CXXRecord_needsImplicitDestructor'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `bbl-translate` due to previous error
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustcK6ZJ1n/symbols.o" <snip>
  = note: /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxx_method_is_deleted':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:311: undefined reference to `clang_CXXMethod_isDeleted'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_default_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:387: undefined reference to `clang_CXXRecord_needsImplicitDefaultConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:391: undefined reference to `clang_CXXRecord_needsImplicitCopyConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:395: undefined reference to `clang_CXXRecord_needsImplicitMoveConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:399: undefined reference to `clang_CXXRecord_needsImplicitCopyAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:403: undefined reference to `clang_CXXRecord_needsImplicitMoveAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_destructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:407: undefined reference to `clang_CXXRecord_needsImplicitDestructor'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `bbl-translate` due to previous error
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-m64" "/tmp/rustc9GulwY/symbols.o" <snip>
  = note: /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxx_method_is_deleted':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:311: undefined reference to `clang_CXXMethod_isDeleted'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_default_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:387: undefined reference to `clang_CXXRecord_needsImplicitDefaultConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:391: undefined reference to `clang_CXXRecord_needsImplicitCopyConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_constructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:395: undefined reference to `clang_CXXRecord_needsImplicitMoveConstructor'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_copy_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:399: undefined reference to `clang_CXXRecord_needsImplicitCopyAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_move_assignment':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:403: undefined reference to `clang_CXXRecord_needsImplicitMoveAssignment'
          /usr/bin/ld: /home/ashley/projects/usd-rs/babble/target/debug/deps/libbbl_clang-1fd2bf479860749d.rlib(bbl_clang-1fd2bf479860749d.2nmxxppwyxjg7au8.rcgu.o): in function `bbl_clang::cursor::Cursor::cxxrecord_needs_implicit_destructor':
          /home/ashley/projects/usd-rs/babble/bbl-clang/src/cursor.rs:407: undefined reference to `clang_CXXRecord_needsImplicitDestructor'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `bbl-write` due to previous error

This happens regardless of what I set the CLANG_EXECUTABLE, LLVM_CONFIG_PATH and LLVM_ROOT environment variables to. I do have Clang and LLVM 15 installed, but downloading and setting the environment variables to the Clang/LLVM 14 binaries didn't help. Perhaps I need to set something to point to the Clang 14 headers instead?

@scott-wilson
Copy link
Member

Hey, unfortunately I can't help you with this issue, but tagging @anderslanglands for help. However, have you spoken with @luke-titley? He's working on USD bindings as well, and right now he's using cpp to do the bindings.

@expenses
Copy link
Author

expenses commented Jan 29, 2023

I noticed that babble actually requires Clang 16:

[features]
clang_16 = ["clang-sys/clang_16_0"]
clang_13 = ["clang-sys/clang_13_0"]
default = ["clang_16"]

so I'm currently compiling the llvm-git (it's taking a while!) to try it out.

However, have you spoken with @luke-titley? He's working on USD bindings as well, and right now he's using cpp to do the bindings.

I have not. If you mean https://github.com/vfx-rs/usd-bind then I avoided that because I had trouble with building cppmm and vfx-rs/usd-bind#18 suggested that babble is a successor to cppmm anyway.

@scott-wilson
Copy link
Member

Yeah, I think the project description might need to be updated. Right now that's using the cpp crate, and may migrate over to Babble later. Either way, I highly suggest chatting with Luke, since he is pretty far in development last I checked.

@expenses
Copy link
Author

I tried compiling with the version of llvm that I compiled but I still had no luck. The final environment variables I ended up trying were CLANG_EXECUTABLE=/home/projects/usd-rs/llvm-16/bin/clang LLVM_CONFIG_PATH=/home/ashley/projects/usd-rs/llvm-16/bin/llvm-config LIBCLANG_PATH=/home/ashley/projects/usd-rs/llvm-16/lib/ cargo test

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

No branches or pull requests

2 participants