Closed vmx closed 1 year ago
I think I got a step further. I think it's important to be on the exact same blst
version. That can be done with using filecoin proofs version 0.15.0 and patching blst
to current HEAD. The error I then get is
= note: /usr/bin/ld.bfd: /home/simon/vmx/supra_seal/obj/libsupraseal.a(sector_parameters.o): undefined reference to symbol '_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareEPKc@@GLIBCXX_3.4.21'
/usr/bin/ld.bfd: /lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
which sounds more like a systems/environment/compiler issue.
I managed to get it compiled cudart_static
was missing.
This is the diff I ended up with:
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -1,4 +1,4 @@
-[patch.crates-io]
-blst = { git = "https://github.com/supranational/blst" }
-sppark = { git = "https://github.com/supranational/sppark" }
-bellperson = { path = "c2/bellperson", version = "0.24.1"}
+#[patch.crates-io]
+#blst = { git = "https://github.com/supranational/blst" }
+#sppark = { git = "https://github.com/supranational/sppark" }
+#bellperson = { path = "c2/bellperson", version = "0.24.1"}
diff --git a/demos/rust/Cargo.toml b/demos/rust/Cargo.toml
index 375c74b..e6c597a 100644
--- a/demos/rust/Cargo.toml
+++ b/demos/rust/Cargo.toml
@@ -5,9 +5,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-[[bin]]
-name = "c2"
-path = "src/c2.rs"
+#[[bin]]
+#name = "c2"
+#path = "src/c2.rs"
[features]
default = ["32GiB"]
@@ -18,12 +18,18 @@ default = ["32GiB"]
anyhow = "1.0.26"
bincode = "1.1.2"
chrono = "0.4"
-filecoin-proofs-api = {version = "14.0.0", default-features = false }
-filecoin-proofs-v1 = { package = "filecoin-proofs", version = "~14.0.0", default-features = false }
-storage-proofs-core = { version = "~14.0.0", default-features = false }
-supraseal-c2 = { path = "../../c2/" }
+filecoin-proofs-api = {version = "15.0.0", default-features = false }
+filecoin-proofs-v1 = { package = "filecoin-proofs", version = "15.0.0", default-features = false }
+storage-proofs-core = { version = "15.0.0", default-features = false }
+#supraseal-c2 = { path = "../../c2/" }
+
+[build-dependencies]
+find_cuda_helper = "0.2.0"
[target."cfg(target_arch = \"aarch64\")".dependencies]
sha2 = { version = "0.10.2", features = ["compress", "asm"] }
[target."cfg(not(target_arch = \"aarch64\"))".dependencies]
sha2 = { version = "0.10.2", features = ["compress"] }
+
+[patch.crates-io]
+blst = { git = "https://github.com/supranational/blst" }
diff --git a/demos/rust/build.rs b/demos/rust/build.rs
index 1655943..f30c44e 100644
--- a/demos/rust/build.rs
+++ b/demos/rust/build.rs
@@ -21,8 +21,16 @@ fn main() {
.canonicalize()
.expect("cannot canonicalize path");
+ // Use the first directory that was found.
+ let cuda_lib_dir = find_cuda_helper::find_cuda_lib_dirs()
+ .first()
+ .expect("CUDA not found")
+ .canonicalize()
+ .expect("cannot canonicalize path");
+
println!("cargo:rustc-link-search={}", cpp_lib_dir.to_str().unwrap());
println!("cargo:rustc-link-search={}", spdk_lib_dir);
+ println!("cargo:rustc-link-search={}", cuda_lib_dir.to_str().unwrap());
println!("cargo:rustc-link-arg=-fno-omit-frame-pointer");
println!("cargo:rustc-link-arg=-Wl,-z,relro,-z,now");
@@ -113,6 +121,7 @@ fn main() {
println!("cargo:rustc-link-arg=-laio");
println!("cargo:rustc-link-arg=-lc");
println!("cargo:rustc-link-arg=-lgcc");
+ println!("cargo:rustc-link-arg=-lcudart_static");
println!("cargo:rustc-link-lib=supraseal");
println!("cargo:rustc-link-lib=gmp");
It compiles PC1/PC2 without the C2 part.
Man, it's all over the place... And none of them are expected to occur. First one looks like linking errors we had prior initial sppark release, 2nd - as if cc-rs has forgotten that it compiles c++, and 3rd - shouldn't happen if there is reference to sppark. But let's put it aside. See if you have any of the referred problems with #26 and we take it from there.
See if you have any of the referred problems with #26 and we take it from there.
Agreed to start there. Let me try it out.
Assumed to be resolved now. If not, reopen or open new issue.
I currently try to get PC1/PC2 compiled. Though I get linker errors like this (full log):
Steps to reproduce:
build.sh
run.Then you need to modify the
demos/rust
projects a bit due tosupraseal-c2
currently being broken (https://github.com/supranational/supra_seal/issues/21). We just comment those parts out. Here's the diff:-[[bin]] -name = "c2" -path = "src/c2.rs" +#[[bin]] +#name = "c2" +#path = "src/c2.rs"
[features] default = ["32GiB"] @@ -21,7 +21,7 @@ chrono = "0.4" filecoin-proofs-api = {version = "14.0.0", default-features = false } filecoin-proofs-v1 = { package = "filecoin-proofs", version = "~14.0.0", default-features = false } storage-proofs-core = { version = "~14.0.0", default-features = false } -supraseal-c2 = { path = "../../c2/" } +#supraseal-c2 = { path = "../../c2/" }
[target."cfg(target_arch = \"aarch64\")".dependencies] sha2 = { version = "0.10.2", features = ["compress", "asm"] }