0

I'm attempting to use LiteIDE to run the program:

// cudatest
package cudatest

import (
    "fmt"
    "github.com/barnex/cuda5/cu"
)

func main() {
    fmt.Println("Hello, your GPU is:", cu.Device(0).Name())
}

All I get is:

c:/go/bin/go.exe build -i [C:/godev]
# github.com/barnex/cuda5/cu
c:\GoDev\src\github.com\barnex\cuda5\cu\context.go:5:18: fatal error: cuda.h: No such file or directory
//#include <cuda.h>
           ^
compilation terminated.
Error: process exited with code 2.

I have the latest CUDA SDK from NVIDIA installed. What do I need to do in order to make the Go compiler see it?

jpreed00
  • 893
  • 8
  • 25

1 Answers1

1

It looks like your C compiler doesn't know what directory has the cuda header file. You can tell go to give the C compiler extra options using the CGO_CPPFLAGS environment variable. You probably want to set it to something like

CGO_CPPFLAGS="-isystem /path/to/dir/with/cuda/header/in/it"

See https://golang.org/cmd/cgo/

singron
  • 126
  • 5