On Tue, Mar 03, 2026 at 12:45:48AM +0200, Andrew W. Nosenko wrote: > On Tue, 3 Mar 2026 at 00:39, Andrew W. Nosenko <[email protected]> > wrote: > > > > > On Mon, 2 Mar 2026 at 22:48, Dima Pasechnik <[email protected]> wrote: > > > >> On Mon, Mar 02, 2026 at 09:45:35PM +0200, Andrew W. Nosenko wrote: > >> > > >> > Does modern Xcode includes libomp “out of the box” or it need to be > >> built > >> > separately from Homebrew/MacPorts/Git? (I have access to Catalina bot > >> not > >> > to more modern version, and on Catalina it doesn’t) > >> No, Xcode has no libomp. But Homebrew has a libomp package: > >> https://formulae.brew.sh/formula/libomp > >> > >> It's also provided by R Project: > >> https://mac.r-project.org/openmp/ > >> > >> And, yes, naturally, one can build libomp as a part of the llvm > >> installation. > >> > > > > > > But then I’m confused again: if I need to build libomp separately from > > LLVM sources, then why I would to prefer XCode’s Clang instead of Clang > > from the same LLVM package, from which I’m going to build libomp anyway? > > > > OpenMP is about compiler’s #pragmas plus runtime support library. So I see > risks in de-synchronisation between frontend (compiler) and backend > (library). But I see no benefits in using de-synchronised toolchain (Xcode > clang + non-Xcode llvm libomp). One can use the Apple's native tools, with a small extension (libomp), and not a 3rd party toolchain, with no guaranties that it works well with the OS components.
As the llvm project does not make separate releases for libomp, the whole thing looks odd, as one uses a big, 167Mb, tarball. I timed it - the building from source and installing of the package only takes 3 minutes on my old Intel Macbook, of which a sizeable part of time is untarring and configuring. The resulting package, headers+library, is just 2Mb in size. You can actually look at the build script, https://github.com/Homebrew/homebrew-core/blob/79725074f2282297d663543404731134b68d150e/Formula/lib/libomp.rb Best, Dima
signature.asc
Description: PGP signature
