Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hera fails to compile using clang-14 and hunter v0.23.169 due to intx error #574

Open
r0qs opened this issue Jan 11, 2023 · 0 comments · May be fixed by #575
Open

Hera fails to compile using clang-14 and hunter v0.23.169 due to intx error #574

r0qs opened this issue Jan 11, 2023 · 0 comments · May be fixed by #575

Comments

@r0qs
Copy link

r0qs commented Jan 11, 2023

Problem description

Hi, I recently tried to compile the project using clang and got the error below.
I'm using Clang version 14.0.6 and Archlinux 6.1.1-arch1-1.

Maybe it is an incompatibility between the intx version that hunter_add_package attempts to download and the current hunter's version that the project uses.

intx was recently updated to 0.9.0 here: cpp-pm/hunter#646 (comment) and it depends on hunter v0.24.0 https://github.com/chfast/intx/blob/master/cmake/Hunter/init.cmake#L25

But I don't know why it works on gcc but not with clang.

The problem seems to be related to this: chfast/intx#244

To reproduce the error

mkdir build ; cd build
CC=clang CXX=clang++ cmake -DBUILD_SHARED_LIBS=ON ..

Workaround

Updating the hunter version in cmake/Hunter/init.cmake to v0.24.0 fixed the issue:

HunterGate(
    URL "https://github.com/cpp-pm/hunter/archive/v0.24.0.tar.gz"
    SHA1 "a3d7f4372b1dcd52faa6ff4a3bd5358e1d0e5efd"
)

Error log

-- [cable ] Cable 0.5.0 initialized
-- Build type: RelWithDebInfo
-- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test fstack-protector
-- Performing Test fstack-protector - Success
-- Performing Test fstack-protector-strong
-- Performing Test fstack-protector-strong - Success
-- Performing Test Wimplicit-fallthrough
-- Performing Test Wimplicit-fallthrough - Success
-- Found Git: /usr/bin/git (found version "2.39.0") 
CMake Warning (dev) at /usr/share/cmake/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  cmake/ProjectWabt.cmake:14 (ExternalProject_Add)
  CMakeLists.txt:54 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test Wfinal-dtor-non-final-class
-- Performing Test Wfinal-dtor-non-final-class - Success
-- Performing Test Wnewline-eof
-- Performing Test Wnewline-eof - Success
-- Performing Test Wsuggest-destructor-override
-- Performing Test Wsuggest-destructor-override - Success
-- Performing Test Wunreachable-code-break
-- Performing Test Wunreachable-code-break - Success
-- Performing Test Wduplicated-cond
-- Performing Test Wduplicated-cond - Failed
-- Performing Test Wduplicate-enum
-- Performing Test Wduplicate-enum - Success
-- Performing Test Wlogical-op
-- Performing Test Wlogical-op - Failed
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- [hunter] Calculating Toolchain-SHA1
-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: /home/cromagnon/.hunter
-- [hunter] [ Hunter-ID: 60de9f2 | Toolchain-ID: 88d479d | Config-ID: c7bb649 ]
-- [hunter] INTX_ROOT: /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Install (ver.: 0.2.0)
-- [hunter] Building intx
loading initial cache file /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/cache.cmake
loading initial cache file /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/args.cmake
-- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at /usr/share/cmake/Modules/ExternalProject.cmake:3075 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/ExternalProject.cmake:4185 (_ep_add_download_command)
  CMakeLists.txt:140 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Build
[ 12%] Creating directories for 'intx-Release'
[ 25%] Performing download step (download, verify and extract) for 'intx-Release'
-- verifying file...
       file='/home/cromagnon/.hunter/_Base/Download/intx/0.2.0/50c4d8e/v0.2.0.tar.gz'
-- File already exists and hash match (skip download):
  file='/home/cromagnon/.hunter/_Base/Download/intx/0.2.0/50c4d8e/v0.2.0.tar.gz'
  SHA1='50c4d8ec601114755be9fd5bf5b288ee4eeacd54'
-- extracting...
     src='/home/cromagnon/.hunter/_Base/Download/intx/0.2.0/50c4d8e/v0.2.0.tar.gz'
     dst='/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[ 37%] No update step for 'intx-Release'
[ 50%] No patch step for 'intx-Release'
[ 62%] Performing configure step for 'intx-Release'
loading initial cache file /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/cache.cmake
loading initial cache file /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/args.cmake
-- [cable ] Cable 0.4.0 initialized
CMake Warning (dev) at /usr/share/cmake/Modules/GNUInstallDirs.cmake:243 (message):
  Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
  target architecture is known.  Please enable at least one language before
  including GNUInstallDirs.
Call Stack (most recent call first):
  CMakeLists.txt:13 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- [cable ] Build type: Release
-- The CXX compiler identification is Clang 14.0.6
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test fstack-protector
-- Performing Test fstack-protector - Success
-- Performing Test Wimplicit-fallthrough
-- Performing Test Wimplicit-fallthrough - Success
-- Performing Test mtune=generic
-- Performing Test mtune=generic - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Build/intx-Release-prefix/src/intx-Release-build
[ 75%] Performing build step for 'intx-Release'
[ 50%] Building CXX object lib/intx/CMakeFiles/intx.dir/div.cpp.o
In file included from /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/lib/intx/div.cpp:5:
In file included from /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/lib/intx/div.hpp:7:
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:12: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
    return (a.hi < b.hi) | ((a.hi == b.hi) & (a.lo < b.lo));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         ||
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:223:14: note: in instantiation of function template specialization 'intx::operator<<256U>' requested here
    return x < uint<N>(y);
             ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/int128.hpp:742:15: note: in instantiation of function template specialization 'intx::operator<<256U, char, void>' requested here
        if (x < d)
              ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:937:12: note: in instantiation of function template specialization 'intx::from_string<intx::uint<256>>' requested here
    return from_string<uint256>(s);
           ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:12: note: cast one or both operands to int to silence this warning
    return (a.hi < b.hi) | ((a.hi == b.hi) & (a.lo < b.lo));
           ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:29: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
    return (a.hi < b.hi) | ((a.hi == b.hi) & (a.lo < b.lo));
                           ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                           &&
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:29: note: cast one or both operands to int to silence this warning
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:171:12: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
    return (a.lo == b.lo) & (a.hi == b.hi);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          &&
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:35: note: in instantiation of function template specialization 'intx::operator==<256U>' requested here
    return (a.hi < b.hi) | ((a.hi == b.hi) & (a.lo < b.lo));
                                  ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:223:14: note: in instantiation of function template specialization 'intx::operator<<512U>' requested here
    return x < uint<N>(y);
             ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/int128.hpp:742:15: note: in instantiation of function template specialization 'intx::operator<<512U, char, void>' requested here
        if (x < d)
              ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:942:12: note: in instantiation of function template specialization 'intx::from_string<intx::uint<512>>' requested here
    return from_string<uint512>(s);
           ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:171:12: note: cast one or both operands to int to silence this warning
    return (a.lo == b.lo) & (a.hi == b.hi);
           ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:12: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
    return (a.hi < b.hi) | ((a.hi == b.hi) & (a.lo < b.lo));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         ||
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:223:14: note: in instantiation of function template specialization 'intx::operator<<512U>' requested here
    return x < uint<N>(y);
             ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/int128.hpp:742:15: note: in instantiation of function template specialization 'intx::operator<<512U, char, void>' requested here
        if (x < d)
              ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:942:12: note: in instantiation of function template specialization 'intx::from_string<intx::uint<512>>' requested here
    return from_string<uint512>(s);
           ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:12: note: cast one or both operands to int to silence this warning
    return (a.hi < b.hi) | ((a.hi == b.hi) & (a.lo < b.lo));
           ^
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:29: error: use of bitwise '&' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
    return (a.hi < b.hi) | ((a.hi == b.hi) & (a.lo < b.lo));
                           ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                           &&
/home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx/Source/include/intx/intx.hpp:216:29: note: cast one or both operands to int to silence this warning
5 errors generated.
make[5]: *** [lib/intx/CMakeFiles/intx.dir/build.make:76: lib/intx/CMakeFiles/intx.dir/div.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:116: lib/intx/CMakeFiles/intx.dir/all] Error 2
make[3]: *** [Makefile:156: all] Error 2
make[2]: *** [CMakeFiles/intx-Release.dir/build.make:86: intx-Release-prefix/src/intx-Release-stamp/intx-Release-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/intx-Release.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

[hunter ** FATAL ERROR **] Build step failed (dir: /home/cromagnon/.hunter/_Base/60de9f2/88d479d/c7bb649/Build/intx
[hunter ** FATAL ERROR **] [Directory:/home/cromagnon/.hunter/_Base/Download/Hunter/0.23.169/60de9f2/Unpacked/cmake/projects/intx]

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

CMake Error at /home/cromagnon/.hunter/_Base/Download/Hunter/0.23.169/60de9f2/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  /home/cromagnon/.hunter/_Base/Download/Hunter/0.23.169/60de9f2/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  /home/cromagnon/.hunter/_Base/Download/Hunter/0.23.169/60de9f2/Unpacked/cmake/modules/hunter_download.cmake:617 (hunter_fatal_error)
  /home/cromagnon/.hunter/_Base/Download/Hunter/0.23.169/60de9f2/Unpacked/cmake/projects/intx/hunter.cmake:43 (hunter_download)
  /home/cromagnon/.hunter/_Base/Download/Hunter/0.23.169/60de9f2/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
  src/CMakeLists.txt:3 (hunter_add_package)


-- Configuring incomplete, errors occurred!
See also "/home/cromagnon/src/hera/build/CMakeFiles/CMakeOutput.log".
See also "/home/cromagnon/src/hera/build/CMakeFiles/CMakeError.log".
@r0qs r0qs linked a pull request Jan 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant