On Tue, Sep 8, 2009 at 8:41 AM, Sanne Korzec<[email protected]> wrote:
> Thanks for the implementation, can't wait to try. But again I'm running into
> some problems.
>
> I installed the c stl with configure --prefix='/home/me/libcalg'
>
> Changed the setup.py:
>
> #!/usr/bin/env python
> # python setup.py build_ext --inplace
> from distutils.core import setup
> from distutils.extension import Extension
> from Cython.Distutils import build_ext
>
> ext = Extension(
>    "cy_hash",
>    ["cy_hash.pyx"],
>    language="c",
>    include_dirs=['/home/me/libcalg/include/libcalg-1.0'],
>    library_dirs=['/home/me/libcalg/lib'],
>    libraries=['calg'],                 #also tried 'libcalg/calg'
>    cmdclass = {'build_ext': build_ext}
>    )
>
> setup(
>    cmdclass={'build_ext': build_ext},
>    ext_modules=[ext]
>    )
>
> When I run python setup.py build_ext --inplace
>
> I get a warning: /usr/lib/python2.5/distutils/extension.py:133: UserWarning:
> Unknown Extension options: 'cmdclass'
> warnings.warn(msg)
>

The warning is very clear, I think... 'cmdclass' is not an option for
Extension(), so remove it... 'cmdclass' is an option for the setup()
function...


> When I run python -c 'import cy_hash as cc; cc.test()'
>
> I get: ImportError: libcalg.so.0: cannot open shared object file: No such
> file or directory
>
> The file is compiled and ready in '/home/me/libcalg/lib' and is rwx
> accessible for me. What's going on here?
>

Please add the argument below to the Extension() constructor...

ext = Extension(
,,,,
runtime_library_dirs=['/home/me/libcalg/lib'],
...
)

That way, distutils will ask the C compiler to pass an special flag
("-Wl,-rpath /home/me/libcalg/lib") to the linker specifying the path
of your library...


>
>
> -----Original Message-----
> From: Robert Bradshaw [mailto:[email protected]]
> Sent: maandag 7 september 2009 23:53
> To: Cython-dev; Sebastien Binet
> Cc: [email protected]
> Subject: Re: [Cython] FW: cython and hash tables / dictionary
>
> Thanks for the implementation. I noticed that your compare was only
> comparing pointers, so if you had two equal strings at different
> memory addresses it wouldn't find them (which may or may not be what
> you'd want) Also, your pointers would go out of scope as soon as test
> ended (so you couldn't return ht and use it later).
>
> I built on what you had to get a float -> float hashtable. Note that
> this technique only works since the float value fits inside a void*,
> anything bigger and you'd have to allocate memory manually to stick
> it into the hashtable.
>
> - Robert
>
>
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to