Opened 7 years ago
Closed 7 years ago
#1230 closed defect (fixed)
Better bundle_builder support for Cython
| Reported by: | Eric Pettersen | Owned by: | Conrad Huang |
|---|---|---|---|
| Priority: | blocker | Milestone: | 0.8 |
| Component: | Infrastructure | Version: | |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | 1229 | |
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
Need some way to inform Cython compile about headers and libs in other bundles.
Change History (3)
comment:1 by , 7 years ago
| Status: | assigned → accepted |
|---|
comment:2 by , 7 years ago
Sounds okay for C, but need support for converting to .cpp files as well.
comment:3 by , 7 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Fixed (mostly). RBVI bundles all build using the new version which requires a minimum of Makefile customization. Still have to make sure Tristan can compile his stuff using only bundle_builder but that is in other tickets.
Note:
See TracTickets
for help on using tickets.
It looks like Cython source code can be easily integrated as part of
CModuleentries. The main problem I ran into while testing is that you cannot cythonize functions that will be used for registering commands. Command registration uses the "inspect" module to examine the function signature, and a cythonized function causes that process to throw and exception. However, it is (or at least seems) straightforward otherwise: just list .py or .pyx source files asSourceFileentries ofCModuleentries in bundle_info.xml. Thedistutils/setuptools/Cythonmodules work together toExtensioninstances passed tosetup()to use the generated .c files.Fix should be in the daily builds tomorrow.
To build a single compiled module, list all the sources (whether C or Cython) in the same
CModuleentry. To build multiple modules, use multipleCModuleentries. The only trick is how to make a Cython module link against a C module. Will need to consult Eric for various scenarios where Cython is used.