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

bug: build error on new AMD cpu's (ubuntu 22.04 LTS) #2560

Open
bufrr opened this issue Mar 28, 2024 · 6 comments
Open

bug: build error on new AMD cpu's (ubuntu 22.04 LTS) #2560

bufrr opened this issue Mar 28, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@bufrr
Copy link

bufrr commented Mar 28, 2024

Problem

build error

Impact

build error

To reproduce

make wakunode2

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots/logs

Building: install/usr/lib/libbacktracenim.a
Building: build/wakunode2
[NimScript] exec: nim c --out:build/wakunode2  --verbosity:0 --hints:off -d:chronicles_log_level=TRACE -d:git_version="v0.25.0-rc.0-87-g2aa835" -d:release --passL:librln_v0.3.6.a --passL:-lm apps/wakunode2/wakunode2.nim
/root/nwaku/apps/wakunode2/wakunode2.nim(8, 18) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_core/peers.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_rln_relay/conversion_utils.nim(10, 7) Warning: imported and not used: 'results' [UnusedImport]
/root/nwaku/waku/waku_rln_relay/rln/wrappers.nim(8, 12) Warning: imported and not used: 'utils' [UnusedImport]
/root/nwaku/waku/waku_rln_relay/rln/wrappers.nim(7, 6) Warning: imported and not used: 'strformat' [UnusedImport]
/root/nwaku/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim(189, 21) template/generic instantiation of `async` from here
/root/nwaku/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim(184, 10) Warning: use {.base.} for base methods; baseless methods are deprecated [UseBase]
/root/nwaku/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim(669, 54) template/generic instantiation of `async` from here
/root/nwaku/waku/waku_rln_relay/group_manager/on_chain/group_manager.nim(708, 12) Warning: use fileExists; existsFile is deprecated [Deprecated]
/root/nwaku/waku/common/confutils/envvar/std/net.nim(6, 32) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/common/confutils/envvar/std/net.nim(9, 1) Warning: net is deprecated [Deprecated]
/root/nwaku/waku/common/logging.nim(4, 6) Warning: imported and not used: 'strutils' [UnusedImport]
/root/nwaku/waku/common/enr/builder.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_enr/capabilities.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_enr/multiaddr.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_enr/sharding.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/vendor/nim-libp2p/libp2p/transports/tcptransport.nim(177, 36) template/generic instantiation of `async` from here
/root/nwaku/vendor/nim-libp2p/libp2p/transports/tcptransport.nim(183, 17) template/generic instantiation of `checkFutures` from here
/root/nwaku/vendor/nim-libp2p/libp2p/errors.nim(30, 24) template/generic instantiation of `readError` from here
/root/nwaku/vendor/nim-chronos/chronos/internal/raisesfutures.nim(217, 12) Warning: No exceptions possible with this operation, `readError` always raises [User]
/root/nwaku/waku/common/utils/sequence.nim(6, 11) Warning: imported and not used: 'sequtils' [UnusedImport]
/root/nwaku/waku/common/utils/nat.nim(7, 57) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/common/databases/dburl.nim(6, 15) Warning: use re2(static string) instead; re is deprecated [Deprecated]
/root/nwaku/waku/common/databases/dburl.nim(8, 67) Warning: use match(string, Regex2) instead; match is deprecated [Deprecated]
/root/nwaku/waku/node/config.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/node/waku_switch.nim(8, 6) Warning: imported and not used: 'math' [UnusedImport]
/root/nwaku/waku/node/waku_node.nim(13, 18) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_archive/archive.nim(7, 6) Warning: imported and not used: 'strutils' [UnusedImport]
/root/nwaku/waku/waku_store/protocol.nim(40, 51) template/generic instantiation of `async` from here
/root/nwaku/waku/waku_store/protocol.nim(43, 31) template/generic instantiation of `decode` from here
/root/nwaku/waku/waku_store/rpc_codec.nim(256, 39) template/generic instantiation of `decode` from here
/root/nwaku/waku/waku_store/rpc_codec.nim(224, 40) template/generic instantiation of `parse` from here
/root/nwaku/waku/waku_store/rpc.nim(80, 28) Warning: conversion to enum with holes is unsafe: HistoryResponseErrorRPC(kind) [HoleEnumConv]
/root/nwaku/waku/utils/tableutils.nim(1, 24) Warning: imported and not used: 'objects' [UnusedImport]
/root/nwaku/waku/waku_filter_v2/client.nim(29, 36) template/generic instantiation of `async` from here
/root/nwaku/waku/waku_filter_v2/client.nim(68, 10) template/generic instantiation of `setResult` from here
/root/nwaku/waku/waku_filter_v2/client.nim(66, 72) template/generic instantiation of `setResult` from here
/root/nwaku/waku/waku_filter_v2/common.nim(68, 38) template/generic instantiation of `parse` from here
/root/nwaku/waku/waku_filter_v2/common.nim(63, 29) Warning: conversion to enum with holes is unsafe: FilterSubscribeErrorKind(kind) [HoleEnumConv]
/root/nwaku/waku/waku_dnsdisc.nim(13, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/vendor/nim-dnsdisc/dnsdisc/client.nim(67, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/waku_discv5.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_rln_relay/group_manager/static/group_manager.nim(1, 31) Warning: imported and not used: 'constants' [UnusedImport]
/root/nwaku/waku/waku_rln_relay/rln_relay.nim(276, 7) Warning: Special variable 'result' is shadowed. [ResultShadowed]
/root/nwaku/waku/waku_rln_relay/rln_relay.nim(7, 6) Warning: imported and not used: 'algorithm' [UnusedImport]
/root/nwaku/waku/waku_rln_relay/rln_relay.nim(11, 10) Warning: imported and not used: 'ratelimit' [UnusedImport]
/root/nwaku/waku/waku_rln_relay/rln_relay.nim(7, 6) Warning: imported and not used: 'strutils' [UnusedImport]
/root/nwaku/waku/waku_rln_relay/rln_relay.nim(37, 11) Warning: imported and not used: 'collector' [UnusedImport]
/root/nwaku/waku/waku_rln_relay/rln_relay.nim(7, 6) Warning: imported and not used: 'os' [UnusedImport]
/root/nwaku/waku/node/waku_node.nim(431, 5) template/generic instantiation of `async` from here
/root/nwaku/waku/node/waku_node.nim(425, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(454, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(472, 36) template/generic instantiation of `async` from here
/root/nwaku/waku/node/waku_node.nim(467, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(550, 36) template/generic instantiation of `async` from here
/root/nwaku/waku/node/waku_node.nim(545, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(619, 36) template/generic instantiation of `async` from here
/root/nwaku/waku/node/waku_node.nim(617, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(702, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(916, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(928, 34) template/generic instantiation of `async` from here
/root/nwaku/waku/node/waku_node.nim(926, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(971, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/node/waku_node.nim(1013, 1) Warning: The raises pragma doesn't work on async procedures - use `async: (raises: [...]) instead. [User]
/root/nwaku/waku/waku_api/handlers.nim(6, 17) Warning: imported and not used: 'chronicles' [UnusedImport]
/root/nwaku/waku/waku_api/rest/server.nim(8, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_api/rest/origin_handler.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/waku_api/rest/filter/handlers.nim(120, 3) Warning: unreachable else, all cases are already covered [UnreachableElse]
/root/nwaku/waku/waku_api/rest/lightpush/types.nim(11, 9) Warning: imported and not used: 'common' [UnusedImport]
/root/nwaku/waku/waku_api/rest/lightpush/types.nim(14, 18) Warning: imported and not used: 'base64' [UnusedImport]
/root/nwaku/waku/waku_store/self_req_handler.nim(16, 31) Warning: imported and not used: 'chronicles' [UnusedImport]
/root/nwaku/waku/waku_api/rest/health/handlers.nim(7, 42) Warning: imported and not used: 'serdes' [UnusedImport]
/root/nwaku/waku/waku_api/rest/health/handlers.nim(6, 20) Warning: imported and not used: 'json_serialization' [UnusedImport]
/root/nwaku/waku/waku_api/rest/admin/handlers.nim(8, 7) Warning: imported and not used: 'byteutils' [UnusedImport]
/root/nwaku/waku/waku_api/rest/admin/handlers.nim(7, 6) Warning: imported and not used: 'sets' [UnusedImport]
/root/nwaku/waku/factory/internal_config.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/factory/builder.nim(9, 13) Warning: use std/net; net is deprecated [Deprecated]
/root/nwaku/waku/factory/validator_signed.nim(7, 6) Warning: imported and not used: 'math' [UnusedImport]
/root/nwaku/waku/factory/validator_signed.nim(14, 30) Warning: imported and not used: 'messages' [UnusedImport]
/root/nwaku/waku/factory/node_factory.nim(111, 35) template/generic instantiation of `async` from here
/root/nwaku/waku/factory/node_factory.nim(312, 10) template/generic instantiation of `setResult` from here
/root/nwaku/waku/factory/node_factory.nim(234, 39) template/generic instantiation of `new` from here
/root/nwaku/waku/waku_archive/retention_policy/builder.nim(22, 44) Warning: use re2(static string) instead; re is deprecated [Deprecated]
/root/nwaku/waku/factory/node_factory.nim(111, 35) template/generic instantiation of `async` from here
/root/nwaku/waku/factory/node_factory.nim(312, 10) template/generic instantiation of `setResult` from here
/root/nwaku/waku/factory/node_factory.nim(234, 39) template/generic instantiation of `new` from here
/root/nwaku/waku/waku_archive/retention_policy/builder.nim(23, 20) Warning: use match(string, Regex2) instead; match is deprecated [Deprecated]
/root/nwaku/apps/wakunode2/app.nim(31, 42) Warning: imported and not used: 'waku_peer_storage' [UnusedImport]
/root/nwaku/apps/wakunode2/app.nim(23, 26) Warning: imported and not used: 'parse_size_units' [UnusedImport]
/root/nwaku/apps/wakunode2/app.nim(26, 43) Warning: imported and not used: 'builder' [UnusedImport]
/root/nwaku/apps/wakunode2/app.nim(49, 28) Warning: imported and not used: 'common' [UnusedImport]
/root/nwaku/apps/wakunode2/app.nim(22, 26) Warning: imported and not used: 'nat' [UnusedImport]
/root/nwaku/apps/wakunode2/app.nim(46, 13) Warning: imported and not used: 'waku_peer_exchange' [UnusedImport]
/root/nwaku/apps/wakunode2/app.nim(25, 33) Warning: imported and not used: 'builder' [UnusedImport]
/root/nwaku/apps/wakunode2/app.nim(24, 30) Warning: imported and not used: 'db_sqlite' [UnusedImport]
/root/nwaku/apps/wakunode2/wakunode2.nim(65, 29) template/generic instantiation of `load` from here
/root/nwaku/waku/factory/external_config.nim(764, 28) template/generic instantiation of `load` from here
/root/nwaku/waku/factory/external_config.nim(772, 18) template/generic instantiation of `addConfigFile` from here
/root/nwaku/vendor/nim-confutils/confutils.nim(874, 39) template/generic instantiation of `loadFile` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization.nim(156, 13) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-serialization/serialization.nim(31, 9) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(424, 8) template/generic instantiation of `decodeInlineTable` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(332, 25) template/generic instantiation of `parseInlineTableImpl` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(334, 21) template/generic instantiation of `fieldReadersTable` from here
/root/nwaku/vendor/nim-serialization/serialization/object_serialization.nim(260, 34) template/generic instantiation of `makeFieldReadersTable` from here



/root/nwaku/vendor/nim-serialization/serialization/object_serialization.nim(220, 26) template/generic instantiation of `enumAllSerializedFields` from here
/root/nwaku/vendor/nim-serialization/serialization/object_serialization.nim(154, 32) template/generic instantiation of `enumAllSerializedFieldsImpl` from here
/root/nwaku/vendor/nim-serialization/serialization/object_serialization.nim(238, 52) template/generic instantiation of `readFieldIMPL` from here
/root/nwaku/vendor/nim-serialization/serialization/object_serialization.nim(205, 13) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-serialization/serialization.nim(31, 9) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(374, 19) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-serialization/serialization.nim(31, 9) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(410, 6) template/generic instantiation of `parseList` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(412, 12) Warning: setLen can potentially expand the sequence, but the element type 'ProtectedTopic' doesn't have a valid default value [UnsafeSetLen]
/root/nwaku/apps/wakunode2/wakunode2.nim(65, 29) template/generic instantiation of `load` from here
/root/nwaku/waku/factory/external_config.nim(764, 28) template/generic instantiation of `load` from here
/root/nwaku/waku/factory/external_config.nim(772, 18) template/generic instantiation of `addConfigFile` from here
/root/nwaku/vendor/nim-confutils/confutils.nim(874, 39) template/generic instantiation of `loadFile` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization.nim(156, 13) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-serialization/serialization.nim(31, 9) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(426, 8) template/generic instantiation of `decodeRecord` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(240, 27) template/generic instantiation of `arrayReadersTable` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/private/array_reader.nim(39, 26) template/generic instantiation of `enumAllSerializedFields` from here
/root/nwaku/vendor/nim-serialization/serialization/object_serialization.nim(154, 32) template/generic instantiation of `enumAllSerializedFieldsImpl` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/private/array_reader.nim(53, 21) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(224, 14) template/generic instantiation of `readValue` from here
/root/nwaku/vendor/nim-toml-serialization/toml_serialization/reader.nim(217, 10) Warning: setLen can potentially expand the sequence, but the element type 'ProtectedTopic' doesn't have a valid default value [UnsafeSetLen]
/root/nwaku/apps/wakunode2/wakunode2.nim(65, 29) template/generic instantiation of `load` from here
/root/nwaku/waku/factory/external_config.nim(764, 28) template/generic instantiation of `load` from here
/root/nwaku/vendor/nim-confutils/confutils.nim(1201, 13) template/generic instantiation of `loadImpl` from here
/root/nwaku/vendor/nim-confutils/confutils.nim(932, 50) template/generic instantiation of `configurationRtti` from here
/root/nwaku/vendor/nim-confutils/confutils.nim(723, 19) template/generic instantiation of `setField` from here
/root/nwaku/waku/factory/external_config.nim(132, 27) template/generic instantiation of `newSeq` from here
/root/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system.nim(680, 10) Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]
In file included from /root/nwaku/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/scalar_impl.h:20,
                 from /root/nwaku/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/secp256k1.c:28:
/root/nwaku/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/scalar_4x64_impl.h: In function ‘secp256k1_scalar_reduce_512’:
/root/nwaku/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/scalar_4x64_impl.h:360:5: error: ‘asm’ operand has impossible constraints
  360 |     __asm__ __volatile__(
      |     ^~~~~~~
/root/nwaku/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/scalar_4x64_impl.h:466:5: error: ‘asm’ operand has impossible constraints
  466 |     __asm__ __volatile__(
      |     ^~~~~~~
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -pthread -I/root/nwaku/vendor/nim-libbacktrace -I/root/nwaku/vendor/nim-libbacktrace/install/usr/include -I/root/nwaku/vendor/nim-bearssl/bearssl/abi -I/root/nwaku/vendor/nim-bearssl/bearssl/abi/../csources/src/ -I/root/nwaku/vendor/nim-bearssl/bearssl/abi/../csources/inc/ -I/root/nwaku/vendor/nim-bearssl/bearssl/abi/../csources/tools/ -DBR_USE_UNIX_TIME=1 -DBR_USE_URANDOM=1 -DBR_LE_UNALIGNED=1 -DBR_64=1  -DBR_amd64=1 -DBR_INT128=1 -I/root/nwaku/vendor/nim-zlib/zlib/csources -DHAVE_UNISTD_H -I/root/nwaku/vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/include -I/root/nwaku/vendor/nim-nat-traversal/vendor/libnatpmp-upstream -DENABLE_STRNATPMPERR -march=native -g3 -Og -O3 -fno-strict-aliasing -fno-ident  -DENABLE_MODULE_ECDH=1 -DENABLE_MODULE_RECOVERY=1 -DENABLE_MODULE_SCHNORRSIG=1 -DENABLE_MODULE_EXTRAKEYS=1 -I/root/nwaku/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1 -I/root/nwaku/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src -DUSE_ASM_X86_64  -I/root/nwaku/vendor/nimbus-build-system/vendor/Nim/lib -I/root/nwaku/apps/wakunode2 -o nimcache/release/wakunode2/@m..@s..@svendor@snim-secp256k1@svendor@ssecp256k1@ssrc@ssecp256k1.c.o /root/nwaku/vendor/nim-secp256k1/secp256k1/../vendor/secp256k1/src/secp256k1.c' failed with exit code: 1


stack trace: (most recent call last)
/root/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(429, 18)
/root/nwaku/waku.nimble(63, 15) wakunode2Task
/root/nwaku/waku.nimble(35, 8) buildBinary
/root/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(273, 7) exec
/root/nwaku/vendor/nimbus-build-system/vendor/Nim/lib/system/nimscript.nim(273, 7) Error: unhandled exception: FAILED: nim c --out:build/wakunode2  --verbosity:0 --hints:off -d:chronicles_log_level=TRACE -d:git_version="v0.25.0-rc.0-87-g2aa835" -d:release --passL:librln_v0.3.6.a --passL:-lm apps/wakunode2/wakunode2.nim [OSError]
make: *** [Makefile:190: wakunode2] Error 1
[root:~/nwaku]# cat /etc/issue                                                                             (master)
Ubuntu 22.04.4 LTS \n \l

[root:~/nwaku]# git show HEAD                                                                              (master)
[root:~/nwaku]# gcc --version                                                                              (master)
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

nwaku version/commit hash

State the version of nwaku where you've encountered the bug or, if built off a specific commit, the relevant commit hash. You can check the version by running ./wakunode2 --version.

  • e.g. v0.9 or ed53bcd

2aa835e3bfd54eba7311cff0afad60553c4bf121

Additional context

Add any other context about the problem here.

@bufrr bufrr added the bug Something isn't working label Mar 28, 2024
@SionoiS
Copy link
Contributor

SionoiS commented Mar 28, 2024

Same thing happen to me when trying to compile on my laptop. Did not investigate yet.

@Ivansete-status
Copy link
Collaborator

That error doesn't happen to me:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy
$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

I guess it may be an architecture issue.
@SionoiS , @bufrr - may share more details about the machine where you have this issue?
Thanks!

In my case:

$ cmake --version
cmake version 3.22.1
$ uname -m
x86_64
$ gcc -march=native -Q --help=target|grep march
  -march=                     		alderlake

Another thing to try is to remove the following line:
https://github.com/bitcoin-core/secp256k1/blob/1ad5185cd42c0636104129fcc9f6a4bf9c67cc40/CMakeLists.txt#L127
from the following file, within nwaku code: vendor/nim-secp256k1/vendor/secp256k1/CMakeLists.txt

@SionoiS
Copy link
Contributor

SionoiS commented Apr 10, 2024

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.4 LTS
Release:	22.04
Codename:	jammy

Same

$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

Same

$ cmake --version
cmake version 3.22.1

Same

$ uname -m
x86_64

Same

$ gcc -march=native -Q --help=target|grep march
  -march=                     		alderlake

I'm on a recent AMD

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         48 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  16
  On-line CPU(s) list:   0-15
Vendor ID:               AuthenticAMD
  Model name:            AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
    CPU family:          25
    Model:               116
    Thread(s) per core:  2
    Core(s) per socket:  8
    Socket(s):           1
    Stepping:            1
    CPU max MHz:         6076.0000
    CPU min MHz:         400.0000
    BogoMIPS:            6587.63
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mc
                         a cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall n
                         x mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_go
                         od amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfm
                         perf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 s
                         se4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lah
                         f_lm cmp_legacy svm extapic cr8_legacy abm sse4a misali
                         gnsse 3dnowprefetch osvw ibs skinit wdt tce topoext per
                         fctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l
                         3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp 
                         ibrs_enhanced vmmcall fsgsbase bmi1 avx2 smep bmi2 erms
                          invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx
                         512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512
                         vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc
                          cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf 
                         xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock n
                         rip_save tsc_scale vmcb_clean flushbyasid decodeassists
                          pausefilter pfthreshold v_vmsave_vmload vgif x2avic v_
                         spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 g
                         fni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vp
                         opcntdq rdpid overflow_recov succor smca fsrm flush_l1d
Virtualization features: 
  Virtualization:        AMD-V
Caches (sum of all):     
  L1d:                   256 KiB (8 instances)
  L1i:                   256 KiB (8 instances)
  L2:                    8 MiB (8 instances)
  L3:                    16 MiB (1 instance)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-15
Vulnerabilities:         
  Gather data sampling:  Not affected
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec rstack overflow:  Mitigation; Safe RET
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer
                          sanitization
  Spectre v2:            Mitigation; Enhanced / Automatic IBRS, IBPB conditional
                         , STIBP always-on, RSB filling, PBRSB-eIBRS Not affecte
                         d
  Srbds:                 Not affected
  Tsx async abort:       Not affected

@NagyZoltanPeter
Copy link
Contributor

CC: @arnetheduck
Yeah, we found that inlined asm is only for AMD platforms but seems having issue with the latest CPUs of AMD.
https://github.com/status-im/nim-secp256k1/blob/2bc945cc9ebfae1b688f72ea59f78fd23873d1d4/secp256k1/abi.nim#L11

Quick workaround, not to use the USE_ASM_X86_64 flag and let just depend on C code.

@NagyZoltanPeter NagyZoltanPeter changed the title bug: build error on ubuntu 22.04 LTS bug: build error on new AMD cpu's (ubuntu 22.04 LTS) Apr 10, 2024
@NagyZoltanPeter
Copy link
Contributor

Will propose workaround for our dependent library: nim-secp256k1

@NagyZoltanPeter
Copy link
Contributor

Follow up issue on vendor lib:
status-im/nim-secp256k1#56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Priority
Development

No branches or pull requests

4 participants