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

I Need your help #1

Open
PandaK404 opened this issue Sep 6, 2023 · 3 comments
Open

I Need your help #1

PandaK404 opened this issue Sep 6, 2023 · 3 comments

Comments

@PandaK404
Copy link

PandaK404 commented Sep 6, 2023

I don't understand rust very well.
When I tried to runnig I encountered the following problems. I don't understand what went wrong? Need your help

XXX@XXX:/home/XXX/test/geosteiner-rs-template# cargo build
warning: fields `p1` and `p2` are never read
  --> src/geosteiner.rs:18:5
   |
17 | pub struct Edge {
   |            ---- fields in this struct
18 |     p1: i32, // number of point 1
   |     ^^
19 |     p2: i32, // number of point 2
   |     ^^
   |
   = note: `Edge` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default

warning: `geosteiner-rs-template` (lib) generated 1 warning
   Compiling geosteiner-rs-template v0.1.0 (/home/pan/test/geosteiner-rs-template)
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcgBi8SB/symbols.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.1g3ba6kf09fska78.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.2ilpc5wwpqehbpy7.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.3bl4iwj58idpbll1.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.3qz1nnqnwod0bol.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.3wx1zrzgnon9xhvt.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.41pleo7a66zhtsnt.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.473wzdkye83em5kh.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.48689ywvp8bywmmc.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.4aqbbhamosycmzhm.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.4s3zjxrpbzw3ol2c.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.5gbvjkazt5zp6n5g.rcgu.o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064.2jgc1fu9p30hw2to.rcgu.o" "-Wl,--as-needed" "-L" "/home/pan/test/geosteiner-rs-template/target/debug/deps" "-L" "src/geosteiner" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/pan/test/geosteiner-rs-template/target/debug/deps/libgeosteiner_rs_template-ab7d8c8882fd771d.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-8f88c761e33f2651.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f9018f9cee1cc5ff.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-919f89587cbed68d.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-c6624cb4360306cd.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-4930b3dc482158f7.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-65bea4bb6af40828.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-bc6864da821ce9a2.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-1bccb7a942e1b311.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-356231f77d1e268a.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-80ed5799bf463787.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-9c3df673b2797081.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-c6afbee8d1102512.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-682387162b570769.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-05a2cedbb78c1d4f.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f002c8f83a289c4b.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-649be05783c8912e.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-13da980d6c74fec5.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-46a989d0e2cef827.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b114db70ea0690b1.rlib" "-Wl,-Bdynamic" "-lrs_geosteiner" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/pan/test/geosteiner-rs-template/target/debug/deps/geosteiner_rs_template-978b7efc25bd4064" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: /usr/bin/ld: cannot find -lrs_geosteiner
          collect2: error: ld returned 1 exit status


error: could not compile `geosteiner-rs-template` (bin "geosteiner-rs-template") due to previous error
@Agent59
Copy link
Owner

Agent59 commented Sep 6, 2023

It seems like rust can't find the C libraries that contain the actual geosteiner. To build these too use cargo build --features rebuild_c. If that doesn't work use cargo build -vv --features rebuild_c to get more information during the build phase.

@PandaK404
Copy link
Author

It seems like rust can't find the C libraries that contain the actual geosteiner. To build these too use cargo build --features rebuild_c. If that doesn't work use cargo build -vv --features rebuild_c to get more information during the build phase.

Thank you for your reply. I am trying to solve the problem, but there is currently no progress, perhaps because I am not a computer major. Can you tell me how to test all the steps of this library? I will do it again according to your steps (I have already installed Rust)

@Agent59
Copy link
Owner

Agent59 commented Sep 17, 2023

I've fixed a bug where the Makefile of the C library changed during the first build. This might have caused the problems you encountered. I've also added a Readme with installation instructions, hope that helps.

I am sorry for the long wait, I'm no cs major too, but rather still a college student and programming is just a hobby, which is why I don't have much time fixing issues.
I apologize.

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