Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Cython on Mac?

Received: by 10.43.61.141 with SMTP id ww13mr3844094icb.6.1348391470874;
        Sun, 23 Sep 2012 02:11:10 -0700 (PDT)
X-BeenThere: cython-users@googlegroups.com
Received: by 10.231.62.200 with SMTP id y8ls865965ibh.5.gmail; Sun, 23 Sep
 2012 02:11:09 -0700 (PDT)
Received: by 10.50.169.39 with SMTP id ab7mr1550619igc.4.1348391469566;
        Sun, 23 Sep 2012 02:11:09 -0700 (PDT)
Received: by 10.50.169.39 with SMTP id ab7mr1550618igc.4.1348391469555;
        Sun, 23 Sep 2012 02:11:09 -0700 (PDT)
Return-Path: <markflorisso...@gmail.com>
Received: from mail-oa0-f42.google.com (mail-oa0-f42.google.com [209.85.219.42])
        by gmr-mx.google.com with ESMTPS id dd6si1781205igc.0.2012.09.23.02.11.09
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 23 Sep 2012 02:11:09 -0700 (PDT)
Received-SPF: pass (google.com: domain of markflorisso...@gmail.com designates 209.85.219.42 as permitted sender) client-ip=209.85.219.42;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of markflorisso...@gmail.com designates 209.85.219.42 as permitted sender) smtp.mail=markflorisso...@gmail.com; dkim=pass header...@gmail.com
Received: by oagj1 with SMTP id j1so1134870oag.1
        for <cython-users@googlegroups.com>; Sun, 23 Sep 2012 02:11:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=oxx/QPn4BDfKAkqJMxxO2uw8+O0r7NXbyG0pdkOzjTc=;
        b=wLSyizMO5EiKp9d+Fqz1VX3Bz24m0yoSRf/ZW2d0MBHbukHjSedu4q9xU9gBmoVN3j
         pet4ATc6Oa+02/rQPjF1ZUyZGHSOsy5nFeg/PLxKleCVHjyMNN1rsC0jDqRpts+AotNY
         9YGgrvCRlD0RhdLEwYrc5nNCOyRQmuYZggHejHSOIFJD+vgq+3qskHToceFcDTszVIsV
         bGscU9cafZz1rVugfdZ1xcCGLdYjRr2Y7UkjyYjLiiLkoJspydagFNLq1K9gQurecUCp
         KWM83N2HRTkqgAdutu8booleZvSkKZ89hMPdY0gqv2SXFUr2YihqO+My2osUEkSduOFV
         3aEQ==
MIME-Version: 1.0
Received: by 10.182.1.72 with SMTP id 8mr7379615obk.61.1348391469172; Sun, 23
 Sep 2012 02:11:09 -0700 (PDT)
Received: by 10.76.93.9 with HTTP; Sun, 23 Sep 2012 02:11:09 -0700 (PDT)
In-Reply-To: <20120921103757.01e38c6a@dino>
References: <20120921103757.01e38c6a@dino>
Date: Sun, 23 Sep 2012 10:11:09 +0100
Message-ID: <CANg26EW51jCthP7td1fqh+atWN486SM90DeE3hWKEsvd7t2...@mail.gmail.com>
Subject: Re: [cython-users] Cython on Mac?
From: mark florisson <markflorisso...@gmail.com>
To: cython-users@googlegroups.com
Content-Type: text/plain; charset=UTF-8

On 21 September 2012 10:37, Mark Summerfield <l...@qtrac.plus.com> wrote:
> Hi,
>
> (1)
>
> I'm trying to build some Cython modules on Mac OS X 10.5. These build
> perfectly on Linux and they seem to build on Mac. However when I do
>
> import MyMod
>
> I get
>
> MyMod.cpython-32m.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00
>
> Can anyone tell me what I'm doing wrong?

Did you clean your build directory first? Make sure you don't have
object files from Linux lying around. Here is the clue:

>>> [chr(x) for x in (0x7f, 0x45, 0x4c, 0x46)]
['\x7f', 'E', 'L', 'F']

> (2)
>
> I'm also trying to access a third-party .dylib on Mac; again it works
> fine on Linux but on Mac it won't build because it says it can't find
> the library. In setup.py I have
>
>     setup(
>         libraries=[("thing", {})],
>         ext_modules=cythonize(...
>
> I tried adding library_dirs=["/path/to/"] to ext_modules but that didn't
> help.
>
> Nor can I find any documentation for setup()'s "libraries" option.
>
> Can anyone point me to an example where Cython is used to access a Mac
> .dylib?
>
> Thanks!
>
> --
> Mark Summerfield, Qtrac Ltd, www.qtrac.eu
>     C++, Python, Qt, PyQt - training and consultancy
>         "Advanced Qt Programming" - ISBN 0321635906
>             http://www.qtrac.eu/aqpbook.html