ucb-bar / chipyard

An Agile RISC-V SoC Design Framework with in-order cores, out-of-order cores, accelerators, and more
https://chipyard.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
1.59k stars 632 forks source link

No rule to make target '/home/oyvind/chipyard/.conda-env/x86_64-conda-linux-gnu/include/c++/12.3.0/iostream' #1599

Closed oharboe closed 1 year ago

oharboe commented 1 year ago

Background Work

Chipyard Version and Hash

commit b7644b2455cc4bae190e811a5d8085f3aad85b87 (HEAD, tag: 1.10.0, origin/stable)

OS Setup

Ex: Output of uname -a + lsb_release -a + printenv + conda list

Linux famine 6.2.0-32-generic #32-Ubuntu SMP PREEMPT_DYNAMIC Mon Aug 14 10:03:50 UTC 2023 x86_64 GNU/Linux

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 23.04 Release: 23.04 Codename: lunar

CONDA_PREFIX=/home/oyvind/miniforge3 CONDA_PYTHON_EXE=/home/oyvind/miniforge3/bin/python PATH=/home/oyvind/chipyard/.conda-env/bin:/home/oyvind/miniforge3/bin

packages in environment at /home/oyvind/miniforge3:

#

Name Version Build Channel

_libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_gnu conda-forge annotated-types 0.5.0 pyhd8ed1ab_0 conda-forge appdirs 1.4.4 pyh9f0ad1d_0 conda-forge boltons 23.0.0 pyhd8ed1ab_0 conda-forge brotli-python 1.1.0 py310hc6cd4ac_0 conda-forge brotlipy 0.7.0 py310h5764c6d_1005 conda-forge bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.19.1 hd590300_0 conda-forge ca-certificates 2023.7.22 hbcca054_0 conda-forge cachecontrol 0.13.1 pyhd8ed1ab_0 conda-forge cachecontrol-with-filecache 0.13.1 pyhd8ed1ab_0 conda-forge cachy 0.3.0 pyhd8ed1ab_1 conda-forge certifi 2023.7.22 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py310h255011f_3 conda-forge charset-normalizer 3.2.0 pyhd8ed1ab_0 conda-forge click 8.1.7 unix_pyh707e725_0 conda-forge click-default-group 1.2.4 pyhd8ed1ab_0 conda-forge clikit 0.6.2 pyhd8ed1ab_2 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge conda 23.3.1 py310hff52083_0 conda-forge conda-libmamba-solver 23.3.0 pyhd8ed1ab_0 conda-forge conda-lock 1.4.0 pyhd8ed1ab_2 conda-forge conda-package-handling 2.2.0 pyh38be061_0 conda-forge conda-package-streaming 0.9.0 pyhd8ed1ab_0 conda-forge crashtest 0.4.1 pyhd8ed1ab_0 conda-forge cryptography 41.0.3 py310h75e40e8_0 conda-forge dbus 1.13.6 h5008d03_3 conda-forge distlib 0.3.7 pyhd8ed1ab_0 conda-forge ensureconda 1.4.3 pyhd8ed1ab_0 conda-forge expat 2.5.0 hcb278e6_1 conda-forge filelock 3.12.3 pyhd8ed1ab_0 conda-forge fmt 9.1.0 h924138e_0 conda-forge gettext 0.21.1 h27087fc_0 conda-forge html5lib 1.1 pyh9f0ad1d_0 conda-forge icu 73.2 h59595ed_0 conda-forge idna 3.4 pyhd8ed1ab_0 conda-forge importlib-metadata 6.8.0 pyha770c72_0 conda-forge importlib_metadata 6.8.0 hd8ed1ab_0 conda-forge jaraco.classes 3.3.0 pyhd8ed1ab_0 conda-forge jeepney 0.8.0 pyhd8ed1ab_0 conda-forge jinja2 3.1.2 pyhd8ed1ab_1 conda-forge jsonpatch 1.32 pyhd8ed1ab_0 conda-forge jsonpointer 2.0 py_0 conda-forge keyring 24.2.0 py310hff52083_0 conda-forge keyutils 1.6.1 h166bdaf_0 conda-forge krb5 1.21.2 h659d440_0 conda-forge ld_impl_linux-64 2.40 h41732ed_0 conda-forge libarchive 3.6.2 h039dbb9_1 conda-forge libcurl 8.2.1 hca28451_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libexpat 2.5.0 hcb278e6_1 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libgcc-ng 13.1.0 he5830b7_0 conda-forge libglib 2.78.0 hebfc3b9_0 conda-forge libgomp 13.1.0 he5830b7_0 conda-forge libiconv 1.17 h166bdaf_0 conda-forge libmamba 1.4.2 hcea66bb_0 conda-forge libmambapy 1.4.2 py310h1428755_0 conda-forge libnghttp2 1.52.0 h61bc06f_0 conda-forge libnsl 2.0.0 h7f98852_0 conda-forge libsolv 0.7.24 hfc55251_3 conda-forge libsqlite 3.43.0 h2797004_0 conda-forge libssh2 1.11.0 h0841786_0 conda-forge libstdcxx-ng 13.1.0 hfd8a6a1_0 conda-forge libuuid 2.38.1 h0b41bf4_0 conda-forge libxml2 2.11.5 h232c23b_1 conda-forge libzlib 1.2.13 hd590300_5 conda-forge lz4-c 1.9.4 hcb278e6_0 conda-forge lzo 2.10 h516909a_1000 conda-forge mamba 1.4.2 py310h51d5547_0 conda-forge markupsafe 2.1.3 py310h2372a71_0 conda-forge more-itertools 10.1.0 pyhd8ed1ab_0 conda-forge msgpack-python 1.0.5 py310hdf3cbec_0 conda-forge ncurses 6.4 hcb278e6_0 conda-forge openssl 3.1.2 hd590300_0 conda-forge packaging 23.1 pyhd8ed1ab_0 conda-forge pastel 0.2.1 pyhd8ed1ab_0 conda-forge pcre2 10.40 hc3806b6_0 conda-forge pip 23.2.1 pyhd8ed1ab_0 conda-forge pkginfo 1.9.6 pyhd8ed1ab_0 conda-forge platformdirs 3.10.0 pyhd8ed1ab_0 conda-forge pluggy 1.3.0 pyhd8ed1ab_0 conda-forge pybind11-abi 4 hd8ed1ab_3 conda-forge pycosat 0.6.4 py310h5764c6d_1 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pydantic 2.3.0 pyhd8ed1ab_0 conda-forge pydantic-core 2.6.3 py310hcb5633a_0 conda-forge pylev 1.4.0 pyhd8ed1ab_0 conda-forge pyopenssl 23.2.0 pyhd8ed1ab_1 conda-forge pysocks 1.7.1 pyha2e5f31_6 conda-forge python 3.10.12 hd12c33a_0_cpython conda-forge python_abi 3.10 3_cp310 conda-forge pyyaml 6.0.1 py310h2372a71_0 conda-forge readline 8.2 h8228510_1 conda-forge reproc 14.2.4 h0b41bf4_0 conda-forge reproc-cpp 14.2.4 hcb278e6_0 conda-forge requests 2.31.0 pyhd8ed1ab_0 conda-forge ruamel.yaml 0.17.32 py310h2372a71_0 conda-forge ruamel.yaml.clib 0.2.7 py310h1fa729e_1 conda-forge secretstorage 3.3.3 py310hff52083_1 conda-forge setuptools 68.1.2 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge tk 8.6.12 h27826a3_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge tomlkit 0.12.1 pyha770c72_0 conda-forge toolz 0.12.0 pyhd8ed1ab_0 conda-forge tqdm 4.66.1 pyhd8ed1ab_0 conda-forge typing-extensions 4.7.1 hd8ed1ab_0 conda-forge typing_extensions 4.7.1 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge urllib3 1.26.15 pyhd8ed1ab_0 conda-forge virtualenv 20.24.4 pyhd8ed1ab_0 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.41.2 pyhd8ed1ab_0 conda-forge xz 5.2.6 h166bdaf_0 conda-forge yaml 0.2.5 h7f98852_2 conda-forge yaml-cpp 0.7.0 h27087fc_2 conda-forge zipp 3.16.2 pyhd8ed1ab_0 conda-forge zstandard 0.19.0 py310h5764c6d_0 conda-forge zstd 1.5.5 hfc55251_0 conda-forge

Other Setup

Ex: Prior steps taken / Documentation Followed / etc...

Setup: https://chipyard.readthedocs.io/en/stable/Chipyard-Basics/Initial-Repo-Setup.html#prerequisites

Current Behavior

(base) oyvind@famine:~/chipyard$ ./build-setup.sh riscv-tools
[deleted]
==> Installing gemmini spike extensions
make: Entering directory '/home/oyvind/chipyard/generators/gemmini/software/libgemmini'
Running with RISCV=/home/oyvind/chipyard/.conda-env/riscv-tools
cp libgemmini.so /home/oyvind/chipyard/.conda-env/riscv-tools/lib
make: Leaving directory '/home/oyvind/chipyard/generators/gemmini/software/libgemmini'
==>  Installing DRAMSim2 Shared Library
make: *** No rule to make target '/home/oyvind/chipyard/.conda-env/x86_64-conda-linux-gnu/include/c++/12.3.0/iostream', needed by 'AddressMapping.po'.  Stop.

Expected Behavior

Successful build

Other Information

Looks like the build is confused between the conda gcc version and the Ubuntu 23.04 12.3.0 gcc version?

$ which -a gcc
/home/oyvind/chipyard/.conda-env/bin/gcc
/usr/bin/gcc
/bin/gcc
(base) oyvind@famine:~/chipyard$ gcc --version
gcc (conda-forge gcc 12.2.0-19) 12.2.0
Copyright (C) 2022 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.

(base) oyvind@famine:~/chipyard$ /usr/bin/gcc --version
gcc (Ubuntu 12.3.0-1ubuntu1~23.04) 12.3.0
Copyright (C) 2022 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.

Skipping some stages I don't need right now, the build completes:

./build-setup.sh riscv-tools -s 3 -s 6 -s 8 -s 9 -s 10
[deleted]
[warn] 19 warnings found
[info] done compiling
[success] Total time: 8 s, completed Sep 14, 2023, 1:27:17 PM
~/chipyard
Setup complete!
oharboe commented 1 year ago

I tried again today with 174ebc50b701a03226fd71c32d185727078cceb3 and ./build-setup.sh riscv-tools and it gets further:

[deleted]
.  /home/oyvind/chipyard/software/firemarshal/images/firechip/br-base/br-base.img
TaskError - taskid:/home/oyvind/chipyard/software/firemarshal/images/firechip/br-base/br-base.img
PythonAction Error
Traceback (most recent call last):
  File "/home/oyvind/chipyard/.conda-env/lib/python3.10/site-packages/doit/action.py", line 461, in execute
    returned_value = self.py_callable(*self.args, **kwargs)
  File "/home/oyvind/chipyard/software/firemarshal/wlutil/build.py", line 602, in makeImage
    wlutil.applyOverlay(config['img'], config['overlay'])
  File "/home/oyvind/chipyard/software/firemarshal/wlutil/wlutil.py", line 671, in applyOverlay
    copyImgFiles(img, flist, 'in')
  File "/home/oyvind/chipyard/software/firemarshal/wlutil/wlutil.py", line 652, in copyImgFiles
    with mountImg(img, getOpt('mnt-dir')):
  File "/home/oyvind/chipyard/.conda-env/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/home/oyvind/chipyard/software/firemarshal/wlutil/wlutil.py", line 589, in mountImg
    run(['guestmount', '--pid-file', 'guestmount.pid', '-a', imgPath, '-m', '/dev/sda', mntPath])
  File "/home/oyvind/chipyard/software/firemarshal/wlutil/wlutil.py", line 527, in run
    raise sp.CalledProcessError(p.returncode, prettyCmd)
subprocess.CalledProcessError: Command 'guestmount --pid-file guestmount.pid -a /home/oyvind/chipyard/software/firemarshal/images/firechip/br-base/br-base.img -m /dev/sda /home/oyvind/chipyard/software/firemarshal/disk-mount' returned non-zero exit status 1.

ERROR: Failed to build workload br-base.json
Log available at: /home/oyvind/chipyard/software/firemarshal/logs/br-base-build-2023-09-15--09-01-03-US1EB6EJYYKNC1P6.log
ERROR: FAILURE: 1 builds failed
[deleted]

Examining a bit more:

$ LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 guestmount --pid-file guestmount.pid -a 
[deleted]
supermin: kernel: modpath /lib/modules/6.2.0-32-generic
cp: cannot open '/boot/vmlinuz-6.2.0-32-generic' for reading: Permission denied
supermin: cp -p '/boot/vmlinuz-6.2.0-32-generic' '/var/tmp/.guestfs-1000/appliance.d.cfaew6vl/kernel': command failed, see earlier errors
libguestfs: error: /usr/bin/supermin exited with error status 1, see debug messages above
libguestfs: trace: launch = -1 (error)
libguestfs: trace: close
libguestfs: closing guestfs handle 0x55df619cc7c0 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfszpM6tM
oharboe commented 1 year ago

Trying sudo chmod +r /boot/vmlinuz-6.2.0-32-generic...

Worked!

[deleted]
Cleared directory 'cva6'
Submodule 'src/main/resources/vsrc/cva6' (https://github.com/openhwgroup/cva6.git) unregistered for path 'cva6'
~/chipyard
Setup complete!
oharboe commented 1 year ago

I'm not entirely sure what I did wrong or if this is a problem that's fixed on latest main...