0

I have a problem in compiling simple program using openCL under Ubuntu. I have downloaded the AMD stream SDK from the AMD site and I have installed it using the installation notes from the same site. I have copied a simple hello world program from a OpenCL manual and I've tried to compile it using the command suggested from manual :

gcc -o hello -I '$AMDSTREAMSDKROOT/include' -L '$AMDSTREAMSDKROOT/lib/x86_64' hello.c ‐lOpenCL    

but the answer from the compiler is

gcc: error: ‐lOpenCL: no such file or directory

Does anyone has any ideas about this problem? Thanks

Hristo Iliev
  • 72,659
  • 12
  • 135
  • 186
JohnMarco
  • 31
  • 1
  • 5
  • Did you see this? http://stackoverflow.com/questions/3668680/gcc-fails-to-recognize-i-path – JoeManiaci Oct 07 '14 at 15:35
  • Yes.. But it doesn't work for me.. For now my solution is removing -L directive and substitute it with the whole path of the library.. But I don't know why the solution with the inclusion of a search path doesn't work – JohnMarco Oct 08 '14 at 16:07

1 Answers1

2

You appear to be using strong quotes (single quotes), which will prevent the environment variable $AMDSTREAMSDKROOT from being expanded. Try using double-quotes instead:

gcc -o hello -I "$AMDSTREAMSDKROOT/include" -L "$AMDSTREAMSDKROOT/lib/x86_64" hello.c ‐lOpenCL
jprice
  • 9,755
  • 1
  • 28
  • 32