gocl icon indicating copy to clipboard operation
gocl copied to clipboard

Build error with -tags="cl12" or -tags="cl20" on NVidia

Open LeMoussel opened this issue 7 years ago • 0 comments

It's OK when I do go build -tags="cl11" gocl/cl

But with -tags="cl12", I encountered the following error:

gocl/cl/image12.go:47: c_image_desc.buffer undefined (type C.struct__cl_image_desc has no field or method buffer)

and with tags="cl20" this

gocl/cl/image12.go:47: c_image_desc.buffer undefined (type C.struct__cl_image_desc has no field or method buffer) gocl/cl/queue20.go:39: cannot use c_properties_ptr (type *C.cl_command_queue_properties) as type *C.cl_queue_properties in argument to func literal

I'm using Nvidia GT 1030 GPU card on Ubuntu 16.04 With tags="cl11", goclinfo give me this informations

Number of platforms: 	1
	CL_PLATFORM_PROFILE     : FULL_PROFILE
	CL_PLATFORM_VERSION     : OpenCL 1.2 CUDA 9.0.194
	CL_PLATFORM_VENDOR      : NVIDIA Corporation
	CL_PLATFORM_EXTENSIONS  : cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_fp64 cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll cl_nv_copy_opts cl_nv_create_buffer

	Number of devices: 	1
		CL_DEVICE_TYPE      : CL_DEVICE_TYPE_GPU
		CL_DEVICE_NAME      : GeForce GT 1030
		CL_DEVICE_VENDOR    : NVIDIA Corporation
		CL_DEVICE_PROFILE   : FULL_PROFILE

I set export CGO_CFLAGS=-I$GOPATH/src/gocl/android/include My Go environment looks like this:

dev@dev-Veriton-M421G:~/go/src$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/dev/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build006095219=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-I/src/gocl/android/include"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

LeMoussel avatar Dec 30 '17 11:12 LeMoussel