BallisticLA / RandBLAS

A header-only C++ library for sketching in randomized linear algebra
https://randblas.readthedocs.io/en/stable/
Other
75 stars 6 forks source link

Update macos-openmp GitHub actions workflow for macos-14 and higher #92

Closed rileyjmurray closed 4 months ago

rileyjmurray commented 4 months ago

The macos-openmp CI build has been failing lately. The error occurrs when trying to build blaspp:

Cloning into 'blaspp'...
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:[16](https://github.com/BallisticLA/RandBLAS/actions/runs/9229409689/job/25395565417?pr=89#step:4:17) (project):
  The CMAKE_CXX_COMPILER:

    /usr/local/opt/llvm/bin/clang++

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

I'm pretty sure this stems from changes to the macos-latest GitHub Actions runner. When the failing builds install the LLVM toolchain, they report using llvm--18.1.5.arm64_sonoma.bottle.tar.gz and install to /opt/homebrew/opt/llvm/. Compare to the successful builds, which report using llvm--17.0.6_1.monterey.bottle.tar.gz and install to /usr/local/opt/llvm/.

I'm not sure if I have a fix at time of opening this PR. I'm only opening it now because I need to test potential fixes and actually run the actions.

My suspicion was right. The CMake configuration lines for blaspp and RandBLAS explicitly set /usr/local/opt/llvm/bin/clang++ and /usr/local/opt/llvm/bin/clang for C++ and C compilers. These paths needed to be updated to reflect the new location of these compilers in the latest macos runner.

Incidental changes

The macos-latest build showed compiler warnings about allocating dynamically-sized arrays on the stack. I've changed them to allocate on the heap (with T* val = new T[size], as opposed to T val[size]).