Following README.md (Section - 1)exactly on a clean Ubuntu 24.04.1 machine, neither make sim nor
make build-isa-tests completes. Two separate gaps in the dependency list, both reproducible.
Environment: Ubuntu 24.04.1, gcc/g++ 13.3.0, Verilator 5.020, core_tile at 2528e7d (v3.1.0),
submodules initialised recursively.
1. libboost-system-dev is required but not listed make sim cannot complete
README.md:25 lists Boost as only libboost-regex-dev >= 1.53. make sim depends on libdisasm
(simulator/verilator/verilator.mk:36), which configures Spike (simulator/reference/spike.mk:5-7),
and that configure step aborts:
checking for boostlib >= 1.53 (105300)... yes
checking whether the Boost::ASIO library is available... yes
configure: error: Could not find a version of the Boost::Asio library!
make: *** [simulator/reference/spike.mk:7: simulator/reference/build/Makefile] Error 1
The two adjacent lines contradict each other, which sends people looking for an Asio problem. The
actual cause is libboost_system:
simulator/reference/riscv-isa-sim/ax_boost_base.m4:154-163 - with no --with-boost, the macro
scans /usr /usr/local /opt /opt/local and sets BOOST_LDFLAGS=-L/usr/lib/x86_64-linux-gnu on
Ubuntu.
ax_boost_asio.m4:65-68 is the check that prints yes. It is an AC_COMPILE_IFELSE on
#include <boost/asio.hpp> - compile only, no link - so it succeeds with no library present,
because Asio is header-only.
- Inside that branch,
ax_boost_asio.m4:84 sets BN=boost_system, and :87 globs
$BOOSTLIBDIR/libboost_system*.so*.
- With no
libboost_system present the glob is empty, $ax_lib stays unset, and :99-100 raises
the error above.
libboost-regex-dev does not pull in libboost-system. On Ubuntu 24.04 the README's exact list
resolves to a closure with no libboost-system in it:
$ apt-get install --no-install-recommends -s gcc gcc-riscv64-unknown-elf \
device-tree-compiler libboost-regex-dev verilator | grep '^Inst ' | grep -i boost
libboost-iostreams1.83.0
libboost-thread1.83.0
libboost-locale1.83.0
libboost1.83-dev
libboost-regex1.83.0
libboost-regex1.83-dev
libboost-regex-dev
Adding libboost-system-dev makes make sim succeed (verified: ./sim, 27 MB, and the ISA suite
runs clean - 169 passed / 0 failed via tb/tb_isa_tests/run-tests.py).
This is related to #12 but not the same failure. That report got as far as
checking for main in -lboost_system... yes and then died at
configure: error: Could not link against boost_system ! - ax_boost_asio.m4:102-103, a link
failure on a machine where the library was present. The failure above is the earlier
:99-100 branch, reached when the library is absent, which is what following README.md:25
produces. #12 was answered with libboost-all-dev in the thread, which is the same fix; recording it
in the README as well would mean the next person does not have to find the thread.
Two smaller items in the same path:
python3 and perl are also required but unlisted. simulator/bootrom/bin2hex.py builds
bootrom.hex, tb/tb_isa_tests/run-tests.py runs the suite, and Verilator's driver is a Perl
script.
simulator/reference/spike.mk:7 invokes ../riscv-isa-sim/configure with no arguments and no
variable hook, so a Boost outside the default prefixes cannot be accommodated without editing the
makefile. A SPIKE_CONFIGURE_ARGS ?= appended to that line would cover it.
2. The riscv64-unknown-elf-gcc requirement is understated - make build-isa-tests fails
README.md:23 asks for riscv64-unknown-elf-gcc >= 12.0. Ubuntu's gcc-riscv64-unknown-elf
package is 13.2.0, so it satisfies that literally, but it ships no C library, and
make build-isa-tests stops at:
riscv-tests/isa/../env/v/string.c:1:10: fatal error: string.h: No such file or directory
The default target include path contains only the two GCC-internal directories - no libc anywhere:
$ riscv64-unknown-elf-gcc -march=rv64g -mabi=lp64d -E -Wp,-v -x c /dev/null
#include <...> search starts here:
.../lib/gcc/riscv64-unknown-elf/13.2.0/include
.../lib/gcc/riscv64-unknown-elf/13.2.0/include-fixed
End of search list.
Installing picolibc-riscv64-unknown-elf does not resolve it either: its headers land in
/usr/lib/picolibc/riscv64-unknown-elf/include, which is not on that path, and there is no spec
file for the target (fatal error: cannot read spec file 'picolibc.specs').
Scope is limited: only the -v- (virtual-memory) tests and the benchmarks need a libc. All 185
rv64 -p- tests build and run with -nostdlib -nostartfiles, which is enough to exercise the core.
Building them directly against riscv-tests/isa/Makefile works:
make -k -j8 -f $ISA_SRC/Makefile src_dir=$ISA_SRC XLEN=64 \
RISCV_GCC_OPTS="-static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles" \
<rv64*-p-* targets>
→ 185 binaries. run-tests.py then attempts 170 of them (its glob is limited to
IMPLEMENTED_EXTENSIONS, so rv64uzfh, rv64uzbc and rv64uc are built but never selected) and
reports 169 passed / 0 failed.
Suggested fix
In README.md Section-1:
Optionally, a make target that builds just the rv64 -p- tests would give newcomers a working
suite from distribution packages alone.
Following
README.md(Section - 1)exactly on a clean Ubuntu 24.04.1 machine, neithermake simnormake build-isa-testscompletes. Two separate gaps in the dependency list, both reproducible.Environment: Ubuntu 24.04.1, gcc/g++ 13.3.0, Verilator 5.020,
core_tileat2528e7d(v3.1.0),submodules initialised recursively.
1.
libboost-system-devis required but not listedmake simcannot completeREADME.md:25lists Boost as onlylibboost-regex-dev >= 1.53.make simdepends onlibdisasm(
simulator/verilator/verilator.mk:36), which configures Spike (simulator/reference/spike.mk:5-7),and that configure step aborts:
The two adjacent lines contradict each other, which sends people looking for an Asio problem. The
actual cause is
libboost_system:simulator/reference/riscv-isa-sim/ax_boost_base.m4:154-163- with no--with-boost, the macroscans
/usr /usr/local /opt /opt/localand setsBOOST_LDFLAGS=-L/usr/lib/x86_64-linux-gnuonUbuntu.
ax_boost_asio.m4:65-68is the check that printsyes. It is anAC_COMPILE_IFELSEon#include <boost/asio.hpp>- compile only, no link - so it succeeds with no library present,because Asio is header-only.
ax_boost_asio.m4:84setsBN=boost_system, and:87globs$BOOSTLIBDIR/libboost_system*.so*.libboost_systempresent the glob is empty,$ax_libstays unset, and:99-100raisesthe error above.
libboost-regex-devdoes not pull inlibboost-system. On Ubuntu 24.04 the README's exact listresolves to a closure with no
libboost-systemin it:Adding
libboost-system-devmakesmake simsucceed (verified:./sim, 27 MB, and the ISA suiteruns clean - 169 passed / 0 failed via
tb/tb_isa_tests/run-tests.py).This is related to #12 but not the same failure. That report got as far as
checking for main in -lboost_system... yesand then died atconfigure: error: Could not link against boost_system !-ax_boost_asio.m4:102-103, a linkfailure on a machine where the library was present. The failure above is the earlier
:99-100branch, reached when the library is absent, which is what followingREADME.md:25produces. #12 was answered with
libboost-all-devin the thread, which is the same fix; recording itin the README as well would mean the next person does not have to find the thread.
Two smaller items in the same path:
python3andperlare also required but unlisted.simulator/bootrom/bin2hex.pybuildsbootrom.hex,tb/tb_isa_tests/run-tests.pyruns the suite, and Verilator's driver is a Perlscript.
simulator/reference/spike.mk:7invokes../riscv-isa-sim/configurewith no arguments and novariable hook, so a Boost outside the default prefixes cannot be accommodated without editing the
makefile. A
SPIKE_CONFIGURE_ARGS ?=appended to that line would cover it.2. The
riscv64-unknown-elf-gccrequirement is understated -make build-isa-testsfailsREADME.md:23asks forriscv64-unknown-elf-gcc >= 12.0. Ubuntu'sgcc-riscv64-unknown-elfpackage is 13.2.0, so it satisfies that literally, but it ships no C library, and
make build-isa-testsstops at:The default target include path contains only the two GCC-internal directories - no libc anywhere:
Installing
picolibc-riscv64-unknown-elfdoes not resolve it either: its headers land in/usr/lib/picolibc/riscv64-unknown-elf/include, which is not on that path, and there is no specfile for the target (
fatal error: cannot read spec file 'picolibc.specs').Scope is limited: only the
-v-(virtual-memory) tests and the benchmarks need a libc. All 185rv64
-p-tests build and run with-nostdlib -nostartfiles, which is enough to exercise the core.Building them directly against
riscv-tests/isa/Makefileworks:→ 185 binaries.
run-tests.pythen attempts 170 of them (its glob is limited toIMPLEMENTED_EXTENSIONS, sorv64uzfh,rv64uzbcandrv64ucare built but never selected) andreports 169 passed / 0 failed.
Suggested fix
In
README.mdSection-1:libboost-system-devto the list at line 25 (or replace the entry withlibboost-all-dev,which is what
+vcdwrites an FST file nameddump_file.vcd, ignores the documented=pathargument, and the documented default filename does not match the code #12 was told to install);python3andperl;(
riscv-gnu-toolchain, xPack or a SiFive prebuilt), and note that a distributiongcc-riscv64-unknown-elfcovers the-p-tests only.Optionally, a make target that builds just the rv64
-p-tests would give newcomers a workingsuite from distribution packages alone.