From 0c7569c2deea383354a017761ad2bb3e523592b5 Mon Sep 17 00:00:00 2001 From: EricShimizuKarbstein Date: Tue, 11 Jan 2022 15:21:07 -0300 Subject: [PATCH] Fix cmake compilation errors - Use cargo git capabilities instead of git submodules for `randomx-rust` and `progpow-rust` - Don't pass `--target` to cmake on `cuckoo-miner` --- .gitmodules | 6 --- Cargo.lock | 77 +++++++++++++++++++++------------------ Cargo.toml | 21 +++++++---- cuckoo-miner/src/build.rs | 2 +- progpow-miner/Cargo.toml | 13 +++++-- progpow-rust | 1 - randomx-miner/Cargo.toml | 7 +++- randomx-rust | 1 - 8 files changed, 70 insertions(+), 58 deletions(-) delete mode 160000 progpow-rust delete mode 160000 randomx-rust diff --git a/.gitmodules b/.gitmodules index 6c2cae8..09f4e23 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,3 @@ [submodule "cuckoo-miner/src/cuckoo_sys/plugins/cuckoo"] path = cuckoo-miner/src/cuckoo_sys/plugins/cuckoo url = https://github.com/tromp/cuckoo.git -[submodule "randomx-rust"] - path = randomx-rust - url = ../randomx-rust.git -[submodule "progpow-rust"] - path = progpow-rust - url = ../progpow-rust.git diff --git a/Cargo.lock b/Cargo.lock index 4177dec..f18ca95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "ahash" version = "0.2.18" @@ -99,7 +101,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e" dependencies = [ "backtrace-sys", - "cfg-if", + "cfg-if 0.1.10", "libc 0.2.68", "rustc-demangle", ] @@ -137,7 +139,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b25ab82877ea8fe6ce1ce1f8ac54361f0218bad900af9eb11803994bf67c221" dependencies = [ "cexpr", - "cfg-if", + "cfg-if 0.1.10", "clang-sys", "clap", "env_logger", @@ -243,6 +245,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "chrono" version = "0.4.11" @@ -365,7 +373,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "crossbeam-channel 0.4.2", "crossbeam-deque", "crossbeam-epoch", @@ -410,7 +418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ "autocfg 1.0.0", - "cfg-if", + "cfg-if 0.1.10", "crossbeam-utils 0.7.2", "lazy_static 1.4.0", "maybe-uninit", @@ -424,7 +432,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "crossbeam-utils 0.7.2", ] @@ -434,7 +442,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "lazy_static 1.4.0", ] @@ -445,7 +453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ "autocfg 1.0.0", - "cfg-if", + "cfg-if 0.1.10", "lazy_static 1.4.0", ] @@ -508,7 +516,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7ecc7282b5361471b607c26f44148205607e26d48a2fc65bd16e7619b1ebb78" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "chrono", "crossbeam-channel 0.3.9", "enum-map 0.5.0", @@ -536,7 +544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "341b03eec276c30c6cdc640d8bd8c08eac9605064c3f9c4838f958dac06973bb" dependencies = [ "ahash", - "cfg-if", + "cfg-if 0.1.10", "chrono", "crossbeam-channel 0.4.2", "enum-map 0.6.2", @@ -628,7 +636,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "dirs-sys", ] @@ -638,7 +646,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc 0.2.68", "redox_users", "winapi 0.3.8", @@ -845,7 +853,7 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f59efc38004c988e4201d11d263b8171f49a2e7ec0bdbb71773433f271504a5e" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc 0.2.68", "redox_syscall", "winapi 0.3.8", @@ -914,7 +922,7 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc 0.2.68", "wasi", ] @@ -1176,7 +1184,7 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -1447,17 +1455,23 @@ dependencies = [ "ocl", ] +[[package]] +name = "once_cell" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" + [[package]] name = "openssl" -version = "0.10.28" +version = "0.10.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973293749822d7dd6370d6da1e523b0d1db19f06c459134c658b2a4261378b52" +checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" dependencies = [ "bitflags 1.2.1", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", - "lazy_static 1.4.0", "libc 0.2.68", + "once_cell", "openssl-sys", ] @@ -1469,9 +1483,9 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" -version = "0.9.54" +version = "0.9.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" +checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" dependencies = [ "autocfg 1.0.0", "cc", @@ -1529,7 +1543,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb88cb1cb3790baa6776844f968fea3be44956cf184fa1be5a03341f5491278c" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi", "libc 0.2.68", "rand 0.6.5", @@ -1681,6 +1695,7 @@ dependencies = [ [[package]] name = "progpow" version = "0.1.0" +source = "git+https://github.com/EpicCash/progpow-rust.git#1f9100e0148119027e70311a8a5359d046dc3b98" dependencies = [ "bigint", "bindgen", @@ -1697,6 +1712,7 @@ dependencies = [ [[package]] name = "progpow_cpu" version = "0.1.0" +source = "git+https://github.com/EpicCash/progpow-rust.git#1f9100e0148119027e70311a8a5359d046dc3b98" dependencies = [ "crunchy 0.2.2", "either", @@ -1705,14 +1721,12 @@ dependencies = [ "memmap", "parking_lot", "primal", - "rustc-hex", - "serde_json", - "tempdir", ] [[package]] name = "progpow_gpu" version = "0.1.0" +source = "git+https://github.com/EpicCash/progpow-rust.git#1f9100e0148119027e70311a8a5359d046dc3b98" dependencies = [ "bigint", "bindgen", @@ -1959,7 +1973,8 @@ dependencies = [ [[package]] name = "randomx" -version = "0.1.0" +version = "0.1.1" +source = "git+https://github.com/EpicCash/randomx-rust.git#b64040eb95b4721a398434eb05fb699782ecfde4" dependencies = [ "bigint", "bindgen", @@ -2366,23 +2381,13 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] - [[package]] name = "tempfile" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc 0.2.68", "rand 0.7.3", "redox_syscall", diff --git a/Cargo.toml b/Cargo.toml index ebfab90..cb79b6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ description = "Mining software for Epic, supports CPU and CUDA GPUs." build = "src/build/build.rs" license = "Apache-2.0" repository = "https://github.com/mimblewimble/epic-miner" -keywords = [ "crypto", "epic", "mimblewimble", "mining"] +keywords = ["crypto", "epic", "mimblewimble", "mining"] autobins = false [workspace] @@ -30,7 +30,10 @@ native-tls = "0.2" serde = "1" serde_derive = "1" serde_json = "1" -slog = { version = "~2.1", features = ["max_level_trace", "release_max_level_trace"] } +slog = { version = "~2.1", features = [ + "max_level_trace", + "release_max_level_trace", +] } term = "0.4" time = "0.1" rand = "^0.3.16" @@ -41,12 +44,14 @@ epic_miner_util = { path = "./util", version = "1.0.2" } epic_miner_plugin = { path = "./plugin", version = "1.0.2" } epic_miner_config = { path = "./config", version = "1.0.2" } #use this alternative inclusion below to build cuda plugins -ocl_cuckatoo = { path = "./ocl_cuckatoo", version = "1.0.2", optional = true} -randomx = { path = "./randomx-rust", version = "0.1.0" } +ocl_cuckatoo = { path = "./ocl_cuckatoo", version = "1.0.2", optional = true } +randomx = { git = "https://github.com/EpicCash/randomx-rust.git", version = "0.1.1" } randomx_miner = { path = "./randomx-miner", version = "0.1.0" } [target.'cfg(windows)'.dependencies] -cursive = { version = "0.14", default-features = false, features = ["pancurses-backend"] } +cursive = { version = "0.14", default-features = false, features = [ + "pancurses-backend", +] } [target.'cfg(windows)'.dependencies.pancurses] version = "0.16.0" features = ["win32"] @@ -87,13 +92,15 @@ optional = true [dependencies.progpow_opencl] package = "progpow" -path = "./progpow-rust" +git = "https://github.com/EpicCash/progpow-rust.git" +version = "0.1.0" features = ["opencl"] optional = true [dependencies.progpow_cuda] package = "progpow" -path = "./progpow-rust" +git = "https://github.com/EpicCash/progpow-rust.git" +version = "0.1.0" features = ["cuda"] optional = true diff --git a/cuckoo-miner/src/build.rs b/cuckoo-miner/src/build.rs index 569f940..35e5c69 100644 --- a/cuckoo-miner/src/build.rs +++ b/cuckoo-miner/src/build.rs @@ -75,7 +75,7 @@ fn main() { let dst = Config::new("src/cuckoo_sys/plugins") .define("BUILD_CUDA_PLUGINS",BUILD_CUDA_PLUGINS) //whatever flags go here //.cflag("-foo") //and here - .build_target("") + .no_build_target(true) .build(); println!("Plugin path: {:?}", plugin_path); diff --git a/progpow-miner/Cargo.toml b/progpow-miner/Cargo.toml index ec47d63..5b0eceb 100644 --- a/progpow-miner/Cargo.toml +++ b/progpow-miner/Cargo.toml @@ -6,23 +6,28 @@ version = "0.1.0" lazy_static = "1.3.0" bigint = "4.4.1" keccak-hash = "0.2.0" -slog = { version = "~2.1", features = ["max_level_trace", "release_max_level_trace"] } +slog = { version = "~2.1", features = [ + "max_level_trace", + "release_max_level_trace", +] } epic_miner_core = { path = "../core", version = "0.1.0" } epic_miner_util = { path = "../util", version = "1.0.2" } [dependencies.progpow_opencl] package = "progpow" -path = "../progpow-rust" +git = "https://github.com/EpicCash/progpow-rust.git" +version = "0.1.0" features = ["opencl"] optional = true [dependencies.progpow_cuda] package = "progpow" -path = "../progpow-rust" +git = "https://github.com/EpicCash/progpow-rust.git" +version = "0.1.0" features = ["cuda"] optional = true [features] opencl = ["progpow_opencl"] -cuda = ["progpow_cuda"] \ No newline at end of file +cuda = ["progpow_cuda"] diff --git a/progpow-rust b/progpow-rust deleted file mode 160000 index 1f9100e..0000000 --- a/progpow-rust +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1f9100e0148119027e70311a8a5359d046dc3b98 diff --git a/randomx-miner/Cargo.toml b/randomx-miner/Cargo.toml index a1e86db..2febc8e 100644 --- a/randomx-miner/Cargo.toml +++ b/randomx-miner/Cargo.toml @@ -6,8 +6,11 @@ version = "0.1.0" lazy_static = "1.3.0" bigint = "4.4.1" log = "^0.3" -slog = { version = "~2.1", features = ["max_level_trace", "release_max_level_trace"] } +slog = { version = "~2.1", features = [ + "max_level_trace", + "release_max_level_trace", +] } epic_miner_core = { path = "../core", version = "0.1.0" } epic_miner_util = { path = "../util", version = "1.0.2" } -randomx = { path = "../randomx-rust", version = "0.1.0" } +randomx = { git = "https://github.com/EpicCash/randomx-rust.git", version = "0.1.1" } diff --git a/randomx-rust b/randomx-rust deleted file mode 160000 index 1f55abc..0000000 --- a/randomx-rust +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1f55abcb323f1286bf79672b2fb1dc2f7a058734