Build, deploy and install

One CMake project builds the library, the command-line tools, the Python extension and fdp-qt on every platform; bootstrap.sh (macOS, Linux) and bootstrap.ps1 (Windows) install the dependencies, create venv/ with htgettoken, build into build/ and run the tests.

NeedVersionNotes
C++ compilerC++17AppleClang 17, GCC 11+, MSVC 2022
CMake3.20+
Boost1.75+JSON, program_options, property_tree
libcurl, OpenSSL, yaml-cpplibcurl from the macOS SDK on macOS
Python3.9+bindings, tests, htgettoken
XRootD client (XrdCl)5.8+ / 6.xoptional: root:// support; off on Windows
Qt6.2+optional: fdp-qt
Xcode, XcodeGenXcode 26FDP Browser (macOS)

macOS

brew install cmake boost yaml-cpp openssl@3 cppunit pkg-config libomp pybind11 xrootd xcodegen
git clone git@github.com:normanajn/Fermi-Data-Platform-Tools.git && cd Fermi-Data-Platform-Tools
./bootstrap.sh                                   # or --install-deps to run brew for you
./bootstrap.sh --with-qt --aqt-qt 6.11.3         # also fdp-qt, with a private Qt 6 in ~/Qt
./start-fdp-browser.sh                           # builds and opens FDP Browser

Homebrew's qtbase cannot be installed while qt@5 is linked; --aqt-qt downloads Qt 6 into ~/Qt without touching system packages (--qt-prefix ~/Qt/6.11.3/macos reuses it). The deployment target is macOS 14; the linker's built for newer version warnings about Homebrew libraries are expected and harmless on the build machine.

Linux

./bootstrap.sh --install-deps          # sudo dnf / sudo apt-get, then venv/, build/, tests
./bootstrap.sh --aqt-qt 6.11.3         # fdp-qt with a private Qt 6 (no system Qt needed)
PYTHON=/usr/bin/python3.9 ./bootstrap.sh --fresh   # EL9 system Python
DistributionNotes
AlmaLinux / RHEL 9all packages from AppStream, CRB and EPEL; xrootd-client-devel from EPEL or OSG. Tested on 9.8 with GCC 11.5.
AlmaLinux 8 without rootconda-forge toolchain (micromamba): GCC, CMake, Boost, XRootD, Qt into one environment. Tested on 8.10.
Amazon Linux 2023everything except XRootD and Qt is packaged: build with --install-deps --no-xrootd --aqt-qt 6.11.3; fdp-qt also needs mesa-libGL-devel libglvnd-devel libxkbcommon-devel fontconfig-devel. Boost has no CMake package files there; the build falls back to CMake's FindBoost. Tested.
Debian / Ubuntuapt packages incl. libxrootd-client-dev, qt6-base-dev. Not yet tested.

Without root on a shared account, keep everything under one directory: a conda-forge environment for the toolchain, the repository, and a per-user install prefix.

Windows 11

Dependencies come from vcpkg; XRootD is off. From a Developer PowerShell for VS 2022:

powershell -ExecutionPolicy Bypass -File bootstrap.ps1 -InstallDeps          # clones C:\vcpkg if needed
powershell -ExecutionPolicy Bypass -File bootstrap.ps1 -InstallDeps -WithQt  # adds qtbase and fdp-qt
build\RelWithDebInfo\fdp-ls.exe -l /amsc/public
cmake --install build --config RelWithDebInfo --prefix $env:USERPROFILE\.local

Add %USERPROFILE%\.local\bin to the user PATH; fdp.dll is installed next to the executables, and the vcpkg DLLs must be on PATH or copied there.

Status: the Windows build is defined but has not been exercised yet, and htgettoken is untested on Windows. If it does not work, obtain a token elsewhere and use it directly: $env:BEARER_TOKEN_FILE = "C:\Users\me\bt_amsc_dunewrite".

Per-user installation

No root needed; the executables find libfdp through a relative RPATH ($ORIGIN/../lib, @loader_path/../lib), and an installed fdp-qt also finds a private Qt.

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFDP_BUILD_TESTS=OFF
cmake --build build -j 8
cmake --install build --prefix $HOME/.local
export PATH=$HOME/.local/bin:$PATH          # ~/.zshrc or ~/.bashrc
export MANPATH=$HOME/.local/share/man:$MANPATH
Installed toContents
bin/the thirteen fdp-* tools (and fdp-qt when built)
lib/ (lib64/)libfdp and its CMake package: find_package(fdp) → FDP::fdp
include/fdp/C++ headers and fdp_c.h
share/man/man pages for every tool and API (sections 1, 3, 7)
share/fdp/fdp.yamlreference configuration (copy to ~/.config/fdp/fdp.yaml to change it)
share/zsh/…, share/bash-completion/…completion scripts

htgettoken must be on PATH: activate the repository's venv/, run python3 -m pip install --user htgettoken, or set token: {htgettoken: /path/to/venv/bin/htgettoken} in ~/.config/fdp/fdp.yaml. Uninstall with xargs rm < build/install_manifest.txt.

Shell completion

# zsh, before compinit in ~/.zshrc (not needed for /usr/local or the macOS package)
fpath=(~/.local/share/zsh/site-functions $fpath)
autoload -Uz compinit && compinit
# bash: automatic with bash-completion 2.x; otherwise in ~/.bashrc
source ~/.local/share/bash-completion/completions/fdp-ls

Check with print ${_comps[fdp-ls]} (zsh) or complete -p fdp-ls (bash). If zsh does not pick up new tools after an upgrade: rm -f ~/.zcompdump*; exec zsh.

Python package

python3 -m pip install .                         # wheel: libfdp ships next to the extension
python3 -c 'import fdptools; print(fdptools.__version__)'
PYTHONPATH=build/python python3 -c 'import fdptools; print(fdptools.FDP().ls("/amsc/public"))'   # from a CMake build

macOS installer packages

scripts/package-macos.sh builds a self-contained FDP Browser.app (libfdp, OpenSSL, Boost, yaml-cpp, XrdCl and its security plugins, libomp, the thirteen CLIs and a one-file htgettoken) and packs it as .pkg, .dmg and .zip:

scripts/package-macos.sh --build                 # ad-hoc signed, for this Mac
FDP_SIGN_IDENTITY="Developer ID Application: Andrew Norman (H7PRZ8RA2Z)" \
FDP_INSTALLER_IDENTITY="Developer ID Installer: Andrew Norman (H7PRZ8RA2Z)" \
FDP_NOTARY_PROFILE=fdp-notary scripts/package-macos.sh --build   # signed, notarized, stapled
sudo installer -pkg dist/FDP-Browser-<version>-macos-arm64.pkg -target /
sudo fdp-uninstall                                 # removes app, links, man pages, receipts

The installer has two parts: the application in /Applications, and the command-line tools (/usr/local/bin/fdp-* links into the app, man pages, completion, an example configuration). A package needs at least the macOS version it was built on, and runs on the build machine's architecture.

CMake options

OptionDefaultMeaning
FDP_SHAREDONlibfdp as a shared library
FDP_BUILD_CLIONthe fdp-* tools
FDP_BUILD_PYTHONOFF (ON in bootstrap)fdptools extension in build/python
FDP_BUILD_QTOFFfdp-qt
FDP_BUILD_TESTSONCppUnit, C ABI, pytest and Qt tests (ctest)
FDP_WITH_XROOTDON (OFF on Windows)root:// backend; skipped with a warning when XrdCl is missing
FDP_WITH_OPENMPONparallel transfers
CMAKE_OSX_DEPLOYMENT_TARGET14.0minimum macOS

Check the installation

fdp-diag                                   # endpoints ok, htgettoken found, clock skew
fdp-ls -l /amsc/public                     # anonymous read
fdp-token get --role duneread              # first token: browser login
fdp-diag /amsc/dune/scratch                # read/write token coverage for a protected area
ctest --test-dir build --output-on-failure # from the source tree: CppUnit, C ABI, pytest (mock dCache), Qt