From fa1c7f77697387fe63ada777287bb4d1227ba97f Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 30 Jun 2025 23:38:28 +0200 Subject: [PATCH 1/4] [fortran] fix bug when copying/memmoving string happens maybe only in some gfortran versions in mac13 and mac14 CI, the last bytes of chopt were being set to garbage memory, which later led to failures due to wrong options being set. chopt was being set to "px exam" where choptt was "px " and "exam" was the first chars of the parameter PASSCHAR("example") on the C side in h2root.cxx --- misc/minicern/src/hbook.f | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/minicern/src/hbook.f b/misc/minicern/src/hbook.f index 522c731686169..6c107c3ff1c4b 100644 --- a/misc/minicern/src/hbook.f +++ b/misc/minicern/src/hbook.f @@ -249,6 +249,9 @@ SUBROUTINE HROPEN(LUN,CHDIR,CFNAME,CHOPTT,LRECL,ISTAT) CHARACTER*(*) CFNAME,CHDIR,CHOPTT CHARACTER*8 CHOPT CHOPT=CHOPTT + DO 11 I=LEN(CHOPTT)+1,8 + CHOPT(I:I) = ' ' + 11 CONTINUE CALL CLTOU(CHOPT) DO 10 I=1,NCHTOP IF(CFNAME.EQ.HFNAME(I))THEN From 4661a7e953a8b5f9d3b785f78d6802a2ffed6242 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 30 Jun 2025 23:42:07 +0200 Subject: [PATCH 2/4] [h2root] revert workaround in C now that it's fixed on Fortrans side --- main/src/h2root.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/main/src/h2root.cxx b/main/src/h2root.cxx index b839c9d8319b4..c119b2e40100c 100644 --- a/main/src/h2root.cxx +++ b/main/src/h2root.cxx @@ -312,11 +312,7 @@ int main(int argc, char **argv) int lun = 10; #ifndef WIN32 - // "px" is a string being changed to "pxc" in the fortran side; since it's a temporary on C's side, - // we need a buffer of at least 3 chars on Cs side, too. Predefine it as a extra variable "px " since that way - // the space will be replaced by 'c' on the preallocated memory, instead of appending a new char (new memory) to "px". - auto opt = PASSCHAR("px "); - hropen(lun,PASSCHAR("example"),PASSCHAR(file_in),opt,record_size,ier,7,strlen(file_in),2); + hropen(lun,PASSCHAR("example"),PASSCHAR(file_in),PASSCHAR("px"),record_size,ier,7,strlen(file_in),2); #else hropen(lun,PASSCHAR("example"),PASSCHAR(file_in),PASSCHAR("px"),record_size,ier); #endif From c090c7a57c4d5ed4c5e4e73b5b5f1ab730602bec Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 30 Jun 2025 23:58:32 +0200 Subject: [PATCH 3/4] [ci] enable fortran on macos now that bug is gone --- .github/workflows/root-ci-config/buildconfig/mac13.txt | 2 +- .github/workflows/root-ci-config/buildconfig/mac14.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/root-ci-config/buildconfig/mac13.txt b/.github/workflows/root-ci-config/buildconfig/mac13.txt index f1206b5371ce9..ca7b20ae43bee 100644 --- a/.github/workflows/root-ci-config/buildconfig/mac13.txt +++ b/.github/workflows/root-ci-config/buildconfig/mac13.txt @@ -1,3 +1,4 @@ +CMAKE_BUILD_RPATH=/usr/local/lib asimage_tiff=OFF builtin_cfitsio=ON builtin_cppzmq=ON @@ -27,7 +28,6 @@ builtin_zeromq=ON builtin_zstd=ON ccache=ON cocoa=ON -fortran=OFF minuit2_omp=OFF pythia8=OFF test_distrdf_dask=ON diff --git a/.github/workflows/root-ci-config/buildconfig/mac14.txt b/.github/workflows/root-ci-config/buildconfig/mac14.txt index a43856231ec74..a4fb57f2322ac 100644 --- a/.github/workflows/root-ci-config/buildconfig/mac14.txt +++ b/.github/workflows/root-ci-config/buildconfig/mac14.txt @@ -1,3 +1,4 @@ +CMAKE_BUILD_RPATH=/usr/local/lib asimage_tiff=OFF builtin_cfitsio=ON builtin_cppzmq=ON @@ -27,7 +28,6 @@ builtin_zeromq=ON builtin_zstd=ON ccache=ON cocoa=ON -fortran=OFF minuit2_omp=OFF pythia8=OFF test_distrdf_dask=OFF From 6622027c04d2b3fa8fdc437bd2c5bdcafd5ff486 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 1 Jul 2025 09:24:30 +0200 Subject: [PATCH 4/4] [ci] disable on mac14 since it's still failing --- .github/workflows/root-ci-config/buildconfig/mac14.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/root-ci-config/buildconfig/mac14.txt b/.github/workflows/root-ci-config/buildconfig/mac14.txt index a4fb57f2322ac..a43856231ec74 100644 --- a/.github/workflows/root-ci-config/buildconfig/mac14.txt +++ b/.github/workflows/root-ci-config/buildconfig/mac14.txt @@ -1,4 +1,3 @@ -CMAKE_BUILD_RPATH=/usr/local/lib asimage_tiff=OFF builtin_cfitsio=ON builtin_cppzmq=ON @@ -28,6 +27,7 @@ builtin_zeromq=ON builtin_zstd=ON ccache=ON cocoa=ON +fortran=OFF minuit2_omp=OFF pythia8=OFF test_distrdf_dask=OFF