z-classic / zclassic

Zclassic is financial freedom. ZK-SNARKs, and no founder's fee.
https://www.reddit.com/r/Zclassic/
Other
189 stars 81 forks source link

Compiling from source (No /zcutil/build.sh) #181

Closed TheQueenIsDead closed 5 years ago

TheQueenIsDead commented 5 years ago

The Issue

I'm trying to compile the latest version of zcash (Release v1.0.10-1-03eafd6) from source without the use of the build script as I'd prefer to build fully from source and not have "wget" as a dependency for compiling

Steps to reproduce

  1. Create a new ubuntu:16.04 docker container
  2. Upgrade apt and install a cocktail of required packages
  3. Clone zcash
  4. Install boost (compiled 1.58.0 from source)
  5. Install BerkelyDB (compiled 6.2.23 from source)
  6. Install libsnark (compiled from source to /usr/local/)
  7. Install sodium (compiled 1.0.16 from source)
  8. Install libff (compiled from source)
  9. Copy the libff files from /usr/local/include/libff to /usr/local/include/libsnark
    • Required as the common/profiling.hpp in libsnark is provided by libff
  10. Build with: rm -rf build autogen.sh ./configure --without-gui --prefix=/src/dist LDFLAGS="-L/src/db5/lib/" CPPFLAGS="-I/src/db5/include/ -I${BOOST_ROOT}/ -I/usr/local/include/libsnark -L/usr/local/lib -lsnark" --with-boost-libdir=${BOOST_ROOT}/stage/lib make

Errors

As you can see, I've gone through and installed a good bunch of dependencies, I was hoping someone could point me to where the error may lie with my most recent error message:

pow.cpp:20:26: fatal error: librustzcash.h: No such file or directory

A fun wee side-note: I have also commented out lines 1130 and line 1131 in init.cpp as the libsnark library is not mentioned in an #include at the top

Any help much appreciated as I try get this going! A question I am also hesitantly curious about asking is, is it possible to fully compile with the current files? I managed to find this thread during my troubles, which doesn't instill me with a whole lot of confidence, but as mentioned, any help appreciated!: https://github.com/zcash/zcash/issues/58

The version of Zclassic / Zcash you were using:

v1.0.10-1-03eafd6

Machine specs:

TheQueenIsDead commented 5 years ago

Quick update, I found the source for librustzcash from the dependancy folder, cloned the repo and built with cargo then moved the librustzcash.h file to my /usr/local/include folder, the neat new error is:

pow.cpp:107:71: error: 'librustzcash_xor' was not declared in this scope assert(librustzcash_xor(0x0f0f0f0f0f0f0f0f, 0x1111111111111111) == 0x1e1e1e1e1e1e1e1e);

nimbosa commented 5 years ago

your observation is correct @TheQueenIsDead, this matter has been brought up but stalled upstream, their build.sh and our build-win.sh were created for convenience and is being (slowly) migrated back to the Automake workflow, any improvement we can do in this regard we must push to upstream Zcash code

ALSO, rust (and snark) build dependencies and links has changed upstream and so our v1.1.1 also pulled in some 2.x changes to reflect this, and compiling from source without build.sh hacks should start getting better, if ever you want to try again..

rofl0r commented 5 years ago

having to use this script sucks. it will only work on mainstream distros where everything behaves exactly as the script authors intended. this is the result of totally incompetent people forking stuff they don't understand (bitcoin & deps, written by yet more incompetent people) and piling on heaps of unreasonable dependencies like a rust compiler. the result is a mess with a shitload of dependencies, which only work in a specific version (like bdb 6.2 and libdb++) or boost 1.62, which is newer than what most distros ship, plus: libcurl, libevent, rustc (which in itself is almost impossible to bootstrap from source), gmp, etc etc. i've spent around 3 hours trying to circumvent the crappy script but ended up failing with the exact same error as OP. i managed to get zcash to build in the past, but now shit has hit the fan. soon it will only be possible to build and use zcash (and forks) in a docker container provided by the developers. i will try to get rid ASAP of my coins as i lack the nerve to deal with crap like this in the future.