Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building issues fixed on Mac with SDK 10.10 and Xcode 6.2 #1

Open
kayjkay opened this issue Jun 18, 2015 · 5 comments
Open

Building issues fixed on Mac with SDK 10.10 and Xcode 6.2 #1

kayjkay opened this issue Jun 18, 2015 · 5 comments

Comments

@kayjkay
Copy link

kayjkay commented Jun 18, 2015

I was unable to compile on Mac with SDK 10.10 and Xcode 6.2. However, the following are the simple fixes.

Copy cl.hpp:

https://www.khronos.org/registry/cl/api/1.2/cl.hpp

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenCL.framework/Versions/A/Headers

Fix CLUtils.hpp by adding #include < numeric > (std::accumulate needs it)

include < numeric >

to have this compile:
rep total (rep initVal = 0.0)
{
return std::accumulate (tExec.begin (), tExec.end (), initVal);
}

Fix CLUtils.cpp by adding (APPLE)

if defined(_WIN32)

include <windows.h>

elif defined(linux)

include <GL/glx.h>

elif APPLE

include <OpenGL/OpenGL.h>

endif

@kayjkay kayjkay changed the title Building issues fixed on Mac with SDK 10.10 an Xcode 6.2 Building issues fixed on Mac with SDK 10.10 and Xcode 6.2 Jun 18, 2015
@nlamprian
Copy link
Owner

Hey kayjkay,

Could you give me a little bit more information since I'm unfamiliar with OSX?

  1. Why do you need to copy cl.hpp? Is it not present on your system? Is the FindOpenCL module unable to find it?
  2. What do you need to include here:
#elif defined(__APPLE__)
#include <???>
#endif

@kayjkay
Copy link
Author

kayjkay commented Jun 19, 2015

Hi Nick,

Thank you for making the ICP source available.

The External Repository cmake did not work that I had to manually build
each of the dependencies. That's why I ended up building CLUtils.

To answer your questions:

  1. There wasn't cl.hpp is not present on the system. Installing XCode (IDE)
    installs the OSX SDK which includes OpenCL and OpenGL framework. Framework
    is a directory structure. Within it, there is cl.h but not cl.hpp. I did
    not do a diff of the two files to see if they were the same.
  2. It's #include <OpenGL/OpenGL.h>. The CglCreateContext symbol was not
    defined otherwise on Mac.

I hope to get your ICP source and the OpenGL example built on OSX. If I
bump in to an issue, I will let you know.

Thanks again.

Kay

On Thu, Jun 18, 2015 at 4:20 PM, Nick Lamprianidis <notifications@github.com

wrote:

Hey kayjkay,

Could you give me a little bit more information since I'm unfamiliar with
OSX?

  1. Why do you need to copy cl.hpp? Is it not present on your system?
    Is the FindOpenCL module unable to find it?
  2. What do you need to include here:

#elif defined(APPLE)
#include <???>
#endif


Reply to this email directly or view it on GitHub
#1 (comment).

@nlamprian
Copy link
Owner

Thank you Kay for the fixes.
I've already made a commit adding those includes.
On the cl.hpp matter, I'll wait until I get a more complete picture of the situation.
And yes, please let me know if anything else comes up.

@drhalftone
Copy link

Dear Guys;

I think I'm running into the same problem; however, I don't know how to fix it. Kayjkay, if you have had success, can you tell me how to get everything to compile? Here is what I'm getting when I try to compile CLutils by itself:

DrHalftone:build dllau$ cmake ..
-- - Includes: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OPENCL.framework
-- gtest not found:
-- - Library will be downloaded from source
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/dllau/SourceTree/CLUtils/build
DrHalftone:build dllau$ make
[ 7%] Building CXX object src/CMakeFiles/CLUtils.dir/CLUtils.cpp.o
In file included from /Users/dllau/SourceTree/CLUtils/src/CLUtils.cpp:37:
/Users/dllau/SourceTree/CLUtils/include/CLUtils.hpp:48:10: fatal error: 'OpenCL/cl.hpp' file not found
#include <OpenCL/cl.hpp>
^
1 error generated.
make[2]: *** [src/CMakeFiles/CLUtils.dir/CLUtils.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/CLUtils.dir/all] Error 2
make: *** [all] Error 2
DrHalftone:build dllau$

@drhalftone
Copy link

Ok, I found a reference to the same compiling problem but a different project. I now better understand kayjkay's solution. What I read was that Mac OS X 10.10 SDK doesn't include the C++ OpenCL headers (the ones that end in .hpp). So that's why we have to download them from Kronos. I thought that by following kayjkay's solution, I was duplicating the headers and that CMake just wasn't finding them. I see that was wrong. So now I can compile the CLUtils project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants