Pass Flang libraries to MSVC linker correctly #409
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test Flang | |
on: | |
pull_request: | |
branches: | |
- 'release_*x' | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
install_prefix: /usr/local | |
strategy: | |
matrix: | |
target: [X86] | |
cc: [clang] | |
cpp: [clang++] | |
version: [10, 11] | |
include: | |
- target: X86 | |
cc: gcc | |
cpp: g++ | |
version: 10 | |
steps: | |
- uses: actions/checkout@v2 | |
- if: matrix.cc == 'clang' | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa | |
sudo touch /etc/apt/sources.list.d/llvm.list | |
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list | |
echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' | sudo tee -a /etc/apt/sources.list.d/llvm.list | |
wget -q -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | |
sudo apt update | |
sudo apt install -f -y llvm-${{ matrix.version }} clang-${{ matrix.version}} | |
- if: matrix.cc == 'gcc' && matrix.version == '10' | |
run: | | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa | |
sudo apt install gcc-10 g++-10 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 10 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 20 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 10 | |
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 20 | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
with: | |
key: key-${{ matrix.cc }}-${{ matrix.version }} | |
- name: Check tools | |
run: | | |
git --version | |
cmake --version | |
make --version | |
${{ matrix.cc }}-${{ matrix.version }} --version | |
${{ matrix.cpp }}-${{ matrix.version }} --version | |
- name: Build and install llvm | |
run: ./build-llvm-project.sh -t ${{ matrix.target }} -p ${{ env.install_prefix }} -a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} -b /usr/bin/${{ matrix.cpp }}-${{ matrix.version }} -n $(nproc) -c -i -s -x "-DLLVM_ENABLE_ASSERTIONS=ON" -v | |
- name: Checkout flang | |
run: | | |
cd ../.. | |
git clone --depth 1 --single-branch --branch master https://github.com/flang-compiler/flang.git | |
- name: Build and install libpgmath & flang | |
run: | | |
cd ../../flang | |
./build-flang.sh -t ${{ matrix.target }} -p ${{ env.install_prefix }} -n $(nproc) -c -s | |
- name: Copy llvm-lit | |
run: | | |
cd ../../flang | |
cp ../classic-flang-llvm-project/classic-flang-llvm-project/build/bin/llvm-lit build/flang/bin/ | |
- name: Test flang | |
run: | | |
cd ../../flang/build/flang | |
make check-all |