Bug 268701 - devel/root: upgrade to ROOT v6.26/10
Summary: devel/root: upgrade to ROOT v6.26/10
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Nuno Teixeira
URL: https://root.cern/doc/v626/release-no...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-02 03:58 UTC by Erik Jensen
Modified: 2023-01-10 09:23 UTC (History)
2 users (show)

See Also:


Attachments
upgrade to ROOT v6.26/10 (539.53 KB, patch)
2023-01-02 03:58 UTC, Erik Jensen
no flags Details | Diff
devel_root02.diff (123.36 KB, patch)
2023-01-08 16:06 UTC, Erik Jensen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Jensen 2023-01-02 03:58:02 UTC
Created attachment 239188 [details]
upgrade to ROOT v6.26/10

- Release notes at https://root.cern/doc/v626/release-notes.html#release-6.2610
- Port now compiles against C++17
- Added build of ROOT v7 preview features as default build option

A fork of the ROOT project repo (https://github.com/root-project/root) with *.orig files, patch files and a short README is located here: https://github.com/eamjensen/root-fbsd
Comment 1 Fernando Apesteguía freebsd_committer freebsd_triage 2023-01-05 07:03:14 UTC
Hi Erik,

Is this patch correct? The diff seems to mark as changed lines that actually don't change:

@@ -1,66 +1,68 @@
-PORTNAME=	root <----
-DISTVERSION=	6.26.06
-CATEGORIES=	devel science math parallel python
-MASTER_SITES=	https://root.cern/download/
-DISTFILES=	${PORTNAME}_v${DISTVERSION}.source${EXTRACT_SUFX}
+PORTNAME=     root <----
+DISTVERSION=  6.26.10
+CATEGORIES=   devel science math parallel python
+MASTER_SITES= https://root.cern/download/
+DISTFILES=    ${PORTNAME}_v${DISTVERSION}.source${EXTRAC
Comment 2 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-05 10:33:43 UTC
PORTNAME=	root (tab)
PORTNAME=     root (spaces)

It seams that tabs where replaced with spaces maybe by text editor.
Comment 3 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-05 10:47:14 UTC
Setting CMAKE_ARGS= -DCMAKE_CXX_STANDARD=17 will enable root7 by default, so option ROOT7 will have no effect.

Sugestion is using flavor root{-root7}:

- default flavor: root
- second flavour: root-root7

pkg-plist will be different for both.

Or use CMAKE_ARGS= -DCMAKE_CXX_STANDARD=14 (minimum required) for normal version and CMAKE_ON= root7 for option ROOT7
Comment 4 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-05 10:59:58 UTC
from https://root.cern/install/build_from_source/#enabling-experimental-features-aka-root7
---
Enabling experimental features, aka ROOT7Permalink

New and improved versions of standard ROOT components are being implemented under codename ROOT7.

Turning on C++17 (or C++14 until v6.24; see Setting the C++ standard) or higher will automatically enable ROOT7. Alternatively, you can explicitly enable ROOT7 with -Droot7=ON, which will in turn set the standard to C++17 (or C++14 until v6.24) if a value was not already specified by the user.
---
Comment 5 Erik Jensen 2023-01-05 20:19:46 UTC
(In reply to Nuno Teixeira from comment #3)
Hi Nuno :-)

Based on the documentation, I also expect ROOT7 to be automatically enabled when C++17 is chosen as standard, but in actuality, when I run `poudriere testport` on this patch, this only happens when I also let
  
  OPTIONS_DEFAULT=  ROOT7

in the Makefile. If I comment this line out, but leave everything else as it is in the Makefile, "OPTIONS_DEFINE=   DOCS ROOT7", then C++17 is the compilation standard, but ROOT7 is not enabled.

Final few lines of output from CMake config step with C++17 and ROOT7 enabled:
"-- Enabled support for:  asimage builtin_clang builtin_cling builtin_ftgl builtin_gl2ps builtin_llvm builtin_nlohmannjson builtin_openui5 builtin_xxhash dataframe exceptions fftw3 fitsio gdml gnuinstall http imt mathmore mlp minuit2 mysql opengl pgsql pyroot roofit webgui root7 rpath runtime_cxxmodules shared soversion sqlite ssl tmva tmva-cpu tmva-pymva spectrum vdt x11 xml xrootd"

Final few lines of output from CMake config step with C++17 and ROOT7 disabled:
"-- Enabled support for:  asimage builtin_clang builtin_cling builtin_ftgl builtin_gl2ps builtin_llvm builtin_nlohmannjson builtin_openui5 builtin_xxhash dataframe exceptions fftw3 fitsio gdml gnuinstall http imt mathmore mlp minuit2 mysql opengl pgsql pyroot roofit webgui root7 rpath runtime_cxxmodules shared soversion sqlite ssl tmva tmva-cpu tmva-pymva spectrum vdt x11 xml xrootd"
Comment 6 Erik Jensen 2023-01-05 20:21:50 UTC
(In reply to Nuno Teixeira from comment #3)
Anyway, this idea of using flavors could still be interesting.
Which solution do you prefer, if the current Makefile and pkg-plist combination otherwise works?
Comment 7 Erik Jensen 2023-01-05 20:24:47 UTC
(In reply to Nuno Teixeira from comment #2)
By the way, maybe I have missed the place where this is written down, but is the convention generally to have a single tab, only and always, after every "=" in port Makefiles? And continued lines are then adjusted to match the indentation of the assignment?
Comment 8 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-05 20:29:33 UTC
(In reply to Erik Jensen from comment #6)

2 flavours will build 2 pkgs.
With options only one pkg will be built based on options defauld.
Comment 9 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-05 20:30:31 UTC
(In reply to Erik Jensen from comment #7)

One tab usually is enough, but sometimes 2 tabs for cosmetic (portfmt).
Comment 10 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-05 20:32:21 UTC
(In reply to Erik Jensen from comment #5)

OK, if that works fine and it build root7 and normal with c++17 independent then we good.
Comment 11 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-05 20:42:55 UTC
(In reply to Erik Jensen from comment #0)

Editing ports files could not modify original formating or diff will be shown to modify all lines, e.g., Makefile.

You should edit and change only parameters that are really needed, keeping original formating unchanged.

Please send a corrected diff so I can test. I will do further testing on flavours after that to see if it applies good to this port.

I usually use flavours when port support qt5/qt6, gtk2/gtk3/gtk4, same port with different base support, need to check if it applies correctly to a normal/+experimental features port.

But OPTION= root7 is the most correct way for this case.

Cheers
Comment 12 Erik Jensen 2023-01-06 09:54:51 UTC
(In reply to Nuno Teixeira from comment #11)
I will send a corrected diff soon.

In the meantime, I have received some emails from pkg-fallout regarding build of root v6.26.06 on 123amd64 and 131arm64, so I will debug this and include it in my corrected diff.

Again, the version of LLVM/Clang on FreeBSD 12 has a few special cases that need handling, and fixing the port to build on arm64 might be a lot easier than I could otherwise have feared :-)
Comment 13 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-06 11:16:05 UTC
(In reply to Erik Jensen from comment #12)

12.3 is eoled but still used in pkg builders.
Port was tested OK on 12.4{amd64,i386} with updated clang 13.0.0:
(12.4 Release Notes: The LLVM toolchain suite has been updated to version 13.0.0. 838e2fa19531)

Nice to hear! Waiting for your patch.
Comment 14 Erik Jensen 2023-01-08 16:06:28 UTC
Created attachment 239343 [details]
devel_root02.diff

upgrade to ROOT v6.26/10 plus a few port fixes

- Release notes at https://root.cern/doc/v626/release-notes.html#release-6.2610
- Port now compiles against C++17
- Added build of ROOT v7 preview features as default build option
- Added dependencies on devel/nlohmann-json, graphics/ftgl, print/gl2ps and devel/xxhash so ROOT does not use builtin versions of these libraries
- ROOT now builds on FreeBSD 12.3 (uses LLVM/Clang 10.0.1) -- a bit of .modulemap hacking was necessary; tested in poudriere jail on my own system
- ROOT *should* build on arm64 -- some files are not installed on arm64 and some files are named differently (re: https://pkg-status.freebsd.org/ampere3/data/131arm64-default/33c48239fb6d/logs/root-6.26.06.log)

A fork of the ROOT project repo (https://github.com/root-project/root) with *.orig files, patch files and a short README is located here: https://github.com/eamjensen/root-fbsd
Comment 15 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-09 20:15:52 UTC
124amd64: clang 13.0.0
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: lib/root/std_config.pcm

# File only installed with LLVM/Clang 13 (used on FreeBSD 13)
.if 1299999 < ${OSVERSION} && ${OSVERSION} < 1400000
PLIST_FILES+=   lib/root/std_config.pcm
.endif

Should be changed to:

# File only installed with LLVM/Clang 13 (used on FreeBSD 12.4 and 13.x)
.if 1204000 <= ${OSVERSION} && ${OSVERSION} < 1400000
PLIST_FILES+=   lib/root/std_config.pcm
.endif

Could you check it? No need to upload a new diff
Comment 16 Erik Jensen 2023-01-09 21:25:00 UTC
(In reply to Nuno Teixeira from comment #15)
Yes, you are completely right. I saw your comment #13 regarding FreeBSD 12.3 and 12.4, but forgot to handle this properly in the Makefile. 

Actually, I also realised, after submitting the new diff, that if the port is built with LLVM/Clang 13 on arm64, then this single .pcm file should be renamed accordingly. 

So a final modification would be

# File only installed with LLVM/Clang 13 (used on FreeBSD 12.4 and 13.x)
.if (1299999 < ${OSVERSION} && ${OSVERSION} < 1400000)
PLIST_FILES+=	lib/root/std_config${AARCH64_PCM_SUFFIX}.pcm
.endif

Just tested in a poudriere jail on 12.4, and it builds.
Comment 17 Erik Jensen 2023-01-09 21:27:20 UTC
(In reply to Erik Jensen from comment #16)
Sorry!
I meant:

# File only installed with LLVM/Clang 13 (used on FreeBSD 12.4 and 13.x)
.if 1204000 <= ${OSVERSION} && ${OSVERSION} < 1400000
PLIST_FILES+=	lib/root/std_config${AARCH64_PCM_SUFFIX}.pcm
.endif
Comment 18 commit-hook freebsd_committer freebsd_triage 2023-01-10 09:17:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e9e0b380a1ec9ac63ca76da8bc5d9c38e49d38d4

commit e9e0b380a1ec9ac63ca76da8bc5d9c38e49d38d4
Author:     Erik Jensen <erik@tenku.dk>
AuthorDate: 2023-01-10 09:06:11 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2023-01-10 09:15:46 +0000

    devel/root: Update to 6.26/10

    - Port now compiles against C++17
    - Added build of ROOT v7 preview features as default build option
    - Added dependencies on devel/nlohmann-json, graphics/ftgl, print/gl2ps
      and devel/xxhash so ROOT does not use builtin versions of these libraries
    - ROOT now builds on FreeBSD 12.3 (uses LLVM/Clang 10.0.1) -- a bit of
      .modulemap hacking was necessary; tested in poudriere jail on my own system
    - ROOT *should* build on arm64 -- some files are not installed on arm64
      and some files are named differently

    ChangeLog:      https://root.cern/doc/v626/release-notes.html#release-6.2610
    PR:             268701

 devel/root/Makefile                                |   57 +-
 devel/root/distinfo                                |    6 +-
 devel/root/pkg-plist                               | 1565 ++++++++++++++++++--
 .../remove-modules-from-modulemap.sh (new +x)      |   27 +
 4 files changed, 1503 insertions(+), 152 deletions(-)
Comment 19 Nuno Teixeira freebsd_committer freebsd_triage 2023-01-10 09:23:04 UTC
Committed, thanks!