Fix MKL version detection for oneAPI and fail fast on a bad Boost source tree (#117) - #139
Draft
skilledwolf wants to merge 1 commit into
Draft
Fix MKL version detection for oneAPI and fail fast on a bad Boost source tree (#117)#139skilledwolf wants to merge 1 commit into
skilledwolf wants to merge 1 commit into
Conversation
…ost tree
FindLapack.cmake parsed the MKL version with a single-space pattern
("#define __INTEL_MKL__ ([0-9]+)"). oneAPI column-aligns the values in
mkl_version.h, so the pattern never matched, MKL_VERSION ended up holding
the raw header lines, and the unquoted if() checks died with
CMake Error at config/FindLapack.cmake:159 (if):
Unknown arguments specified
as soon as MKLROOT was set in the environment (reported in ALPSim#117 for a
Spack build on a machine with oneAPI 2025 installed).
- Match the whitespace as [ \t]+ and extract the version with REGEX MATCH.
- Decide the library layout by version comparison (layered libraries since
10.0, lib/intel64 or lib since 10.3) instead of patterns that only knew
10.x and 11.x, so the year-numbered releases (2017 ... oneAPI 2025) get
the layered libraries rather than the pre-10 -lmkl -lguide set.
- Use lib/ when lib/intel64 does not exist (oneAPI 2024+), add -ldl on
Linux, warn and assume a current release when no version can be read,
and fix the $ENV{mkl_home} typo in the include search.
FindBoostSrc.cmake: when Boost_SRC_DIR points at a directory without
boost/version.hpp (the first failure in ALPSim#117, an empty resource
directory), stop with one FATAL_ERROR naming the directory and the
options, instead of a file(READ) error, three MATH() errors and
"Boost Version: ERROR_ERROR_ERROR".
Refs ALPSim#117
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the two CMake configure failures from the Spack thread in #117.
FindLapack.cmakeparsed the MKL version with a single-space pattern. oneAPI column-aligns the macro values, soMKL_VERSIONended up holding raw header lines and the unquotedif()died withUnknown arguments specifiedwheneverMKLROOTwas set in the environment. Match the whitespace properly, choose the library layout by version comparison (layered libraries since 10.0,lib/intel64orlibsince 10.3) so the year-numbered releases work, preferlib/whenlib/intel64is absent (oneAPI 2024+), and add-ldlon Linux.FindBoostSrc.cmake: whenBoost_SRC_DIRpoints at a directory withoutboost/version.hpp, stop with one clear error instead of afile(READ)error, threeMATH()errors andBoost Version: ERROR_ERROR_ERROR.The Spack side (handing Spack's BLAS/LAPACK to ALPS so a host
MKLROOTcannot hijack the build) is in ALPSim/spack-packages#1.Testing
Unknown argumentserror, the new one produces the expected link line for each vintageFindBoostSrc: an empty directory now fails with a single message; the fetched Boost 1.87 tree still reports1_87_0Related to #117