[Relax-devel] Re: python to c++ (January 09, 2006 - 06:02)

Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Headers

 

I think I'm on the right track with the low level Python/C API.  I've
worked out how to build the shared objects and get them to import into
relax.  Now I need a bit more C knowledge to get the functions
functional.  This approach is probably the best as I now know how to
include Fortran code as well.  You use one of the C/Fortran APIs to
use the Fortran functions in the C code, the functions of which are
used by the Python code.  That way I can start using the fast linear
algebra functions of LAPACK or BLAS (maybe even ATLAS) to massively
speed up the number crunching in relax.

Oh, the use of the distutils package for compiling the code and
installing relax did not work very well.  It seems to be designed for
site-packages, building the code creates a directory called 'build' in
the base directory, followed by a directory named after the build
architecture, then a few other directories, and finally the name of
the actual directory the module belongs to (eg 'maths_fns').  Running
'python setup.py install' then copies the compiled *.so file into the
'site-packages' directory of the global python install.  Modifying
distutils to be useful seems like too much of a pain.  It will be very
useful once I spin the minimisation code out into it's own project but
for relax, distulits is not the right approach.

I've therefore decided to use Makefiles.  I've migrated my scripts for
cleaning up the byte compiled python files, the *.o and *.so files,
etc into the Makefile (without any modification of the rm command). 
There is also the relax manual compilation script, HTML version of the
manual compilation script, the packaging script, etc which can be
migrated to make rules.  It's a lot simpler than the distutil package,
although much less portable.

Edward


P.S.  I hope you don't mind me forwarding this to the relax-devel mailing list.


On 08/01/06, Andrew Perry <andrewjamesperry@xxxxxxxxx> wrote:
> I found yet another python to "something faster maybe" converter:
>
> http://shed-skin.blogspot.com/
>
> Probably won't be much use yet, but I've added it to my list :)
>


Related Mails




Powered by MHonArc, Updated Fri Jan 13 03:20:27 2006