Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I need gcc as a default compiler to compile cuda samples and I need clang to compile my network projects because clang has better warnings and errors specifications.
Is there any way to run both compilers?
Yes you can.
Apple's Xcode supplies clang (and puts in /usr/bin/gcc a link to clang not gcc)
Then you can then install gcc - probably the easiest way is via a package manager like Macports, Homebrew or Fink