Skip to content

Add Docker Container of DSP-MLIR #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: latestMain
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ mlir/examples/dsp/SimpleBlocks/Output/TryDSPApps/BenchmarkTest/Output/*
/mlir/examples/dsp/SimpleBlocks/Output/TryDSPApps/BenchmarkTest/DSP-DSL/HClanglogs
/mlir/examples/dsp/SimpleBlocks/Output/TryDSPApps/BenchmarkTest/DSP-DSL/ServerExeLogs
/mlir/examples/dsp/SimpleBlocks/Output/TryDSPApps/BenchmarkTest/CCode/ServerExeLogs
hexagon_target/*
Hexagon_Tools/*
95 changes: 59 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,61 @@
# Use the official Ubuntu base image
FROM ubuntu:latest
# Use an official Ubuntu 22.04 as a base
FROM ubuntu:22.04

# Install required packages
# Install dependencies
RUN apt-get update && \
apt-get install -y git cmake ninja-build clang

# Set the working directory
WORKDIR /llvm-project

# Clone the LLVM project repository
RUN git clone https://github.com/tridhapuku/DSP_MLIR.git .

# Checkout latest Branch
RUN git checkout latestMain

# Create the build directory
RUN mkdir build

# Change to the build directory
WORKDIR /llvm-project/build

# Download and install cmake
RUN apt-get install -y cmake

# Configure and build LLVM projects
RUN cmake -S llvm -B build -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="mlir;clang;clang-tools-extra;lld" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_ENABLE_LLD=OFF

# Configure and build MLIR project
RUN cmake ../llvm \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD="Native" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON

# Build and run MLIR tests
RUN cmake --build . --target check-mlir
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
cmake \
ninja-build \
clang \
build-essential \
python3 \
libedit2 \
libedit-dev \
libncurses6 \
libtinfo5 \
libncurses-dev \
python3-pip \
lld \
wget \
curl \
vim \
desktop-file-utils \
gawk \
sudo \
systemd \
xdg-utils && \
ln -s /usr/bin/python3 /usr/bin/python && \
rm -rf /var/lib/apt/lists/*


# Symlinks for older libraries
RUN ln -s /usr/lib/x86_64-linux-gnu/libedit.so.2 /usr/lib/x86_64-linux-gnu/libedit.so.0 && \
ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/x86_64-linux-gnu/libncurses.so.5



# Set environment variables
ENV PATH=/usr/local/bin:$PATH

# Clone your project (checkout docker branch directly)
RUN git clone https://github.com/MPSLab-ASU/DSP_MLIR.git /DSP_MLIR

# Set working directory
WORKDIR /DSP_MLIR
RUN git checkout docker
# Build
RUN mkdir build && cd build && \
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS="mlir;clang" \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD="Native;Hexagon" \
-DCMAKE_BUILD_TYPE=Release && \
ninja

# Copy additional files
# COPY hexagon_target/ /DSP_MLIR/build/bin/hexagon/
# COPY Hexagon_Tools/ /DSP_MLIR/Hexagon_Tools/

# Default to bash
CMD ["/bin/bash"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <stdlib.h>

#define INPUT_LENGTH 101
#define M_PI 3.14159265358979323846
#define PI M_PI
#define FS 8000
#define FC1 500
Expand Down Expand Up @@ -76,10 +77,12 @@ int main() {
double final1 = getElemAtIndx(hpf_w1, 6);
double final2 = getElemAtIndx(hpf_w2, 7);
double final3 = getElemAtIndx(hpf_w3, 8);
double final4 = getElemAtIndx(hpf_w3, 5);

printf("%f\n", final1);
printf("%f\n", final2);
printf("%f\n", final3);
printf("%f\n", final4);

free(hamming_window);
free(hpf1);
Expand Down
Loading