When these 2 llvm packages are installed: $ pkg info | grep llvm llvm15-15.0.7_10 LLVM and Clang llvm18-18.1.6_1 LLVM and Clang This cmake script fails to find llvm18: $ cat CMakeLists.txt cmake_minimum_required(VERSION 3.18.0) find_package(LLVM 18 REQUIRED CONFIG) Error: Make Error at CMakeLists.txt:2 (find_package): Could not find a configuration file for package "LLVM" that is compatible with requested version "18". The following configuration files were considered but not accepted: /usr/local/llvm15/lib/cmake/llvm/LLVMConfig.cmake, version: 15.0.7 /usr/local/llvm18/lib/cmake/llvm/LLVMConfig.cmake, version: 18.1.6 It is unclear why is llvm18-18.1.6 not compatible with the requirement "18" for LLVM. 14.1-STABLE cmake-3.29.3 Meta-port to connect all CMake bits cmake-core-3.29.3 Cross-platform Makefile generator
From ${LOCALBASE}/llvm18/lib/cmake/llvm/LLVMConfigVersion.cmake: "LLVM is API-compatible only with matching major.minor versions and patch versions not less than that requested." So, requesting version 18 (18.0) will not satisfy this condition. Use 18.1 for the version check instead. See also: https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-version-selection