- On macOS on Apple Silicon
- Homebrew OpenMP
- Built PyKokkos from source, main branch
When @pk.workunit is invoked, the JIT compiler calls find_package(Kokkos) which loads KokkosConfig.cmake which then calls
FIND_DEPENDENCY(OpenMP REQUIRED COMPONENTS CXX)
Apple Clang/CMake cannot find OpenMP though and so fails with
Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
User must therefore set CPATH and LIBRARY_PATH. My current hack is to activate my uv venv with
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ ! -d "$SCRIPT_DIR/.venv" ]; then
echo "Error: .venv not found. Run 'make setup' first."
return 1 2>/dev/null || exit 1
fi
source "$SCRIPT_DIR/.venv/bin/activate"
if [ "$(uname)" = "Darwin" ]; then
OMP_PREFIX="$(brew --prefix libomp 2>/dev/null)"
if [ -n "$OMP_PREFIX" ]; then
export CPATH="${OMP_PREFIX}/include${CPATH:+:$CPATH}"
export LIBRARY_PATH="${OMP_PREFIX}/lib${LIBRARY_PATH:+:$LIBRARY_PATH}"
fi
fi
When
@pk.workunitis invoked, the JIT compiler callsfind_package(Kokkos)which loadsKokkosConfig.cmakewhich then callsApple Clang/CMake cannot find OpenMP though and so fails with
User must therefore set
CPATHandLIBRARY_PATH. My current hack is to activate myuvvenv with