Skip to content

Conversation

@cho-m
Copy link
Member

@cho-m cho-m commented Sep 7, 2025

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Experimenting with Make alternative to

As CMake support may be reverted.

@github-actions github-actions bot added long build Set a long timeout for formula testing long dependent tests Set a long timeout for dependent testing labels Sep 7, 2025
@fxcoudert
Copy link
Member

If we used libomp instead of gcc, I could see the point (lower disk usage). But we can't remove GCC anyway, because of the Fortran side, so…

@cho-m
Copy link
Member Author

cho-m commented Sep 14, 2025

If we used libomp instead of gcc, I could see the point (lower disk usage). But we can't remove GCC anyway, because of the Fortran side, so…

Part of issue is mixed OpenMP usage across dependency trees, e.g.

  • dynare uses libgomp but has dependency on suite-sparse which uses libomp. At same time colmap & gizmo use libomp & suite-sparse
  • pytorch uses libomp but has dependency on openblas which uses libgomp
  • lammps, synfig, siril, votca use libomp but has dependency on fftw which uses libgomp

Depending on how code interacts, this could lead to unexpected behavior.

Changing compiler to GCC would lead to C++ issues (libstdc++ vs libc++) so only option seems to be aligning OpenMP. In this case, libomp is easier to force everything to use than libgomp.

@fxcoudert
Copy link
Member

But I don't think everything can use libomp, in particular, the Fortran parts.

@cho-m
Copy link
Member Author

cho-m commented Sep 14, 2025

But I don't think everything can use libomp, in particular, the Fortran parts.

May need to experiment with Fortran on this. There has been tests done for C/C++ parts like https://cpufun.substack.com/i/138445340/is-there-any-way-around-this

If Fortran interacts with OpenMP in a similar fashion, then it should be possible to inject libomp and have a functioning OpenMP runtime.

There is still an inconvenience where gfortran -fopenmp won't work for compiling+linking as GCC will want to use libgomp. This is where some workarounds are needed (which is possible via CMake)

@ywwry66
Copy link
Contributor

ywwry66 commented Sep 14, 2025

But I don't think everything can use libomp, in particular, the Fortran parts.

Some evidence of Fortran working with libomp:

gfortran -fopenmp -c test.f90 -o test.o
gfortran -L/opt/homebrew/opt/libomp/lib -lomp test.o -o test

test.f90:

PROGRAM Test
USE OMP_LIB

!$OMP PARALLEL

    CALL SLEEP(10)
    PRINT *, "Hello from process: ", OMP_GET_THREAD_NUM()

!$OMP END PARALLEL

END

@cho-m
Copy link
Member Author

cho-m commented Sep 28, 2025

Closing for now. Can re-open if needed based on other PR and upstream decision.

@cho-m cho-m closed this Sep 28, 2025
@github-actions github-actions bot deleted the openblas-libomp branch September 28, 2025 21:25
@cho-m cho-m added the not merged PR was closed without being merged (and may need to be revisited) label Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

long build Set a long timeout for formula testing long dependent tests Set a long timeout for dependent testing not merged PR was closed without being merged (and may need to be revisited)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants