Tidy unused #ifdefs, unbuilt sources and a few dead headers
Maintainers usually reply within 3 days
@skilledwolf is already working on this.
Since Nov 2, 2026.
Assessment
This issue has not been assessed yet.
Description
A full configure (apps, all tests, legacy API, MPI, OpenMP) shows several macros, files and headers that no build uses. The first four sections remove nothing that is compiled today, except the five fitter sources noted below. The last two are judgement calls.
Every claim here was re-checked against master: each macro's definitions were grepped across sources, CMake, config.h.in and the Python build; the scheduler-using translation units were preprocessed to read ALPS_WRITE_ALL_XML; the two tests were rebuilt with their guards removed; and the dead headers were compiled on their own with the build's flags.
Macros that nothing defines
-
ALPS_WITHOUT_XML(13 files in lattice, model, legacy parameters andalps/xml.h) andALPS_WITHOUT_OSIRIS(5 ALEA files). These are build modes without XML or osiris, which ALPS no longer supports. Keep the code under#ifndefand drop the guards. -
ALPS_ONE_CHECKPOINT_FILE_ONLYinscheduler/montecarlo.Candtask.C. This is an unfinished one-file checkpoint layout: the RNG state save is still a//TODO. -
USE_MPIinapps/dmft/qmc/green_function.h. It guards an<mpi.h>include and abroadcast()member that nothing calls. -
ALPS_HAVE_SHARED_ALLOCATORingf/.../tensors/tensor_base.hpp. It would alias ashared_storagetype that doesn't exist. -
ALPS_HDF5_1_8inaccumulators/tests/save_load2.cpp. It hides thelong doublecases with the note "fail with HDF5 1.10+", but they pass with HDF5 1.10.10 and 1.14.6 (96 tests). Drop the guards and keep the cases; it is the file's last#ifdef. -
HAVE_PARAPACK_13in looper (loop.C,path_integral.C,sse.C,looper/evaluator.h). -
ALPS_MPI_HAS_MPI_CXX_BOOL,ALPS_MPI_HAS_MPI_CXX_FLOAT_COMPLEXandALPS_MPI_HAS_MPI_CXX_DOUBLE_COMPLEXinutilities/mpi.hppandutilities/tests/mpi_utils_reduce.cpp. Keep the#ifndefside (the hand-writtenbooloverloads). -
USE_LATTICE_CONSTANT_2Dingraph/is_embeddable.hpp. It includesalps/graph/lattice_constant_2d.hpp, which doesn't exist. - Vendor BLAS switches:
VECLIB,ACMLandMKLinnumeric/matrix/vector.hpp,ACMLindmft/qmc/interaction_expansion/operator.hppandinteraction_expansion2/operator.hpp, andUBLASandUSE_MATRIX_DISPATCH(with its#undef __APPLE_CC__) in the deprecated numeric headers. Keep the plain-loop side. -
FOURPOINTindmft/qmc/hirschfyesim.C.
Macros that are always defined
For these, keep the #ifdef side and drop the #else side.
-
ALPS_ONLY_HDF5inscheduler/task.h,types.handmontecarlo.C.config.h.indefines it unconditionally. Note thattask.htests it before anything includesconfig.h, so in ten translation units (scheduler/{abstract_task,factory,task,workertask}.C,fulldiag/{factory,fulldiag}.C,sparsediag/{factory,sparsediag}.C,dmrg/{dmrg,factory}.C) theALPS_WRITE_ALL_XMLdefault is currentlytrueinstead offalse. Nothing there uses the default; the two callers that do (dmft/qmc/hirschfyesim.Candinteraction_expansion/measurements.cpp) already seefalse. So making it an unconditionalfalsechanges no behaviour. -
ALPS_HAVE_HDF5: 21 guards in the scheduler sources andapps/dmrg/dmrg/dmrg.h. Three have an#else(options.C,master_scheduler.C). -
HAVE_LAPACKinapps/maxent/src/eigen_lapack.hppandmaxent_params.cpp, defined bytarget_compile_definitionsinapps/maxent/CMakeLists.txtandapps/maxent/tests/CMakeLists.txt. Drop both definitions with the guards. -
BOOST_HAS_LONG_LONG: 20 guards in osiris andparser/xmlstream.h. Every C++17 compiler haslong long.
Workarounds for compilers and libraries below the minimum
The build requires C++17 and Boost 1.76. None of these conditions can hold, so keep the modern side.
-
BOOST_NO_EXCEPTIONS(79 sites, mostlytry/catcharound appmains). ALPS can't build with exceptions off. -
BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP(21 sites, allusingdeclarations). -
BOOST_NO_SFINAE(expression/evaluate_helper.h,expression.h,model/half_integer.h, looperpower.h). -
BOOST_NO_OPERATORS_IN_NAMESPACE(parapackinteger_range.h). -
BOOST_NO_STRINGSTREAM(utilities/vectorio.hpp). -
BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS(params/dict_value.hpp). -
__GXX_EXPERIMENTAL_CXX0X__inietl/jd.h. On a non-GCC compiler it selects the pre-C++11eigensystemsignature without the defaulted solver. - GCC 3.x checks: legacy
utility/bitops.hpp(3) andcontainers/tests/test_main.h. - The Apple GCC 4.2 OpenMP workaround in
parapack/parapack.C. - The Boost 1.58 + C++14 workaround in
params/src/dict_value.cpp. - The Intel-on-macOS guard in
accumulators/tests/mean_err_count.cpp. It is inverted: theEXPECT_ANY_THROWchecks run only on the platform where they were said to fail. They pass on GCC (276 tests), so make them unconditional. - Old Fujitsu compiler (
__FCC_VERSION) inalea/simplebinning.handlattice/latticelibrary.C. On that compilermake_all_graphs()throws "not implemented". - PGI (
__PGI) ingf/flagcheck.hpp. It only silences two#warnings. -
crayin legacyutility/bitops.hpp.
Sources that no build compiles
-
parapack/tests/clone_mpi.Candworker_mpi.C, with their.ip-4/.op-4files. They include parapack headers that no longer exist. The registered*_mpitests cover parapack's MPI code. -
graph/tests/embedding_test.cppand its.output, andalea/tests/binned_data.C. They test removed headers (graph/embedding.hpp,alea/binned_data.h). -
containers/tests/timing_{stack,queue,vector}.C. These are micro-benchmarks with no assertions, and they useboost::timer. -
tutorials/examples/scheduler/evaluate.Candevaluate2.C. The CMakeLists there builds onlyising1-ising3. They are also the only users ofALPS_HAVE_VALARRAY. -
apps/mc/spins/fit.C. No build has ever compiled it. The fitter sources it uses (abstract_fitter.C,base_incr_fitter.C,dummy_fitter.C,est_grad_fitter.C,fitting_scheduler.C/.h,fitter.h) are compiled, intospinmc_implinapps/mc/spins/CMakeLists.txt, but nothing inspinmcorspinmc_evaluatereferences a fitter. Remove them from that library withfit.C. -
osiris/src/osiris/xdrcore.C. This is an older copy of the XDR code, now built fromthird_party/xdr/src. It is also the only user ofALPS_HAVE_RPC_XDR_H,USE_IN_LIBIOandvax. -
apps/mc/simple/vtk.h. It is empty apart from its include guard. -
tests/cmake/preserved_public_headers.json. Nothing reads it since the installed-header check replaced it.
Switches that nothing defines (judgement call)
Removing these keeps today's behaviour:
-
ALPS_NGS_SINGLE_THREAD(commented out inngs/config.hpp,ngs/mutex.hpp,thread_exceptions.hpp,hdf5/archive.*,cli/mcoptions.cpp,cli_contract.cpp). This is a build without mutexes and without--threaded. Best done after the Boost.Thread removal. -
ALPS_HDF5_CLOSE_GREEDYandALPS_HDF5_READ_GREEDYinhdf5/src/archive.cpp, with their commented-out lines inngs/config.hpp. -
ALPS_NO_DELETEinalea/src/alea/observableset.C. -
USEPATTERNinsrc/tools/archive/. It guards a--pattern-filemode of thearchivetool; drop that option with it. -
ALPS_DEBUGinosiris/src/osiris/mpdump.C. These are three "message not initialized" checks, and they could become plainasserts instead (absent in Release builds, as today).
Installed headers that don't compile (judgement call)
Nothing in the repo includes these, and they fail on their own. Removing them is a small public-API change, so it belongs in the release notes. Each is listed in its component's header set in CMakeLists.txt, which must be edited with it.
-
ietl/interface/mtl.h. Its body is#error The MTL-2 interface is not yet implemented. -
ietl/interface/blitz.h. It needs Blitz++, which the build doesn't support. -
ietl/krylov_wrapper.h. It needs the old ITL (itl/krylov/cg.h). -
alps/numeric/matrix/matrix_concept_archetype.hpp. It includesboost/concept_archetypes.hpp, which doesn't exist. -
alps/ngs/scheduler/tcpserver.hppandalps/ngs/detail/tcpsession.hpp. An unused prototype; it lacks the<map>and<boost/function.hpp>includes it needs. -
alps/graph/lattice_constant_debug.hpp. It uses adetail::has_coloringthat no longer exists. It is also the only user ofUSE_COMPRESSED_EMBEDDING{,2}andCHECK_COMPRESSED_EMBEDDING. -
alps/random/mersenne_twister.hpp. It compiles, but nothing includes it: everything usesboost/random/mersenne_twister.hppdirectly. Its#elsebranch is a bundled copy of Boost's header for the Boost 1.47 bug, and the only user ofBOOST_NO_INT64_T,BOOST_NO_INTEGRAL_INT64_TandBOOST_NO_INCLASS_MEMBER_INITIALIZATION. Delete the file and its line inrandom/CMakeLists.txt.
Sequencing
hdf5/src/archive.cpp, parapack/parapack.C and the scheduler sources are also changed by #281, #282, #284 and #288. The BOOST_NO_EXCEPTIONS, ALPS_HAVE_HDF5 and ALPS_ONLY_HDF5 edits in particular overlap with #282, so do this cleanup after those merge.
Not included here: apps/qmc/sse, sse2 and apps/diag/fulldiagfqhe (to be decided separately), and app-specific debug switches in dmtk, looper, worms and sse4.
Related: #213
- Dominant language
- C++
- Stars
- 32
- Forks
- 10
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 51
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ALPSim/ALPS
-
area:tutorials bug scientific-correctness
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
area:parapack bug scientific-correctness
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
area:lattice bug
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
area:parapack compatibility-change enhancement
Difficulty 3/5 1-2 days Newbie friendliness 57/100
Maintainers usually reply within 3 days
-
area:ci-tests area:parapack area:tutorials
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 3 days
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
eic/TimeframeBuilder#102 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
error not reported I/O low priority rt_lib
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
[XLA] hlo/pass/README.md says passes implement Run; since the NVI change they implement RunImplOpen
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
objectionary/game-of-life#78 ·