Newer
Older
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## Development notes
- How do i do debug builds?
You use `build_debug.sh`. Note that it removes the
build directory fully before it attempts to build
the project. `CMakeLists.txt` sets two variables
`CMAKE_CXX_FLAGS_DEBUG` and `CMAKE_LINKER_FLAGS_DEBUG`
that configure the debug build. Cmake will only
recognize these flags if you use `build_debug.sh`.
- How to re-build if I only changed a little code and
want to keep the current build config as is?
Just use `./rebuild.sh`. It does not remove
the build directory, and only runs make again which
will only rebuild the object files affected by your
change. Use `./rebuild.sh -m some_obj_in_src.cpp.o`
to just build one object. This is useful if you
struggle with compiler output.
- How do I test the build?
You use `./test.sh` with some flags.
Use `./test.sh -n <testName>` to run a specific test.
Use `./test.sh -N` to list all tests.
Use `./test.sh -l <labelName>` to run a group of tests
with a specific label. Query label names via
`./test.sh -s`. Check the output of the last
test with `./test.sh -e`.
- How do I create a test?
Either you copy and paste some code from the
test_XXX directories or you use the helper
script `generate_module_test.sh`. Use the
`-h` flag for documentation.
- What is the difference between `lib_full_test`, `lib_test`?
`lib_full_test` holds headers and source files to be linked
to test source files that orka modifies (remember, orka emits modified
C soruces). `lib_test` holds functions primarily used
by module tests in `tests_orka_module`.
- What goes into the different `test_XXX` directories?
`tests_automated_stable` holds full tests, i.e. tests where
a C source containing openmp target pragmas is source-to-source
translated via orka.
`tests_orka_module` holds module tests, i.e. tests that
tests certain implementation details in isolation.
`tests_openmp` holds module tests that test openmp
related implementation details. `tests_orkaxomp` holds tests
for the runtime library. `tests_rose` holds module tests
that demonstrate and document ROSE's features and quirks.
`tests_semi_automated` is a test playground.
`tests_spec_accel` only holds spec accel tests and consists
of a git submodule because of licensing issues.
- Use `clang-format` (version 16 or above) to format the
OpenMP inputs to orka. `clang-format` version 15 or lower
does not format OpenMP target pragmas properly. "But on
my Ubuntu 20.04 I cannot get `clang-format` version 16!"
Just add this line to your `/etc/apt/sources.list`
`deb http://apt.llvm.org/focal/ llvm-toolchain-focal-16 main`,
Acquire the gpg key via `$ wget https://apt.llvm.org/llvm-snapshot.gpg.key`
and add it to apt with `$ sudo apt-key add llvm-snapshot.gpg.key`.
## Usage examples
```shell
./orka --rose:openmp:ast_only \
"--log=Orka(DEBUG)" --mode BASE \
testcode/omp_calc_pi.c -o omp_calc_pi -lm
```