Giter VIP home page Giter VIP logo

Comments (12)

jakirkham avatar jakirkham commented on July 4, 2024 2

Ok, so actually I didn't know how it was named in defaults. This is helpful. We've been using the one from conda-forge presently, which is just called openmp.

One of the most common questions that we get in conda-forge when building numeric code is how to enable OpenMP support. Our solutions have varied from use gcc, use our copy of openmp (macOS specifically), and now lately use defaults compilers with our copy of openmp. As LLVM has a solution for this, it has been tested for a while, and we are already packaging it as part of the LLVM build, it would be good to just ship LLVM's OpenMP implementation with the compiler and as part of the compiler runtime library.

Compare this to other platforms. When a user builds a recipes with say {{ compiler("c") }} on Linux, it will install gcc and libgcc (add appropriate prefix/postfix here), which includes libgomp. So OpenMP just works on Linux. Similarly on Windows, Visual Studio includes OpenMP support out-of-the-box and our runtimes include the appropriate DLLs, vcomp. However on macOS, the experience remains less than straightforward, users need to add llvm-openmp explicitly (and maybe pin it?). It would be better to just include this with the clang compiler on macOS by default and include the libomp with run_exports so it just gets pulled along with anything else built.

from aggregate.

nehaljwani avatar nehaljwani commented on July 4, 2024

There is a package for macOS. It's called llvm-openmp

from aggregate.

jakirkham avatar jakirkham commented on July 4, 2024

Friendly nudge 😉

from aggregate.

nehaljwani avatar nehaljwani commented on July 4, 2024

There is a plan to upgrade the llvm compilers soon. If @mingwandroid agrees, the changes suggested by you may be considered during the upgrade. 😜

from aggregate.

mingwandroid avatar mingwandroid commented on July 4, 2024

I'd actually rather we split libgomp from GCC! But I don't really mind either way as in defaults we are adding llvm-openmp for macOS in a few places and it's pretty ugly.

from aggregate.

mingwandroid avatar mingwandroid commented on July 4, 2024

The reason for splitting is in case anyone wants to do a matrix build against different implementations but then again that's probably too much work for all of us!

from aggregate.

jakirkham avatar jakirkham commented on July 4, 2024

Well if we can have a consistent solution between macOS and Linux, that would be very helpful.

A split friendly option might be to have {{ compiler("openmp") }}.

To make sure I understand, do you mean mixing GOMP with the LLVM toolchain or vice versa for GCC? Assuming I'm understanding this correctly, what are the use cases for this?

from aggregate.

mingwandroid avatar mingwandroid commented on July 4, 2024

There no technical reason to tie the compiler used to openmp implementation that I'm aware of. That is all.

We're looking into llvm/clang for Linux for example..

from aggregate.

jakirkham avatar jakirkham commented on July 4, 2024

As a note, people are needing to add the include path for llvm-openmp specifically for the compilers. Otherwise they get error messages about the compilers not being able to find omp.h. Would it be possible to include this in the compiler flags?

https://github.com/conda-forge/nfft-feedstock/pull/10/files#diff-44a73bcc045c193c3bd45da87994b03b

from aggregate.

mingwandroid avatar mingwandroid commented on July 4, 2024

Hi @jakirkham, nfft is doing it wrong; this is an example of how to correctly use llvm-openmp.

echo -e "#include <omp.h>\nint main() {}" | CONDA_BUILD_SYSROOT=/opt/MacOSX10.9.sdk $CC -x c -fopenmp=libomp -

from aggregate.

mingwandroid avatar mingwandroid commented on July 4, 2024

There's one gotcha, llvm-openmp needs to go into build and run requirements, but that's not a big deal IMHO.

from aggregate.

jakirkham avatar jakirkham commented on July 4, 2024

Adding it to build in addition to host and run seems to work without that hack. Thanks @mingwandroid.

from aggregate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.