Git Product home page Git Product logo

Comments (3)

npinto avatar npinto commented on June 21, 2024

How did you link the shared library ?

Here is an example of setup.py (the one you call with python setup.py build_ext --inplace):


from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

import numpy

ext_modules=[
    Extension("fbcorr_cython", ["fbcorr_cython.pyx"],
              include_dirs = [numpy.get_include(),'.'],
              libraries=['cblas'],
              extra_compile_args = \
              ["-O3", "-Wall",
               "-pthread",
               "-fopenmp",
               #"-ffast-math",
               #"-funroll-all-loops",
               "-msse2",
               "-msse3",
               "-msse4",
               #"-fomit-frame-pointer",
               "-march=native",
               "-mtune=native",
               "-ftree-vectorize",
               "-ftree-vectorizer-verbose=2",
               #"-fwrapv",
              ],
              ),
]

setup(
  cmdclass = {'build_ext': build_ext},
  ext_modules = ext_modules,
)

The relevant line is in the libraries kwarg.

from asgd.

argoncloud avatar argoncloud commented on June 21, 2024

Nevermind, the problem is that I accidentally misnamed the shared
library as .o instead of .so - changing that solved it.

I am not using setup.py, I am compiling the files manually via Makefile
with the same calls specified at http://wiki.cython.org/tutorials/numpy
it's more convenient because with the Makefile variables you can use the
same parameters for compiling everything.

On 11/13/2011 10:56 PM, Nicolas Pinto wrote:

How did you link the shared library ?

Here is an example of setup.py (the one you call with python setup.py build_ext --inplace):


from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

import numpy

ext_modules=[
    Extension("fbcorr_cython", ["fbcorr_cython.pyx"],
              include_dirs = [numpy.get_include(),'.'],
              libraries=['cblas'],
              extra_compile_args = \
              ["-O3", "-Wall",
               "-pthread",
               "-fopenmp",
               #"-ffast-math",
               #"-funroll-all-loops",
               "-msse2",
               "-msse3",
               "-msse4",
               #"-fomit-frame-pointer",
               "-march=native",
               "-mtune=native",
               "-ftree-vectorize",
               "-ftree-vectorizer-verbose=2",
               #"-fwrapv",
              ],
              ),
]

setup(
  cmdclass = {'build_ext': build_ext},
  ext_modules = ext_modules,
)

The relevant line is in the libraries kwarg.


Reply to this email directly or view it on GitHub:
#10 (comment)

from asgd.

npinto avatar npinto commented on June 21, 2024

For Cython modules, please use setup.py or we'll have many issues in the future.

from asgd.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.