#6 provide archive of compiled files

closed
nobody
None
5
2011-03-06
2011-02-10
No

instead of only providing the pycxx source files (cxx_extensions.cxx, etc) the possibility to build a library archive from them so users only need to link their own files with the archive would be beneficial.

E.g. by adding this to the makefile created by setup_makefile.py (example for linux):
obj/libpycxx.a:
ar cru obj/libpycxx.a obj/cxxsupport.objobj/cxx_extensions.obj obj/cxxextensions.obj obj/IndirectPythonInterface.obj

compiling extensions could then be done like this:
g++ -shared -g -o obj/example.so -g -Wall -fPIC -fexceptions -frtti -I. -ISrc -I/usr/include/python2.6 -DNDEBUG obj/example.o obj/range.o obj/rangetest.o -Lobj -lpycxx

I think this would simplify the build process a bit and make distribution in package based operating systems more transparent.

When this is done it would be great if pysvn's setup.py would accept an archive instead of only --pycxx-src-dir

Discussion

  • Julian Taylor

    Julian Taylor - 2011-02-12

    two patches added based on 6.2.2
    0001 generates an archive with ar (static library)
    0002 generates a versioned shared library (+soname link)
    both only work on linux like systems

     
  • Barry Alan Scott

    This request comes up from time to time.

    Its not a good idea because the compile options that you choose make a big difference to the
    object code. Its not practical to pick one set of compiler options that deliver binaries for it.

    I recommend that any use of PyCXX compiles the PyCXX sources along with the rest of their
    modules code so that the compiler options match.

    PySVN knows how to handle PyCXX from sources. I do not find it a problem for PySVN.

     
  • Barry Alan Scott

    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks