ethereum / retesteth

testeth via RPC. Test run, generation by t8ntool protocol
http://retesteth.ethdevops.io/
GNU General Public License v3.0
114 stars 75 forks source link

Unable to build on MacOS (Apple M1 Max) #187

Closed diega closed 2 years ago

diega commented 2 years ago

I'm getting an error trying to build retesteth

OS version: MacOS 12.6 Go version: go version go1.16.15 darwin/arm64 Architecture: Apple M1 Max

Relevant output

$ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake
[...]
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Build
[1/16] Creating directories for 'cryptopp-Release'
[1/16] Performing download step (download, verify and extract) for 'cryptopp-Release'
-- Downloading...
   dst='/Users/diegoll/.hunter/_Base/Download/cryptopp/8.2.0-p1/ad02d42/v8.2.0-p1.tar.gz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://github.com/cpp-pm/cryptopp/archive/v8.2.0-p1.tar.gz'
-- verifying file...
       file='/Users/diegoll/.hunter/_Base/Download/cryptopp/8.2.0-p1/ad02d42/v8.2.0-p1.tar.gz'
-- Downloading... done
-- extracting...
     src='/Users/diegoll/.hunter/_Base/Download/cryptopp/8.2.0-p1/ad02d42/v8.2.0-p1.tar.gz'
     dst='/Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[2/16] No update step for 'cryptopp-Release'
[4/16] No patch step for 'cryptopp-Release'
[4/16] Performing configure step for 'cryptopp-Release'
loading initial cache file /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/cache.cmake
loading initial cache file /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/args.cmake
-- *************************************************************************
The Crypto++ library does not officially support CMake. CMake support is a
community effort, and the library works with the folks using CMake to help
improve it. If you find an issue then please fix it or report it at
https://github.com/noloader/cryptopp-cmake.
-- *************************************************************************
-- CMake version 3.24.2
CMake Deprecation Warning at CMakeLists.txt:32 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Native arch: FALSE
-- Compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Compiler options:
-- Compiler definitions:
-- Build type: Release
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Build/cryptopp-Release-prefix/src/cryptopp-Release-build
[5/16] Performing build step for 'cryptopp-Release'
[1/173] Building CXX object CMakeFiles/cryptopp-static.dir/cpu.cpp.o
[...]
[37/173] Building CXX object CMakeFiles/cryptopp-static.dir/crc_simd.cpp.o
FAILED: CMakeFiles/cryptopp-static.dir/crc_simd.cpp.o
/Library/Developer/CommandLineTools/usr/bin/c++  -I/Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk -fPIC -std=c++17 -MD -MT CMakeFiles/cryptopp-static.dir/crc_simd.cpp.o -MF CMakeFiles/cryptopp-static.dir/crc_simd.cpp.o.d -o CMakeFiles/cryptopp-static.dir/crc_simd.cpp.o -c /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source/crc_simd.cpp
/Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source/crc_simd.cpp:123:13: error: use of undeclared identifier '__crc32b'
        c = __crc32b(c, *s);
            ^
/Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source/crc_simd.cpp:126:13: error: use of undeclared identifier '__crc32w'
        c = __crc32w(c, *(const word32 *)(void*)s);
            ^
/Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source/crc_simd.cpp:129:13: error: use of undeclared identifier '__crc32b'
        c = __crc32b(c, *s);
            ^
/Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source/crc_simd.cpp:135:13: error: use of undeclared identifier '__crc32cb'
        c = __crc32cb(c, *s);
            ^
/Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source/crc_simd.cpp:138:13: error: use of undeclared identifier '__crc32cw'
        c = __crc32cw(c, *(const word32 *)(void*)s);
            ^
/Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Source/crc_simd.cpp:141:13: error: use of undeclared identifier '__crc32cb'
        c = __crc32cb(c, *s);
            ^
6 errors generated.
[38/173] Building CXX object CMakeFiles/cryptopp-static.dir/darn.cpp.o
[39/173] Building CXX object CMakeFiles/cryptopp-static.dir/des.cpp.o
[40/173] Building CXX object CMakeFiles/cryptopp-static.dir/default.cpp.o
ninja: build stopped: subcommand failed.
FAILED: cryptopp-Release-prefix/src/cryptopp-Release-stamp/cryptopp-Release-build /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Build/cryptopp-Release-prefix/src/cryptopp-Release-stamp/cryptopp-Release-build
cd /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Build/cryptopp-Release-prefix/src/cryptopp-Release-build && /opt/homebrew/Cellar/cmake/3.24.2/bin/cmake --build . --config Release -- -j4 && /opt/homebrew/Cellar/cmake/3.24.2/bin/cmake -E touch /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp/Build/cryptopp-Release-prefix/src/cryptopp-Release-stamp/cryptopp-Release-build
ninja: build stopped: subcommand failed.

[hunter ** FATAL ERROR **] Build step failed (dir: /Users/diegoll/.hunter/_Base/908ddcb/f957051/8f3687a/Build/cryptopp
[hunter ** FATAL ERROR **] [Directory:/Users/diegoll/.hunter/_Base/Download/Hunter/0.24.7/908ddcb/Unpacked/cmake/projects/cryptopp]

------------------------------ ERROR -----------------------------
    https://hunter.readthedocs.io/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------

CMake Error at /Users/diegoll/.hunter/_Base/Download/Hunter/0.24.7/908ddcb/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  /Users/diegoll/.hunter/_Base/Download/Hunter/0.24.7/908ddcb/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  /Users/diegoll/.hunter/_Base/Download/Hunter/0.24.7/908ddcb/Unpacked/cmake/modules/hunter_download.cmake:623 (hunter_fatal_error)
  /Users/diegoll/.hunter/_Base/Download/Hunter/0.24.7/908ddcb/Unpacked/cmake/projects/cryptopp/hunter.cmake:74 (hunter_download)
  /Users/diegoll/.hunter/_Base/Download/Hunter/0.24.7/908ddcb/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
  CMakeLists.txt:46 (hunter_add_package)

-- Configuring incomplete, errors occurred!
See also "/Users/diegoll/dev/upstream/retesteth/build/CMakeFiles/CMakeOutput.log".
See also "/Users/diegoll/dev/upstream/retesteth/build/CMakeFiles/CMakeError.log".
winsvega commented 2 years ago

hmm this seems to be related https://github.com/cryfs/cryfs/issues/345 the problem is with cryptopp, see if you can install it manually. I see many dependency build problem on mac recently. we can switch to manual installation in such cases. (that will require me to update cmake script)

winsvega commented 2 years ago

https://output.circle-artifacts.com/output/job/73dc76dd-2411-4366-8318-d7c045c7b200/artifacts/0/retesteth/retesteth

Here is the binary for mac12 (nightly build)

winsvega commented 2 years ago

fixed by: https://github.com/ethereum/retesteth/pull/174/commits/4327e9927221f9a862c1f3feffa73bf2a93c89c2

introducing -DLOCALDEPS cmake flag that let you use locally installed dependencies insetead of hunter autoinstall (which uses outdated version of cryptopp that does not compile on this version of mac)

Solution (from the build directory):

rm -r /home/root/.hunter
rm CMakeCache.txt
cmake .. -DLOCALDEPS=CRYPTOPP

the script should detect system installed version of CRYPTOPP, BOOST, or MPIR (so far problems been reported with this ones)