Install and Build Problem on Mac OS X 10.5 and Python 2..6
-
Paul J. Davis
- State changed from new to open
Calum,
You need to make sure that libnspr is installed from ports. You can install it like:
$ sudo port install nsprThough it should've been installed for spidermonkey I think. If that says nspr is already installed check and see if there's an nspr-config script in /opt/local/bin. If there is, then you just need to make sure /opt/local/bin is on your path. You can do that temporarily why running the setup.py script like such:
$ PATH=$PATH:/opt/local/bin python setup.py buildLet me know if that fixes things.
-
Paul J. Davis
- Tag changed from 10.5, 2..6, build, install, mac, os, python, x to 10.5, 2.6, build, install, mac, os, python, x
-
Calum Moore
Thanks for the quick reply!
I seem to have nspr installed because when using:
$ sudo port install nspr
I get the following already installed message (well i think that's what it is)
Macintosh-9:~ calum$ sudo port install nspr
Password:
Skipping org.macports.activate (nspr ) since this port is already active
---> Cleaning nsprI checked /opt/local/bin and there is a nspr-config file. I used
$ PATH=$PATH:/opt/local/bin python setup.py build
and again got the same error as always:
Macintosh-9:python-spidermonkey-0.0.7 calum$ PATH=$PATH:/opt/local/bin python setup.py build
Traceback (most recent call last):
File "setup.py", line 186, in**platform_config()File "setup.py", line 143, in platform_config
return nspr_config(config=config)File "setup.py", line 87, in nspr_config
return pkg_config("nspr", config)File "setup.py", line 59, in pkg_config
raise RuntimeError("No package configuration found for: %s" % pkg_name)RuntimeError: No package configuration found for: nspr
Also to note, when I installed MacPorts for the first time it didn't work. So i added the following to /Users/Calum/.bash_profile
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
test -r /sw/bin/init.sh && . /sw/bin/init.shNow the complete file (/Users/Calum/.bash_profile) reads:
Setting PATH for MacPython 2.6
The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}"
export PATH##
Your previous /Users/calum/.bash_profile file was backed up as /Users/calum/.bash_profile.macports-saved_2009-06-25_at_01:05:02
##
MacPorts Installer addition on 2009-06-25_at_01:05:02: adding an appropriate MANPATH variable for use with MacPorts.
export MANPATH=/opt/local/share/man:$MANPATH
Finished adapting your MANPATH environment variable for use with MacPorts.
export PATH=$PATH:/opt/local/bin
export MANPATH=$MANPATH:/opt/local/share/man
export INFOPATH=$INFOPATH:/opt/local/share/info
test -r /sw/bin/init.sh && . /sw/bin/init.shNot sure if this is having an effect.
Calum
-
Calum Moore
Just to clarify the parts in header format are commented out, but i'm guessing the hash is seen as formatting and therefore removed.
-
Paul J. Davis
Calum,
Oh, forgot one, you need pkgconfig installed too.
$ sudo port install pkgconfigIn the end, you need the following command to work:
$ pkg-config --cflags nspr -I/opt/local/include/nsprIf that fixes things I'll add a note to the README.
-
Paul J. Davis
Calum,
Did you manage to get this fixed?
Paul
-
Calum Moore
Paul
Sorry for the delay in the response. My computer went in for repairs so I won't know till next week. I will let you know as soon as I get it from repairs.
Calum
-
Bernardo Heynemann
I can confirm that it does fix it.
Cheers,
Bernardo Heynemann -
Bernardo Heynemann
But then I get the following:
sudo pip install python-spidermonkey
Downloading/unpacking python-spidermonkey
Running setup.py egg_info for package python-spidermonkeywarning: no files found matching 'README'Installing collected packages: python-spidermonkey
Running setup.py install for python-spidermonkeybuilding 'spidermonkey' extension gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -Ispidermonkey/libjs -Ispidermonkey/Darwin-i386 -I/opt/local/include/nspr -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c ./spidermonkey/libjs/jsarena.c -o build/temp.macosx-10.6-universal-2.6/./spidermonkey/libjs/jsarena.o -DJS_THREADSAFE -DPOSIX_SOURCE -D_BSD_SOURCE -Wno-strict-prototypes -DXP_UNIX In file included from ./spidermonkey/libjs/jsarena.c:49: ./spidermonkey/libjs/jsbit.h:169: error: size of array ‘js_static_assert_line_169’ is negative lipo: can't open input file: /var/tmp//ccdi5TV7.out (No such file or directory) error: command 'gcc-4.2' failed with exit status 1 Complete output from command /usr/local/virtual/bin/python -c "import setuptools; __file__='/usr/local/virtual/build/python-spidermonkey/setup.py'; execfile('/usr/local/virtual/build/python-spidermonkey/setup.py')" install --single-version-externally-managed --record /tmp/pip-snHrZX-record/install-record.txt --install-headers /usr/local/virtual/lib/include: running installrunning build
running build_ext
building 'spidermonkey' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -Ispidermonkey/libjs -Ispidermonkey/Darwin-i386 -I/opt/local/include/nspr -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c ./spidermonkey/libjs/jsarena.c -o build/temp.macosx-10.6-universal-2.6/./spidermonkey/libjs/jsarena.o -DJS_THREADSAFE -DPOSIX_SOURCE -D_BSD_SOURCE -Wno-strict-prototypes -DXP_UNIX
In file included from ./spidermonkey/libjs/jsarena.c:49:
./spidermonkey/libjs/jsbit.h:169: error: size of array ‘js_static_assert_line_169’ is negative
lipo: can't open input file: /var/tmp//ccdi5TV7.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
Command /usr/local/virtual/bin/python -c "import setuptools; file='/usr/local/virtual/build/python-spidermonkey/setup.py'; execfile('/usr/local/virtual/build/python-spidermonkey/setup.py')" install --single-version-externally-managed --record /tmp/pip-snHrZX-record/install-record.txt --install-headers /usr/local/virtual/lib/include failed with error code 1
-
j1m
- Milestone order changed from 0 to 0
I'm getting the same build failure on snow leopard.
I installed pkgconfig and nspr with ports. I'm using a Python built
from source../spidermonkey/libjs/jsapi.c: In function 'JS_ConvertArgumentsVA': ./spidermonkey/libjs/jsapi.c:267: warning: passing argument 5 of 'TryArgumentFormatter' from incompatible pointer type ./spidermonkey/libjs/jsapi.c: In function 'JS_PushArgumentsVA': ./spidermonkey/libjs/jsapi.c:370: warning: passing argument 5 of 'TryArgumentFormatter' from incompatible pointer type In file included from ./spidermonkey/libjs/jsarena.c:49:
./spidermonkey/libjs/jsbit.h:169: error: size of array 'js_static_assert_line_169' is negative error: command 'gcc' failed with exit status 1 -
j1m
I beat my head on this a bit more.
The assertion errors results from sizeof(unsigned) (4) not being the
same as sizeof(unsigned long) (8). I assume this was something that
changed in Mac OS X Snow Leopard.Since python-spidermonkey includes a snapshot of spidermonkey, I
thought I'd try to install later versions of spider monkley and
install python-spidermonkey via system libraries. After much flailing,
I managed to get a system build of spider monkey from the mercurial
repo build with --enable-threadsafe and managed to get
python-spidermonkey to use it by hand crafting a mozilla-ns.pc file.
Unfortunately, python-spidermonkey fails to build with many errors
suggesting the spidermonkey apis have changed too much for
python-spidermonkey to keep up with. -
Zvezdan Petkovic
Building
python-spidermonkeyegg on MacTo build a
python-spidermonkeyegg on Mac OS X 10.6 (Snow Leopard):-
Install from
MacPorts:-
pkg-config
sudo port -c install pkgconfig +universal -
spidermonkey
sudo port -c install spidermonkey +universal
The
spidermonkeyport will installnspras a dependency.(The
+universalis optional. If you use a universal build of Python it's better to build universal libraries too.) -
-
Create a
pkg-configmetadata file forspidermonkeybecause it
does not create one during install.The file needs to be named
mozilla-js.pcbecause that's the namepython-spidermonkeyis looking for when it callspkg-config.Open in your favorite editor
/opt/local/lib/pkgconfig/mozilla-js.pcand put this content inprefix=/opt/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include/js Name: SpiderMonkey Description: JavaScript-C Engine Version: 1.7.0 Requires: nspr Libs: -L${libdir} -ljs Cflags: -I${includedir} -DJS_THREADSAFE -DJS_C_STRINGS_ARE_UTF8 -DXP_UNIX -
Download a source distribution of the
python-spidermonkeyegg from
http://pypi.python.org/pypi/python-spidermonkey/0.0.9 or the latest snapshot from thepython-spidermonkeyhome page listed at PyPI. -
Unpack the source distribution and build the egg using
zc.buildoutbuildout setup . --system-library bdist_eggor Python
(Add the appropriate path to buildout or python above.)python setup.py --system-library bdist_egg
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.