njoy / NJOY2016

Nuclear data processing with legacy NJOY
https://www.njoy21.io/NJOY2016
Other
96 stars 86 forks source link

Q: Any interest in CPack configurations for creating common installers? #252

Open bapthorpe opened 2 years ago

bapthorpe commented 2 years ago

Is there any interest in extending the CMake configuration to create installable packages?

I've been using NJOY2016 as a test project to work through some build environment issues (remote development on Windows over SSH to a Linux virtual). As part of testing our CMake installation, I added packaging directives for Linux (deb and RPM), MacOS, and Windows packaging directives for creating executable, MSI, and nupkg installers based on work I've done to package other safety analysis codes. Basic archives, DEB and RPM generation are confirmed to work; Windows, and MacOS packaging have not been tested but are based on working production examples.

Attached is a proof-of-concept modification of CMakeLists.txt. Review and modification of some fields is necessary, mainly in administrative details like points of contact, vendor name, software description, URLs, etc.. Windows support also requires icon files, an upgrade GUID (the one supplied should be sufficient but it's probably safer to create a new one), the license file in RTF format, and a few other files but nothing too onerous.

It wasn't clear if the test data should be packaged for distribution or where it should be installed so the directives for packaging the tests subdirectory are commented out. Likewise, it may be helpful to generate documentation as part of the build process and install only the generated results. For the purpose of illustration, the docs directory is included in its entirety with no additional processing.

If this looks reasonable, I can prepare a PR incorporating any comments you have. CMakeLists.txt

FWIW, packaging is a rather esoteric niche, especially with scientific code and MacOS and Windows. However it really simplifies configuration control when working under NQA-1 rules for safety-related software, reactor design, etc.

whaeck commented 2 years ago

I think this is something we should explore. Nathan, who maintains our CMake files, is currently away from the lab but I'll talk to him as soon as he's back.

bapthorpe commented 2 years ago

Great! I'm out until next Thursday (7/28) but I'll check in periodically.