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 Conrad Huang, 7 years ago

Status: assignedaccepted

It looks like Cython source code can be easily integrated as part of CModule entries. 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 as SourceFile entries of CModule entries in bundle_info.xml. The distutils/setuptools/Cython modules work together to

  • generate .c files for .py/.pyx files, and
  • convert the Extension instances passed to setup() 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 CModule entry. To build multiple modules, use multiple CModule entries. 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.

comment:2 by Eric Pettersen, 7 years ago

Sounds okay for C, but need support for converting to .cpp files as well.

comment:3 by Conrad Huang, 7 years ago

Resolution: fixed
Status: acceptedclosed

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.