NebulousLabs / Sia-GPU-Miner

A GPU Miner for Sia
MIT License
151 stars 79 forks source link

attempt to re-add linux special timer #32

Closed DavidVorick closed 9 years ago

DavidVorick commented 9 years ago

this doesn't compile, but I'm not sure why.

The error is

gcc -c -std=c11 -Wall -pedantic -O2 sia-gpu-miner.c -o sia-gpu-miner.o
sia-gpu-miner.c: In function ‘grindNonces’:
sia-gpu-miner.c:81:2: warning: implicit declaration of function ‘clock_gettime’ [-Wimplicit-function-declaration]
  clock_gettime(CLOCK_REALTIME, &begin);
  ^
sia-gpu-miner.c:81:16: error: ‘CLOCK_REALTIME’ undeclared (first use in this function)
  clock_gettime(CLOCK_REALTIME, &begin);
                ^
sia-gpu-miner.c:81:16: note: each undeclared identifier is reported only once for each function it appears in
Makefile:9: recipe for target 'linux' failed
make: *** [linux] Error 1
JoshVorick commented 9 years ago

So, you have to do the time ifdef before you do the CL ifdef. It compiles now. I don't know exactly why this is the case though.