Promote appl2pine
and fnlo2pine
from example programs to subcommands in the CLI
#115
Replies: 2 comments 5 replies
-
@alecandido thanks, you pretty much spelled out what I was thinking. Let me extend a bit: From a user's point of view I think that the best would be to have a subcommand
I'm not quite sure about the technical issues; the easiest is certainly fastNLO, because we can use it as is, whereas for APPLgrid we need to use a bundled and patched version, most likely. Meson we certainly don't need, we only need to call |
Beta Was this translation helpful? Give feedback.
-
A couple of interesting resources, in case we're really going for binary distribution at some point:
|
Beta Was this translation helpful? Give feedback.
-
I'm not properly understanding what do you (@cschwan) mean by "proper programs" https://github.com/NNPDF/runcards/issues/123#issuecomment-1044133667. Therefore, I'll make some assumptions, and spell out my ideas, even when trivial, and you've already thought about them. This way, you will correct me where I'm wrong (you're for sure much more expert than me in C/C++ code compilation), and we'll have a common ground.
I'll assume that, as you say for fastNLO, you'd like to make them part of PineAPPL CLI, so either as source or compiled.
In any case, I'd use
cargo
as far as possible as build tool (not puttingcargo
inside another build tool), and make both fastNLO and APPLgrid optional (so scope them asfeatures
).Distributing source
This is just the simpler version, but contains the whole complication of writing the thing itself.
From my point of view, what we want is to compile
appl2pine
andfnlo2pine
in libraries, providing essentially one function each (in place of main), that will be consumed by PineAPPL CLI.In rust should be not so unusual to consume C libraries, and I believe we can compile altogether in one step, without anything else than
cargo
. This should be doable with build scripts and thecc
crate, as written on Cargo Book - Build Scripts.What I don't know here is can
cc
replace all you are using frommeson
?.meson
for sure will be able to do much more thancc
alone, but you don't use the fullmeson
, and maybe there are other crates that can help (something likepkg_config
, for example).Afterwards, we should be able to bind it with
extern "C" {}
, but here you are the expert (you already went at least once from C to Rust, inlhapdf
).Distributing binaries
This is a pain in the neck, but still doable in CD (worst case compiling in containers). We are not even doing right now, apart from the python package (and you know it has been painful).
Essentially, it adds almost nothing to the former section, it only has to be decided if linking statically or dynamically with libraries, and writing the workflows.
If possible, I'd go for dynamical linking (to shrink the size of the binary), but it's further pain.
Beta Was this translation helpful? Give feedback.
All reactions