Skip to content

Commit

Permalink
Merge pull request #132 from THU-DSP-LAB/add-some-configuration
Browse files Browse the repository at this point in the history
[VENTUS][Configuration] Add some configuration
  • Loading branch information
wangqinfan committed Jun 26, 2024
2 parents ddc7052 + 3581f12 commit ecddf38
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These owners will be the default owners for everything in
# the repo.
* @Jules-Kong @dodohack @wangqinfan @zhoujingya @ziliangzl
41 changes: 41 additions & 0 deletions .github/workflows/containers/dockerfiles/ventus_centos.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM centos:7.9.2009 as base

RUN yum remove gcc gcc-c++ gdb make -y \
&& yum install -y scl-utils \
&& yum install -y centos-release-scl \
&& yum install -y devtoolset-8-toolchain \
&& echo "source /opt/rh/devtoolset-8/enable" >> /etc/profile \
&& scl enable devtoolset-8 bash \
&& yum install -y epel-release \
&& yum install -y llvm-toolset-7.0-clang.x86_64 llvm-toolset-7.0-llvm-libs.x86_64 llvm-toolset-7.0-lld.x86_64 libatomic \
&& ldconfig \
&& echo "source /opt/rh/llvm-toolset-7.0/enable" >> /etc/profile \
&& echo "/opt/rh/llvm-toolset-7.0/root/usr/lib64" > /etc/ld.so.conf.d/clang.conf \
&& ldconfig \
&& yum clean all && rm -rf /var/cache/yum /tmp/* /var/tmp/*

ENV PATH="/opt/rh/devtoolset-8/root/usr/bin:/opt/rh/llvm-toolset-7.0/root/usr/bin:$PATH"

FROM base as ventus-env

# In experience, installing git in the Dockerfile will cause the image to take a long time to build. It is recommended to install git in the container.
RUN yum remove cmake -y && yum install -y wget \
&& cd /opt/ && wget https://github.com/Kitware/CMake/releases/download/v3.22.1/cmake-3.22.1.tar.gz && tar -zxvf cmake-3.22.1.tar.gz && rm cmake-3.22.1.tar.gz \
&& yum install -y openssl openssl-devel \
&& cd /opt/cmake-3.22.1 && ./bootstrap --prefix=/usr/local/cmake && make && make install \
&& ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake \
&& yum install -y python3 python3-devel ccache ninja-build which dtc words autoconf automake libtool ncurses-devel hwloc-devel hwloc hwloc-libs patch ruby git \
&& yum clean all && rm -rf /var/cache/yum /tmp/* /var/tmp/*

LABEL \
org.opencontainers.image.title="CentOS Base Image of Ventus" \
org.opencontainers.image.description="This centos base image is used to build and run the software toolchain of Ventus v2.0.2." \
org.opencontainers.image.url="https://github.com/THU-DSP-LAB" \
org.opencontainers.image.version="2.0.2" \
org.opencontainers.image.vendor="Ventus" \
org.opencontainers.image.created="2024-06-24 00:00:00+00:00" \
org.opencontainers.image.licenses="MulanPSL2"

WORKDIR /root

CMD ["/bin/bash"]
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Our program is based on LLVM, so the need packages to build ventus are almost th
* ccache
* cmake
* ninja
* clang(optional)
* clang

> If you see any packages missing information, just install them
Expand Down Expand Up @@ -210,3 +210,30 @@ the workflow file is `.github/workflows/ventus-build.yml`, including below jobs
* Isa simulation test
* GPU-rodinia testsuite
* Pocl testing

### 6: Docker image

If the user needs to build the toolchain of the Ventus project in an environment other than Ubuntu, such as the CentOS system, we provide the Dockerfile for building the CentOS image. The file is under '.github/workflows/containers/dockerfiles'.

Note: When using build-ventus.sh to build the instantiated centos container, the following modifications are required, which are different from the above "2: Build all the programs":

```
--- a/build-ventus.sh
+++ b/build-ventus.sh
@@ -119,6 +119,8 @@ build_llvm() {
-DLLVM_CCACHE_BUILD=ON \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
-DLLVM_PARALLEL_LINK_JOBS=12 \
+ -DCMAKE_C_COMPILER=clang \
+ -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DLLVM_ENABLE_PROJECTS="clang;lld;libclc" \
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86;RISCV" \
@@ -232,7 +234,7 @@ export_elements() {
export SPIKE_TARGET_DIR=${VENTUS_INSTALL_PREFIX}
export VENTUS_INSTALL_PREFIX=${VENTUS_INSTALL_PREFIX}
export POCL_DEVICES="ventus"
- export OCL_ICD_VENDORS=${VENTUS_INSTALL_PREFIX}/lib/libpocl.so
+ export OCL_ICD_VENDORS=${VENTUS_INSTALL_PREFIX}/lib64/libpocl.so
}
```

0 comments on commit ecddf38

Please sign in to comment.