Makefile and run on Mac M1 chip? - macos
Is there any way to compile and run this on Mac M1 chip? I have xcode installed and all other c and c++ libraries. I try with UTM/ubunto also dodnt work.
default:
g++ -O3 -c oldbloom/bloom.cpp -o oldbloom.o
g++ -O3 -c bloom/bloom.cpp -o bloom.o
# g++ -O3 -c sha256/sha256.c -o sha256.o
gcc -O3 -c base58/base58.c -o base58.o
gcc -O3 -c rmd160/rmd160.c -o rmd160.o
g++ -O3 -c sha3/sha3.c -o sha3.o
g++ -O3 -c sha3/keccak.c -o keccak.o
gcc -O3 -c xxhash/xxhash.c -o xxhash.o
g++ -O3 -c util.c -o util.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Int.cpp -o Int.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Point.cpp -o Point.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/SECP256K1.cpp -o SECP256K1.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/IntMod.cpp -o IntMod.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/Random.cpp -o Random.o
g++ -m64 -mssse3 -Wno-unused-result -Wno-write-strings -O2 -c secp256k1/IntGroup.cpp -o IntGroup.o
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/ripemd160.o -c hash/ripemd160.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/sha256.o -c hash/sha256.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/ripemd160_sse.o -c hash/ripemd160_sse.cpp
g++ -m64 -mssse3 -Wno-write-strings -O2 -o hash/sha256_sse.o -c hash/sha256_sse.cpp
g++ -o keyhunt keyhunt.cpp base58.o rmd160.o hash/ripemd160.o hash/ripemd160_sse.o hash/sha256.o hash/sha256_sse.o bloom.o oldbloom.o xxhash.o util.o Int.o Point.o SECP256K1.o IntMod.o Random.o IntGroup.o sha3.o keccak.o -lm -lpthread
rm -r *.o
clean:
rm keyhunt
I get all this errors when i try to compile it on Mac M1:
In file included from secp256k1/Int.cpp:18:
secp256k1/Int.h:204:27: error: invalid output constraint '=d' in asm
__asm__( "mulq %[b];" :"=d"(rhi),"=a"(rlo) :"1"(a),[b]"rm"(b));
^
secp256k1/Int.h:211:43: error: invalid output constraint '=D' in asm
__asm__ ("movq %1,%0;shrdq %3,%2,%0;" : "=D"(c) : "r"(a),"r"(b),"c"(n));
^
secp256k1/Int.h:218:43: error: invalid output constraint '=D' in asm
__asm__ ("movq %1,%0;shldq %3,%2,%0;" : "=D"(c) : "r"(b),"r"(a),"c"(n));
^
secp256k1/Int.h:234:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[1], y, &h), carry, dst + 1); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:235:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[2], y, &h), carry, dst + 2); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:236:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[3], y, &h), carry, dst + 3); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:237:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[4], y, &h), carry, dst + 4); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:253:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[1], y, &h), carry, dst + 1); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:254:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[2], y, &h), carry, dst + 2); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:255:7: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
c = _addcarry_u64(c, _umul128(x[3], y, &h), carry, dst + 3); carry = h;
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
secp256k1/Int.h:262:3: error: use of undeclared identifier '__builtin_ia32_addcarryx_u64'
_addcarry_u64(c, 0ULL, carry, dst + (NB64BLOCK - 1));
^
secp256k1/Int.h:223:32: note: expanded from macro '_addcarry_u64'
#define _addcarry_u64(a,b,c,d) __builtin_ia32_addcarryx_u64(a,b,c,(long long unsigned int*)d);
^
In file included from secp256k1/Int.cpp:24:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
In file included from secp256k1/Int.cpp:24:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/xmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
In file included from secp256k1/Int.cpp:24:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/emmintrin.h:17:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/xmmintrin.h:17:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"
#error "This header is only meant to be used on x86 and x64 architecture"
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'?
__builtin_ia32_emms();
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:5: note: '__builtin_isless' declared here
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:37:25: error: too few arguments to function call, expected 2, have 0
__builtin_ia32_emms();
~~~~~~~~~~~~~~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:54:19: error: use of undeclared identifier '__builtin_ia32_vec_init_v2si'
return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:71:12: error: use of undeclared identifier '__builtin_ia32_vec_ext_v2si'
return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/mmintrin.h:133:19: error: use of undeclared identifier '__builtin_ia32_packsswb'
return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
My question is, is it needed to change Makefile only or the whole script, to work on M1 chip?
Thanks in advance!
Related
Error running '__rvm_make -j8' in macos Monterey
I'm trying to install ruby 2.7.0 using RVM on MacOS(12.4: apple M2), but i'm getting below error and not able to install required ruby version. I have tried all the solutions available on internet related to openssl but nothing works for me and tried with rbenv also but no luck. Please help me, thank you in advance. Current version: OpenSSL 1.1.1s 1 Nov 2022 +__rvm_make:0> make -j8 BASERUBY = /usr/bin/ruby --disable=gems CC = gcc LD = ld LDSHARED = gcc -dynamiclib CFLAGS = -O3 -ggdb3 -Wno-error=implicit-function-declaration -std=gnu99 -fno-common -pipe XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/-darwin21 -I./include -I. -I./enc/unicode/12.1.0 CPPFLAGS = -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl#1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT DLDFLAGS = -Wl,-multiply_defined,suppress -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl#1.1/lib -install_name /Users/rashmib/.rvm/rubies/ruby-2.7.0/lib/libruby.2.7.dylib -compatibility_version 2.7 -current_version 2.7.0 -fstack-protector-strong -framework Security -framework Foundation -fstack-protector-strong -framework Security -framework Foundation SOLIBS = -lpthread -ldl -lobjc LANG = LC_ALL = LC_CTYPE = UTF-8 MFLAGS = - --jobserver-fds=4,5 -j Apple clang version 14.0.0 (clang-1400.0.29.202) Target: arm64-apple-darwin21.5.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin compiling ./main.c compiling dmydln.c compiling miniinit.c compiling dmyext.c translating probes probes.d compiling bignum.c compiling class.c compiling ast.c . ./vm_opts.h compiling compar.c compiling compile.c compiling complex.c compiling cont.c bignum.c:6127:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] return rb_num_coerce_bin(x, y, rb_intern("remainder")); ^~~~~~~~~~~~~~~~~~~~~~ ./include/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ bignum.c:6127:33: note: '{' token is here return rb_num_coerce_bin(x, y, rb_intern("remainder")); ^~~~~~~~~~~~~~~~~~~~~~ ./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' { \ ^ bignum.c:6127:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] return rb_num_coerce_bin(x, y, rb_intern("remainder")); ^~~~~~~~~~~~~~~~~~~~~~ ./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE' } ^ bignum.c:6127:33: note: ')' token is here return rb_num_coerce_bin(x, y, rb_intern("remainder")); ^~~~~~~~~~~~~~~~~~~~~~ ./include/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern' __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \ ^ class.c:541:13: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
After trying lot of suggestions, following these steps worked for me MAC ports installation https://trac.macports.org/wiki/Migration Run rvm install 2.7.0 --with-out-ext=fiddle
Unable to install fasttext through terminal using make
I am working on Ubuntu 16.04 and am trying to install fasttext through terminal using the following commands (from their website): $ wget https://github.com/facebookresearch/fastText/archive/v0.2.0.zip $ unzip v0.2.0.zip $ cd fastText-0.2.0 $ make But I am getting the following error when I try to make it: c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/args.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/dictionary.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/productquantizer.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/matrix.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/qmatrix.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/vector.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/model.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/utils.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/meter.cc c++ -pthread -std=c++0x -march=native -O3 -funroll-loops -c src/fasttext.cc src/fasttext.cc: In member function ‘void fasttext::FastText::quantize(const fasttext::Args&)’: src/fasttext.cc:302:16: warning: ‘std::vector<int> fasttext::FastText::selectEmbeddings(int32_t) const’ is deprecated: selectEmbeddings is being deprecated. [-Wdeprecated-declarations] auto idx = selectEmbeddings(qargs.cutoff); ^ src/fasttext.cc:279:22: note: declared here std::vector<int32_t> FastText::selectEmbeddings(int32_t cutoff) const { ^ src/fasttext.cc:302:45: warning: ‘std::vector<int> fasttext::FastText::selectEmbeddings(int32_t) const’ is deprecated: selectEmbeddings is being deprecated. [-Wdeprecated-declarations] auto idx = selectEmbeddings(qargs.cutoff); ^ src/fasttext.cc:279:22: note: declared here std::vector<int32_t> FastText::selectEmbeddings(int32_t cutoff) const { ^ src/fasttext.cc: In member function ‘void fasttext::FastText::lazyComputeWordVectors()’: src/fasttext.cc:531:5: warning: ‘void fasttext::FastText::precomputeWordVectors(fasttext::Matrix&)’ is deprecated: precomputeWordVectors is being deprecated. [-Wdeprecated-declarations] precomputeWordVectors(*wordVectors_); ^ src/fasttext.cc:514:6: note: declared here void FastText::precomputeWordVectors(Matrix& wordVectors) { ^ src/fasttext.cc:531:40: warning: ‘void fasttext::FastText::precomputeWordVectors(fasttext::Matrix&)’ is deprecated: precomputeWordVectors is being deprecated. [-Wdeprecated-declarations] precomputeWordVectors(*wordVectors_); ^ src/fasttext.cc:514:6: note: declared here void FastText::precomputeWordVectors(Matrix& wordVectors) { ^ src/fasttext.cc: In member function ‘void fasttext::FastText::trainThread(int32_t)’: src/fasttext.cc:650:7: warning: ‘void fasttext::FastText::supervised(fasttext::Model&, fasttext::real, const std::vector<int>&, const std::vector<int>&)’ is deprecated: supervised is being deprecated. [-Wdeprecated-declarations] supervised(model, lr, line, labels); ^ src/fasttext.cc:338:6: note: declared here void FastText::supervised( ^ src/fasttext.cc:650:41: warning: ‘void fasttext::FastText::supervised(fasttext::Model&, fasttext::real, const std::vector<int>&, const std::vector<int>&)’ is deprecated: supervised is being deprecated. [-Wdeprecated-declarations] supervised(model, lr, line, labels); ^ src/fasttext.cc:338:6: note: declared here void FastText::supervised( ^ src/fasttext.cc:653:7: warning: ‘void fasttext::FastText::cbow(fasttext::Model&, fasttext::real, const std::vector<int>&)’ is deprecated: cbow is being deprecated. [-Wdeprecated-declarations] cbow(model, lr, line); ^ src/fasttext.cc:355:6: note: declared here void FastText::cbow(Model& model, real lr, const std::vector<int32_t>& line) { ^ src/fasttext.cc:653:27: warning: ‘void fasttext::FastText::cbow(fasttext::Model&, fasttext::real, const std::vector<int>&)’ is deprecated: cbow is being deprecated. [-Wdeprecated-declarations] cbow(model, lr, line); ^ src/fasttext.cc:355:6: note: declared here void FastText::cbow(Model& model, real lr, const std::vector<int32_t>& line) { ^ src/fasttext.cc:656:7: warning: ‘void fasttext::FastText::skipgram(fasttext::Model&, fasttext::real, const std::vector<int>&)’ is deprecated: skipgram is being deprecated. [-Wdeprecated-declarations] skipgram(model, lr, line); ^ src/fasttext.cc:371:6: note: declared here void FastText::skipgram( ^ src/fasttext.cc:656:31: warning: ‘void fasttext::FastText::skipgram(fasttext::Model&, fasttext::real, const std::vector<int>&)’ is deprecated: skipgram is being deprecated. [-Wdeprecated-declarations] skipgram(model, lr, line); ^ src/fasttext.cc:371:6: note: declared here void FastText::skipgram( ^ c++ -pthread -std=c++0x -march=native -O3 -funroll-loops args.o dictionary.o productquantizer.o matrix.o qmatrix.o vector.o model.o utils.o meter.o fasttext.o src/main.cc -o fasttext I don't know what is causing the error. As far as I have figure, these are depreciation warnings and make is treating them errors. Is there anyway to suppress this behaviour of make? Or is there any other way to install fasttext? I read from somewhere and tried make -i but it is also giving the same error. Thanks in advance!
I had the same issue in version v0.9.1. They are just warnings. My binary still compiled with just the warnings. ./fasttext
Issue with zlib while running makefile MacOS sierra
I am trying to run a make file in MacOS sierra, but it seems to have trouble with the header of the Zlib (see below). I have tried to install a separate version with brew and pass the directory of the brew zlib installation in the configure file. ./configure --prefix=/usr/local/etherlab --with-xml-prefix=/usr/local/opt/libxml2 --with-zlib-dir=/usr/local/opt/zlib CXXFLAGS=-std=c++11 However, when I run make I got the error $ make /Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive Making all in proto make[2]: Nothing to be done for `all'. Making all in lib Making all in LibDLS make[3]: Nothing to be done for `all'. /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/etherlab/include -Wall -I/usr/local/include -I/usr/local/opt/zlib/include -I/usr/local/opt/libxml2/include/libxml2 -std=c++11 -MT libdls_la-ZLib.lo -MD -MP -MF .deps/libdls_la-ZLib.Tpo -c -o libdls_la-ZLib.lo `test -f 'ZLib.cpp' || echo './'`ZLib.cpp libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/etherlab/include -Wall -I/usr/local/include -I/usr/local/opt/zlib/include -I/usr/local/opt/libxml2/include/libxml2 -std=c++11 -MT libdls_la-ZLib.lo -MD -MP -MF .deps/libdls_la-ZLib.Tpo -c ZLib.cpp -fno-common -DPIC -o .libs/libdls_la-ZLib.o ZLib.cpp:22:10: warning: non-portable path to file '<ZLib.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path] #include <zlib.h> ^~~~~~~~ <ZLib.h> In file included from ZLib.cpp:22: ./zlib.h:42:17: error: unknown type name 'string'; did you mean 'std::string'? EZLib(const string &pmsg) : Exception(pmsg) {}; ^~~~~~ std::string /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/iosfwd:194:65: note: 'std::string' declared here typedef basic_string<char, char_traits<char>, allocator<char> > string; ^ ZLib.cpp:90:5: error: unknown type name 'uLongf' uLongf out_size; ^ ZLib.cpp:104:17: error: use of undeclared identifier 'uLongf' out_size = (uLongf) (src_size * 1.01 + 12 + 0.5); ^ ZLib.cpp:117:28: error: use of undeclared identifier 'Bytef' comp_ret = ::compress((Bytef *) _out_buf, &out_size, ^ ZLib.cpp:117:35: error: expected expression comp_ret = ::compress((Bytef *) _out_buf, &out_size, ^ ZLib.cpp:118:34: error: unknown type name 'Bytef' (const Bytef *) src, src_size); ^ ZLib.cpp:117:16: error: no member named 'compress' in the global namespace; did you mean simply 'compress'? comp_ret = ::compress((Bytef *) _out_buf, &out_size, ^~~~~~~~~~ compress ZLib.cpp:88:12: note: 'compress' declared here void ZLib::compress(const char *src, unsigned int src_size) ^ ZLib.cpp:120:21: error: use of undeclared identifier 'Z_OK' if (comp_ret != Z_OK) // Fehler beim Komprimieren ^ ZLib.cpp:123:25: error: use of undeclared identifier 'Z_BUF_ERROR' if (comp_ret == Z_BUF_ERROR) err << " (BUFFER ERROR)"; ^ ZLib.cpp:155:5: error: unknown type name 'uLongf' uLongf zlib_out_size = out_size; ^ ZLib.cpp:173:32: error: use of undeclared identifier 'Bytef' uncomp_ret = ::uncompress((Bytef *) _out_buf, &zlib_out_size, ^ ZLib.cpp:173:39: error: expected expression uncomp_ret = ::uncompress((Bytef *) _out_buf, &zlib_out_size, ^ ZLib.cpp:174:38: error: unknown type name 'Bytef' (const Bytef *) src, src_size); ^ ZLib.cpp:173:18: error: no member named 'uncompress' in the global namespace; did you mean simply 'uncompress'? uncomp_ret = ::uncompress((Bytef *) _out_buf, &zlib_out_size, ^~~~~~~~~~~~ uncompress ZLib.cpp:150:12: note: 'uncompress' declared here void ZLib::uncompress(const char *src, unsigned int src_size, ^ ZLib.cpp:176:23: error: use of undeclared identifier 'Z_OK' if (uncomp_ret != Z_OK) // Fehler beim Dekomprimieren ^ ZLib.cpp:179:27: error: use of undeclared identifier 'Z_BUF_ERROR' if (uncomp_ret == Z_BUF_ERROR) { ^ 1 warning and 16 errors generated. make[3]: *** [libdls_la-ZLib.lo] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Digging a bit more I found that I could try to add #include <string> #include <cstring> to the header zlib.h but this does not work either. What else can I do to solve this issue?.
Build Tensorflow on RPi3 with Bazel: C++ compilation of rule '#boringssl//:crypto' failed
Trying to run tensorflow on Raspberry PI 3B. Following the Guide on: https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blob/master/GUIDE.md#3-build-bazel Everything goes fine until the following step: pi#raspberrypi:~/tf/tensorflow $ bazel build -c opt --jobs 1 --copt="-mfpu=neon-vfpv4" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" --local_resources 1024,1.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package gcc is 4.8, bazel is 5.4 Raspbian 9 (Stretch) ERROR: /home/pi/.cache/bazel/_bazel_pi/477..6d/external/boringssl/BUILD:115:1: C++ compilation of rule '#boringssl//:crypto' failed (Exit 1): gcc failed: error executing command Here is what follows after the error-message: (cd /home/pi/.cache/bazel/_bazel_pi/477..6d/execroot/org_tensorflow && \ exec env - \ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games \ PWD=/proc/self/cwd \ PYTHON_BIN_PATH=/usr/bin/python \ PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages \ TF_NEED_CUDA=0 \ TF_NEED_OPENCL=0 \ /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 ' -D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction- sections -fdata-sections '-mfpu=neon-vfpv4' -funsafe-math-optimizations -ftree-vectorize -fomit-frame-pointer -MD -MF bazel-out/local-opt/bin/external/boringssl/_objs/crypto/external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.pic.d -fPIC -iquote external/boringssl -iquote bazel-out/local-opt/genfiles/external/boringssl -iquote external/bazel_tools -iquote bazel-out/local-opt/genfiles/external/bazel_tools -isystem external/boringssl/src/include -isystem bazel-out/local-opt/genfiles/external/boringssl/src/include -isystem external/bazel_tools/tools/cpp/gcc3 -DOPENSSL_NO_ASM -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c -o bazel-out/local-opt/bin/external/boringssl/_objs/crypto/external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.pic.o). external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c: In function 'gcm_siv_crypt': external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:616:3: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t done = 0; done < in_len;) { ^ external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:616:3: note: use option -std=c99 or -std=gnu99 to compile your code external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:626:5: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < todo; i++) { ^ external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c: In function 'gcm_siv_polyval': external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:673:3: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < EVP_AEAD_AES_GCM_SIV_NONCE_LEN; i++) { ^ external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c: In function 'gcm_siv_keys': external/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c:703:3: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < blocks_needed; i++) { ^ Target //tensorflow/tools/pip_package:build_pip_package failed to build INFO: Elapsed time: 69.995s, Critical Path: 1.36s Found several different issues for this but nothing worked so far. I think it could be the gcc version.
Error message during g++ compiling an installation file
The environments are Cent OS 6.7, boost-1.6.2, gcc-6.2.0 I have tried to install a software, but I got some errors. Are theses errors come from g++ ? or boost? I can't understand these messages.. because I have never been use g++.. Here is starting line. [root#cms CASMcode-0.2.0]# scons install scons: Reading SConscript files ... rm /usr/local/include/casm scons: done reading SConscript files. scons: Building targets ... Install directory: "include/casm" as "/usr/local/include/casm" /usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/version/version.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude src/casm/version/version.cc /usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/clex/ConfigIOStrucScore.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude -I/usr/local/boost_1_62_0/include src/casm/clex/ConfigIOStrucScore.cc In file included from include/casm/external/Eigen/Core:263:0, from include/casm/external/Eigen/Dense:1, from include/casm/CASM_global_definitions.hh:13, from include/casm/casm_io/EigenDataStream.hh:3, from src/casm/clex/ConfigIOStrucScore.cc:3: Error message appear here. In file included from include/casm/casm_io/DataFormatterTools.hh:1291:0, from include/casm/casm_io/DataFormatter_impl.hh:3, from include/casm/casm_io/DataFormatter.hh:757, from include/casm/clex/ConfigIO.hh:4, from src/casm/clex/ConfigIOStrucScore.cc:6: include/casm/casm_io/DataFormatterTools_impl.hh: In member function 'bool CASM::DataFormatterOperator<ValueType, ArgType, DataObject>::parse_args(const string&)': include/casm/casm_io/DataFormatterTools_impl.hh:33:33: error: invalid initialization of reference of type 'const wstring& {aka const std::__cxx11::basic_string<wchar_t>&}' from expression of type 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' val = std::stod(ttag); ^ And here In file included from include/casm/clex/PrimClex.hh:14:0, from include/casm/clex/ConfigIOStrucScore.hh:6, from src/casm/clex/ConfigIOStrucScore.cc:7: include/casm/clex/ChemicalReference.hh: In member function 'void CASM::ChemicalReferencePrinter::print(const std::vector<CASM::ChemicalReferenceState>&)': include/casm/clex/ChemicalReference.hh:366:27: error: 'round' is not a member of 'std' if(almost_equal(std::round(num), num, 1e-14)) { ^~~