question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow compilation when OpenMP is unavailable

See original GitHub issue

Is your feature request related to a problem? Please describe. I’m trying to get started with dace on a mac where the default compiler doesn’t support OpenMP. Poking around I saw that a single threaded schedule is supported, but I couldn’t figure out how to make use of it, given a dace.program instance.

Describe the solution you’d like A workaround for when OpenMP support, i.e. prog.compile(without_omp=True) or longer if necessary. It would be ideal though to fall back automatically if CMake says it can’t find OpenMP.

Describe alternatives you’ve considered Installing GCC via brew but I’m not sure how to tell dace to use GCC instead of clang on Mac. I considered running in Docker but not enough time to set it all up.

Additional context Devs on Mac will run into this issue, so some at least a workaround if not a solution would be nice.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
alexnick83commented, Oct 26, 2021

You just pass a string. Assuming the compiler executable is in the PATH, you only need the name. For example, see the first lines of a sample config file below. You are interested in the last line:

cache: name
compiler:
  allow_shadowing: true
  allow_view_arguments: false
  autobuild_bitstreams: true
  build_type: RelWithDebInfo
  codegen_lineinfo: false
  cpu:
    args: -std=c++14 -fPIC -Wall -Wextra -O3 -march=native -ffast-math -Wno-unused-parameter
      -Wno-unused-label
    executable: 'g++'
1reaction
alexnick83commented, Oct 25, 2021

As you noted, it is possible to change the schedule of the Maps to be sequential. It might be useful to have an API method to automate this. However, CMake will probably still try to find OpenMP, so I don’t think that this is a real solution to the issue.

Regarding selecting GCC, you should be able to do something like CXX=g++ python dace_program.py, which should tell to CMAKE to use g++.

I would also try to add OpenMP support to clang. This link might help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[R-package] OpenMP is not available #2503 - dmlc/xgboost
Warning: OpenMP is not available, project will be compiled into single-thread code. Use OpenMP-enabled compiler to get benefit of ...
Read more >
/openmp (Enable OpenMP Support) | Microsoft Learn
If /openmp isn't specified in a compilation, the compiler ignores OpenMP clauses and directives. OpenMP Function calls are processed by the ...
Read more >
Enable OpenMP support in clang in Mac OS X (sierra & Mojave)
Try using Homebrew's llvm: brew install llvm. You then have all the llvm binaries in /usr/local/opt/llvm/bin . Compile the OpenMP Hello ...
Read more >
OpenMP Compilers & Tools
Compile with -mp to enable OpenMP for multicore CPUs on all platforms. Compile with -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda to enable ...
Read more >
OpenMP on macOS with Xcode tools
It can be tricked into performing its designed function by using -Xclang -fopenmp flags. The unfortunate part about this is that Apple is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found