Merge pull request #1140 from ucb-bar/use_conda
Enable firesim to use conda
This commit is contained in:
2
.github/workflows/chipyard-run-tests.yml
vendored
2
.github/workflows/chipyard-run-tests.yml
vendored
@@ -7,7 +7,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
tools-cache-version: v13
|
tools-cache-version: v14
|
||||||
BUILDSERVER: ${{ secrets.BUILDSERVER }}
|
BUILDSERVER: ${{ secrets.BUILDSERVER }}
|
||||||
BUILDUSER: ${{ secrets.BUILDUSER }}
|
BUILDUSER: ${{ secrets.BUILDUSER }}
|
||||||
SERVER: ${{ secrets.BUILDUSER }}@${{ secrets.BUILDSERVER }}
|
SERVER: ${{ secrets.BUILDUSER }}@${{ secrets.BUILDSERVER }}
|
||||||
|
|||||||
@@ -154,7 +154,9 @@ else
|
|||||||
module_make riscv-gnu-toolchain linux
|
module_make riscv-gnu-toolchain linux
|
||||||
fi
|
fi
|
||||||
|
|
||||||
module_all riscv-isa-sim --prefix="${RISCV}"
|
# disable boost explicitly for https://github.com/riscv-software-src/riscv-isa-sim/issues/834
|
||||||
|
# since we don't have it in our requirements
|
||||||
|
module_all riscv-isa-sim --prefix="${RISCV}" --with-boost=no
|
||||||
# build static libfesvr library for linking into firesim driver (or others)
|
# build static libfesvr library for linking into firesim driver (or others)
|
||||||
echo '==> Installing libfesvr static library'
|
echo '==> Installing libfesvr static library'
|
||||||
module_make riscv-isa-sim libfesvr.a
|
module_make riscv-isa-sim libfesvr.a
|
||||||
@@ -186,8 +188,24 @@ if [ -z "$IGNOREQEMU" ] ; then
|
|||||||
git -C "$dir" submodule foreach --quiet --recursive '! grep -q "git\.qemu\.org" .gitmodules 2>/dev/null' && \
|
git -C "$dir" submodule foreach --quiet --recursive '! grep -q "git\.qemu\.org" .gitmodules 2>/dev/null' && \
|
||||||
echo "==> PLEASE REMOVE qemu URL-REWRITING from scripts/build-toolchains.sh. It is no longer needed!" && exit 1
|
echo "==> PLEASE REMOVE qemu URL-REWRITING from scripts/build-toolchains.sh. It is no longer needed!" && exit 1
|
||||||
|
|
||||||
|
(
|
||||||
|
# newer version of BFD-based ld has made '-no-pie' an error because it renamed to '--no-pie'
|
||||||
|
# meanwhile, ld.gold will still accept '-no-pie'
|
||||||
|
# QEMU 5.0 still uses '-no-pie' in it's linker options
|
||||||
|
|
||||||
|
# default LD to ld if it isn't set
|
||||||
|
if ( set +o pipefail; ${LD:-ld} -no-pie |& grep 'did you mean --no-pie' >/dev/null); then
|
||||||
|
echo "==> LD doesn't like '-no-pie'"
|
||||||
|
# LD has the problem, look for ld.gold
|
||||||
|
if type ld.gold >&/dev/null; then
|
||||||
|
echo "==> Using ld.gold to link QEMU"
|
||||||
|
export LD=ld.gold
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# now actually do the build
|
# now actually do the build
|
||||||
SRCDIR="$(pwd)/toolchains" module_build qemu --prefix="${RISCV}" --target-list=riscv${XLEN}-softmmu --disable-werror
|
SRCDIR="$(pwd)/toolchains" module_build qemu --prefix="${RISCV}" --target-list=riscv${XLEN}-softmmu --disable-werror
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# make Dromajo
|
# make Dromajo
|
||||||
|
|||||||
@@ -28,29 +28,30 @@ module_prepare() ( # <submodule> [ignored-submodule..]
|
|||||||
echo "=> Starting ${name} build"
|
echo "=> Starting ${name} build"
|
||||||
echo "==> Initializing ${name} submodule"
|
echo "==> Initializing ${name} submodule"
|
||||||
if [ $# -gt 0 ] ; then
|
if [ $# -gt 0 ] ; then
|
||||||
git submodule update --init "${dir}"
|
(set -x; git submodule update --init "${dir}")
|
||||||
while [ -n "$1" ] ; do
|
while [ -n "$1" ] ; do
|
||||||
git -C "${dir}" config submodule."${1}".update none
|
(set -x; git -C "${dir}" config submodule."${1}".update none)
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
git submodule update --init --recursive "${dir}"
|
(set -x; git submodule update --init --recursive "${dir}")
|
||||||
)
|
)
|
||||||
|
|
||||||
module_run() ( # <submodule> <command..>
|
module_run() ( # <submodule> <command..>
|
||||||
set -e
|
set -e
|
||||||
|
echo "=> cd ${SRCDIR}/${1}"
|
||||||
cd "${SRCDIR}/${1}"
|
cd "${SRCDIR}/${1}"
|
||||||
shift
|
shift
|
||||||
"$@"
|
(set -x; "$@")
|
||||||
)
|
)
|
||||||
|
|
||||||
module_make() ( # <submodule> <target..>
|
module_make() ( # <submodule> <target..>
|
||||||
set -e -o pipefail
|
set -e -o pipefail
|
||||||
cd "${SRCDIR}/${1}/build"
|
build_dir="${SRCDIR}/${1}/build"
|
||||||
shift
|
shift
|
||||||
"${MAKE}" "$@" | tee "build-${1:-make}.log"
|
(set -x; "${MAKE}" -C "$build_dir" "$@") | tee "build-${1:-make}.log"
|
||||||
if [ -n "$CLEANAFTERINSTALL" ] ; then
|
if [ -n "$CLEANAFTERINSTALL" ] ; then
|
||||||
"${MAKE}" clean # get rid of intermediate files
|
(set -x; "${MAKE}" -C "$build_dir" clean) # get rid of intermediate files
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -59,33 +60,33 @@ module_build() ( # <submodule> [configure-arg..]
|
|||||||
name=$1
|
name=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
|
echo "==> cd ${SRCDIR}/${name}"
|
||||||
cd "${SRCDIR}/${name}"
|
cd "${SRCDIR}/${name}"
|
||||||
|
|
||||||
if [ -e build ] ; then
|
if [ -e build ] ; then
|
||||||
echo "==> Removing existing ${name}/build directory"
|
echo "==> Removing existing ${name}/build directory"
|
||||||
rm -rf build
|
(set -x; rm -rf build)
|
||||||
fi
|
fi
|
||||||
if ! [ -e configure ] ; then
|
if ! [ -e configure ] ; then
|
||||||
echo "==> Updating autoconf files for ${name}"
|
echo "==> Updating autoconf files for ${name}"
|
||||||
find . -iname configure.ac -type f -print0 |
|
find . -iname configure.ac -type f -print0 |
|
||||||
while read -r -d '' file ; do
|
while read -r -d '' file ; do
|
||||||
mkdir -p -- "${file%/*}/m4"
|
(set -x; mkdir -p -- "${file%/*}/m4")
|
||||||
done
|
done
|
||||||
autoreconf -i
|
(set -x; autoreconf -i)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p build
|
(set -x; mkdir -p build)
|
||||||
cd build
|
|
||||||
{
|
{
|
||||||
export PATH="${RISCV:+${RISCV}/bin:}${PATH}"
|
export PATH="${RISCV:+${RISCV}/bin:}${PATH}"
|
||||||
echo "==> Configuring ${name}"
|
echo "==> Configuring ${name}"
|
||||||
../configure "$@"
|
(set -x; cd build && ../configure "$@")
|
||||||
echo "==> Building ${name}"
|
echo "==> Building ${name}"
|
||||||
"${MAKE}"
|
(set -x; "${MAKE}" -C build)
|
||||||
echo "==> Installing ${name}"
|
echo "==> Installing ${name}"
|
||||||
"${MAKE}" install
|
(set -x; "${MAKE}" -C build install)
|
||||||
if [ -n "$CLEANAFTERINSTALL" ] ; then
|
if [ -n "$CLEANAFTERINSTALL" ] ; then
|
||||||
"${MAKE}" clean # get rid of intermediate files
|
(set -x; "${MAKE}" -C build clean) # get rid of intermediate files
|
||||||
fi
|
fi
|
||||||
} 2>&1 | tee build.log
|
} 2>&1 | tee build.log
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user