You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compile/README.md
+22-4Lines changed: 22 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
Minimal C bindings for JetReconstruction.jl
4
4
5
-
-[C-header](include/JetReconstruction.h)
6
-
- shared library compiled with [PackageCompiler.jl](https://github.com/JuliaLang/PackageCompiler.jl)
5
+
-[C-header](include/JetReconstruction.h.in)
6
+
- shared library compiled with [PackageCompiler.jl](https://github.com/JuliaLang/PackageCompiler.jl) or juliac
7
7
8
8
## Building library
9
9
@@ -13,6 +13,16 @@ To build the library, run the following command from the package root directory:
13
13
julia --project=compile compile/build.jl
14
14
```
15
15
16
+
> [!NOTE]
17
+
> Since Julia 1.12 `--juliac` can be specified to use the juliac compiler instead of PackageCompiler.
18
+
> Before Julia 1.12, nightlies can be used instead:
19
+
>
20
+
> ```sh
21
+
> julia +nightly --project=compile compile/build.jl --juliac
22
+
>```
23
+
>
24
+
> Packes compiled with `PackageCompiler.jl` will have `JETRECONSTRUCTION_COMPILER_PACKAGECOMPILER` defined. Packages compiled with `juliac` will have `JETRECONSTRUCTION_COMPILER_JULIAC` defined.
25
+
16
26
## Usage example
17
27
18
28
### Example source file
@@ -21,10 +31,16 @@ Example usage of C bindings in an application:
21
31
22
32
```C
23
33
#include "JetReconstruction.h"
24
-
#include"julia_init.h"/*Should be automatically generated by PackageCompiler.jl and distributed together with the "JetReconstruction.h" header file*/
34
+
35
+
/*Should be automatically generated by PackageCompiler.jl and distributed together with the "JetReconstruction.h" header file*/
36
+
#ifdef JETRECONSTRUCTION_COMPILER_PACKAGECOMPILER
37
+
#include "julia_init.h"
38
+
#endif
25
39
26
40
int main(int argc, char *argv[]) {
27
-
init_julia(argc, argv); /*initialization of julia runtime*/
41
+
#ifdef JETRECONSTRUCTION_COMPILER_PACKAGECOMPILER
42
+
init_julia(0, NULL); /*initialization of julia runtime*/
43
+
#endif
28
44
29
45
/*Prepare array of pseudo jets*/
30
46
size_t particles_len;
@@ -47,7 +63,9 @@ int main(int argc, char *argv[]) {
0 commit comments