Skip to content

README - dependency list is incomplete: make sim and make build-isa-tests both fail on a clean Ubuntu 24.04 following it exactly #13

Description

@badnikhil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions