enable -march=native by default

plus some drive-by fixes and cosmetic changes
This commit is contained in:
Ștefan Talpalaru 2020-02-13 20:18:27 +01:00
parent e9e33d3a56
commit 8568ec35ea
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
6 changed files with 53 additions and 15 deletions

View File

@ -14,15 +14,41 @@ BUILD_SYSTEM_DIR := vendor/nimbus-build-system
-include $(BUILD_SYSTEM_DIR)/makefiles/variables.mk
# debugging tools + testing tools
TOOLS := premix persist debug dumper hunter regress tracerTestGen persistBlockTestGen
TOOLS_DIRS := premix tests waku
TOOLS := \
premix \
persist \
debug \
dumper \
hunter \
regress \
tracerTestGen \
persistBlockTestGen
TOOLS_DIRS := \
premix \
tests \
waku
# comma-separated values for the "clean" target
TOOLS_CSV := $(subst $(SPACE),$(COMMA),$(TOOLS))
# "--import" can't be added to config.nims, for some reason
# "--define:release" implies "--stacktrace:off" and it cannot be added to config.nims either
NIM_PARAMS := $(NIM_PARAMS) -d:release --import:libbacktrace
.PHONY: all $(TOOLS) build-system-checks deps update nimbus test test-reproducibility clean libnimbus.so libnimbus.a wrappers wrappers-static libbacktrace
.PHONY: \
all \
$(TOOLS) \
build-system-checks \
deps \
update \
nimbus \
test \
test-reproducibility \
clean \
libnimbus.so \
libnimbus.a \
wrappers \
wrappers-static \
libbacktrace
# default target, because it's the first one that doesn't start with '.'
all: build-system-checks $(TOOLS) nimbus

View File

@ -14,6 +14,16 @@ if defined(windows):
# set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag so we can use PAE, if enabled, and access more than 2 GiB of RAM
switch("passL", "-Wl,--large-address-aware")
# remember to disable -march=native for reproducible builds
if defined(disableMarchNative):
switch("passC", "-msse3")
else:
switch("passC", "-march=native")
if defined(windows):
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65782
# ("-fno-asynchronous-unwind-tables" breaks Nim's exception raising, sometimes)
switch("passC", "-mno-avx512vl")
--threads:on
--opt:speed
--excessiveStackTrace:on

View File

@ -10,14 +10,15 @@ skipDirs = @["tests", "examples"]
# bin = @["build/nimbus"]
requires "nim >= 0.19",
"chronicles",
"nimcrypto",
"stint",
"json_rpc",
"chronos",
"bncurve",
"eth",
"stew"
"bncurve",
"chronicles",
"chronos",
"eth",
"json_rpc",
"libbacktrace",
"nimcrypto",
"stew",
"stint"
proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
if not dirExists "build":
@ -26,7 +27,7 @@ proc buildBinary(name: string, srcDir = "./", params = "", lang = "c") =
var extra_params = params
for i in 2..<paramCount():
extra_params &= " " & paramStr(i)
exec "nim " & lang & " --out:build/" & name & " " & extra_params & " " & srcDir & name & ".nim"
exec "nim " & lang & " --out:build/" & name & " -d:release --import:libbacktrace " & extra_params & " " & srcDir & name & ".nim"
proc test(name: string, lang = "c") =
buildBinary name, "tests/", "-d:chronicles_log_level=ERROR"
@ -46,3 +47,4 @@ task wakunode, "Build Waku node":
task wakusim, "Build Waku simulation tools":
buildBinary "quicksim", "waku/", "-d:chronicles_log_level=INFO"
buildBinary "start_network", "waku/", "-d:chronicles_log_level=DEBUG"

2
vendor/nim-json-rpc vendored

@ -1 +1 @@
Subproject commit 9b401994a16640892e3e643c52fa4ff00f4b9b3e
Subproject commit 09f6fd63556a22312af7c5a7e3fa105b26897316

@ -1 +1 @@
Subproject commit 3653b9c4675c80f7f9cb351003446fd8364a2058
Subproject commit 61f29dcfb4ec395bf1c0752e3ee61653c5b3aad3

@ -1 +1 @@
Subproject commit 2a70c4f152ee849db1ededa92c1d80f7102dd718
Subproject commit 2c4faa5372d2d8b0c2d16710fe5f93beab1c86af