Skip to content

Commit b83bce1

Browse files
committed
adding ValenciaPlugin
1 parent b12021d commit b83bce1

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

.ci/build_tarballs.jl

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
# Note that this script can accept some limited command-line arguments, run
22
# `julia build_tarballs.jl --help` to see a usage message.
33
using BinaryBuilder
4+
using Pkg
45

56
name = "FastJet_Julia_Wrapper"
6-
version_number = get(ENV, "TRAVIS_TAG", "")
7-
if version_number == ""
8-
version_number = "v0.99"
9-
end
10-
version = VersionNumber(version_number)
7+
version = v"0.7.0"
118

129
# Collection of sources required to build Fjwbuilder
1310
sources = [
14-
"FastJet_Julia_Wrapper",
11+
DirectorySource("FastJet_Julia_Wrapper"),
1512
ArchiveSource("https://julialang-s3.julialang.org/bin/linux/x64/1.3/julia-1.3.1-linux-x86_64.tar.gz", "faa707c8343780a6fe5eaf13490355e8190acf8e2c189b9e7ecbddb0fa2643ad"; unpack_target="julia-x86_64-linux-gnu"),
1613
]
1714

1815
# Bash recipe for building across all platforms
1916
script = raw"""
20-
Julia_PREFIX=${WORKSPACE}/srcdir/julia-$target/julia-1.3.1
17+
case "$target" in
18+
arm-linux-gnueabihf|x86_64-linux-gnu)
19+
Julia_PREFIX=${WORKSPACE}/srcdir/julia-$target/julia-1.3.1
20+
;;
21+
x86_64-apple-darwin14|x86_64-w64-mingw32)
22+
Julia_PREFIX=${WORKSPACE}/srcdir/julia-$target/juliabin
23+
;;
24+
esac
2125
cd ${WORKSPACE}/srcdir
2226
mkdir build && cd build
23-
export JlCxx_DIR=${prefix}
2427
cmake -DJulia_PREFIX=${Julia_PREFIX} -DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_FIND_ROOT_PATH=${prefix} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release ..
2528
VERBOSE=ON cmake --build . --config Release --target install
29+
install_license $WORKSPACE/srcdir/LICENSE.md
2630
"""
2731

2832
# These are the platforms we will build for by default, unless further
@@ -41,7 +45,8 @@ products = [
4145
dependencies = [
4246
Dependency("libcxxwrap_julia_jll"),
4347
Dependency("FastJet_jll")
48+
# Dependency(PackageSpec(;name="FastJet_jll", url="https://github.com/jstrube/FastJet_jll.jl"))
4449
]
4550

4651
# Build the tarballs, and possibly a `build.jl` as well.
47-
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"8")
52+
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"9")

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ include(InstallRequiredSystemLibraries)
2323
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
2424
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-parameter -Wextra -Wreorder")
2525
endif()
26-
#set(CMAKE_CXX_STANDARD 17)
26+
set(CMAKE_CXX_STANDARD 17)
2727
add_definitions(-DJULIA_ENABLE_THREADING)
2828
# JlCxx_DIR needs to be passed in with -D
2929
find_package(JlCxx REQUIRED )
@@ -44,7 +44,7 @@ link_directories(${CMAKE_INSTALL_PREFIX}/lib lib)
4444
######################################################
4545
# add_library(fjcore SHARED src/fjcore)
4646
add_library(fastjetwrap SHARED src/fastJetWrap.cc)
47-
target_link_libraries(fastjetwrap JlCxx::cxxwrap_julia JlCxx::cxxwrap_julia_stl fastjet)
47+
target_link_libraries(fastjetwrap JlCxx::cxxwrap_julia JlCxx::cxxwrap_julia_stl fastjet ValenciaPlugin)
4848
install(TARGETS
4949
fastjetwrap
5050
LIBRARY DESTINATION lib${LIBDIR_SUFFIX}

src/fastJetWrap.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "jlcxx/stl.hpp"
33

44
#include "fastjet/ClusterSequence.hh"
5-
// #include "fjcore.hh"
5+
#include "fastjet/ValenciaPlugin.hh"
66
#include <vector>
77

88
using namespace std;
@@ -106,6 +106,16 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& fastjet)
106106
fastjet.add_type<JetDefinition>("JetDefinition")
107107
.constructor<const JetAlgorithm, double>();
108108

109+
fastjet.add_type<JetDefinition::Plugin>("JetDefinitionPlugin");
110+
111+
fastjet.add_type<contrib::ValenciaPlugin>("ValenciaPlugin", jlcxx::julia_base_type<JetDefinition::Plugin>())
112+
.constructor<double, double>()
113+
.constructor<double, double, double>();
114+
115+
fastjet.method("JetDefinition", [](const JetDefinition::Plugin* p) {
116+
return JetDefinition(p);
117+
});
118+
109119
fastjet.method("constituents", [](const PseudoJet& pj) {
110120
return pj.constituents();
111121
});

0 commit comments

Comments
 (0)