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

[fix]: Iroha 1: Mac: Repair benchmark #3345

Merged
merged 2 commits into from Apr 13, 2023

Conversation

baziorek
Copy link
Member

@baziorek baziorek commented Mar 31, 2023

Description

Currently develop is failling to build on MacOS, after enabling build on MacOS (829357f), that is why I'm trying to fix its by doing something similar to:
#2906

Hopefully it will fix the compilation error:
#3081 (comment)

[5/22] /Library/Developer/CommandLineTools/usr/bin/clang++ -DHAVE_POSIX_REGEX -DHAVE_STD_REGEX -DHAVE_STEADY_CLOCK -I/Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/include -I/Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/src -I/Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/src/../include -fPIC  -std=c++11  -Wall  -Wextra  -Wshadow  -Wshorten-64-to-32  -fstrict-aliasing  -Wno-deprecated-declarations  -Wstrict-aliasing  -Wthread-safety -O3 -DNDEBUG  -Werror  -Wno-deprecated -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -MD -MT src/CMakeFiles/benchmark.dir/complexity.cc.o -MF src/CMakeFiles/benchmark.dir/complexity.cc.o.d -o src/CMakeFiles/benchmark.dir/complexity.cc.o -c /Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/src/complexity.cc
FAILED: src/CMakeFiles/benchmark.dir/complexity.cc.o 
/Library/Developer/CommandLineTools/usr/bin/clang++ -DHAVE_POSIX_REGEX -DHAVE_STD_REGEX -DHAVE_STEADY_CLOCK -I/Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/include -I/Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/src -I/Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/src/../include -fPIC  -std=c++11  -Wall  -Wextra  -Wshadow  -Wshorten-64-to-32  -fstrict-aliasing  -Wno-deprecated-declarations  -Wstrict-aliasing  -Wthread-safety -O3 -DNDEBUG  -Werror  -Wno-deprecated -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -MD -MT src/CMakeFiles/benchmark.dir/complexity.cc.o -MF src/CMakeFiles/benchmark.dir/complexity.cc.o.d -o src/CMakeFiles/benchmark.dir/complexity.cc.o -c /Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/src/complexity.cc
/Users/qwerty/workdir/iroha/vcpkg-build/buildtrees/benchmark/src/eeee844489-b89864c19e.clean/src/complexity.cc:85:10: error: variable 'sigma_gn' set but not used [-Werror,-Wunused-but-set-variable]
  double sigma_gn = 0.0;
         ^
1 error generated.
ninja: build stopped: subcommand failed

Fixed build (hopefully, because I don't have MacOS), according to the instruction:
https://stackoverflow.com/questions/72588408/vcpkg-how-to-edit-package-file-when-compilation-fails-when-installing-package

Linked issue

#3081

Closes #{issue_number}

Benefits

Successful build on MacOS

Checklist

  • I've read CONTRIBUTING.md
  • I've used the standard signed-off commit format (or will squash just before merging)
  • All applicable CI checks pass (or I promised to make them pass later)
  • (optional) I've written unit tests for the code changes
  • I replied to all comments after code review, marking all implemented changes with thumbs up

@baziorek baziorek self-assigned this Mar 31, 2023
@baziorek baziorek force-pushed the repairingBenchmarkBuildOnMacOs branch 2 times, most recently from 5b34f44 to a7a554d Compare March 31, 2023 15:45
@baziorek baziorek marked this pull request as ready for review March 31, 2023 15:45
@baziorek baziorek force-pushed the repairingBenchmarkBuildOnMacOs branch from 18e3cdf to 2733254 Compare March 31, 2023 15:59
@baziorek
Copy link
Member Author

I noticed that after upgrading of VCPKG version (fdc2c1e) some of patches are not applicable anymore (new version probably fixed its). That is why I've removed them:

  • 0005-disable-prometheus-logs.patch
  • 0007-repaired-ambiguous-template-usage.patch
  • 0002-rxcpp-from-master-2020-08-22.patch
  • 0006-prometheus-remove-self-metrics.patch
  • 0008-added-missing-standard-header-to-benchmark-library.patch

@baziorek
Copy link
Member Author

baziorek commented Mar 31, 2023

I noticed that upgrading vcpkg updated libraries, and Iroha is using some old dependencies:

[26/922] Building CXX object libs/crypto/CMakeFiles/keys_manager.dir/keys_manager_impl.o
FAILED: libs/crypto/CMakeFiles/keys_manager.dir/keys_manager_impl.o 
/usr/local/bin/ccache /usr/local/opt/ccache/libexec/clang++ -DBOOST_NO_RTTI -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -I/Users/runner/work/iroha/iroha -I/Users/runner/work/iroha/iroha/shared_model -I/Users/runner/work/iroha/iroha/irohad -I/Users/runner/work/iroha/iroha/libs -isystem /Users/runner/work/iroha/iroha/vcpkg-build/installed/x64-osx/include -Wall -fdiagnostics-color=always -g -g -Wextra -Wno-unused-parameter -Wno-deprecated-declarations -O0 -std=gnu++17 -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -fPIC -Ded25519_EXPORTS -MD -MT libs/crypto/CMakeFiles/keys_manager.dir/keys_manager_impl.o -MF libs/crypto/CMakeFiles/keys_manager.dir/keys_manager_impl.o.d -o libs/crypto/CMakeFiles/keys_manager.dir/keys_manager_impl.o -c /Users/runner/work/iroha/iroha/libs/crypto/keys_manager_impl.cpp
In file included from /Users/runner/work/iroha/iroha/libs/crypto/keys_manager_impl.cpp:6:
In file included from /Users/runner/work/iroha/iroha/libs/crypto/keys_manager_impl.hpp:9:
In file included from /Users/runner/work/iroha/iroha/libs/crypto/keys_manager.hpp:13:
In file included from /Users/runner/work/iroha/iroha/shared_model/cryptography/keypair.hpp:9:
In file included from /Users/runner/work/iroha/iroha/shared_model/cryptography/private_key.hpp:9:
In file included from /Users/runner/work/iroha/iroha/shared_model/cryptography/blob.hpp:14:
In file included from /Users/runner/work/iroha/iroha/shared_model/interfaces/base/model_primitive.hpp:11:
In file included from /Users/runner/work/iroha/iroha/shared_model/utils/string_builder.hpp:11:
/Users/runner/work/iroha/iroha/libs/common/to_string.hpp:80:33: error: no template named 'is_optional_related' in namespace 'boost::optional_detail'; did you mean 'is_optional_or_tag'?
        boost::optional_detail::is_optional_related<T>::value,
        ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
                                is_optional_or_tag
/Users/runner/work/iroha/iroha/vcpkg-build/installed/x64-osx/include/boost/optional/optional.hpp:790:8: note: 'is_optional_or_tag' declared here
struct is_optional_or_tag
       ^
1 error generated.
[27/922] Building CXX object libs/multihash/CMakeFiles/multihash.dir/multihash.o

EDIT: But it is quite easy to fix:
image

@baziorek
Copy link
Member Author

baziorek commented Apr 1, 2023

@safinsaf Could You please install: autoconf for docker images?
image
Locally on Ubuntu it is compiling "Build iroha vcpkg dependancies"

@baziorek
Copy link
Member Author

baziorek commented Apr 1, 2023

I've fixed building (locally) of irohad, iroha-cli and few examples of iroha-lib. But tests are still not compiling.

@appetrosyan
Copy link
Contributor

Just FYI, I recommend squashing these commits, rather than rebasing. This doesn't exactly follow our commit conventions.

@appetrosyan appetrosyan changed the title Repairing benchmark build on mac os [fix]: Iroha 1: Mac: Repair benchmark Apr 1, 2023
2. Removed incorrect patches to vcpkg libraries after VCPKG version bump
3. Fixed building for irohad and iroha-cli after after VCPKG version bump (and 3rd part libraries version bump)

Signed-off-by: Grzegorz Bazior <g.bazior@yodiss.pl>
@baziorek baziorek force-pushed the repairingBenchmarkBuildOnMacOs branch from b79b184 to ee3cc7d Compare April 1, 2023 20:36
@baziorek
Copy link
Member Author

baziorek commented Apr 1, 2023

I've fixed building (locally) of irohad, iroha-cli and few examples of iroha-lib. But tests are still not compiling.

Just FYI, I recommend squashing these commits, rather than rebasing. This doesn't exactly follow our commit conventions.

I've created one commit with :

git rebase -i HEAD~3

is the way which You wanted?

Signed-off-by: safinsaf <safinsaft@gmail.com>
@baziorek baziorek mentioned this pull request Apr 12, 2023
5 tasks
@appetrosyan appetrosyan merged commit 63f8688 into develop Apr 13, 2023
23 of 25 checks passed
@appetrosyan appetrosyan deleted the repairingBenchmarkBuildOnMacOs branch April 25, 2023 09:19
@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 build iroha1 The legacy version of Iroha.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants