Closed parsevalbtc closed 1 month ago
I suspect the options are not enabled on the node (or database or network) project. In this case they would be compiled into system and therefore fully utilized unless functions that use them are compiled from templates directly into the node compilation unit. The symbols in the command line tool are read from a system header, which will produce a different result in node if the applicable WITH_...
symbol is not defined there. This is the case in the MSVC builds, but may not be in the others. So again, in this case you are likely getting the behavior, just not the recognition in the command line tool.
It is designed this way because a good amount of the code relies on templates which use these symbols. The templates will not have the optimization if the symbols are not defined within the compilation unit, so the command line tool catches that possibility. However it may be the case that some or all functions in use are compiled into the system object lib due to the fact that they are wrapped with helper functions and those are typically what is used. But again, not assured.
@pmienk - can you make sure that these options are picked up in each of the libs, so that there is no chance that the optimizations will be missed downstream?
Thanks @pmienk. Will be trying your modifications from the merge.
Ran the following for compiling libbitcoin node on a Linux System:
CFLAGS="-O3" CXXFLAGS="-O3" ./install.sh --prefix=/home/user --build-boost --enable-ndebug --disable-shared --enable-avx2 --enable-sse4
Commits of the repositories involved are as follows:
Compilation went smoothly till the end without particular warnings. Avx2 and sse4 optimizations have been detected in the compilation stream as well:
However checking the software with
./bn --hardware
command the two optimizations seems to not have been compiled:Any idea?