Skip to content
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

Sort CMake configuration options and update actions/checkout #1151

Open
wants to merge 2 commits into
base: main
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
76 changes: 42 additions & 34 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# Clone the repo and its submodules. Do shallow clone to save clone
# time.
- name: Get the project repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: "true"
Expand All @@ -50,7 +50,7 @@ jobs:

- name: Install Python packages
run: |

pip install -r python/requirements.txt

- name: Install packages
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Get MLIR
id: mlir-wheels
run: |

VERSION=$(utils/clone-llvm.sh --get-wheel-version)
pip -q download mlir==$VERSION \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro
Expand All @@ -98,33 +98,37 @@ jobs:
- name: Build and test (Assert)
if: matrix.build_type == 'Assert'
run: |

mkdir build_assert
cd build_assert


# Please keep the options sorted so it is easier to compare
cmake .. \
-GNinja \
-DAIE_COMPILER=NONE \
-DAIE_ENABLE_AIRBIN=OFF \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DAIE_LINKER=NONE \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_VISIBILITY_PRESET=hidden \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DAIE_COMPILER=NONE \
-DAIE_LINKER=NONE \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DAIE_ENABLE_AIRBIN=OFF \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DHOST_COMPILER=NONE \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_RTTI=ON \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_USE_LINKER=lld \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON

-DLLVM_USE_LINKER=lld \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir

ninja
ninja check-aie
ninja check-tutorials
Expand All @@ -134,32 +138,36 @@ jobs:
- name: Build and test (Release)
if: matrix.build_type == 'Release'
run: |

mkdir build_release
cd build_release


# Please keep the options sorted so it is easier to compare
cmake .. \
-G Ninja \
-DAIE_COMPILER=NONE \
-DAIE_ENABLE_AIRBIN=OFF \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DAIE_LINKER=NONE \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_VISIBILITY_PRESET=hidden \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DAIE_COMPILER=NONE \
-DAIE_LINKER=NONE \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DAIE_ENABLE_AIRBIN=OFF \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DHOST_COMPILER=NONE \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_RTTI=ON \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DLLVM_USE_LINKER=lld \
-DLLVM_EXTERNAL_LIT=$(which lit)
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir

ninja
ninja check-aie
ninja check-tutorials
Expand Down
41 changes: 21 additions & 20 deletions .github/workflows/buildAndTestAieTools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ jobs:
dotnet: true
haskell: true
large-packages: true
swap-storage: false
swap-storage: false

- name: Docker prune
shell: bash
run: |
docker system prune -a -f

- uses: uraimo/[email protected]
name: Run commands
id: runcmd
Expand All @@ -66,60 +66,61 @@ jobs:
--mac-address ${{ secrets.XILINX_MAC }}
run: |
ls -l /opt/Xilinx/Vitis/2023.2/

# this is the inverse of `base64 -w 1000000 Xilinx.lic`
# the -w ("wrap after 1000000 cols") is so that there are no spaces in the XILINX_LIC env var
echo -n "${{ secrets.XILINX_LIC }}" | base64 --decode > ~/.Xilinx/Xilinx.lic

cd /
git clone https://github.com/Xilinx/mlir-aie.git
cd /mlir-aie

git checkout ${{ github.head_ref }}
if [ x"${{ inputs.AIE_COMMIT }}" != x"" ]; then
git reset --hard ${{ inputs.AIE_COMMIT }}
fi

git submodule update --init --recursive

apt install python3.10-venv
python -m venv aie-venv
source aie-venv/bin/activate
pip install -r python/requirements.txt

VERSION=$(utils/clone-llvm.sh --get-wheel-version)
pip -q download mlir==$VERSION \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro
unzip -q mlir-*.whl
find mlir -exec touch -a -m -t 201108231405.14 {} \;

# don't delete the space in the sed
pushd cmake/modulesXilinx && sed -i.bak 's/ VITIS_VPP//g' FindVitis.cmake && popd

mkdir build && cd build
export PATH=/opt/Xilinx/Vitis/2023.2/bin:/opt/Xilinx/Vitis/2023.2/aietools/bin:$PATH
# Please keep the options sorted so it is easier to compare
cmake .. -G Ninja \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DVITIS_ROOT=/opt/Xilinx/Vitis/2023.2/ \
-DVitis_VERSION_MAJOR=2023 \
-DVitis_VERSION_MINOR=2 \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DAIE_INCLUDE_INTEGRATION_TESTS=OFF \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=install

-DCMAKE_INSTALL_PREFIX=install \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DVITIS_ROOT=/opt/Xilinx/Vitis/2023.2 \
-DVitis_VERSION_MAJOR=2023 \
-DVitis_VERSION_MINOR=2

ninja

if [ x"${{ inputs.LIT_FILTER }}" == x"" ]; then
export LIT_FILTER="${{ inputs.LIT_FILTER }}"
fi

# filter out CODirect until I put bootgen into the image
export LIT_OPTS="-sv --timeout 600 -j1 --filter-out Targets/AIEGenerateCDODirect"
ninja check-aie
Expand Down
36 changes: 19 additions & 17 deletions .github/workflows/buildAndTestMulti.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
# Clone the repo and its submodules. Do shallow clone to save clone
# time.
- name: Get the project repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2
submodules: "true"
Expand All @@ -79,7 +79,7 @@ jobs:

- name: Install Python packages
run: |

pip install -r python/requirements.txt

- name: Setup Cpp
Expand All @@ -103,7 +103,7 @@ jobs:
- name: Get MLIR
id: mlir-wheels
run: |

VERSION=$(utils/clone-llvm.sh --get-wheel-version)
if [ x"${{ matrix.ENABLE_RTTI }}" == x"OFF"]; then
WHEEL=mlir_no_rtti
Expand All @@ -117,35 +117,37 @@ jobs:
# Build the repo test target in release mode to build and test.
- name: Build and test
run: |

mkdir build_release
cd build_release

if [ x"${{ contains(matrix.OS, 'windows') }}" == x"true" ]; then
LLVM_EXTERNAL_LIT="$(where lit)"
else
LLVM_EXTERNAL_LIT="$(which lit)"
fi


# Please keep the options sorted so it is easier to compare
cmake .. \
-G Ninja \
-DAIE_COMPILER=NONE \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DAIE_LINKER=NONE \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_VISIBILITY_PRESET=hidden \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
-DAIE_COMPILER=NONE \
-DAIE_LINKER=NONE \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DCMAKE_PLATFORM_NO_VERSIONED_SONAME=ON \
-DCMAKE_VISIBILITY_INLINES_HIDDEN=ON \
-DHOST_COMPILER=NONE \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_ENABLE_ASSERTIONS=${{ matrix.ENABLE_ASSERTIONS }} \
-DLLVM_ENABLE_RTTI=${{ matrix.ENABLE_RTTI }} \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../mlir/lib/cmake/llvm \
-DLLVM_EXTERNAL_LIT="$LLVM_EXTERNAL_LIT"

-DLLVM_EXTERNAL_LIT="$LLVM_EXTERNAL_LIT" \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir

ninja
# tests hang/fail on windows
if [ x"${{ contains(matrix.OS, 'windows') }}" == x"false" ]; then
Expand Down
Loading
Loading