How to use both "--cudart static" and -fopenmp with nvcc on Mac OSX?

I have trouble compiling my code on a Mac. The Apple stock compiler clang (clang-800.0.42.1) does not accept -fopenmp, but if I set -ccbin=/opt/local/bin/gcc with nvcc when linking, nvcc complains gcc/g++ is not supported on Mac OSX (with the --cudart static option).

if you want to reproduce this issue, here are the simple commands you can run:

git clone https://github.com/fangq/mcx.git
cd mcx/src
make static

if you are on a mac, you may see “clang: error: unsupported option ‘-fopenmp’” error.

any workaround?