diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..14a5e65 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: Build +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-24.04 + env: + LLVM_DIR: /usr/lib/llvm-18/cmake + steps: + - uses: actions/checkout@v4 + + - name: Install build tools and libraries + run: | + sudo apt-get update + sudo apt-get install -y gcc-14 g++-14 cmake ninja-build llvm-18-dev libmlir-18-dev libgccjit-14-dev mlir-18-tools + + - name: Build + run: | + cmake -B build -G Ninja -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 . + cmake --build build diff --git a/README.md b/README.md index 87502c1..c0c75f4 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,10 @@ In general you need the following tools and libraries to build `mlir-gccjit`: - A working C++ compiler toolchain that supports C++20 standard. - [CMake] with minimum version 3.22. - [Ninja] build system (recommended but not mandatory). -- [LLVM] libraries and development files. -- [MLIR] libraries and development files. -- [libgccjit] libraries and development files. +- [LLVM] libraries and development files. For now we have only tested LLVM-18. +- [MLIR] libraries and development files. For now we have only tested MLIR-18. +- [libgccjit] libraries and development files. For now we have only tested + libgccjit-14. [CMake]: https://cmake.org/ [Ninja]: https://ninja-build.org/ @@ -22,7 +23,7 @@ In general you need the following tools and libraries to build `mlir-gccjit`: For Ubuntu 24.04 (noble) users: ```bash -apt-get install build-essential cmake ninja-build llvm-18-dev libmlir-18-dev libgccjit-13-dev +apt-get install build-essential cmake ninja-build llvm-18-dev libmlir-18-dev libgccjit-14-dev mlir-18-tools ``` ## Build diff --git a/src/GCCJITOps.cpp b/src/GCCJITOps.cpp index ff50cd1..21828a1 100644 --- a/src/GCCJITOps.cpp +++ b/src/GCCJITOps.cpp @@ -42,7 +42,6 @@ #include "mlir/Support/LLVM.h" #include "mlir/Support/LogicalResult.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/Support/LogicalResult.h" using namespace mlir; using namespace mlir::gccjit; diff --git a/src/Translation/Registration.cpp b/src/Translation/Registration.cpp index f08d3ff..315656b 100644 --- a/src/Translation/Registration.cpp +++ b/src/Translation/Registration.cpp @@ -21,7 +21,6 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/FileSystem.h" -#include "llvm/Support/LogicalResult.h" #include "llvm/Support/MemoryBuffer.h" namespace mlir::gccjit { @@ -38,15 +37,15 @@ dumpContextToTempfile(gcc_jit_context *ctxt, bool reproducer) { return file; } -llvm::LogicalResult copyFileToStream(llvm::sys::fs::TempFile file, - llvm::raw_ostream &os) { +LogicalResult copyFileToStream(llvm::sys::fs::TempFile file, + llvm::raw_ostream &os) { os.flush(); llvm::ErrorOr> buffer = llvm::MemoryBuffer::getFile(file.TmpName); if (!buffer) - return mlir::failure(); + return failure(); os << buffer.get()->getBuffer(); - return mlir::success(); + return success(); } void registerTranslation(llvm::StringRef name, llvm::StringRef desc,