Skip to content

Brew LLVM OpenMP #374

Open
Open

Description

@aminya

After the last release my MacOS pipelines are failing because OpenMP is not found anymore automatically:
https://github.com/flatironinstitute/finufft/actions/runs/13840315537/job/38725974952
This was working until version 1.1.1 flatironinstitute/finufft@dc2931a

Do I need to specify OpenMP to be installed?

Thanks,
Marco

Originally posted by @DiamonDinoia in #335 (comment)

Activity

  1. changed the title [-]Dear @aminya, after the last release my pipelines are failing because OpenMP is not found anymore:[/-] [+]Brew LLVM OpenMP[/+] on Mar 17, 2025
  2. aminya commented on Mar 17, 2025

    @aminya
    OwnerAuthor

    I wonder if it's because the LLVM installation via brew doesn't include OpenMP. I'll try to test. Could you pin setup-cpp meanwhile?

  3. DiamonDinoia commented on Apr 7, 2025

    @DiamonDinoia

    Hi @aminya,

    It seems that I still have problems: https://github.com/DiamonDinoia/finufft/actions/runs/14312541051

    Do I need to export LD_LIBRARY_PATH after installing libomp?

    Thanks,
    Marco

  4. reopened this on Apr 7, 2025
  5. aminya commented on Apr 7, 2025

    @aminya
    OwnerAuthor

    If the issue still happens, the problem is somewhere else. Needs more investigation.

    I disabled the export of the library path due to the conflicts with the system libraries, as the linker automatically picks those libraries. So, only add this if you intend to do so.

  6. aminya commented on Apr 7, 2025

    @aminya
    OwnerAuthor

    @DiamonDinoia I could configure the project with this. CMake doesn't automatically pick up the homebrew libs.

    brew install libomp
    
    cmake -S . -B ./build -G 'Ninja Multi-Config' -DCMAKE_PREFIX_PATH="/opt/homebrew;/opt/homebrew/opt/libomp/"
    

    I'll have to see how we can support this by default. Perhaps I should export LLVM_CMAKE_PREFIX_PATH that you can use in your builds

  7. DiamonDinoia commented on Aug 18, 2025

    @DiamonDinoia

    @aminya my soluton is:

    brew install libomp 
    {
      echo "LDFLAGS=-L$(brew --prefix libomp)/lib"
      echo "CPPFLAGS=-I$(brew --prefix libomp)/include"
      echo "LIBRARY_PATH=$(brew --prefix libomp)/lib"
      echo "DYLD_LIBRARY_PATH=$(brew --prefix libomp)/lib"
      echo "CMAKE_PREFIX_PATH=$(brew --prefix libomp)"
    } >> "$GITHUB_ENV"

    It would be nice to have an openmp=true like vcvarsall

  8. aminya commented on Aug 25, 2025

    @aminya
    OwnerAuthor

    I'll add OpenMP by default to the LLVM installations in the next release. The inconsistency between the platforms is not ideal

  9. DiamonDinoia commented on Aug 25, 2025

    @DiamonDinoia

    Sometimes I use setup-cpp to install ninja and cmake only, leaving system compiler default. In apple case it is AppleClang. It would be great to be able to pass openmp there so to use it with AppleClang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions