z-classic / z-nomp

z-nomp is mining pool software for Zcash and Zclassic so you can create internet money in your home!
MIT License
288 stars 441 forks source link

[SOLVED] Z-NOMP @ Mac OS X build Failed #332

Closed igorvoltaic closed 6 years ago

igorvoltaic commented 6 years ago

Mac OS X build Failed at the equihashverify@0.0.2 install script (undeclared identifier in crypto/common.h included from arith_uint256.cpp)

Anyone got working Z-NOMP on OS X?

System: Mac mini 2014, OS X High Sierra, Xcode 9.3 (Build version 9E145), Node.js 8.11.1 daemons: zend + komodod

this were used to build daemons:

brew tap discoteq/discoteq; brew install flock
brew install autoconf autogen automake
brew install gcc5
brew install binutils
brew install protobuf
brew install coreutils
brew install wget

I'm stuck at npm update and not able to google this out:

 c++ '-DNODE_GYP_MODULE_NAME=equihashverify' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DHAVE_DECL_STRNLEN=1' '-DHAVE_BYTESWAP_H=1' '-DBUILDING_NODE_EXTENSION' -I/Users/igor/.node-gyp/10.0.0/include/node -I/Users/igor/.node-gyp/10.0.0/src -I/Users/igor/.node-gyp/10.0.0/deps/uv/include -I/Users/igor/.node-gyp/10.0.0/deps/v8/include -I../../nan -I../. -I/usr/include -I/usr/include/boost  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/equihashverify/arith_uint256.o.d.raw   -c -o Release/obj.target/equihashverify/arith_uint256.o ../arith_uint256.cpp
In file included from ../arith_uint256.cpp:10:
.././crypto/common.h:20:12: error: use of undeclared identifier 'le16toh'
    return le16toh(*((uint16_t*)ptr));
           ^
.././crypto/common.h:25:12: error: use of undeclared identifier 'le32toh'
    return le32toh(*((uint32_t*)ptr));
           ^
.././crypto/common.h:30:12: error: use of undeclared identifier 'le64toh'
    return le64toh(*((uint64_t*)ptr));
           ^
.././crypto/common.h:35:25: error: use of undeclared identifier 'htole16'
    *((uint16_t*)ptr) = htole16(x);
                        ^
.././crypto/common.h:40:25: error: use of undeclared identifier 'htole32'
    *((uint32_t*)ptr) = htole32(x);
                        ^
.././crypto/common.h:45:25: error: use of undeclared identifier 'htole64'
    *((uint64_t*)ptr) = htole64(x);
                        ^
.././crypto/common.h:50:12: error: use of undeclared identifier 'be32toh'
    return be32toh(*((uint32_t*)ptr));
           ^
.././crypto/common.h:55:12: error: use of undeclared identifier 'be64toh'
    return be64toh(*((uint64_t*)ptr));
           ^
.././crypto/common.h:60:25: error: use of undeclared identifier 'htobe32'
    *((uint32_t*)ptr) = htobe32(x);
                        ^
.././crypto/common.h:65:25: error: use of undeclared identifier 'htobe64'
    *((uint64_t*)ptr) = htobe64(x);
                        ^
../arith_uint256.cpp:92:9: error: cannot use 'throw' with exceptions disabled
        throw uint_error("Division by zero");
        ^
../arith_uint256.cpp:92:9: error: cannot use 'throw' with exceptions disabled
../arith_uint256.cpp:192:42: note: in instantiation of member function 'base_uint<256>::operator/=' requested here
template base_uint<256>& base_uint<256>::operator/=(const base_uint<256>& b);
                                         ^
12 errors generated.
make: *** [Release/obj.target/equihashverify/arith_uint256.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/igor/z-nomp/node_modules/equihashverify
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! equihashverify@0.0.2 install: `env V=1 node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the equihashverify@0.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
igorvoltaic commented 6 years ago

BSD/Linux-like for MacOS X <-- this needs to be placed here:

/usr/local/include/endian.h

still have one error to solve

../arith_uint256.cpp:92:9: error: cannot use 'throw' with exceptions disabled
        throw uint_error("Division by zero");
igorvoltaic commented 6 years ago

from here found out how to deal with exceptions in Mac OS X. We need to edit ~/.node-gyp/8.11.1/include/node/common.gypi like this:

        ['OS=="mac"', {
          'xcode_settings': {
            'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
          }
        }]

just to stop little later with this:

In file included from ../random.cpp:9:
.././serialize.h:23:10: fatal error: 'boost/array.hpp' file not found
#include <boost/array.hpp>
igorvoltaic commented 6 years ago

I thought boost was already there.. brew install boost

here u go, z-nomp on mac os x