mimblewimble / cuckoo-miner

Mining wrapper around the Cuckoo Cycle proof of work system for the Grin/MimbleWimble blockchain.
Apache License 2.0
52 stars 16 forks source link

Fails on build on windows #1

Closed Latrasis closed 7 years ago

Latrasis commented 7 years ago

Trying to build on x86_64-pc-windows-msvc result with:

cargo check
...
Compiling env_logger v0.3.5
Compiling cuckoo_edgetrim_16 v0.1.0 (https://github.com/mimblewimble/cuckoo-miner?tag=grin_integration_2#43fd4177)
Compiling cuckoo_tomato_25 v0.1.0 (https://github.com/mimblewimble/cuckoo-miner?tag=grin_integration_2#43fd4177)
Compiling cuckoo_simple_12 v0.1.0 (https://github.com/mimblewimble/cuckoo-miner?tag=grin_integration_2#43fd4177)
Compiling cuckoo_tomato_16 v0.1.0 (https://github.com/mimblewimble/cuckoo-miner?tag=grin_integration_2#43fd4177)
Compiling cuckoo_tomato_30 v0.1.0 (https://github.com/mimblewimble/cuckoo-miner?tag=grin_integration_2#43fd4177)
Compiling cuckoo_simple_16 v0.1.0 (https://github.com/mimblewimble/cuckoo-miner?tag=grin_integration_2#43fd4177)

...

error: failed to run custom build command for `cuckoo_tomato_16 v0.1.0 (https://github.com/mimblewimble/cuckoo-miner?tag=grin_integration_2#43fd4177)`
process didn't exit successfully: `C:\Users\Latrasis\Documents\Repos\grin\target\debug\build\cuckoo_tomato_16-758c64c2c02ca080\build-script-build` (exit code
: 101)

...

running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.10.25017\\bin\\HostX64\\x64\\cl.exe" "/nologo" "/MD" "/Z7
" "/I" "../../cuckoo/src" "/I" "../../cuckoo/src/cuckoo_miner" "/I" "." "-EHsc" "-DEDGEBITS=27" "/DNDEBUG=1" "/FoC:\\Users\\Raketa\\Documents\\Repos\\grin\
\target\\debug\\build\\cuckoo_simple_28-ea166400c846717c\\out/cuckoo-28\\../../cuckoo/src\\simple_miner.o" "/c" "../../cuckoo/src/simple_miner.cpp"
simple_miner.cpp
c:\users\latrasis\.cargo\git\checkouts\cuckoo-miner-4752934f0f1f2bfe\43fd417\cuckoo-sys\cuckoo\src\siphash.h(6): fatal error C1083: Cannot open include file:
 'endian.h': No such file or directory
exit code: 2
yeastplume commented 7 years ago

At the moment, all of John Tromp's miners are linux/osx only, so the build is currently focused on linux. At some point in the not-too-distant future, I intend to create a cmake project that does a better job detecting the platform and building plugins accordingly, but no ETA there.

This shouldn't be breaking grin builds on windows, however, so I'll tweak the current build to not fail on windows. In the meantime, to work around this:

-git clone cuckoo-miner beside the grin directory -in grin/grin/Cargo.toml, include the package locally, i.e.

cuckoo_miner = { file="../../cuckoo-miner"}

#[cfg(target_os = "windows")]
static DLL_SUFFIX: &str=".dll";
#cuckoo_simple_12 = { path = "plugins/cuckoo_simple_12" }
#cuckoo_simple_16 = { path = "plugins/cuckoo_simple_16" }
#cuckoo_simple_20 = { path = "plugins/cuckoo_simple_20" }
#cuckoo_simple_25 = { path = "plugins/cuckoo_simple_25" }
#cuckoo_simple_28 = { path = "plugins/cuckoo_simple_28" }
#cuckoo_simple_30 = { path = "plugins/cuckoo_simple_30" }

This should allow cuckoo-miner to compile, and then in grin's grin.toml change the value 'use_cuckoo_miner' to false.

Note I haven't yet been able to test this, let me know if it works for you. I'll work on fixing the build for windows in the meantime.

Further edit: I've been able to test this now.. cuckoo_miner does compile, but there are other issues in grin causing the windows build to fail, particularly the daemonize-0.2.3 library.

yeastplume commented 7 years ago

Fixed in master and tag included by grin, once https://github.com/ignopeverell/grin/pull/84 is merged. Build won't fail but plugins won't work, grin will have to use internal mining mode.