lppcom / opencl-book-samples

Automatically exported from code.google.com/p/opencl-book-samples
0 stars 0 forks source link

Defect: (ch7) #34

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If this is an issue with the source code, please specify the problem,
platform, OpenCL implementation, and any additional information that will help 
us reproduce the problem:

After a fresh checkout and following the build instructions on the wiki, GCC on 
OS X 10.6.8 & Xcode 4.0 errors out due to undefined variables in the 
SimpleBufferSubBuffer example of chapter 7.

Please provide any additional information below.

henksmacbook:build henk$ uname -a
Darwin henksmacbook.fritz.box 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 
16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
henksmacbook:build henk$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
henksmacbook:build henk$ cmake ../
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found OpenCL: /System/Library/Frameworks/OpenCL.framework 
-- Boost version: 1.47.0
-- Found the following Boost libraries:
--   program_options
-- Configuring done
-- Generating done
-- Build files have been written to: 
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/build
henksmacbook:build henk$ make
Scanning dependencies of target HelloWorld
[  8%] Building CXX object 
src/Chapter_2/HelloWorld/CMakeFiles/HelloWorld.dir/HelloWorld.cpp.o
Linking CXX executable HelloWorld
[  8%] Built target HelloWorld
Scanning dependencies of target OpenCLInfo
[ 16%] Building CXX object 
src/Chapter_3/OpenCLInfo/CMakeFiles/OpenCLInfo.dir/OpenCLInfo.cpp.o
Linking CXX executable OpenCLInfo
[ 16%] Built target OpenCLInfo
Scanning dependencies of target OpenCLConvolutionChap3
[ 25%] Building CXX object 
src/Chapter_3/OpenCLConvolution/CMakeFiles/OpenCLConvolutionChap3.dir/Convolutio
n.cpp.o
Linking CXX executable OpenCLConvolutionChap3
[ 25%] Built target OpenCLConvolutionChap3
Scanning dependencies of target HelloBinaryWorld
[ 33%] Building CXX object 
src/Chapter_6/HelloBinaryWorld/CMakeFiles/HelloBinaryWorld.dir/HelloBinaryWorld.
cpp.o
Linking CXX executable HelloBinaryWorld
[ 33%] Built target HelloBinaryWorld
Scanning dependencies of target SimpleBufferSubBuffer
[ 41%] Building CXX object 
src/Chapter_7/SimpleBufferSubBuffer/CMakeFiles/SimpleBufferSubBuffer.dir/simple.
cpp.o
In file included from 
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/simple.cpp:22:
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/info.hpp: In static member function ‘static void 
InfoDevice<T>::display(_cl_device_id*, cl_device_info, std::string)’:
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/info.hpp:200: error: ‘CL_FP_SOFT_FLOAT’ was not declared 
in this scope
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/simple.cpp: In function ‘int main(int, char**)’:
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/simple.cpp:205: error: ‘cl_buffer_region’ was not 
declared in this scope
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/simple.cpp:205: error: expected `;' before ‘region’
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/simple.cpp:213: error: ‘CL_BUFFER_CREATE_TYPE_REGION’ 
was not declared in this scope
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/simple.cpp:214: error: ‘region’ was not declared in this 
scope
/Users/henk/Dropbox/Programmeren/opencl-book-samples-read-only/src/Chapter_7/Sim
pleBufferSubBuffer/simple.cpp:215: error: ‘clCreateSubBuffer’ was not 
declared in this scope
make[2]: *** 
[src/Chapter_7/SimpleBufferSubBuffer/CMakeFiles/SimpleBufferSubBuffer.dir/simple
.cpp.o] Error 1
make[1]: *** 
[src/Chapter_7/SimpleBufferSubBuffer/CMakeFiles/SimpleBufferSubBuffer.dir/all] 
Error 2
make: *** [all] Error 2

Original issue reported on code.google.com by henkpo...@gmail.com on 7 Sep 2011 at 6:42

GoogleCodeExporter commented 8 years ago
Sorry for the title..

Could the problem be that clCreateSubBuffer is OpenCL 1.1, and that OS X Snow 
Leopard only implements OpenCL 1.0 (at least at release time, so 10.6.0) ?

Original comment by henkpo...@gmail.com on 7 Sep 2011 at 7:24

GoogleCodeExporter commented 8 years ago
You need to install OS X Lion for OpenCL 1.1 support. Note that the book is 
based on OpenCL 1.1 and so you need to have a valid 1.1 implementation for many 
of the examples to work correctly.

I'm moving this to invalid as I don't think it is an issue. Please reopen if 
this is not the case.

Original comment by benedict...@gmail.com on 7 Sep 2011 at 7:29