PBR

No docs for setup.cfg syntax for compiled extensions

Bug #1510898 reported by Florian Wilhelm
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PBR
Confirmed
Medium
Unassigned

Bug Description

By looking in the source code of pbr/util.py it seems to be possible to define extensions in setup.cfg with following syntax:
[extension:ext_name]
sources=
include_dirs=
define_macros=
undef_macros=
library_dirs=
libraries=
runtime_library_dirs=
extra_objects=
extra_compile_args=
extra_link_args=
export_symbols=
swig_opts=
depends=

But this is not mentioned in the official documentation! Could this be added? Also how would one use dynamic generation of these options like when an extensions depends on numpy, you fairly often see:
include_dirs = [numpy.get_include()])
Is this also possible inside setup.cfg? If not one should also support it.

Ben Nemec (bnemec)
Changed in pbr:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Sadique (sheiksadique) wrote :

Has there been any progress on this.
I am looking to build a pytorch based module that requires building some cpp_extensions.

The build process works flawlessly if I use setup tools but when i use pbr there are linker errors.

My setup files looks as follows.

```
setup(
    setup_requires=['pbr'],
    pbr=True,
    ext_modules=[
        cpp_extension.CppExtension(
            'myextension',
            ['file1.cpp', 'file2.cpp']
        )],
    cmdclass={'build_ext': cpp_extension.BuildExtension},
)

```

Ofcourse ideally the ext_modules should be inside cfg file but as OP pointed out, it is not clear how i would use custom include dirs like `include_dirs=cpp_extension.include_paths()`.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.