Skip to content

Commit d617409

Browse files
authored
Merge branch 'OpenCilk:dev' into fix-memory-alert-on-start
2 parents b2c3b88 + b71934c commit d617409

File tree

10 files changed

+185
-449
lines changed

10 files changed

+185
-449
lines changed

.github/workflows/handcomp-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
2222
volumes:
2323
- /mnt/:/mnt/
24+
options: --user root
2425
strategy:
2526
fail-fast: false
2627
matrix:

.github/workflows/small-cilkapps.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
2222
volumes:
2323
- /mnt/:/mnt/
24+
options: --user root
2425
strategy:
2526
fail-fast: false
2627
matrix:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CMake build for Cheetah.
22

3-
cmake_minimum_required(VERSION 3.13.4)
3+
cmake_minimum_required(VERSION 3.20.0)
44

55
# Check if cheetah is built as a standalone project.
66
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR CHEETAH_STANDALONE_BUILD)

README.md

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,49 @@
1+
# The OpenCilk runtime system
2+
3+
This repository contains the source code of the OpenCilk runtime system. This library is intended to be used with the [OpenCilk compiler](https://github.com/OpenCilk/opencilk-project) and can either be built [together with the compiler](https://www.opencilk.org/doc/users-guide/build-opencilk-from-source/) or as a standalone library.
4+
15
## Building a standalone copy of the OpenCilk runtime
26

3-
These instructions assume that you are building the OpenCilk runtime system
4-
using the OpenCilk compiler.
7+
These instructions assume that you are building the OpenCilk runtime system using the OpenCilk compiler.
58

69
### Using Makefiles
710

8-
1. If necessary, update the `COMPILER_BASE` variable in `config.mk` to point
9-
to the directory containing the OpenCilk compiler binaries, e.g.,
10-
`/path/to/opencilk-project/build/bin/`. When it executes `clang` and other
11-
OpenCilk compiler binaries, the Makefile prepends this path to those
12-
binaries.
11+
1. If necessary, update the `COMPILER_BASE` variable in `config.mk` to point to the directory containing the OpenCilk compiler binaries, e.g., `/path/to/opencilk-project/build/bin/`. When it executes `clang` and other OpenCilk compiler binaries, the Makefile prepends this path to those binaries.
1312
2. Run `make`.
1413

1514
To clean the build, run `make clean`.
1615

1716
### Using CMake
1817

1918
1. Make a build directory at the top level and enter it:
20-
```
21-
$ mkdir build
22-
$ cd build
23-
```
24-
2. Configure CMake. Make sure to specify `CMAKE_C_COMPILER` and
25-
`LLVM_CMAKE_DIR` to point to the corresponding build or installation
26-
of the OpenCilk compiler binaries. In addition, set
27-
`CMAKE_BUILD_TYPE` to specify the build type, such as, `Debug`, for an
28-
unoptimized build with all assertions enabled; `Release`, for an fully
29-
optimized build with assertions disabled; or `RelWithDebInfo`, to
30-
enable some optimizations and assertions. (The default build type is
31-
`Debug`.)
32-
33-
Example configuration:
34-
```
35-
$ cmake -DCMAKE_C_COMPILER=/path/to/opencilk-project/build/bin/clang -DCMAKE_BUILD_TYPE=Release -DLLVM_CMAKE_DIR=/path/to/opencilk-project/build ../
36-
```
19+
20+
```console
21+
mkdir build
22+
cd build
23+
```
24+
25+
2. Configure CMake. Make sure to specify `CMAKE_C_COMPILER`, `CMAKE_CXX_COMPILER`, and `LLVM_CMAKE_DIR` to point to the corresponding build or installation of the OpenCilk compiler binaries. In addition, set `CMAKE_BUILD_TYPE` to specify the build type, such as:
26+
27+
- `Debug`, for an unoptimized build with all assertions enabled (default);
28+
- `Release`, for an fully optimized build with assertions disabled; or
29+
- `RelWithDebInfo`, to enable some optimizations and assertions.
30+
31+
```console
32+
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/path/to/opencilk-project/build/bin/clang -DCMAKE_CXX_COMPILER=/path/to/opencilk-project/build/bin/clang++ -DLLVM_CMAKE_DIR=/path/to/opencilk-project/build ../
33+
```
34+
3735
3. Build the runtime:
38-
```
39-
$ cmake --build . -- -j<number of build threads>
40-
```
4136

42-
To clean the build, run `cmake --build . --target clean` from the build
43-
directory.
37+
```console
38+
cmake --build . -- -j<number of build threads>
39+
```
4440

45-
## Linking against a standalone build of the OpenCilk runtime
41+
To clean the build, run `cmake --build . --target clean` from the build directory.
4642

47-
The OpenCilk compiler accepts the flag
48-
`--opencilk-resource-dir=/path/to/cheetah` to specify where to find all
49-
relevant OpenCilk runtime files, including the runtime library, the
50-
bitcode ABI file, and associated header files. This resource directory
51-
should have `include/` and `lib/<target triple>` as subdirectories. For
52-
example, if you built the standalone OpenCilk runtime using CMake, then
53-
pass the flag `--opencilk-resource-dir=/path/to/cheetah/build` to the
54-
OpenCilk compiler to link against that standalone build, e.g.,
55-
```
43+
## Using a standalone build of the OpenCilk runtime
44+
45+
The OpenCilk compiler accepts the flag `--opencilk-resource-dir=/path/to/cheetah` to specify where to find all relevant OpenCilk runtime files, including the runtime library, the bitcode ABI file, and associated header files. This resource directory should have `include/` and `lib/<target triple>` as subdirectories. For example, if you built the standalone OpenCilk runtime using CMake, then pass the flag `--opencilk-resource-dir=/path/to/cheetah/build` to the OpenCilk compiler to link against that standalone build as follows:
46+
47+
```console
5648
/path/to/opencilk-project/build/bin/clang -o fib fib.c -fopencilk -O3 --opencilk-resource-dir=/path/to/cheetah/build
5749
```

cmake/Modules/AddCheetah.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ function(add_cheetah_runtime name type)
358358
if (NEED_EXPLICIT_ADHOC_CODESIGN)
359359
add_custom_command(TARGET ${libname}
360360
POST_BUILD
361-
COMMAND codesign --sign - $<TARGET_FILE:${libname}>
361+
COMMAND codesign --sign - -f $<TARGET_FILE:${libname}>
362362
WORKING_DIRECTORY ${CHEETAH_OUTPUT_LIBRARY_DIR}
363363
)
364364
endif()

config.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ CXX=$(COMPILER_BASE)clang++
88
LINK_CC=$(CC)
99
LLVM_LINK=$(COMPILER_BASE)llvm-link
1010
LLVM_CONFIG=$(COMPILER_BASE)llvm-config
11+
AR=ar
12+
#AR=$(COMPILER_BASE)llvm-ar
1113
#
1214
ABI_DEF?=-DOPENCILK_ABI
1315
# If use cheetah
@@ -20,7 +22,8 @@ RTS_PEDIGREE_LIB?=libopencilk-pedigrees
2022
# All runtime libraries and associated files will be placed in
2123
# `/oath/to/cheetah/lib/<target-triple>`, so that the compiler can easily find
2224
# all of those files using the flag --opencilk-resource-dir=/path/to/cheetah.
23-
RTS_LIBDIR_NAME?=lib/$(shell $(LLVM_CONFIG) --host-target)
25+
TARGET?=$(shell $(LLVM_CONFIG) --host-target)
26+
RTS_LIBDIR_NAME?=lib/$(TARGET)
2427
RESOURCE_DIR?=$(CONFIG_DIR)
2528
RTS_LIBDIR?=$(RESOURCE_DIR)/$(RTS_LIBDIR_NAME)
2629
RTS_OPT?=-fopencilk --opencilk-resource-dir=$(RESOURCE_DIR)

0 commit comments

Comments
 (0)