Commit Graph
629 Commits
Author SHA1 Message Date
suter_a 99cf0b19ec HDF4 4.4.0 changed the Vgetname() prototype from
Build and Deploy Documentation / build-and-deploy (push) Successful in 25s
int32 Vgetname(int32 vkey, char *vgname)
to
   int32 Vgetname(int32 vkey, char *vgname, size_t *buf_size)
(a fix for a buffer-overflow issue). Detect which one is present so
PNeXus.cpp can call the right form for both old and new HDF4 releases.
2026-09-16 09:34:34 +02:00
suter_aandClaude Opus 5 fd0b3c3b19 cmake: portability and macOS fixes
Fixes found while reviewing the cmake setup, with a focus on macOS. All
changes are either platform neutral or guarded by if (APPLE).

Portability / correctness:
* CMP0167 was guarded by 'CMAKE_VERSION GREATER_EQUAL 3.3', a *numeric*
  comparison which is true on e.g. cmake 3.22. Since the policy only exists
  since cmake 3.30, configuring aborted on RHEL 9 / Ubuntu 22.04, although
  cmake_minimum_required allows them. Use 'if (POLICY CMP0167)'.
* CMAKE_REQUIRED_INCLUDES expects directories, not header names. Setting it
  to 'math.h' injected a bogus -I<scratch>/math.h into every check_*() and
  leaked into the find_package() calls. Dropped, and CMAKE_REQUIRED_LIBRARIES
  is now unset after the checks. config.h is unchanged.
* The Qt3 fallback tested 'AND Qt4_FOUND' instead of 'AND NOT Qt4_FOUND'.
* NeXus regression tests were registered unconditionally and therefore failed
  in a default build. They are gated on 'nexus' now, and the HDF4 based ones
  additionally on HAVE_HDF4.
* HAVE_HDF4 was queried but never defined, i.e. there was no way to switch on
  the HDF4 support that PNeXus/PRunDataHandler/dump_header/musrfit implement.
  Added option(HAVE_HDF4), to be used together with -Dnexus=1. This is not
  academic: the ISIS example data are HDF4 files and test-histo-NeXus only
  passes with -DHAVE_HDF4=1.

Do not use ${ROOT_USE_FILE}:
  It overwrote CMAKE_CXX_STANDARD with ROOT's value and added ROOT's include
  dirs, definitions and recommended compiler flags to *every* target,
  including the Qt applications which do not use ROOT at all. Replaced by an
  explicit equivalent; the C++ standard is now only raised, never silently
  changed. The Qt sub-trees reset flags and include dirs again, mupp/plotter
  puts them back since it does use ROOT. ROOT's flags are kept wherever ROOT
  headers are used, -fsigned-char and -fsized-deallocation are ABI relevant
  there. Verified: the compile flags of all ROOT consuming targets are
  byte-identical to before.

Homebrew header shadowing:
  Boost_INCLUDE_DIRS and FFTW3_INCLUDE are both /opt/homebrew/include on a
  Homebrew system, i.e. the whole 3rd party header tree, and they were passed
  to target_include_directories() with BEFORE - ahead of musrfit's own
  src/include. They now come from the Boost::headers and FFTW3::FFTW3
  imported targets, which contribute them as SYSTEM includes after the
  project's own directories.

macOS:
* mupp: do not set the VERSION property on a MACOSX_BUNDLE target. cmake then
  names the binary Contents/MacOS/mupp-1.1.0 and only leaves a symlink 'mupp'
  beside it, contradicting CFBundleExecutable and not surviving
  zipping/codesigning. This is the reason the symlink had to be created by
  hand so far. VERSION is still set for the non-APPLE build.
* All four app bundles had an empty CFBundleShortVersionString and
  CFBundleVersion; set MACOSX_BUNDLE_SHORT_VERSION_STRING / _BUNDLE_VERSION.
* APPLE is UNIX, so the RPM generator was also active on macOS -> restrict to
  'UNIX AND NOT APPLE'. Likewise the /usr/local/lib rpath, which on Apple
  silicon should be /opt/homebrew/lib; macOS gets its own branch now.
* mupp: -fpermissive is a GCC option, hand it to GCC only.
* musredit: use VERSION_GREATER_EQUAL for the Darwin version icon switch.

Verified on macOS 26 / arm64 with ROOT 6.40.03, Qt 6.11, cmake 4.4: full
build clean in the default configuration, with -DASlibs -DBMWlibs -DBNMRlibs
-DDummyUserFcn (identical list of 55 targets), and with -Dnexus / -DHAVE_HDF4.
ctest shows no regression at any step; no maxLH test fails in any of the three
NeXus configurations.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 18:28:30 +02:00
suter_a e663d229e6 Merge remote-tracking branch 'origin/refactor-pmsrhandler-cpp17-tokenizer' into root6 2026-07-22 08:03:49 +02:00
suter_aandClaude Sonnet 4.6 471b928622 Fix macOS 26 CLING runtime dictionary errors caused by Homebrew/SDK header conflicts
macOS 26 (Darwin 25.5.0) introduced stricter Clang module map rules in
DarwinFoundation1.modulemap: the '_c_standard_library_obsolete' module
now requires the 'found_incompatible_headers__check_search_paths' feature,
which CLING's runtime interpreter does not set. When fftw3.h (from
/opt/homebrew/include) was parsed by CLING via the inlined PStartupHandler
dictionary payload, it triggered this module map error, causing all
PStartupHandler signal/slot connections to fail.

Two fixes:
- PMusr.h: guard '#include "fftw3.h"' with '#ifndef __CLING__'. No fftw
  types appear in PMusr.h class definitions, so CLING does not need it
  for reflection. This is the primary runtime fix.
- CMakeLists.txt (src/classes and all src/external libs): replace
  '-I${FFTW3_INCLUDE}', '-I${Boost_INCLUDE_DIRS}', '-I${GSL_INCLUDE_DIRS}',
  and '-I${ROOT_INCLUDE_DIRS}' with '-isystem' in all root_generate_dictionary
  OPTIONS blocks, and change 'include_directories(${FFTW3_INCLUDE})' to
  'include_directories(SYSTEM ...)'. Internal project paths (MUSRFIT_INC,
  BMW_TOOLS_INC, NONLOCAL_INC, CMAKE_CURRENT_SOURCE_DIR, etc.) keep '-I'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 14:06:11 +02:00
suter_aandClaude Opus 4.8 e7af0a781e libCuba: guard memcpy in SobolIni against negative length
GCC's -Wstringop-overflow flagged the memcpy in SobolIni() with a bound
of (size_t)(-4): on the (in practice unreachable) path where the Sobol
generator polynomial 'powers' is 0, the bit-count loop leaves inibits at
its initial -1, so inibits*sizeof underflows. The generator-polynomial
table always has a non-zero first column, so this never happens at run
time, but the compiler cannot prove it.

Guard the copy with 'if (inibits > 0)', which silences the false-positive
warning and hardens the edge case without changing behaviour for valid
input.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 15:02:17 +02:00
suter_a a735f92195 more improvements on the cmake build system. 2026-04-17 09:15:07 +02:00
suter_a 53ec95db6e work on cleaner cmake. 2026-04-15 20:29:55 +02:00
suter_a dbbaf554b2 MusrRoot: XML-schema evaluation files are moved to https://doi.org/10.5281/zenodo.19593555. to have a DOI and not be depend on a shaky URL
Build and Deploy Documentation / build-and-deploy (push) Successful in 29s
2026-04-15 14:34:32 +02:00
suter_a 9083561e20 added PyScripts/nexus_muon_validator.py to nexus.
Build and Deploy Documentation / build-and-deploy (push) Successful in 21s
2026-03-07 14:50:57 +01:00
suter_a c062e0f4e9 add musrfitConfig.cmake, etc. for musrfit.
Build and Deploy Documentation / build-and-deploy (push) Successful in 30s
2026-03-01 09:35:34 +01:00
suter_a 92008a4e49 fix Boost_INCLUDE_DIR -> Boost_INCLUDE_DIRS
Build and Deploy Documentation / build-and-deploy (push) Successful in 21s
2026-02-21 17:38:11 +01:00
suter_a 79b05cced7 adopted the PNeXus lib such that the class naming scheme is self-consistent. 2026-02-21 07:44:20 +01:00
suter_a 4136806847 better hdf4/5 include handling. 2026-02-11 16:05:02 +01:00
suter_a 6a41458310 start working on the deadtime correction. 2026-02-08 15:34:22 +01:00
suter_a d70fd34345 improved NeXus docu. 2026-02-08 09:11:36 +01:00
suter_a 3858cc723a improved docu for HDF4/5. 2026-02-07 21:43:34 +01:00
suter_a a6f5b956bf adopt HDF4 support for proper hierarchical writing of the data. 2026-02-07 21:26:35 +01:00
suter_a 8cb4fc7221 clean up HDF4 in PNeXus. First implementation for HDF4 IDF1/2 write. Compiles, but still some issues. 2026-02-07 20:54:09 +01:00
suter_a 8f3ad0c61d PNeXus now handles std::vector<> attributes new correctly. HDF4/5 now is using int. 2026-02-07 20:00:27 +01:00
suter_a c690965025 add a function in the NeXus lib which gives the time in ISO8601. 2026-02-07 11:28:38 +01:00
suter_a 4dcef1a835 add HDF4/HDF5 library version information, needed for writing. 2026-02-07 08:05:09 +01:00
suter_a 4519a0b76e add more complete dump info for NeXus. 2026-02-06 18:08:37 +01:00
suter_a 3aecdbf0a8 added the missing sample information when reading NeXus IDF V2. 2026-02-06 15:15:10 +01:00
suter_a dd2f743b3a added docu by Claude for PNeXus. 2026-02-06 08:45:58 +01:00
suter_a d5dbc12175 NeXus HDF4/HDF5 IDF V1: read 'frames_good' 2026-02-05 13:29:27 +01:00
suter_a 643be9738f fixed wrong path in NeXus IDF V2. 2026-02-05 12:59:10 +01:00
suter_a 88b5e492dd NeXus IDF V2 detector_1 -> instrument/detector_1 where possible. 2026-02-05 12:08:40 +01:00
suter_a 810306cb2a first full IDF V2 implementation. 2026-02-05 10:59:15 +01:00
suter_a 3aaca28c87 start populating HDF4 header info. 2026-02-01 17:54:02 +01:00
suter_a 83c8f6630c 2nd spot for cmake version check for policy setting. 2026-01-25 14:50:23 +01:00
suter_a b3e4d247f0 add HDF4/HDF5 example programs. 2026-01-25 14:07:36 +01:00
suter_a 6aaed94adf add doxygen file comment. 2026-01-25 12:05:04 +01:00
suter_a c3e9c03920 added HDF5 ISIS NeXus class handling. 2026-01-25 11:15:49 +01:00
suter_a 909fa6519d added HDF4 ISIS NeXus class handling. 2026-01-25 10:51:23 +01:00
suter_a 3eea73f07a stub for new NeXus file handling. Not much is working yet. 2026-01-25 08:26:43 +01:00
suter_a f66c832d56 updated the copyright info. 2026-01-25 07:45:44 +01:00
suter_a 990e280c8f set cmake Boost find policy. Removed NeXus library find from cmake, since it will not be used anymore. 2026-01-25 07:28:47 +01:00
suter_a 3442ca7b62 adopted from AFS to NFS.
Build and Deploy Documentation / build-and-deploy (push) Successful in 20s
2025-12-24 14:03:44 +01:00
suter_a 975f48f3fa add missing #include<cmath> to make some compilers happy. 2025-11-27 15:30:45 +01:00
suter_a 93f6bccaef improve the doxygen docu of the BMWtools.
Build and Deploy Documentation / build-and-deploy (push) Successful in 20s
2025-11-25 18:51:57 +01:00
suter_a 2fd0248e37 deal with Boost 1.89 not having system as component anymore. 2025-11-25 08:29:45 +01:00
suter_a 1e9b82f1c2 add TDirectory option to any2many. 2025-10-03 15:42:44 +02:00
suter_a fbfce99790 better handling of values=n/a when dumping the header info. 2025-10-01 12:36:01 +02:00
suter_a 32b49e7ac8 fixed char* comparison bug. 2025-10-01 09:38:17 +02:00
suter_a 675ed39739 update of the in-source MusrRoot docu. 2025-09-29 16:41:17 +02:00
suter_a 288c4c644b updated the docu and removed unused DrawHeader. 2025-09-29 12:45:24 +02:00
suter_a ea646e012b increase the MusrRoot version to 2.0. 2025-09-29 12:43:21 +02:00
suter_a 4917e5c7ae added the reader part for MusrRoot if written with TDirectory rather than TFolder. 2025-09-29 10:47:58 +02:00
suter_a 7e28402e25 start implementing TDirectory infrastructure. 2025-09-28 16:45:49 +02:00
suter_a 15c5b02c8b more docu. 2025-05-28 13:48:57 +02:00