Name: bart Version: 1.0.00 Release: 3%{?dist} Summary: The Berkeley Advanced Reconstruction Toolbox (BART) License: BSD-3-Clause URL: https://github.com/mrirecon/bart Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz BuildRequires: make BuildRequires: gcc BuildRequires: fftw-devel BuildRequires: openblas-devel BuildRequires: lapack-devel BuildRequires: libpng-devel # %%check: readelf asserts the stack is not executable. BuildRequires: binutils # The Makefile says it requires make 4.0 or newer. Fedora has it. %description The Berkeley Advanced Reconstruction Toolbox (BART) is a free and open-source image-reconstruction framework for Computational Magnetic Resonance Imaging. It consists of a library and a toolbox with many command-line algorithms for MRI reconstruction, such as SENSE, POCS-enhanced SPIRiT, and compressed sensing. %prep %autosetup -n %{name}-%{version} # Remove hardcoded rpath and -L/usr/lib which causes issues on Fedora sed -i 's|BLAS_L := -Wl,-rpath $(BLAS_BASE)/lib -L$(BLAS_BASE)/lib|BLAS_L :=|' Makefile sed -i 's|FFTW_L := -Wl,-rpath $(FFTW_BASE)/lib -L$(FFTW_BASE)/lib -lfftw3f|FFTW_L := -lfftw3f|' Makefile %build # BART's Makefile uses PREFIX for install, but not necessarily for build. # We can use Makefile.local to configure. cat > Makefile.local <mov1) && ...' failed. # -2's %%check ran only `bart version`, which makes no nested call, so this # shipped. Found 2026-10-11 by the DeepInverse/BART comparison test. # # GCC 14+ can place trampolines on the heap instead (-ftrampoline-impl=heap, # x86_64 and aarch64 Linux). That needs neither the byte-decoding hack nor an # executable stack, on every arch -- so aarch64, which had to ship with an # executable stack under -2, no longer does either. echo "CFLAGS += -ftrampoline-impl=heap" >> Makefile.local %make_build %install %make_install PREFIX=%{_prefix} # The install target in the Makefile seems a bit incomplete for Fedora standards # It doesn't install the man page. mkdir -p %{buildroot}%{_mandir}/man1 install -p -m 644 doc/bart.1 %{buildroot}%{_mandir}/man1/ # The Makefile installs to %{_prefix}/share/doc/bart/ which is not where we want it in Fedora. # Fedora uses %{_docdir}/%{name} which %doc takes care of. # Let's remove the one installed by Makefile rm -rf %{buildroot}%{_prefix}/share/doc/bart/ %check # The stack must not be executable (that is the point of the heap trampolines). readelf -lW %{buildroot}%{_bindir}/bart | grep -E '^\s+GNU_STACK' readelf -lW %{buildroot}%{_bindir}/bart | grep -E '^\s+GNU_STACK' | grep -qv 'RWE' # Exercise nested calls, which `bart version` (the -2 check) never did. ./bart ones 2 4 4 o ./bart phantom -x 32 p # Upstream's unit tests and command-line tests. %make_build utest # One command-line test is dropped. test-ecalib-econ requires ESPIRiT's # memory-saving mode (-e -1) to give BIT-IDENTICAL maps to the normal one # (`nrmse -t 0.`); on f44 x86_64 they differ by an NRMSE of 4.4e-8, with # OpenBLAS at 1 thread as well as many. Every other one of the 449 tests passed # in that run (make -k test, local f44 mock, 2026-10-12), including # test-ecalib-nystroem and the other ecalib tests with a 1e-5 tolerance. sed -i '/^TESTS += tests\/test-ecalib-econ$/d' tests/ecalib.mk ! grep -q 'TESTS += tests/test-ecalib-econ' tests/ecalib.mk %make_build test %files %license LICENSE %doc README README.md doc/*.txt %{_bindir}/bart %{_mandir}/man1/bart.1* %dir %{_prefix}/lib/bart %dir %{_prefix}/lib/bart/commands %changelog * Sun Oct 11 2026 Morgan Hough - 1.0.00-3 - Fix every command aborting on x86_64. NOEXEC_STACK=1 decodes GCC's stack trampoline byte by byte and asserts mov/mov/jmp; Fedora's -fcf-protection prefixes it with endbr64, so the first nested call failed with "md_nary_int: Assertion `(0xbb41 == __t->mov1) && ...' failed" (phantom, ones, zeros and fft all rc 134). -2's %%check, `bart version`, never made a nested call, so it passed. - Build with -ftrampoline-impl=heap on every arch instead: no decoding hack, no execstack -c, and aarch64 no longer ships with an executable stack. - %%check now asserts GNU_STACK is not RWE and runs upstream's `make utest` and `make test` in place of `bart version`: all unit tests and 448 of 449 command-line tests pass. test-ecalib-econ is dropped: it demands bit-identical ESPIRiT maps from two code paths and gets an NRMSE of 4.4e-8. - Found by tests/deepinv-bart-mri.bats. * Thu Sep 10 2026 Morgan Hough - 1.0.00-2 - Only enable NOEXEC_STACK and the matching execstack -c on x86_64. src/misc/nested.h guards that trampoline hack with "#ifndef __x86_64__ #error NOEXEC_STACK only supported on x86_64", so the aarch64 build failed outright. Elsewhere the header falls back to real GCC nested functions, whose trampolines need an executable stack -- so the flag is left in place there rather than stripped. NOTE: this means the aarch64 binary ships with an executable stack. * Wed Feb 25 2026 Morgan Hough - 1.0.00-1 - Initial BART package