Building on MacOS, and build keeps failing around 95-97%. Already tried reinstalling Clang, LLVM, Cmake, pulling fresh, etc. Below is the log before the failure:
[ 97%] Building CXX object unittests/CMakeFiles/unit_test.dir/tic_tac_toe_tests.cpp.o
[ 97%] Building CXX object unittests/CMakeFiles/unit_test.dir/wasm_tests.cpp.o
1 warning generated.
/Users/bwonymph/Desktop/src/github.com/eos/unittests/wasm_tests.cpp:588:2: warning: This test does not appear to be very robust. [-W#warnings]
#warning This test does not appear to be very robust.
^
/Users/bwonymph/Desktop/src/github.com/eos/unittests/wasm_tests.cpp:1485:2: warning: restore net_usage_tests [-W#warnings]
#warning restore net_usage_tests
^
2 warnings generated.
[ 97%] Linking CXX executable unit_test
ld: warning: ignoring file /usr/local/lib/libz.a, file was built for archive which is not the architecture being linked (x86_64): /usr/local/lib/libz.a
Undefined symbols for architecture x86_64:
"_compress2", referenced from:
llvm::zlib::compress(llvm::StringRef, llvm::SmallVectorImpl&, llvm::zlib::CompressionLevel) in libLLVMSupport.a(Compression.cpp.o)
(maybe you meant: _mz_compress2)
"_compressBound", referenced from:
llvm::zlib::compress(llvm::StringRef, llvm::SmallVectorImpl&, llvm::zlib::CompressionLevel) in libLLVMSupport.a(Compression.cpp.o)
(maybe you meant: _mz_compressBound)
"_crc32", referenced from:
boost::iostreams::detail::zlib_base::after(char const*&, char*&, bool) in libboost_iostreams-mt.a(zlib.o)
llvm::zlib::crc32(llvm::StringRef) in libLLVMSupport.a(Compression.cpp.o)
(maybe you meant: _mz_crc32, __Z13_mm_crc32_u64yy )
"_deflate", referenced from:
boost::iostreams::detail::zlib_base::xdeflate(int) in libboost_iostreams-mt.a(zlib.o)
(maybe you meant: _mz_deflateBound, _mz_deflate , _mz_deflateEnd , _mz_deflateInit2 , _mz_deflateInit , _mz_deflateReset )
"_deflateEnd", referenced from:
boost::iostreams::detail::zlib_base::reset(bool, bool) in libboost_iostreams-mt.a(zlib.o)
(maybe you meant: _mz_deflateEnd)
"deflateInit2", referenced from:
boost::iostreams::detail::zlib_base::do_init(boost::iostreams::zlib_params const&, bool, void* ()(void, unsigned int, unsigned int), void ()(void, void*), void*) in libboost_iostreams-mt.a(zlib.o)
"_deflateReset", referenced from:
boost::iostreams::detail::zlib_base::reset(bool, bool) in libboost_iostreams-mt.a(zlib.o)
(maybe you meant: _mz_deflateReset)
"_inflate", referenced from:
boost::iostreams::detail::zlib_base::xinflate(int) in libboost_iostreams-mt.a(zlib.o)
(maybe you meant: _mz_inflateInit, _mz_inflateInit2 , _mz_inflateEnd , _mz_inflate )
"_inflateEnd", referenced from:
boost::iostreams::detail::zlib_base::reset(bool, bool) in libboost_iostreams-mt.a(zlib.o)
(maybe you meant: _mz_inflateEnd)
"inflateInit2", referenced from:
boost::iostreams::detail::zlib_base::do_init(boost::iostreams::zlib_params const&, bool, void* ()(void, unsigned int, unsigned int), void ()(void, void*), void*) in libboost_iostreams-mt.a(zlib.o)
"_inflateReset", referenced from:
boost::iostreams::detail::zlib_base::reset(bool, bool) in libboost_iostreams-mt.a(zlib.o)
"_uncompress", referenced from:
llvm::zlib::uncompress(llvm::StringRef, char*, unsigned long&) in libLLVMSupport.a(Compression.cpp.o)
llvm::zlib::uncompress(llvm::StringRef, llvm::SmallVectorImpl&, unsigned long) in libLLVMSupport.a(Compression.cpp.o)
(maybe you meant: _mz_uncompress)
ld: symbol(s) not found for architecture x86_64
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [unittests/unit_test] Error 1
make[1]: *** [unittests/CMakeFiles/unit_test.dir/all] Error 2
make: *** [all] Error 2
>>>>>>>>>>>>>>>>>>>> MAKE building EOSIO has exited with the above error.
Appreciate any help regarding this thanks!
@bwonymph It looks as though you have an install of zlib that is causing an issue i.e.
ld: warning: ignoring file /usr/local/lib/libz.a, file was built for archive which is not the architecture being linked (x86_64): /usr/local/lib/libz.a
You probably need to reinstall zlib for x86_64 architecture. You can do this with home-brew or from source. Give it a shot and let me know how it turns out.
Libz.a was the error, I removed it from the usr/local/lib folder and it built correctly from eosio_build.sh. It probably links to the correct libz.a, seemed suspicious that it was in the usr/local folder. Thanks for the advice!