[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - NEWB Example GCC Compilation

NEWB Example GCC Compilation

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

NEWB Example GCC Compilation

Postby doddy1985 » Fri Jul 03, 2015 4:46 pm

Hello,

I just want to try and run one of the examples that came with the image installed on my parallela. I am at:

/usr/local/browndeer/examples/hello_opencl/

from the README file it says to compile use:
gcc hello_opencl.c -o hello_opencl.x -I/usr/local/browndeer/include -L/usr/local/browndeer/lib -lcoprthr


I sudo this command but get these results:
linaro-nano:/usr/local/browndeer/examples/hello_opencl> sudo gcc hello_opencl.c -o hello_opencl.x -I/usr/local/browndeer/include -L/usr/local/browndeer/lib -lcoprthr
/tmp/ccewc8h5.o: In function `main':
hello_opencl.c:(.text+0x2a): undefined reference to `clGetPlatformIDs'
hello_opencl.c:(.text+0x54): undefined reference to `clGetPlatformIDs'
hello_opencl.c:(.text+0x9e): undefined reference to `clGetPlatformInfo'
hello_opencl.c:(.text+0x11e): undefined reference to `clGetDeviceIDs'
hello_opencl.c:(.text+0x15a): undefined reference to `clGetDeviceIDs'
hello_opencl.c:(.text+0x1ba): undefined reference to `clCreateContext'
hello_opencl.c:(.text+0x1de): undefined reference to `clCreateCommandQueue'
hello_opencl.c:(.text+0x3ba): undefined reference to `clCreateBuffer'
hello_opencl.c:(.text+0x3e8): undefined reference to `clCreateBuffer'
hello_opencl.c:(.text+0x416): undefined reference to `clCreateBuffer'
hello_opencl.c:(.text+0x468): undefined reference to `clCreateProgramWithSource'
hello_opencl.c:(.text+0x486): undefined reference to `clBuildProgram'
hello_opencl.c:(.text+0x4a0): undefined reference to `clCreateKernel'
hello_opencl.c:(.text+0x4b4): undefined reference to `clSetKernelArg'
hello_opencl.c:(.text+0x4c6): undefined reference to `clSetKernelArg'
hello_opencl.c:(.text+0x4d8): undefined reference to `clSetKernelArg'
hello_opencl.c:(.text+0x4ea): undefined reference to `clSetKernelArg'
hello_opencl.c:(.text+0x52c): undefined reference to `clEnqueueNDRangeKernel'
hello_opencl.c:(.text+0x562): undefined reference to `clEnqueueReadBuffer'
hello_opencl.c:(.text+0x56e): undefined reference to `clWaitForEvents'
hello_opencl.c:(.text+0x5f2): undefined reference to `clReleaseEvent'
hello_opencl.c:(.text+0x5fe): undefined reference to `clReleaseEvent'
hello_opencl.c:(.text+0x608): undefined reference to `clReleaseKernel'
hello_opencl.c:(.text+0x612): undefined reference to `clReleaseProgram'
hello_opencl.c:(.text+0x61e): undefined reference to `clReleaseMemObject'
hello_opencl.c:(.text+0x62a): undefined reference to `clReleaseMemObject'
hello_opencl.c:(.text+0x636): undefined reference to `clReleaseMemObject'
hello_opencl.c:(.text+0x640): undefined reference to `clReleaseCommandQueue'
hello_opencl.c:(.text+0x64a): undefined reference to `clReleaseContext'



Looking at the paths for include path and library path I see these lists of files respectively (include list, then library path):
linaro-nano:/usr/local/browndeer/include> ls
CL/ clsched.h e32pth_if_needham.h
CLETE/ clvector.h e32pth_mem_if_needham.h
clarg.h coprthr/ esdk_missing.h
clcontext.h coprthr.h kcall.h
clelf.h coprthr_arch.h opencl_lift.h
clerror.h coprthr_dev.h opencl_lift_icc.h
clexec.h coprthr_device.h opencl_lift_icc_mic.h
clfcn.h coprthr_mem.h sl_engine.h
clforka.h coprthr_program.h stdcl.h
clinit.h coprthr_sched.h stdcl_host.h
clmalloc.h coprthr_thread.h stdcl_kernel.h
clmalloc_allocator.h coprthr_types.h stdcl_kernel_openclcompat.h
clmulti_array.h coprthr_xdevice.h workp.h
clrpc.h e32_config_needham.h
clrpc_common.h e32_opencl_ext.h

linaro-nano:/usr/local/browndeer/lib> ls
_e32pth_core_main_needham.o libcoprthr_opencl.so
_e32pth_core_needham.ldf libcoprthrcc-e.a
libclelf.a libcoprthrcc-e.so
libclelf.so libcoprthrcc.a
libclrpc.a libcoprthrcc.so
libclrpc.so libe_platform.so
libcoprthr.a libe_platform.so.needham
libcoprthr.so libocl.a
libcoprthr_arch_e32.so libocl.so
libcoprthr_arch_x86_64.a libstdcl.a
libcoprthr_arch_x86_64.so libstdcl.so
libcoprthr_opencl.a


The source code for the c file has include for these:
#include <stdlib.h>
#include <stdio.h>
#include <CL/cl.h>

I don't see the stdlib.h or stdio.h in the include path, but i do see cl.h in the CL under include path:
linaro-nano:/usr/local/browndeer/include/CL> ls
cl.h cl_ext.h cl_gl.h cl_platform.h cl_platform_scalar.h

opening the header cl.h I don't see any reference to the function 'clGetPlatformIDs' or any of the functions that the compiler is complaining about (in bold above), so it makes sense why i'm not compiling. Is there a later install file I need to grab from Github, am I just out of date perhaps? I can't recall where I saw on the parallela forum, but I thought I saw someone mentioning a later image has updated libraries.



If I try to compile with debugger I get:
linaro-nano:/usr/local/browndeer/examples/hello_opencl> sudo gcc hello_opencl.c -o hello_opencl.x -I/usr/local/browndeer/include -L/usr/local/browndeer/lib -lcoprthr_d
/usr/bin/ld: cannot find -lcoprthr_d
collect2: error: ld returned 1 exit status

I don't see any lcoprthr_d at the library path either (there is a lcoprthr.a and lcoprthr.so).


Has anyone had the same problem? Did you resolve? Any help to get my libraries in good shape? Sorry this is so newby, I'm still trying to wrap my head around basic level things. Maybe this should be in stackoverflow for general linux path stuff/gcc compiler issues instead of parallela specific, I wasn't sure if it is just operator error or if I'm missing a latest build for parallella stuff.
doddy1985
 
Posts: 15
Joined: Tue Oct 08, 2013 4:38 pm

Re: NEWB Example GCC Compilation

Postby jar » Thu Jun 30, 2016 4:11 pm

User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am

Re: NEWB Example GCC Compilation

Postby nickoppen » Fri Jul 01, 2016 1:32 am

Hi JAR,

The download link and the change log link on that page are not working. Both bring up a 404.

nick
Sharing is what makes the internet Great!
User avatar
nickoppen
 
Posts: 266
Joined: Mon Dec 17, 2012 3:21 am
Location: Sydney NSW, Australia

Re: NEWB Example GCC Compilation

Postby jar » Fri Jul 01, 2016 3:26 am

Nick,

I would expect them to work soon. I only checked the documentation links earlier.

They docs were just uploaded recently.
User avatar
jar
 
Posts: 295
Joined: Mon Dec 17, 2012 3:27 am


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 2 guests

cron