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

Repaired building iroha according to instruction: Added patch file to repair building of benchmark library: std::numeric_limits requires <limits> header #2906

Conversation

baziorek
Copy link
Contributor

Description of the Change

This is really similar to #2902, but there is problem with another dependency: benchmark library.

When building according to the instruction, which is with command:

./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build

Suddenly building is stopping with message:

Building package benchmark[core]:x64-linux...
-- Downloading https://github.com/google/benchmark/archive/73d4d5e8d6d449fc8663765a42aa8aeeee844489.tar.gz -> google-benchmark-73d4d5e8d6d449fc8663765a42aa8aeeee844489.tar.gz...
-- Extracting source /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/downloads/google-benchmark-73d4d5e8d6d449fc8663765a42aa8aeeee844489.tar.gz
-- Using source at /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-75b6880063.clean
-- Found external ninja('1.10.1').
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:146 (message):
    Command failed: /usr/bin/cmake --build . --config Debug --target install -- -v -j6
    Working Directory: /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/benchmark/x64-linux-dbg
    See logs for more information:
      /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/benchmark/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_cmake.cmake:105 (vcpkg_execute_build_process)
  scripts/cmake/vcpkg_install_cmake.cmake:45 (vcpkg_build_cmake)
  ports/benchmark/portfile.cmake:21 (vcpkg_install_cmake)
  scripts/ports.cmake:142 (include)


Error: Building package benchmark:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: benchmark:x64-linux
  Vcpkg version: 2021-01-13-unknownhash

Additionally, attach any relevant sections from the log files above.

In the log file is problem:

In file included from /home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-75b6880063.clean/src/benchmark_register.cc:15:
/home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-75b6880063.clean/src/benchmark_register.h: In function ‘typename std::vector<T>::iterator benchmark::internal::AddPowers(std::vector<T>*, T, T, int)’:
/home/student/Desktop/iroha_code/baziorek/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-75b6880063.clean/src/benchmark_register.h:22:30: error: ‘numeric_limits’ is not a member of ‘std’
   22 |   static const T kmax = std::numeric_limits<T>::max();
      |                              ^~~~~~~~~~~~~~

So to fix its it is enough to add to the file: benchmark_register.h extra line:

#include <limits>

So I've corrected this according to instruction: https://stackoverflow.com/questions/72588408/vcpkg-how-to-edit-package-file-when-compilation-fails-when-installing-package


I'm using Ubuntu 22.04, with version of g++: g++ (Ubuntu 11.2.0-19ubuntu1) 11.2.0.

Issue

Benefits

Automatic build of HL Iroha

Possible Drawbacks

Chosen way of fix can be not best possible (maybe upgrading the library would be better, but more dangerous).

Usage Examples or Tests [optional]

After the fix the command:

./vcpkg/build_iroha_deps.sh $PWD/vcpkg-build

is passing to build benchmark without any hacks described here.

Alternate Designs [optional]

… repair building of benchmark library: std::numeric_limits requires <limits> header

Signed-off-by: Grzegorz Bazior <[email protected]>
@baziorek baziorek added Bug Something isn't working 1.x build 1.5 Dev defect The defect was found at the development stage. Did not have an impact on users. labels Oct 24, 2022
@baziorek baziorek self-assigned this Oct 24, 2022
@baziorek baziorek temporarily deployed to test-env October 24, 2022 22:07 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 22:07 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 22:07 Inactive
@baziorek baziorek temporarily deployed to test-env October 24, 2022 22:07 Inactive
@baziorek baziorek marked this pull request as ready for review October 24, 2022 22:12
Copy link
Contributor

@6r1d 6r1d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@appetrosyan appetrosyan merged commit d5d7551 into hyperledger-iroha:develop Oct 25, 2022
@baziorek baziorek deleted the building_with_vcpkg_fix_benchmark branch November 11, 2022 11:02
@baziorek baziorek mentioned this pull request Mar 24, 2023
@nxsaken nxsaken added the iroha1 The legacy version of Iroha. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.5 Bug Something isn't working build Dev defect The defect was found at the development stage. Did not have an impact on users. iroha1 The legacy version of Iroha.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants