Skip to content

Commit

Permalink
Merge pull request #31 from AnoushkaU/command_parse
Browse files Browse the repository at this point in the history
CI: Added LLVM-JIT testing
  • Loading branch information
Rafael Stahl authored Dec 13, 2020
2 parents f05100d + 621a80d commit 049bed4
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
24 changes: 19 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
strategy:
matrix:
config:
- {name: "Linux", os: ubuntu-latest, cmakegen: "", tc: "riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-linux-ubuntu14", tc-ext: ".tar.gz", unpack: "tar xf"}
- {name: "Windows", os: windows-latest, cmakegen: "-G \"MinGW Makefiles\"", tc: "riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-w64-mingw32", tc-ext: ".zip", unpack: "unzip"}
- {name: "Mac", os: macOS-latest, cmakegen: "", tc: "riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-apple-darwin", tc-ext: ".tar.gz", unpack: "tar xf"}
- {name: "Linux", os: ubuntu-latest, cmakegen: "", jit: "clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04", jit-ext: ".tar.xz", tc: "riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-linux-ubuntu14", tc-ext: ".tar.gz", unpack: "tar xf"}
- {name: "Windows", os: windows-latest, cmakegen: "-G \"MinGW Makefiles\"", jit: "LLVM-7.0.0-win64", jit-ext: ".exe", tc: "riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-w64-mingw32", tc-ext: ".zip", unpack: "unzip"}
- {name: "Mac", os: macOS-latest, cmakegen: "", jit: "clang+llvm-7.0.0-x86_64-apple-darwin", jit-ext: ".tar.xz", tc: "riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-apple-darwin", tc-ext: ".tar.gz", unpack: "tar xf"}

runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
Expand All @@ -31,12 +31,22 @@ jobs:
run: |
choco install boost-msvc-14.1 --version=1.67.0
choco install wget unzip
choco install llvm --version=7.0.0
- name: Requirements (Mac)
if: matrix.config.name == 'Mac'
run: |
brew install boost coreutils
- name: Requirements (Linux/Mac)
if: matrix.config.name == 'Linux' || matrix.config.name == 'Mac'
working-directory: ${{runner.workspace}}
shell: bash
run: |
wget https://releases.llvm.org/7.0.0/${{ matrix.config.jit }}${{ matrix.config.jit-ext }}
${{ matrix.config.unpack }} ${{ matrix.config.jit }}${{ matrix.config.jit-ext }}
mv ${{ matrix.config.jit }} llvm-lib
- name: Requirements
shell: bash
working-directory: ${{runner.workspace}}
Expand All @@ -51,7 +61,9 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../install
run: |
export LLVM_DIR=${{runner.workspace}}/llvm-lib
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../install
- name: Build
working-directory: ${{runner.workspace}}/build
Expand Down Expand Up @@ -89,5 +101,7 @@ jobs:
run: |
./run_helper.sh ../SW/riscv/build/riscv_example
./run_helper.sh ../SW/riscv/build/riscv_example gcc
./run_helper.sh ../SW/riscv/build/riscv_example llvm
./run_helper.sh ../SW/riscv_cpp/build/riscv_example
./run_helper.sh ../SW/riscv_cpp/build/riscv_example gcc
./run_helper.sh ../SW/riscv_cpp/build/riscv_example llvm
20 changes: 9 additions & 11 deletions JITImpl/LLVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,18 @@ IF(LLVM_FOUND)
)
ETISSPlugin(${PROJECT_NAME})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC
-Wl,--start-group
${LLVM_LIBS}
clangFrontend
clangCodeGen
clangLex
clangFrontend
clangSerialization
clangAST
clangBasic
clangSema
clangEdit
clangAnalysis
clangDriver
clangParse
-Wl,--end-group
)
clangSema
clangAnalysis
clangEdit
clangAST
clangLex
clangBasic
${LLVM_LIBS}
)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC include ${LLVM_INCLUDE_DIRS})
ENDIF()
1 change: 1 addition & 0 deletions JITImpl/LLVM/src/LLVMJIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ void *LLVMJIT::translate(std::string code, std::set<std::string> headerpaths, st
args.push_back("-std=c99");
args.push_back("-isystem" + etiss::jitFiles() + "/clang_stdlib");
args.push_back("-isystem/usr/include");
args.push_back("-isystem/usr/include/x86_64-linux-gnu");
for (const auto &headerPath : headerpaths)
{
args.push_back("-I" + headerPath);
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ ETISS is supported on x86_64 Linux and Windows hosts. Tested compilers include G
- GCC Compiler >= 5.0
- Boost >= 1.54
- Graphviz + Doxygen (For documentation generation)
- LLVM + Clang 7
(If you want to use LLVM-JIT compiler then you have to setup LLVM and Clang
libraries somewhere on the host PC and source it with the environment variable
`LLVM_DIR`.)
- LLVM + Clang 7 (Please download appropriate pre-built binaries from https://releases.llvm.org/download.html)

Packages for Ubuntu 18:

Expand All @@ -55,6 +52,10 @@ Change to the created directory, e.g.,

$ cd build_dir

If LLVM-JIT compiler is used, source it with the environment variable:

$ export LLVM_DIR=/path/to/llvm

Configure the build system, e.g.,
Replace `` `pwd`/installed`` with your `<etiss_install_path>` if you do not like to install etiss into `build_dir/installed/`. Set up path to cmake if necessary.

Expand Down

0 comments on commit 049bed4

Please sign in to comment.