← Back to team overview

ubuntu-phone team mailing list archive

Re: golang and OpenCL attempts on the Ubuntu Saucy Nexus 4 undefined reference to `__libc_csu_fini'

 

status of golang/opencl on ubuntu phone saucy stable nexus 4:
-updated to Golang 1.2 did not fix this error.

Isolating golang out of the equation, I tried to just C++ compile Bolt,
but its cmake project required BOOST_ROOT environment variable.  In
order to have this, I resorted to trying to compile straight from
BOOST.org web site's tar.gz rather than apt getting sources.  What a
headache.  I did not succeed in compiling BOOST with cmake because it
boost.org doesn't use cmake.  OpenCL as shipped from AMDAPP requires cmake.

Recommendation:
-have ubuntu desktop & ubuntu phone install cmake support for
Boost/Bolt/OpenCL along with pre-built binaries
-have opencl support within ubuntu saucy nexus4 and desktop repositories.

Cheers,
David Marceau


On 12/08/2013 12:47 PM, David Marceau wrote:
> I have managed to compile golang OpenCL on ubuntu saucy stable Nexus 4.
>  I have a linker error I don't know how to get rid of:
> undefined reference to `__libc_csu_fini'
> undefined reference to `__libc_csu_init'
> 
> Any suggestions to fix this?
> Thank you.
> 
> Cheers,
> David Marceau
> 
> 
> Here are the noisy details:
> apt-get install golang
> wget http://adequatech.ca/gostuff.tar
> cd /home/phablet
> tar xvf gostuff.tar
> # these are already done in the tar
> # go get code.google.com/p/goncurses
> # go get github.com/tones111/raw
> # go get github.com/tones111/go-opencl/cl
> 
> export GOPATH=/home/phablet/gostuff
> cd /usr/include
> ln -s /home/phablet/gostuff/src/github.com/tones111/go-opencl/cl/CL CL
> 
> cd /home/phablet/gostuff/src/github.com/tones111/go-opencl/clinfo
> go build -x clinfo.go
> WORK=/tmp/go-build116707911
> mkdir -p $WORK/github.com/tones111/go-opencl/cl/_obj/
> mkdir -p $WORK/github.com/tones111/go-opencl/
> cd /home/phablet/gostuff/src/github.com/tones111/go-opencl/cl
> /usr/lib/go/pkg/tool/linux_arm/cgo -objdir
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -- -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ buffer.go commandQueue.go
> context.go device.go image.go kernel.go memory.go opencl.go platform.go
> program.go sampler.go
> /usr/lib/go/pkg/tool/linux_arm/5c -F -V -w -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -I
> /usr/lib/go/pkg/linux_arm -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/_cgo_defun.5 -D GOOS_linux
> -D GOARCH_arm $WORK/github.com/tones111/go-opencl/cl/_obj/_cgo_defun.c
> nclude -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/_cgo_export.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/_cgo_export.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/buffer.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/buffer.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/commandQueue.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/commandQueue.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/context.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/context.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/device.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/device.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/image.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/image.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/kernel.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/kernel.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/memory.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/memory.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/opencl.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/opencl.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/platform.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/platform.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/program.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/program.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include -I.
> -I/usr/include -I. -I/usr/include -I. -I/usr/include -I. -I/usr/include
> -I. -I/usr/include -I. -I/usr/include -I. -I
> $WORK/github.com/tones111/go-opencl/cl/_obj/ -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/sampler.cgo2.o -c
> $WORK/github.com/tones111/go-opencl/cl/_obj/sampler.cgo2.c
> gcc -I . -g -O2 -fPIC -marm -pthread -o
> $WORK/github.com/tones111/go-opencl/cl/_obj/_cgo_.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/_cgo_main.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/_cgo_export.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/buffer.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/commandQueue.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/context.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/device.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/image.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/kernel.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/memory.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/opencl.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/platform.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/program.cgo2.o
> $WORK/github.com/tones111/go-opencl/cl/_obj/sampler.cgo2.o -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ /lib/arm-linux-gnueabihf/libc.so.6 -lOpenCL
> -L/android/system/lib/ -lc -lOpenCL -L/android/system/lib/
> /lib/arm-linux-gnueabihf/libc.so.6 -pie
> # github.com/tones111/go-opencl/cl
> /android/system/lib//libc.so: warning: the `gets' function is dangerous
> and should not be used.
> /android/system/lib//libc.so: warning: the use of `mktemp' is dangerous,
> better use `mkstemp' or `mkdtemp'
> /android/system/lib//libc.so: warning: the use of `tempnam' is
> dangerous, better use `mkstemp'
> /android/system/lib//libc.so: warning: the use of `tmpnam' is dangerous,
> better use `mkstemp'
> /android/system/lib//libc.so: warning: the use of
> `pthread_attr_setstackaddr' is deprecated, use `pthread_attr_setstack'
> /android/system/lib//libc.so: warning: the use of
> `pthread_attr_getstackaddr' is deprecated, use `pthread_attr_getstack'
> /android/system/lib//libc.so: warning: the `gets' function is dangerous
> and should not be used.
> /android/system/lib//libc.so: warning: the use of `mktemp' is dangerous,
> better use `mkstemp' or `mkdtemp'
> /android/system/lib//libc.so: warning: the use of `tempnam' is
> dangerous, better use `mkstemp'
> /android/system/lib//libc.so: warning: the use of `tmpnam' is dangerous,
> better use `mkstemp'
> /usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/Scrt1.o:
> In function `_start':
> (.text+0x44): undefined reference to `__libc_csu_fini'
> /usr/lib/gcc/arm-linux-gnueabihf/4.8/../../../arm-linux-gnueabihf/Scrt1.o:
> In function `_start':
> (.text+0x48): undefined reference to `__libc_csu_init'
> collect2: error: ld returned 1 exit status
> 
> 



References