-framework with nvcc? and/or objective c++?
Hi, I'm not sure if anyone already posted this on this site or not because I can't get the search function to work in this forum.
Anyway, I am trying to compile some code using some mac objective c++ frameworks and nvcc code to utilize my new GPU.
However, I can't figure out how to compile and link both objective c++ files that use mac frameworks and the nvcc files.
If anyone has figured this out, could you please give me a command line example of how to do the compiling and/or linking? Thanks!
Hi, I'm not sure if anyone already posted this on this site or not because I can't get the search function to work in this forum.

Anyway, I am trying to compile some code using some mac objective c++ frameworks and nvcc code to utilize my new GPU.

However, I can't figure out how to compile and link both objective c++ files that use mac frameworks and the nvcc files.

If anyone has figured this out, could you please give me a command line example of how to do the compiling and/or linking? Thanks!

#1
Posted 01/04/2010 03:48 PM   
[quote name='sean.mcguffee@gmail.com' post='975314' date='Jan 4 2010, 09:48 AM']Hi, I'm not sure if anyone already posted this on this site or not because I can't get the search function to work in this forum.
Anyway, I am trying to compile some code using some mac objective c++ frameworks and nvcc code to utilize my new GPU.
However, I can't figure out how to compile and link both objective c++ files that use mac frameworks and the nvcc files.
If anyone has figured this out, could you please give me a command line example of how to do the compiling and/or linking? Thanks![/quote]

I have posted a new topic that contains a modified common.mk and an example Makefile that allows you to use Objective-C, Cocoa API, and frameworks.

The entire project source code for the project is on SourceForge with working XCode projects. Its at: [url="http://sourceforge.net/projects/flam4/"]http://sourceforge.net/projects/flam4/[/url]
[quote name='sean.mcguffee@gmail.com' post='975314' date='Jan 4 2010, 09:48 AM']Hi, I'm not sure if anyone already posted this on this site or not because I can't get the search function to work in this forum.

Anyway, I am trying to compile some code using some mac objective c++ frameworks and nvcc code to utilize my new GPU.

However, I can't figure out how to compile and link both objective c++ files that use mac frameworks and the nvcc files.

If anyone has figured this out, could you please give me a command line example of how to do the compiling and/or linking? Thanks!



I have posted a new topic that contains a modified common.mk and an example Makefile that allows you to use Objective-C, Cocoa API, and frameworks.



The entire project source code for the project is on SourceForge with working XCode projects. Its at: http://sourceforge.net/projects/flam4/

#2
Posted 01/09/2010 10:12 PM   
[quote name='sean.mcguffee@gmail.com' post='975314' date='Jan 4 2010, 10:48 AM']Hi, I'm not sure if anyone already posted this on this site or not because I can't get the search function to work in this forum.
Anyway, I am trying to compile some code using some mac objective c++ frameworks and nvcc code to utilize my new GPU.
However, I can't figure out how to compile and link both objective c++ files that use mac frameworks and the nvcc files.
If anyone has figured this out, could you please give me a command line example of how to do the compiling and/or linking? Thanks![/quote]

You can pass framework arguments though nvcc to the linker using the -Xlinker option.
For instance:
[indent]nvcc -Xlinker -framework,GLUT -Xlinker -framework,OpenGL -Xlinker -framework,Cocoa myGLcode.cu[/indent]
[quote name='sean.mcguffee@gmail.com' post='975314' date='Jan 4 2010, 10:48 AM']Hi, I'm not sure if anyone already posted this on this site or not because I can't get the search function to work in this forum.

Anyway, I am trying to compile some code using some mac objective c++ frameworks and nvcc code to utilize my new GPU.

However, I can't figure out how to compile and link both objective c++ files that use mac frameworks and the nvcc files.

If anyone has figured this out, could you please give me a command line example of how to do the compiling and/or linking? Thanks!



You can pass framework arguments though nvcc to the linker using the -Xlinker option.

For instance:

[indent]nvcc -Xlinker -framework,GLUT -Xlinker -framework,OpenGL -Xlinker -framework,Cocoa myGLcode.cu[/indent]

#3
Posted 07/26/2010 07:16 PM   
[quote name='Bionary' date='26 July 2010 - 08:16 PM' timestamp='1280171810' post='1093926']
You can pass framework arguments though nvcc to the linker using the -Xlinker option.
For instance:
[indent]nvcc -Xlinker -framework,GLUT -Xlinker -framework,OpenGL -Xlinker -framework,Cocoa myGLcode.cu[/indent]
[/quote]
Works great, very important information. The first guess would be to add "-framework OpenGL" just like gcc but you have to know about the "Xlinker" packaging.

One could of course note that you can compile your .cu files to object code, and then link with other .o files with gcc/g++ (and use the usual -framework syntax).
[quote name='Bionary' date='26 July 2010 - 08:16 PM' timestamp='1280171810' post='1093926']

You can pass framework arguments though nvcc to the linker using the -Xlinker option.

For instance:

[indent]nvcc -Xlinker -framework,GLUT -Xlinker -framework,OpenGL -Xlinker -framework,Cocoa myGLcode.cu[/indent]



Works great, very important information. The first guess would be to add "-framework OpenGL" just like gcc but you have to know about the "Xlinker" packaging.



One could of course note that you can compile your .cu files to object code, and then link with other .o files with gcc/g++ (and use the usual -framework syntax).

#4
Posted 11/23/2011 08:22 AM   
Scroll To Top