On Mon, 01 Aug 2016 17:23:43 -0700, stan wrote:
On Mon, 1 Aug 2016 22:21:58 +0000 (UTC) "Amadeus W.M." amadeus84@verizon.net wrote:
On Mon, 01 Aug 2016 09:34:51 -0700, stan wrote:
On Mon, 1 Aug 2016 04:30:03 +0000 (UTC) "Amadeus W.M." amadeus84@verizon.net wrote: [snip]
Unfortunately nothing worked.
In the cuda distribution there is a host_config.h file which contains the following lines:
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9)
#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
#endif /* __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9) */
This checks the version of the compiler and triggers an error with gcc-6.1 even if I pass --std=gnu89 which was the default C standard in gcc-4.9.
You don't have write access to that file? If you do, you could just comment out that check.
I do have write access to that file, but I imagine that compiler check is there for a reason, so I would rather use the right compiler than not check for it. Chances are the cuda code won't compile (correctly) if I skip the check. Still, maybe worth a shot.
But that's why you put in the --std=gnu89 flag. You're telling gcc to pretend that it is gcc 4.9, even though it's 6.1, so you are manually doing the check. That is, even though the compiler is 6.1, it's going to emulate 4.9.
That's what I thought too, but try this:
// Compile as // g++ -o gnuc gnuc.cpp // then as // g++ --std=gnu++11 -o gnuc gnuc.cpp
#include <iostream> #include <cstdlib>
using namespace std;
int main(int argc, char * argv[]) { cout << __GNUC__ << "." << __GNUC_MINOR__ << endl; return 0; }
It always outputs 6.1, whether or not you compile it with the --std flag. And if you think about it, __GNUC__ is probably a macro defined in the compiler at compile time, so it can't possibly change at run time. Haven't checked, but it's a good guess.