Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Install and Build Problem on Mac OS X 10.5 and Python 2..6

#20

Hi

I have used macport to install spidermonkey. It says this is installed.

When i attempt to build spidermonkey it fails with the error message below.

Macintosh-9:python-spidermonkey-0.0.7 calum$ 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

Same message appears when i attempt install.

Macintosh-9:python-spidermonkey-0.0.7 calum$ python setup.py install
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

Really have no idea what is wrong.

Calum

Reported by Calum Moore · June 24th, 2009 @ 10:16 PM

State: open
Milestone: none
Assigned to: Paul J. Davis Paul J. Davis

Activity

  1. Paul J. Davis
    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 nspr
    

    Though 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 build
    

    Let me know if that fixes things.

    June 24th, 2009 @ 10:29 PM

  2. Paul J. Davis
    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

    June 24th, 2009 @ 10:29 PM

  3. Calum Moore
    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 nspr

    I 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.sh

    Now 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.sh

    Not sure if this is having an effect.

    Calum

    June 25th, 2009 @ 06:07 AM

  4. Calum Moore
    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.

    June 25th, 2009 @ 06:09 AM

  5. Paul J. Davis
    Paul J. Davis

    Calum,

    Oh, forgot one, you need pkgconfig installed too.

    $ sudo port install pkgconfig
    

    In the end, you need the following command to work:

    $ pkg-config --cflags nspr
    -I/opt/local/include/nspr
    

    If that fixes things I'll add a note to the README.

    June 25th, 2009 @ 04:29 PM

  6. Paul J. Davis
    Paul J. Davis

    Calum,

    Did you manage to get this fixed?

    Paul

    June 26th, 2009 @ 07:56 PM

  7. Calum Moore
    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

    June 27th, 2009 @ 08:48 AM

  8. Bernardo Heynemann
    Bernardo Heynemann

    I can confirm that it does fix it.

    Cheers,
    Bernardo Heynemann

    June 18th, 2010 @ 10:26 AM

  9. 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-spidermonkey

    warning: no files found matching 'README'
    

    Installing collected packages: python-spidermonkey
    Running setup.py install for python-spidermonkey

    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
    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 install
    

    running 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

    June 18th, 2010 @ 10:27 AM

  10. j1m
    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

    January 10th, 2011 @ 09:51 AM

  11. j1m
    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.

    January 17th, 2011 @ 11:25 AM

  12. Zvezdan Petkovic
    Zvezdan Petkovic

    Building python-spidermonkey egg on Mac

    To build a python-spidermonkey egg on Mac OS X 10.6 (Snow Leopard):

    1. Install from MacPorts:

      • pkg-config

        sudo port -c install pkgconfig +universal
        
      • spidermonkey

        sudo port -c install spidermonkey +universal
        

      The spidermonkey port will install nspr as a dependency.

      (The +universal is optional. If you use a universal build of Python it's better to build universal libraries too.)

    2. Create a pkg-config metadata file for spidermonkey because it
      does not create one during install.

      The file needs to be named mozilla-js.pc because that's the name python-spidermonkey is looking for when it calls pkg-config.

      Open in your favorite editor /opt/local/lib/pkgconfig/mozilla-js.pc and put this content in

      prefix=/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
      
    3. Download a source distribution of the python-spidermonkey egg from
      http://pypi.python.org/pypi/python-spidermonkey/0.0.9 or the latest snapshot from the python-spidermonkey home page listed at PyPI.

    4. Unpack the source distribution and build the egg using zc.buildout

      buildout setup . --system-library bdist_egg
      

      or Python

      python setup.py --system-library bdist_egg
      
      (Add the appropriate path to buildout or python above.)

    January 23rd, 2011 @ 07:47 PM

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.