areusch commented on code in PR #12534:
URL: https://github.com/apache/tvm/pull/12534#discussion_r965278333


##########
docker/install/ubuntu_install_spike_sim.sh:
##########
@@ -0,0 +1,86 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+ubuntu_install_spike_sim.sh
+
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+set -o pipefail
+set -x
+
+function show_usage() {
+    cat <<EOF
+Usage: docker/install/ubuntu_install_spike_sim.sh <RISCV_PATH>
+RISCV_PATH is the installation path of the risc-v gcc.
+EOF
+}
+
+if [ "$#" -lt 1 -o "$1" == "--help" -o "$1" == "-h" ]; then
+    show_usage
+    exit -1
+fi
+
+export RISCV=$1
+export PATH=$RISCV/bin:$PATH
+shift
+
+export DEBIAN_FRONTEND=noninteractive
+export TZ=Etc/UTC

Review Comment:
   i think this is also done in ubuntu_install_zephyr.sh, maybe we can move to 
ubuntu_install_core.sh?



##########
docker/install/ubuntu_install_spike_sim.sh:
##########
@@ -0,0 +1,86 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+ubuntu_install_spike_sim.sh
+
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+set -u
+set -o pipefail
+set -x
+
+function show_usage() {
+    cat <<EOF
+Usage: docker/install/ubuntu_install_spike_sim.sh <RISCV_PATH>
+RISCV_PATH is the installation path of the risc-v gcc.
+EOF
+}
+
+if [ "$#" -lt 1 -o "$1" == "--help" -o "$1" == "-h" ]; then
+    show_usage
+    exit -1
+fi
+
+export RISCV=$1
+export PATH=$RISCV/bin:$PATH
+shift
+
+export DEBIAN_FRONTEND=noninteractive
+export TZ=Etc/UTC
+sudo ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
+echo $TZ > /etc/timezone
+
+sudo apt-install-and-clear -y --no-install-recommends device-tree-compiler
+
+# Install spike
+mkdir /tmp/spike
+cd /tmp/spike
+# TODO: freeze version?
+git clone https://github.com/riscv/riscv-isa-sim.git
+pushd riscv-isa-sim
+mkdir build
+cd build
+../configure --prefix=$RISCV --with-isa=RV32IMAC
+make -j`nproc`

Review Comment:
   slight pref for nproc - 1, in case you're locally building.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to