-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Angelina Lee <angelee@gmail.com>
- Loading branch information
Showing
107 changed files
with
5,471 additions
and
14,279 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,53 @@ | ||
How to build runtime independently from OpenCilk using Makefiles: | ||
- update COMPILER_BASE variable the config.mk to point to the right path | ||
to /path/to/opencilk-project/build/bin (or where its binaries are installed) | ||
- type 'make' | ||
|
||
======================================= | ||
|
||
How to build runtime independently from OpenCilk using cmake: | ||
- make a build directory at top level and go into it: | ||
> mkdir build | ||
> cd build | ||
- do the cmake configuration step | ||
> cmake -DCMAKE_BUILD_TYPE=Debug ../ | ||
- use cmake to build | ||
> cmake --build . -- -j<num of cores> | ||
Note: you can use CMake flags at the configuration step, like | ||
-DCMAKE_C_COMPILER, -DCMAKE_CXX_COMPILER, -DCMAKE_C_FLAGS, etc. | ||
|
||
======================================= | ||
|
||
How to link with the runtime independently compiled from OpenCilk: | ||
setup your LIBRARY_PATH and LD_LIBRARY_PATH to point to | ||
/path/to/cheetah/runtime | ||
|
||
(that's where you can find libopencilkd.a and libopencilk.so) | ||
|
||
Alternatively, the compiler by default will look for header files (such as | ||
cilk/cilk.h) in /path/to/opencilk-project/build/lib/clang/9.0.1/include/ | ||
and will look for libraries in | ||
/path/to/opencilk-project/build/lib/clang/9.0.1/lib/<something>/ | ||
where <something> encodes the architecture and OS | ||
|
||
You can copy the necessary header files and compiled libopencilk.* | ||
to these directories where opencilk-project is installed. | ||
|
||
## Building a standalone copy of the OpenCilk runtime | ||
|
||
These instructions assume that you are building the OpenCilk runtime system | ||
using the OpenCilk compiler. | ||
|
||
### Using Makefiles | ||
|
||
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. | ||
2. Run `make`. | ||
|
||
To clean the build, run `make clean`. | ||
|
||
### Using CMake | ||
|
||
1. Make a build directory at the top level and enter it: | ||
``` | ||
$ mkdir build | ||
$ cd build | ||
``` | ||
2. Configure CMake. In particular, make sure to specify `CMAKE_C_COMPILER` | ||
and `LLVM_CONFIG_PATH` to point to the corresponding OpenCilk compiler | ||
binaries. For example: | ||
``` | ||
$ cmake -DCMAKE_C_COMPILER=/path/to/opencilk-project/build/bin/clang -DLLVM_CONFIG_PATH=/path/to/opencilk-project/build/bin/llvm-config ../ | ||
``` | ||
3. Build the runtime: | ||
``` | ||
$ cmake --build . -- -j<number of build threads> | ||
``` | ||
|
||
*Note:* During step 2, you can specify other CMake flags at this step as | ||
well, such as `CMAKE_BUILD_TYPE` or `CMAKE_C_FLAGS`. | ||
|
||
To clean the build, run `cmake --build . --target clean` from the build | ||
directory. | ||
|
||
## Linking against a standalone build of the OpenCilk runtime | ||
|
||
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, e.g., | ||
``` | ||
/path/to/opencilk-project/build/bin/clang -o fib fib.c -fopencilk -O3 --opencilk-resource-dir=/path/to/cheetah/build | ||
``` |
Oops, something went wrong.