-Wno-long-double ?

279 views
Skip to first unread message

Rekveld

unread,
Dec 12, 2009, 3:02:14 PM12/12/09
to pygraphviz-discuss
Hi,

i'm a relative newbie, so my apologies if this questions seems silly.
I'm attempting to install pygraphviz, I run the enthought distribution
python 2.5 on mac os X 10.6.2.
First I tried the easy_install, and after an error I donwloaded the
source and am now trying setup.py

Both give me the same series of errors:

cc1: error: unrecognized command line option "-Wno-long-double"
lipo: can't figure out the architecture type of: /var/folders/K0/K0Evt-
jhE1aRP+AB5PoHCk+++TI/-Tmp-//ccS8GLKW.out
error: command 'gcc' failed with exit status 1

can somebody help me solve this ?

thanks,

Joost.

Rekveld

unread,
Dec 12, 2009, 3:53:55 PM12/12/09
to pygraphviz-discuss

Hi,

just installed pygraphviz via macports and that seemed to work at
first, but when i try to run it says:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/
4.1.30101/lib/python2.5/site-packages/pygraphviz/_graphviz.so, 2): no
suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/
site-packages/pygraphviz/_graphviz.so: mach-o, but wrong architecture

which perhaps points to the same problem ?

any help very much appreciated..

Christopher Ellison

unread,
Dec 12, 2009, 4:31:55 PM12/12/09
to pygraphvi...@googlegroups.com
One major difficulty is navigating through the various python
distributions on your computer. On the mac, some potential
distributions are:

1) the system python
2) the enthought python
3) the fink python
4) the macports python

Since you are using the enthought python distribution, you cannot
install pygraphviz through macports. What you can do, however, is
install 'graphviz' within macports. This will setup the build
environment for you to manually compile pygraphviz (from svn or tar.gz).
You will then need to choose where to install pygraphviz, and this
location will need to be added to your PYTHONPATH. Finally, when you
load the enthought python, it will be able to find pygraphviz.

So I'm guessing what has happened in your case is that pygraphviz was
installed in /opt/... (which is the macports location) and your
enthought python distribution is not finding the _graphviz.so module.

My recommendation is to install pygraphviz (manually) after installing
'graphviz' via macports (so that you have the headers, etc).

python setup.py install --user # assuming python 2.6

Then add

~/.local/lib/python2.6/site-packages/pygraphviz

to your PYTHONPATH (again, assuming python 2.6).

Pardon any mistakes in the above,
Chris
> --
>
> You received this message because you are subscribed to the Google Groups "pygraphviz-discuss" group.
> To post to this group, send email to pygraphvi...@googlegroups.com.
> To unsubscribe from this group, send email to pygraphviz-disc...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pygraphviz-discuss?hl=en.
>
>

Rekveld

unread,
Dec 12, 2009, 5:48:28 PM12/12/09
to pygraphviz-discuss

Hi Christopher,

thanks a lot for the reply.
I tried three things:
- easy_install pygraphviz
- manually installing pygraphviz
- installing pygraphviz via macports (which meant it started
installing the macports python 2.5 too :((, so now I do have three of
the four python installs you mention ) I copied the build to a known
place and added that place to the pythonpath. I also tried without
moving anything, but

before doing this I installed Graphviz via macPorts (and found out
after trying lots of things that I had to change the PATH-variable in
Eclipse/PyDev to make sure my pYthon could find the executables)

the first two gave me the error I mention in my first email: I can't
seem to compile it properly, and to my uninformed eye that looks like
a strange command line option indeed ? isn't there an error of some
sort there ?
the third approach gave the error in my second post.

as far as I can understand what you describe is the same as my second
approach; the only difference is the '--user' option, which does not
work for me since I am on python 2.5, is that something essential ?

just tried the easy_install again, and if I read the terminal
messages, it does seem to find graphviz in the righ place, so I
wouldn't think that would be the problem...
below the messages from terminal:

Processing pygraphviz-0.99.1.zip
Running pygraphviz-0.99.1/setup.py -q bdist_egg --dist-dir /var/
folders/K0/K0Evt-jhE1aRP+AB5PoHCk+++TI/-Tmp-/easy_install-vkc-UW/
pygraphviz-0.99.1/egg-dist-tmp-SqAeV1
Trying pkg-config
library_path=/opt/local/lib
include_path=/opt/local/include/graphviz
warning: no files found matching '*.edgelist' under directory
'examples'
warning: no files found matching '*.mbox' under directory 'examples'
warning: no files found matching '*.bz2' under directory 'examples'
warning: no files found matching '*.png' under directory 'doc'
warning: no previously-included files matching '*~' found anywhere in
distribution
warning: no previously-included files matching '*.pyc' found anywhere
in distribution
warning: no previously-included files matching '.svn' found anywhere
in distribution
no previously-included directories found matching 'doc/build'
cc1: error: unrecognized command line option "-Wno-long-double"
cc1: error: unrecognized command line option "-Wno-long-double"
lipo: can't figure out the architecture type of: /var/folders/K0/K0Evt-
jhE1aRP+AB5PoHCk+++TI/-Tmp-//ccq4ncsG.out
error: Setup script exited with error: command 'gcc' failed with exit
status 1

any more ideas ?


Aric Hagberg

unread,
Dec 12, 2009, 6:00:47 PM12/12/09
to pygraphvi...@googlegroups.com
That looks OK up to the error.

My guess is some interaction between the 10.6.2 version of gcc (which is it?)
and your Python install.

Does this help? Might be others if you google for that error.

http://www.reddit.com/r/Python/comments/9gpuc/snow_leopard_and_python_compatibility_issues/

Aric

Christopher Ellison

unread,
Dec 12, 2009, 6:11:44 PM12/12/09
to pygraphvi...@googlegroups.com


Rekveld wrote the following on 12/12/2009 02:48 PM:
> Hi Christopher,
>
> thanks a lot for the reply.
> I tried three things:
> - easy_install pygraphviz

Keep in mind that with "easy_install", you need to make sure that it is
running the proper python (system, fink, macports, enthought, etc). You
can find this out by examining the "easy_install" file and looking at
the first or second line.

>
> before doing this I installed Graphviz via macPorts (and found out
> after trying lots of things that I had to change the PATH-variable in
> Eclipse/PyDev to make sure my pYthon could find the executables)
>
>

When having troubles like this, I would avoid IDEs until after I am sure
everything is working from the command-line. It avoids dealing with yet
another layer.

the first two gave me the error I mention in my first email: I can't
> seem to compile it properly, and to my uninformed eye that looks like
> a strange command line option indeed ? isn't there an error of some
> sort there ?

Indeed, and I just read Aric's response. It definitely looks like
something with the gcc version and the OS/configuration. Further
googling suggests this is a pretty common problem. The "proper"
solution might be elusive, but I found multiple possible solutions. For
example:

http://groups.google.com/group/cython-users/browse_thread/thread/5ce58f208c07687a

Make sure you use the right python and if you want to use easy_install,
make sure it is using the right python. Also, the --user is not
essential. You can use --prefix=~/ or something similar for python
versions less than 2.6.

Chris

Rekveld

unread,
Dec 12, 2009, 6:50:31 PM12/12/09
to pygraphviz-discuss
thanks Aric and Chris for the suggestions !

Aric's pointer pointed further to this:
<http://mtrichardson.com/2009/09/fixing-jinja2-and-pycrypto-and-
probably-others-on-snow-leopard/>

I reinstalled me developer tools, including the 10.4 SDK, but that
didn't work.
gcc still fails.

It is gcc 4.2.1 on Snow Leopard by the way, I understand that might be
the problem ?

I also found this:

<http://quatermain.tumblr.com/post/124150829/iphone-2-x-sdks-on-snow-
leopard>

which I understand effectively calls an older version of gcc unless
specified otherwise. Is that not overkill ?
Is there no way to manually specify an older gcc version while
compiling pygraphviz, rather than changing my default compiler for
everything ?

thanks !

Rekveld

unread,
Dec 12, 2009, 7:15:20 PM12/12/09
to pygraphviz-discuss

just tried agian the manual install:

terminal says this:

crystalbox:pygraphviz-0.99.1 joost$ python setup.py install
Trying pkg-config
library_path=/opt/local/lib
include_path=/opt/local/include/graphviz
running install
running build
running build_py
running build_ext
building 'pygraphviz._graphviz' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -
fno-common -dynamic -DNDEBUG -g -O3 -I/opt/local/include/graphviz -I/
Library/Frameworks/Python.framework/Versions/4.1.30101/include/
python2.5 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.3-
i386-2.5/pygraphviz/graphviz_wrap.o
cc1: error: unrecognized command line option "-Wno-long-double"
cc1: error: unrecognized command line option "-Wno-long-double"
lipo: can't figure out the architecture type of: /var/folders/K0/K0Evt-
jhE1aRP+AB5PoHCk+++TI/-Tmp-//cczWI7wP.out
error: command 'gcc' failed with exit status 1

it does mention the 10.4 sdk I just (re-)installed, but it still
doesn't work..

hmm.

Rekveld

unread,
Dec 12, 2009, 7:57:55 PM12/12/09
to pygraphviz-discuss

found another pointer here:
http://www.python-forum.org/pythonforum/viewtopic.php?f=17&t=15150&p=72380&hilit=snow+leopard#p72380

and after doing this in the terminal:
sudo ln -fs /usr/bin/gcc-4.0 /usr/bin/gcc

it compiled without errors.

But now this:

>>> import pygraphviz
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/
python2.5/site-packages/pygraphviz/__init__.py", line 36, in <module>
from agraph import AGraph, Node, Edge, Attribute, ItemAttribute
File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/
python2.5/site-packages/pygraphviz/agraph.py", line 18, in <module>
import graphviz as gv
File "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/
python2.5/site-packages/pygraphviz/graphviz.py", line 7, in <module>
import _graphviz
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/
4.1.30101/lib/python2.5/site-packages/pygraphviz/_graphviz.so, 2):
Symbol not found: _Agstrictundirected
Referenced from: /Library/Frameworks/Python.framework/Versions/
4.1.30101/lib/python2.5/site-packages/pygraphviz/_graphviz.so
Expected in: dynamic lookup

Christopher Ellison

unread,
Dec 12, 2009, 8:48:27 PM12/12/09
to pygraphvi...@googlegroups.com
Yuck. Can you try to rebuild pygraphviz from scratch? Ie, delete the
"build" directory and run "python setup.py install ..." again. Perhaps
some of the files were compiled with the gcc from before your symbolic link.

Chris

Rekveld

unread,
Dec 12, 2009, 9:51:07 PM12/12/09
to pygraphviz-discuss
thanks for the suggestion: I tried it, but no luck.
Tried installing the latest version, same problem...

hmm..

AGfarb

unread,
Dec 13, 2009, 4:57:40 AM12/13/09
to pygraphviz-discuss
Your issue may have to do with the version of gcc used with the
Enthought Python Distribution-- I had a similar problem.
The newest version of EPD (as of 12/13/09) is compiled under gcc 4.0,
while your version of gcc is likely 4.2 with Snow Leopard. You have
to downgrade your gcc version to match the version with which your EPD
was compiled in order to compile and install pygraphviz successfully.

To check which version of gcc your EPD used, just type "python" into
the command line in Terminal.

You may see something like this:
<<<

Python 2.5.4 |EPD 5.1.1| (r254:67916, Jul 20 2009, 15:41:21)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>>

As you can see from the second line of output, the gcc version with
which EPD was compiled is 4.0.1. If this is the case for you,
continue reading.

To check your version of gcc, after you quit out of the Python
interpreter, do:

$ gcc -v

The last line of output after this command will tell you the gcc
(compiler) version you're running.

To change the version of gcc you are using to 4.0, change the symlink
to gcc at the command line using:

$ sudo ln -sf /usr/bin/gcc-4.0 /usr/bin/gcc

(This may be different for you depending on the directory where you
have gcc installed. Just make sure your gcc version matches your
Python installation version. The command line will also ask you for
your password. Proffer it.)

Then navigate to your uppermost pygraphviz directory in Terminal (I
assume you have checked out the most recent version from the
Subversion repository, and that you know the location of the directory
where you have downloaded this version of pygraphviz, e.g. Downloads
or your default User home directory).

do this at the command line:

$ sudo python setup.py install

Hopefully, the installation will work this time. To test the
pygraphviz installation, go back to the Terminal and "cd .." out of
your pygraphviz download directory. Start the python interpreter
("python") and do:

>>> import pygraphviz

If no errors are thrown, congratulations. You have yourself some
pygraphviz.

You should change your gcc version back to 4.2 after you have
installed pygraphviz successfully, if indeed you had to change gcc to
version 4.0:

$ sudo ln -sf /usr/bin/gcc-4.2 /usr/bin/gcc


I hope I got the syntax correct. Please let me know if any commands
or suggestions are unclear.

Thanks, and hope this helps,

Adam

Rekveld

unread,
Dec 13, 2009, 9:14:34 AM12/13/09
to pygraphviz-discuss
Dear Adam,

thanks for your reply; what you are describing corresponds to what I
did last night: I managed to compile pygraphviz successfully, but now
I get the errors described below when I try to import it.
Thanks for confirming this problem and approach, and thanks for
telling me (how) to set gcc-4.2 again as the default compiler.
But can anybody please illuminate these new errors ?

thanks,

Joost.


On Dec 13, 1:57 am, Rekveld <li...@lumen.nu> wrote:
> found another pointer here:http://www.python-forum.org/pythonforum/viewtopic.php?f=17&t=15150&p=...

Aric Hagberg

unread,
Dec 13, 2009, 9:46:02 AM12/13/09
to pygraphvi...@googlegroups.com
On Sun, Dec 13, 2009 at 7:14 AM, Rekveld <li...@lumen.nu> wrote:
> Dear Adam,
>
> thanks for your reply; what you are describing corresponds to what I
> did last night: I managed to compile pygraphviz successfully, but now
> I get the errors described below when I try to import it.
> Thanks for confirming this problem and approach, and thanks for
> telling me (how) to set gcc-4.2 again as the default compiler.
> But can anybody please illuminate these new errors ?

If you haven't already - start with a clean PyGraphviz build directory
to make sure
you aren't using some leftover compiled objects.

Which version of Graphviz are you using? Did you compile it yourself
(probably use the same compiler as when compiling the PyGraphviz extension).

Aric

AGfarb

unread,
Dec 13, 2009, 11:45:51 AM12/13/09
to pygraphviz-discuss
Unfortunately, during my few days of attempting to install pygraphviz
on top of Graphviz, I didn't run into that problem, but I would echo
Aric and say that you might try installing the newest version of
graphviz:

http://www.graphviz.org/Download_macos.php

It's a .pkg, so I didn't compile it myself, but my install is working
correctly. Perhaps if you install the latest version of graphviz and
THEN compile and install pygraphviz as per the above steps, all the
necessary dependencies between the two will be resolved.

I hope-- good luck.

Rekveld

unread,
Dec 13, 2009, 11:55:07 AM12/13/09
to pygraphviz-discuss
Aha,
that download page looks interesting: I had installed 2.24, but here
the latest stable release is 2.26 and there are separate Leopard and
Snow-Leopard versions.
That might do the trick, we'll see tonight..

thanks !

Joost.

Rekveld

unread,
Dec 13, 2009, 4:44:54 PM12/13/09
to pygraphviz-discuss
Hi Chris, Adam, Aric,

thanks a million for your help; i managed to get it to work.
Since I've recently moved to Snow Leopard, I decided to update my
Enthought Python version too; now i'm on 5.1.1, which includes a
recent Networkx (0.99) and a recent PyDot (1.0.2).
This more recent Python distribution is still compiled with gcc 4.0.1
by the way.

Then I removed all installations I could find of Graphviz and
PyGraphviz.

I installed the Snow Leopard version of Graphviz version 2.26.0 from
the .pkg
(I also realized that I had been looking too low on the Graphviz
download page, so I was downloading from http://www.ryandesign.com/graphviz/
)
I had to change the PyDev $PATH variable for Python to find it, but
then it worked with PyDot.
(also for the Terminal I had to add the graphviz install location to
the $PATH variable, in my .bash_profile)

Then I set my default compiler to gcc 4.0.1
manually installed PyGraphviz, added it to the PythonPath, and yes, it
worked !

so I had two problems:
- the wrong Graphviz version
- the gcc4.0/4.2 issue for pygraphviz

thanks for your support and wisdom,

Joost.





Reply all
Reply to author
Forward
0 new messages