[Numpy-discussion] Building statically-linked Numpy causes problems with f2py extensions

listservs at mac.com listservs at mac.com
Thu Jun 8 19:43:57 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Because of complaints of linking errors from some OS X users, I am  
trying to build and distribute statically-linked versions. To do  
this, I have taken the important libraries (e.g. freetype, libg2c),  
and put them in a directory called staticlibs, then built numpy by:

python setup.py build_clib build_ext -L../staticlibs build bdist_mpkg

It builds, installs and runs fine. However, when I go to build and  
run f2py extensions, I now get the following (from my PyMC code):


/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/PyMC/MCMC.py
      37 _randint = random.randint
      38 rexponential = random.exponential
- ---> 39 from flib import categor as _categorical
         global flib = undefined
         global categor = undefined
         global as = undefined
         _categorical = undefined
      40 from flib import rcat as rcategorical
      41 from flib import binomial as _binomial

ImportError: Loaded module does not contain symbol _initflib

Here, flib is the f2py extension that is built in the PyMC setup file  
according to:

from numpy.distutils.core import setup, Extension
flib = Extension(name='PyMC.flib',sources=['PyMC/flib.f'])
version = "1.0"
distrib = setup(
         version=version,
         author="Chris Fonnesbeck",
         author_email="fonnesbeck at mac.com",
         description="Version %s of PyMC" % version,
         license="Academic Free License",
         name="PyMC",
         url="pymc.sourceforge.net",
         packages=["PyMC"],
         ext_modules = [flib]
)

This worked fine before my attempts to statically link numpy. Any  
ideas regarding a solution?

Thanks,
Chris
- --
Christopher Fonnesbeck
+ Atlanta, GA
+ fonnesbeck at mac.com
+ Contact me on AOL IM using email address


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFEiLY+keka2iCbE4wRAi1/AJ90K7LIkF7Y+ti65cVxLB1KCA+MNgCggj2p
I1jzals7IoBeYX0cWfmlbcI=
=bY3a
-----END PGP SIGNATURE-----




More information about the NumPy-Discussion mailing list