HDK - Multiple source compilation [Linux]

   2150   1   0
User Avatar
Member
301 posts
Joined: 7月 2005
Offline
This is a variation on the thread

http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=22535 [sidefx.com]

hence I am starting a new post.

I am starting a project SOP_CLProcessor

I have the main entry point via SOP_CLProcessor.C but there are a host of other support files GPUUtils.cxx, MemManager.cxx

If I use hcustom directly e.g.

hcustom -I <some dir> -L <some dir> -l OpenCL -i . SOP_CLProcessor.C GPUUtils.cxx MemManager.cxx

hcustom tries to build 3 individual *.so files

Is there a way to tell hcustom that we are only building a single plugin

I have tried using the Makefile approach but it has a lot of errors with locating the HDK's header file

What's more, when I do a “make clean”, it deleted my source file, good thing my code is under revision control so I could do a ‘hg revert’

I am not sure if it is a bug or my usage that is the problem hence I have not submitted a bug report.

Regards
Nicholas Yue
User Avatar
Member
7732 posts
Joined: 7月 2005
Offline
hcustom cannot be used to compile multiple files into a single plugin.

If you examine Makefile.gnu, you'll notice the that only .C and .cpp files are recognized, not .cxx. That's probably why it's not working for you.
OBJECTS = $(SOURCES:.C=.o)
OBJECTS := $(OBJECTS:.cpp=.o)


So you either need to change the names of your source files, or use your own custom Makefile.gnu variant. ie. add the line,

OBJECTS := $(OBJECTS:.cxx=.o)
  • Quick Links