Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
12.0.0.20230529: update to debian:bookworm (#117)
Browse files Browse the repository at this point in the history
* Docker image 瘦身

* fix Dockerfile

* fix workflow

* rm Symbolic Link

* add file

* Revert "Docker image 瘦身"

* 12.0.0.20230529: update to debian:bookworm (#113)

1. 更新实验环境为 `debian:bookworm`、`clang-14`、`llvm-14`
2. 重构 `lib1. 更新实验环境为 `debian:bookworm`、`clang-14`、`llvm-14`
2. 重构 `librarian` 目录
3. 调整 `cmake_minimum_required`,与 `llvm-14` 对齐
4. 调整文档
5. 修复 #74 rarian` 目录
3. 调整 `cmake_minimum_required`,与 `llvm-14` 对齐
4. 调整文档
5. 修复 #74
  • Loading branch information
WuK authored Nov 21, 2023
1 parent c4ea7b1 commit 3a074b4
Show file tree
Hide file tree
Showing 34 changed files with 62 additions and 55 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BASE_IMAGE=debian:11
build-args: BASE_IMAGE=debian:bookworm

- name: Build Docker image for unstable-slim
if: github.ref_name == 'unstable-slim' || github.base_ref == 'unstable-slim'
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BASE_IMAGE=debian:11
build-args: BASE_IMAGE=debian:bookworm
platforms: linux/amd64,linux/arm64/v8

- name: Build and push Docker image for unstable-slim
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.18.4)
project(SYsU-lang VERSION 11.1.0.20230227)
# <https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/llvm/CMakeLists.txt>
cmake_minimum_required(VERSION 3.13.4)
project(SYsU-lang VERSION 12.0.0.20230529)
include(CPack)
include(CTest)
add_subdirectory(compiler)
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ SYsU 是一个教学语言,应用于中山大学(**S**un **Y**at-**s**en **U

## 编译运行

需要注意的是,[SysY](https://gitlab.eduxiji.net/nscscc/compiler2021/-/blob/master/SysY%E8%AF%AD%E8%A8%80%E5%AE%9A%E4%B9%89.pdf) 语言允许编译时能够求值的 `const int` 作为数组大小,导致部分算例不能通过 `gcc` 的编译,因此为保持兼容推荐使用 `clang` 编译。经过测试的实验环境为 `debian:11`
需要注意的是,[SysY](https://gitlab.eduxiji.net/nscscc/compiler2021/-/blob/master/SysY%E8%AF%AD%E8%A8%80%E5%AE%9A%E4%B9%89.pdf) 语言允许编译时能够求值的 `const int` 作为数组大小,导致部分算例不能通过 `gcc` 的编译,因此为保持兼容推荐使用 `clang` 编译。经过测试的实验环境为 `debian:bookworm`

```bash
# 安装依赖
sudo apt-get install -y --no-install-recommends \
clang llvm-dev zlib1g-dev lld flex bison \
cmake python3 ninja-build git

git clone https://github.com/arcsysu/SYsU-lang
git clone \
-c feature.manyFiles=true \
--depth=1 \
https://github.com/arcsysu/SYsU-lang

cd SYsU-lang

# 编译安装
Expand Down Expand Up @@ -307,7 +311,7 @@ entry:
大算例以 `git submodule` 的形式存放在 `tester/third_party`。加载方式:

```bash
git submodule update --init
git submodule update --init --recursive --depth 1
```

## 实验反馈
Expand Down Expand Up @@ -347,7 +351,7 @@ git submodule update --init

目前本项目存在两个分支:

- [`latest`](https://github.com/arcsysu/SYsU-lang/tree/latest) 分支下为中大课程教学中使用的代码,功能稳定,预期在 `debian:11` 环境中工作。
- [`latest`](https://github.com/arcsysu/SYsU-lang/tree/latest) 分支下为中大课程教学中使用的代码,功能稳定,预期在 `debian:bookworm` 环境中工作。
- [`unstable-slim`](https://github.com/arcsysu/SYsU-lang/tree/unstable-slim) 分支下为助教探索后续实验改革方案(如 mlir)的代码,预期在`debian:unstable-slim` 环境中工作。该分支中的文档可能不会及时更新,以对应 [Dockerfile](https://github.com/arcsysu/SYsU-lang/blob/unstable-slim/Dockerfile) 中的测试语句为准。

对于中大以外的高校教学者与个人自学者,我们建议使用 [releases](https://github.com/arcsysu/SYsU-lang/releases) 中最新发布的实验框架源码以及对应版本号的 [docker image](https://hub.docker.com/r/wukan0621/sysu-lang)。它们可能在时间上略有落后,但经过了中大一学期的教学检验,不存在潜在的可能导致教学事故的错误。我们也十分欢迎来自你们的课堂反馈[![Discussions](https://img.shields.io/github/discussions/arcsysu/SYsU-lang)](https://github.com/arcsysu/SYsU-lang/discussions) 与改进建议[![Issues](https://img.shields.io/github/issues/arcsysu/SYsU-lang)](https://github.com/arcsysu/SYsU-lang/issues)[![Issues-pr](https://img.shields.io/github/issues-pr/arcsysu/SYsU-lang)](https://github.com/arcsysu/SYsU-lang/pulls) 请提交至 `unstable-slim` 分支)。
Expand Down
6 changes: 3 additions & 3 deletions generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ $ echo $? # 在 Unix & Linux 中,可以通过 echo $? 来查看最后运行的

## 你可能会感兴趣的

- [Kaleidoscope: Code generation to LLVM IR](https://releases.llvm.org/11.0.1/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.html)
- [Kaleidoscope: Code generation to LLVM IR](https://releases.llvm.org/14.0.0/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.html)
- [SYsU-lang 实验三快速上手](https://www.yuque.com/shuitang/rra4fg/bnqy1c)
- [Viz.js — Graphviz in your browser.](http://viz-js.com/)
- [llvm::IRBuilder](https://github.com/llvm/llvm-project/blob/llvmorg-11.0.1/llvm/include/llvm/IR/IRBuilder.h)
- 该文件同样位于 debian:11[llvm-dev](https://packages.debian.org/bullseye/devel/llvm-dev) 包的 </usr/include/llvm/IR/IRBuilder.h>。
- [llvm::IRBuilder](https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/llvm/include/llvm/IR/IRBuilder.h)
- 该文件同样位于 debian:bookworm[llvm-dev](https://packages.debian.org/bookworm/devel/llvm-dev) 包的 </usr/include/llvm/IR/IRBuilder.h>。
3 changes: 2 additions & 1 deletion lexer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
find_package(FLEX REQUIRED)
flex_target(lexer lexer.l main.cc DEFINES_FILE lexer.hh)
flex_target(lexer lexer.l ${CMAKE_CURRENT_BINARY_DIR}/main.cc
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/lexer.hh)
add_executable(sysu-lexer ${FLEX_lexer_OUTPUTS})
install(TARGETS sysu-lexer)
4 changes: 2 additions & 2 deletions lexer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ eof '' Loc=<tester/functional/000_main.sysu.c:3:2>
## 你可能会感兴趣的

- [Lexical Analysis With Flex](http://westes.github.io/flex/manual/)
- [FindFLEX — CMake 3.18.6 Documentation](https://cmake.org/cmake/help/v3.18/module/FindFLEX.html)
- [Preprocessor Output](https://gcc.gnu.org/onlinedocs/gcc-10.2.0/cpp/Preprocessor-Output.html)
- [FindFLEX — CMake 3.13.5 Documentation](https://cmake.org/cmake/help/v3.13/module/FindFLEX.html)
- [Preprocessor Output](https://gcc.gnu.org/onlinedocs/gcc-12.2.0/cpp/Preprocessor-Output.html)
- [这篇博客](https://wu-kan.cn/2020/05/14/%E4%BD%BF%E7%94%A8%E8%AF%8D%E6%B3%95%E5%88%86%E6%9E%90%E5%99%A8-Flex-%E6%8F%90%E5%8F%96%E7%A8%8B%E5%BA%8F%E4%B8%AD%E7%9A%84%E6%95%B4%E6%95%B0%E5%92%8C%E6%B5%AE%E7%82%B9%E6%95%B0/)提到了一种处理注释的方案,如果你不想使用 [flex 自带的注释处理方法](http://westes.github.io/flex/manual/Comments-in-the-Input.html)(当然,实际上注释在预处理阶段已经去除了…)。
- [这篇博客](https://wu-kan.cn/2020/07/03/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%85%B3%E7%B3%BB%E5%88%A4%E5%AE%9A/)通过构造有限自动机,判断两个正则表达式的关系。
11 changes: 1 addition & 10 deletions librarian/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
set(libs sysy;sysu)
foreach(lib IN LISTS libs)
file(GLOB mains ${lib}/*.cc)
add_library(${lib} SHARED ${mains})
install(TARGETS ${lib})
file(GLOB mains ${lib}/*.h)
foreach(mainfile ${mains})
install(FILES ${mainfile} DESTINATION include/${lib})
endforeach()
endforeach()
add_subdirectory(lib)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions librarian/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set(libs sysy;sysu)
foreach(lib IN LISTS libs)
file(GLOB mains ${lib}/*.cc)
add_library(${lib} SHARED ${mains})
install(TARGETS ${lib})
target_include_directories(${lib}
PRIVATE ${CMAKE_SOURCE_DIR}/librarian/include)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/librarian/include/${lib} TYPE INCLUDE)
endforeach()
2 changes: 1 addition & 1 deletion librarian/sysu/fcntl.cc → librarian/lib/sysu/fcntl.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "fcntl.h"
#include "sysu/fcntl.h"
#include <fcntl.h>

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion librarian/sysu/stdio.cc → librarian/lib/sysu/stdio.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdio.h"
#include "sysu/stdio.h"
#include <stdio.h>

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion librarian/sysu/stdlib.cc → librarian/lib/sysu/stdlib.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "stdlib.h"
#include "sysu/stdlib.h"
#include <stdlib.h>

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion librarian/sysu/string.cc → librarian/lib/sysu/string.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "string.h"
#include "sysu/string.h"
#include <string.h>

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion librarian/sysu/unistd.cc → librarian/lib/sysu/unistd.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "unistd.h"
#include "sysu/unistd.h"
#include <unistd.h>

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion librarian/sysy/sylib.cc → librarian/lib/sysy/sylib.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define __SYSY 202203L
#define __SYSY_NO_DEFINE
#include "sylib.h"
#include "sysy/sylib.h"
#include <chrono>
#include <cstdarg>
#include <cstdio>
Expand Down
6 changes: 3 additions & 3 deletions optimizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
LIBRARY_PATH=$HOME/sysu/lib:$LIBRARY_PATH \
LD_LIBRARY_PATH=$HOME/sysu/lib:$LD_LIBRARY_PATH &&
clang -E tester/mizuno_ai/mizuno_ai.sysu.c |
clang -cc1 -O0 -S -emit-llvm |
clang -cc1 -O0 -S -emit-llvm -disable-O0-optnone |
opt -S --enable-new-pm -load-pass-plugin=libsysuOptimizer.so -passes="sysu-optimizer-pass" )
```

Expand All @@ -46,11 +46,11 @@

并思考,这些优化是否可以在语法树(即 `sysu-generator`)上完成?在这两个阶段各自的优点与缺点是什么?

如果你使用了来自 LLVM 的其他组件,你需要将其加入本目录下 `CMakeLists.txt` 中的 `llvm_map_components_to_libnames`,否则可能无法通过编译。你可以终端执行 `llvm-config --components`,查看所有的 LLVM 组件名称。然而,禁止使用任何 LLVM 自带的 [transform-passes](https://releases.llvm.org/11.0.1/docs/Passes.html#transform-passes)(当然,你被鼓励去学习这些 pass 的实现原理),助教会结合 `llvm-objdump` 等工具检查。
如果你使用了来自 LLVM 的其他组件,你需要将其加入本目录下 `CMakeLists.txt` 中的 `llvm_map_components_to_libnames`,否则可能无法通过编译。你可以终端执行 `llvm-config --components`,查看所有的 LLVM 组件名称。然而,禁止使用任何 LLVM 自带的 [transform-passes](https://releases.llvm.org/14.0.0/docs/Passes.html#transform-passes)(当然,你被鼓励去学习这些 pass 的实现原理),助教会结合 `llvm-objdump` 等工具检查。

### Q & A:有关 new pass manager 与 legacy pass manager

Pass/PassManager 是 LLVM 里最重要的核心组件之一,自 LLVM 诞生以来已经有数十年历史。由于原有的 PM 编译效率低且错失很多优化机会,2014 年开始 LLVM 团队对其开始重构。在实验环境中使用的 LLVM-11.0.1 默认使用的仍然是旧 PM,但已经包含新 PM;在 LLVM-12 中已经默认使用 new pass manager 代替 legacy pass manager;在助教写下这段话的 2022 年 03 月 25 日,LLVM-14 正式发布,其 [ReleaseNotes](https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html) 中提到:
Pass/PassManager 是 LLVM 里最重要的核心组件之一,自 LLVM 诞生以来已经有数十年历史。由于原有的 PM 编译效率低且错失很多优化机会,2014 年开始 LLVM 团队对其开始重构。在 SYsU-lang 第一年使用的 LLVM-11 默认使用的仍然是旧 PM,但已经包含新 PM;在 LLVM-12 中已经默认使用 new pass manager 代替 legacy pass manager;在助教写下这段话的 2022 年 03 月 25 日,LLVM-14 正式发布,其 [ReleaseNotes](https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html) 中提到:

> Using the legacy pass manager for the optimization pipeline is deprecated and will be removed after LLVM 14.
Expand Down
2 changes: 1 addition & 1 deletion optimizer/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int main(int argc, char **argv) {
"calls in the input IR file\n");

// Makes sure llvm_shutdown() is called (which cleans up LLVM objects)
// https://releases.llvm.org/11.0.1/docs/ProgrammersManual.html#ending-execution-with-llvm-shutdown
// https://releases.llvm.org/14.0.0/docs/ProgrammersManual.html#ending-execution-with-llvm-shutdown
llvm::llvm_shutdown_obj SDO;

// Parse the IR file passed on the command line.
Expand Down
2 changes: 1 addition & 1 deletion optimizer/optimizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sysu::StaticCallCounterPrinter::run(llvm::Module &M,

sysu::StaticCallCounter::Result
sysu::StaticCallCounter::run(llvm::Module &M, llvm::ModuleAnalysisManager &) {
llvm::MapVector<const llvm::Function *, unsigned> Res;
Result Res;

for (auto &Func : M) {
for (auto &BB : Func) {
Expand Down
3 changes: 2 additions & 1 deletion parser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
find_package(LLVM REQUIRED)
find_package(BISON REQUIRED)
bison_target(parser parser.y main.cc DEFINES_FILE parser.hh)
bison_target(parser parser.y ${CMAKE_CURRENT_BINARY_DIR}/main.cc
DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.hh)
add_executable(sysu-parser ${BISON_parser_OUTPUT_SOURCE})
llvm_map_components_to_libnames(LLVM_LIBS support)
target_link_libraries(sysu-parser ${LLVM_LIBS})
Expand Down
12 changes: 6 additions & 6 deletions parser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ flowchart TD;
### Q & A:为什么要输出到 `llvm::json`?

1. 输出到 json,便于使用 python 脚本和 clang 导出的语法树对比,自动批改。
2. 输出到 json,因为 json 格式非常容易理解,不需要像 [LLVM 官方教程](https://releases.llvm.org/11.0.1/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.html) 一样定义很多节点。
2. 输出到 json,因为 json 格式非常容易理解,不需要像 [LLVM 官方教程](https://releases.llvm.org/14.0.0/docs/tutorial/MyFirstLanguageFrontend/LangImpl02.html) 一样定义很多节点。
3. 输出到 `llvm::json`,可以让同学们提前上手 LLVM 库的使用,平滑下一个实验的难度。

## 评分规则
Expand Down Expand Up @@ -314,15 +314,15 @@ flowchart TD;
- 输入一个经过预处理的 SYsU 源程序,输出其语法分析树。
- 建议:将 `sysu-lexer` 的核心代码打包成一个 `libsysuLexer.so`,将 `sysu-parser` 的核心代码打包成一个 `libsysuParser.so`,然后链接到到同一个 `main.cc`
- 注意:`add_flex_bison_dependency`
7. 鉴于本次实验已经开始进入 LLVM 开发范畴,建议遵守 [LLVM Coding Standards](https://releases.llvm.org/11.0.1/docs/CodingStandards.html)
7. 鉴于本次实验已经开始进入 LLVM 开发范畴,建议遵守 [LLVM Coding Standards](https://releases.llvm.org/14.0.0/docs/CodingStandards.html)
- 可以使用 `clang-tidy``clang-format` 工具检查你的代码是否规范,如 `cmake -DCMAKE_CXX_CLANG_TIDY=clang-tidy #...`
- 将 [LLVM Coding Standards](https://releases.llvm.org/11.0.1/docs/CodingStandards.html) 与 [GNU](https://www.gnu.org/prep/standards/standards.html)、[Google](https://google.github.io/styleguide/)、[Chromium](https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++-dos-and-donts.md)、[Microsoft](https://docs.microsoft.com/zh-cn/dotnet/csharp/fundamentals/coding-style/coding-conventions)、[Mozilla](https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html)、[WebKit](https://webkit.org/code-style-guidelines/) 等其他知名编程规范进行比较,选出一种或是基于他们归纳出一个你认为最合理的编程规范,编写对应的 `.clang-format``.clang-tidy` 文件,并在以后坚持使用下去!~~(就助教来说更加偏好 LLVM,毕竟没有人会比编译器更懂语言)~~
- 将 [LLVM Coding Standards](https://releases.llvm.org/14.0.0/docs/CodingStandards.html) 与 [GNU](https://www.gnu.org/prep/standards/standards.html)、[Google](https://google.github.io/styleguide/)、[Chromium](https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++-dos-and-donts.md)、[Microsoft](https://docs.microsoft.com/zh-cn/dotnet/csharp/fundamentals/coding-style/coding-conventions)、[Mozilla](https://firefox-source-docs.mozilla.org/code-quality/coding-style/coding_style_cpp.html)、[WebKit](https://webkit.org/code-style-guidelines/) 等其他知名编程规范进行比较,选出一种或是基于他们归纳出一个你认为最合理的编程规范,编写对应的 `.clang-format``.clang-tidy` 文件,并在以后坚持使用下去!~~(就助教来说更加偏好 LLVM,毕竟没有人会比编译器更懂语言)~~
8. 改进这个实验模板(欢迎 PR!)。
9. Do what you want to do。
## 你可能会感兴趣的
- [GNU Bison - The Yacc-compatible Parser Generator](https://www.gnu.org/software/bison/manual/)
- [FindBISON — CMake 3.18.6 Documentation](https://cmake.org/cmake/help/v3.18/module/FindBISON.html)
- [llvm::json](https://github.com/llvm/llvm-project/blob/llvmorg-11.0.1/llvm/include/llvm/Support/JSON.h)
- 该文件同样位于 debian:11 中 [llvm-dev](https://packages.debian.org/bullseye/devel/llvm-dev) 包的 </usr/include/llvm/Support/JSON.h>
- [FindBISON — CMake 3.13.5 Documentation](https://cmake.org/cmake/help/v3.13/module/FindBISON.html)
- [llvm::json](https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/llvm/include/llvm/Support/JSON.h)
- 该文件同样位于 debian:bookworm 中 [llvm-dev](https://packages.debian.org/bookworm/devel/llvm-dev) 包的 </usr/include/llvm/Support/JSON.h>
12 changes: 6 additions & 6 deletions tester/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ foreach(_test lexer-0)
${_test}
PROPERTIES
ENVIRONMENT
"CPATH=${CMAKE_SOURCE_DIR}/librarian:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LD_LIBRARY_PATH}"
"CPATH=${CMAKE_SOURCE_DIR}/librarian/include:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LD_LIBRARY_PATH}"
)
endforeach()

Expand All @@ -44,7 +44,7 @@ foreach(_test lexer-1 lexer-2 lexer-3)
${_test}
PROPERTIES
ENVIRONMENT
"CPATH=${CMAKE_SOURCE_DIR}/librarian:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LD_LIBRARY_PATH}"
"CPATH=${CMAKE_SOURCE_DIR}/librarian/include:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LD_LIBRARY_PATH}"
)
endforeach()

Expand All @@ -61,7 +61,7 @@ foreach(_test parser-0)
${_test}
PROPERTIES
ENVIRONMENT
"CPATH=${CMAKE_SOURCE_DIR}/librarian:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LD_LIBRARY_PATH}"
"CPATH=${CMAKE_SOURCE_DIR}/librarian/include:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LD_LIBRARY_PATH}"
)
endforeach()

Expand All @@ -77,7 +77,7 @@ foreach(_test parser-1 parser-2 parser-3)
${_test}
PROPERTIES
ENVIRONMENT
"CPATH=${CMAKE_SOURCE_DIR}/librarian:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LD_LIBRARY_PATH}"
"CPATH=${CMAKE_SOURCE_DIR}/librarian/include:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LD_LIBRARY_PATH}"
)
endforeach()

Expand All @@ -93,7 +93,7 @@ foreach(_test benchmark_generator_and_optimizer_0)
${_test}
PROPERTIES
ENVIRONMENT
"CPATH=${CMAKE_SOURCE_DIR}/librarian:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LD_LIBRARY_PATH}"
"CPATH=${CMAKE_SOURCE_DIR}/librarian/include:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LD_LIBRARY_PATH}"
)
endforeach()

Expand All @@ -109,6 +109,6 @@ foreach(_test benchmark_generator_and_optimizer_1)
${_test}
PROPERTIES
ENVIRONMENT
"CPATH=${CMAKE_SOURCE_DIR}/librarian:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian:$ENV{LD_LIBRARY_PATH}"
"CPATH=${CMAKE_SOURCE_DIR}/librarian/include:$ENV{CPATH};LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LIBRARY_PATH};LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/librarian/lib:$ENV{LD_LIBRARY_PATH}"
)
endforeach()
2 changes: 1 addition & 1 deletion tester/function_test2020/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ foreach(mainfile ${mains})
add_executable(sysu-tester-function_test2020_${mainname} ${mainfile})
target_link_libraries(sysu-tester-function_test2020_${mainname} sysy)
target_include_directories(sysu-tester-function_test2020_${mainname}
PRIVATE ${CMAKE_SOURCE_DIR}/librarian)
PRIVATE ${CMAKE_SOURCE_DIR}/librarian/include)
install(TARGETS sysu-tester-function_test2020_${mainname})
endforeach()
Loading

0 comments on commit 3a074b4

Please sign in to comment.