-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from JuliaHEP/new-wrapit
Prepare to use WrapIt.jl
- Loading branch information
Showing
12 changed files
with
76 additions
and
39 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,7 +1,7 @@ | ||
name = "PYTHIA8" | ||
uuid = "ab9774ad-7527-4370-92ef-86b02700ecc9" | ||
authors = ["Pere Mato <[email protected]>"] | ||
version = "0.2.0" | ||
version = "0.2.1" | ||
|
||
[deps] | ||
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[deps] | ||
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4" | ||
PYTHIA_jll = "47b8ac8e-e87e-59c1-8ebd-407ebead3f7c" | ||
WrapIt = "962878d8-9763-11ee-8c14-fbf60c98afae" |
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
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,22 +1,47 @@ | ||
using CxxWrap | ||
using PYTHIA_jll | ||
#using WrapIt | ||
|
||
#---Build the wrapper library---------------------------------------------------------------------- | ||
builddir = joinpath(@__DIR__, "build") | ||
sourcedir = @__DIR__ | ||
cd(@__DIR__) | ||
mkpath(builddir) | ||
cd(builddir) | ||
|
||
if Sys.isapple() | ||
ENV["SDKROOT"]=readchomp(`xcrun --sdk macosx --show-sdk-path`) | ||
end | ||
|
||
cxxwrap_prefix = CxxWrap.prefix_path() | ||
pythia8_prefix = PYTHIA_jll.artifact_dir | ||
julia_prefix = dirname(Sys.BINDIR) | ||
|
||
#---Generate the wrapper code---------------------------------------------------------------------- | ||
updatemode = ("--update" ∈ ARGS) | ||
updatemode && println("Update mode") | ||
wit = joinpath(@__DIR__, "Pythia8.wit") | ||
witin = joinpath(@__DIR__, "Pythia8.wit.in") | ||
open(wit, "w") do f | ||
for l in eachline(witin) | ||
println(f, replace(l, "@Pythia8_INCLUDE_DIR@" => "$pythia8_prefix/include", | ||
"@Julia_INCLUDE_DIR@" => "$julia_prefix/include/julia", | ||
"@JlCxx_INCLUDE_DIR@" => "$cxxwrap_prefix/include", | ||
"@CxxWrap_VERSION@" => "$(pkgversion(CxxWrap))")) | ||
end | ||
end | ||
|
||
#rc = wrapit(wit, force=true, cmake=false, update=updatemode, verbosity=1) | ||
rc = run(`wrapit $wit --force -v 1`).exitcode | ||
|
||
|
||
if !isnothing(rc) && rc != 0 | ||
println(stderr, "Failed to produce wrapper code with the wrapit function. Exited with code ", rc, ".") | ||
exit(rc) | ||
end | ||
|
||
#---Build the wrapper library---------------------------------------------------------------------- | ||
cd(builddir) | ||
run(`cmake -DCMAKE_BUILD_TYPE=Release | ||
-DCMAKE_CXX_STANDARD=17 | ||
-DCMAKE_PREFIX_PATH=$cxxwrap_prefix\;$pythia8_prefix $sourcedir | ||
-DCxxWrap_VERSION=$(pkgversion(CxxWrap))`) | ||
-DCMAKE_PREFIX_PATH=$cxxwrap_prefix\;$pythia8_prefix $sourcedir`) | ||
run(`cmake --build . --config Release --parallel 8`) |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// BinaryBuilder uses old SDK which doesn't have ranges | ||
#ifdef __APPLE__ | ||
#undef JLCXX_HAS_RANGES | ||
#endif |
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
197a149
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
Release notes:
New functionality
gen/build.jl
to use the WrapIt.jl package instead of a locally installedwrapit
Fixes
cd
to avoid warnings197a149
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/119886
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: