Opened 5 weeks ago

Last modified 4 weeks ago

#57520 assigned defect

py-pyopencl: Does not build on libstdc++ systems; does not honor MacPorts build flags

Reported by: ryandesign (Ryan Schmidt) Owned by: petrrr
Priority: Normal Milestone:
Component: ports Version:
Keywords: snowleopard lion mountainlion Cc:
Port: py-pyopencl

Description

py-pyopencl doesn't build on older systems that use libstdc++, because although it includes the cxx11 1.1 portgroup, that portgroup can't function properly because the pyopencl build system does not make use of the CXXFLAGS and LDFLAGS that MacPorts sets.

I've spent a little time trying to understand the build system, but unfortunately I'm not getting very far. I don't know python very well. I see in the setup.py these lines:

        StringListOption("CXXFLAGS", default_cxxflags,
            help="Any extra C++ compiler options to include"),
        StringListOption("LDFLAGS", default_ldflags,
            help="Any extra linker options to include"),
        ])

Naïvely, I assume this means that the build system allows us to specify CXXFLAGS and LDFLAGS in some way. Unfortunately, I have been unable to determine what that way is. MacPorts of course already sets these as environment variables, which are being ignored.

I also notice that the build is using clang (instead of clang++) to compile the C++ code (but is using clang++ to link it). While this appears to work, it should ideally be fixed to use the right compiler.

Change History (2)

comment:1 Changed 5 weeks ago by ryandesign (Ryan Schmidt)

Note that you don't need to be on an older system to confirm if you've fixed this problem. On any system, you can look at the MacPorts debug output or main.log file to see if the -stdlib=... flag is being added where it should be.

comment:2 in reply to:  description Changed 4 weeks ago by ryandesign (Ryan Schmidt)

Replying to ryandesign:

I also notice that the build is using clang (instead of clang++) to compile the C++ code (but is using clang++ to link it). While this appears to work, it should ideally be fixed to use the right compiler.

I've learned that this is simply a bug in distutils that has never been fixed. Python simply does not support modules written in C++. Brilliant.

Note: See TracTickets for help on using tickets.