Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

mapnik failed to build on 10.8.2 #16144

Closed
myersjustinc opened this issue Nov 19, 2012 · 45 comments
Closed

mapnik failed to build on 10.8.2 #16144

myersjustinc opened this issue Nov 19, 2012 · 45 comments
Labels

Comments

@myersjustinc
Copy link

Trying to install Mapnik on a Mac Pro (early 2009) with 10.8.2, but it isn't building for me.

The gist requested in the troubleshooting instructions is here: https://gist.github.com/4111928

There weren't any numbered make logs available, so I just included the config.log in ~/Library/Logs/Homebrew/mapnik; if there are any other files that might be useful instead, just let me know.

Thanks for any help you can provide.

@adamv
Copy link
Contributor

adamv commented Nov 19, 2012

"c++" -o src/libmapnik.dylib -Wl,-install_name,/usr/local/Cellar/mapnik/2.1.0/lib/libmapnik.dylib -current_version 2.1.0 -compatibility_version 2.1.0 -dynamiclib src/libxml2_loader.os src/feature_style_processor.os src/color.os src/css_color_grammar.os src/conversions.os src/image_compositing.os src/image_filter_grammar.os src/image_scaling.os src/box2d.os src/building_symbolizer.os src/datasource_cache.os src/debug.os src/deepcopy.os src/expression_node.os src/expression_grammar.os src/expression_string.os src/expression.os src/transform_expression_grammar.os src/transform_expression.os src/feature_kv_iterator.os src/feature_type_style.os src/font_engine_freetype.os src/font_set.os src/gamma_method.os src/gradient.os src/graphics.os src/image_reader.os src/image_util.os src/layer.os src/line_symbolizer.os src/line_pattern_symbolizer.os src/map.os src/load_map.os src/memory.os src/parse_path.os src/parse_transform.os src/palette.os src/path_expression_grammar.os src/placement_finder.os src/plugin.os src/png_reader.os src/point_symbolizer.os src/polygon_pattern_symbolizer.os src/polygon_symbolizer.os src/save_map.os src/shield_symbolizer.os src/text_symbolizer.os src/tiff_reader.os src/wkb.os src/projection.os src/proj_transform.os src/distance.os src/scale_denominator.os src/memory_datasource.os src/stroke.os src/symbolizer.os src/symbolizer_helpers.os src/unicode.os src/markers_symbolizer.os src/raster_colorizer.os src/wkt/wkt_factory.os src/wkt/wkt_generator.os src/mapped_memory_cache.os src/marker_cache.os src/svg_parser.os src/svg_path_parser.os src/svg_points_parser.os src/svg_transform_parser.os src/warp.os src/json/geometry_grammar.os src/json/geometry_parser.os src/json/feature_grammar.os src/json/feature_collection_parser.os src/json/geojson_generator.os src/processed_text.os src/formatting/base.os src/formatting/expression.os src/formatting/list.os src/formatting/text.os src/formatting/format.os src/formatting/registry.os src/text_placements/registry.os src/text_placements/base.os src/text_placements/dummy.os src/text_placements/list.os src/text_placements/simple.os src/text_properties.os src/xml_tree.os src/config_error.os src/jpeg_reader.os src/agg/agg_renderer.os src/agg/process_building_symbolizer.os src/agg/process_line_symbolizer.os src/agg/process_line_pattern_symbolizer.os src/agg/process_text_symbolizer.os src/agg/process_point_symbolizer.os src/agg/process_polygon_symbolizer.os src/agg/process_polygon_pattern_symbolizer.os src/agg/process_raster_symbolizer.os src/agg/process_shield_symbolizer.os src/agg/process_markers_symbolizer.os src/grid/grid.os src/grid/grid_renderer.os src/grid/process_building_symbolizer.os src/grid/process_line_pattern_symbolizer.os src/grid/process_line_symbolizer.os src/grid/process_markers_symbolizer.os src/grid/process_point_symbolizer.os src/grid/process_polygon_pattern_symbolizer.os src/grid/process_polygon_symbolizer.os src/grid/process_raster_symbolizer.os src/grid/process_shield_symbolizer.os src/grid/process_text_symbolizer.os -Ldeps/agg -Lsrc -L/usr/local/Cellar/freetype/2.4.10/lib -L/usr/local/Cellar/icu4c/50.1/lib -L/usr/local/lib -L/usr/lib -lagg -lfreetype -lltdl -lpng -ltiff -lz -lproj -licuuc -lboost_filesystem-mt -lboost_system-mt -lboost_regex-mt -ljpeg -lxml2 -lboost_thread-mt
Undefined symbols for architecture x86_64:
  "icu_50::UnicodeString::doCompare(int, int, unsigned short const*, int, int) const", referenced from:
      boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_or_equal const, icu_50::UnicodeString const>::result_type boost::variant<mapnik::value_null, bool, int, double, icu_50::UnicodeString, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::apply_visitor<boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_or_equal const, icu_50::UnicodeString const> >(boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_or_equal const, icu_50::UnicodeString const>&) const in feature_style_processor.os
      boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_than const, icu_50::UnicodeString const>::result_type boost::variant<mapnik::value_null, bool, int, double, icu_50::UnicodeString, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::apply_visitor<boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_than const, icu_50::UnicodeString const> >(boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_than const, icu_50::UnicodeString const>&) const in feature_style_processor.os
      boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_or_equal const, icu_50::UnicodeString const>::result_type boost::variant<mapnik::value_null, bool, int, double, icu_50::UnicodeString, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::apply_visitor<boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_or_equal const, icu_50::UnicodeString const> >(boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_or_equal const, icu_50::UnicodeString const>&) const in feature_style_processor.os
      boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_than const, icu_50::UnicodeString const>::result_type boost::variant<mapnik::value_null, bool, int, double, icu_50::UnicodeString, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::apply_visitor<boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_than const, icu_50::UnicodeString const> >(boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_than const, icu_50::UnicodeString const>&) const in feature_style_processor.os
      boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_or_equal const, icu_50::UnicodeString const>::result_type boost::variant<mapnik::value_null, bool, int, double, icu_50::UnicodeString, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::apply_visitor<boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_or_equal const, icu_50::UnicodeString const> >(boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_or_equal const, icu_50::UnicodeString const>&) const in symbolizer.os
      boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_than const, icu_50::UnicodeString const>::result_type boost::variant<mapnik::value_null, bool, int, double, icu_50::UnicodeString, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::apply_visitor<boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_than const, icu_50::UnicodeString const> >(boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::greater_than const, icu_50::UnicodeString const>&) const in symbolizer.os
      boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_or_equal const, icu_50::UnicodeString const>::result_type boost::variant<mapnik::value_null, bool, int, double, icu_50::UnicodeString, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_, boost::detail::variant::void_>::apply_visitor<boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_or_equal const, icu_50::UnicodeString const> >(boost::detail::variant::apply_visitor_binary_invoke<mapnik::impl::less_or_equal const, icu_50::UnicodeString const>&) const in symbolizer.os
      ...
  "icu_50::UnicodeString::doIndexOf(unsigned short, int, int) const", referenced from:
      mapnik::placement_finder<mapnik::label_collision_detector4>::find_line_breaks() in placement_finder.os
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
s

Looks like a problem with the new Boost and ICU bottles.

@myersjustinc
Copy link
Author

I know nothing about Boost and ICU, but I did attempt to build them from source instead of using the bottles to see if that would affect anything. Boost wouldn't build from source for me (I can add a ticket for that, too, if you'd like), but ICU built just fine.

Using ICU installed with brew install --build-from-source icu4c and Boost installed from the bottle, I get the same error in the same place. (The only difference in the output of HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install mapnik is the mention of this open issue.)

@2bits
Copy link
Contributor

2bits commented Nov 19, 2012

Boost will build with the older icu4c-49.1.2, but the current one Homebrew updated to, 50.1, has API changes. For now, if you want to build with icu4c support, you will have to downgrade icu4c. Use this to examine your options:

cd `brew --prefix`
brew versions icu4c

@2bits
Copy link
Contributor

2bits commented Nov 19, 2012

Interesting is that boost-1.52.0 will build against icu-50.1 if you do this:

brew install --with-icu --with-c++11 boost

Don't know why, but there you go. Thanks for the bug report.

2bits pushed a commit to 2bits/homebrew that referenced this issue Nov 19, 2012
boost needs the `--with-c++11` option if it's going to build
with icu4c-50.1.  This is partially due to a change in icu4c,
as the previous version compiled into boost without error.
The current icu4c-50.1 does pass `make check`.

- Enable the c++11 if when the user throws `--with-icu`.

Fixes Homebrew#16144
@MikeMcQuaid
Copy link
Member

Perhaps we should default to c++11? This stuff is going to get used more and more.

@myersjustinc
Copy link
Author

Thanks for that. I went ahead and used that information to build Boost from source as well, but Mapnik still wouldn't build despite neither Boost nor ICU being from a bottle anymore.

I've updated the gist with the new brew install log. The build fails in the same place, and I think it generally looks similar to how it looked before, except for some added references to -DBOOST_REGEX_HAS_ICU. I also tried it with --with-c++11 (even though I'm not sure that's a valid option for the Mapnik build), but I got the same results.

@2bits
Copy link
Contributor

2bits commented Nov 20, 2012

That pull request of mine may not work. The only proper way to do this from what I now have learned about c++11 compatibility is that we should leave boost the way it was and have you downgrade to icu4c-49.1.2 and use that with the unaltered boost formula. That builds a working boost like we've always had. Then using that, try to do mapnik again.

cd `brew --prefix`
brew rm -f icu4c boost
brew versions icu4c
git checkout c25fd2f `brew --prefix`/Library/Formula/icu4c.rb
brew install icu4c
brew install --with-icu boost
brew install mapnik

I'm trying this right on 10.8.2 with system Python.

@myersjustinc
Copy link
Author

That worked great, @2bits; everything built just fine when I did that. Thanks for the help!

@adamv
Copy link
Contributor

adamv commented Jan 5, 2013

What's the status here? I don't use bottles on my current machines, and things seem to build from source, but I also don't have Mountain Lion to test with.

@myersjustinc
Copy link
Author

I don't have access anymore to the machine I originally noticed this bug on (changed jobs), but here's what happened yesterday when I tried it on my own computer (also on Mountain Lion):

  • I ran brew update followed by brew install icu4c, brew install --with-icu boost and brew install mapnik, and everything succeeded; when I actually tried to import mapnik from Python, though, I got this:

    Fatal Python error: PyThreadState_Get: no current thread Abort trap: 6

  • Per the Mapnik docs, I checked which Python got used for building boost with otool -L brew list boost | grep python.*dylib | grep -i python, and I got this:

    /usr/local/Cellar/boost/1.52.0/lib/libboost_python-mt.dylib: /usr/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.2)

    Since I'm running a homebrew Python (2.7.3), that's probably the problem.

  • When I try to install boost with HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install --with-icu --build-from-source boost, sure enough, it decides on the system Python instead of my homebrew:

    ==> Downloading http://downloads.sourceforge.net/project/boost/boost/1.52.0/boost_1_52_0.tar.bz2 Already downloaded: /Library/Caches/Homebrew/boost-1.52.0.tar.bz2 /usr/bin/tar xf /Library/Caches/Homebrew/boost-1.52.0.tar.bz2 ==> ./bootstrap.sh --prefix=/usr/local/Cellar/boost/1.52.0 --libdir=/usr/local/Cellar/boost/1.52.0/lib --with-icu=/usr/local/opt/icu4c ./bootstrap.sh --prefix=/usr/local/Cellar/boost/1.52.0 --libdir=/usr/local/Cellar/boost/1.52.0/lib --with-icu=/usr/local/opt/icu4c -n Building Boost.Build engine with toolset darwin... tools/build/v2/engine/bin.macosxx86_64/b2 -n Detecting Python version... 2.7 -n Detecting Python root... /System/Library/Frameworks/Python.framework/Versions/2.7

Any idea how I can get boost to build against the homebrew Python instead?

@samueljohn
Copy link
Contributor

Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

This is usually a result of mixing python versions. For example first installing pygtk (or perhaps any other gtk and/or python related formula) with system python. It works so far.
Then, installing a brewed python and trying to import from there fails, because the python binaries are not compatible.

Remove alle the formulae that are involved here. Then first brew install python. Then re-brew everything you want.

I noted that down in the wiki. Perhaps there should be a prominent warning, but I don't know where to put it (in which formula). Perhaps I can write a doctor check... not sure though

@samueljohn
Copy link
Contributor

I try to do brew install --with-icu --build-from-source boost and will report back if system python is choosen. If so, then we have to update boost ....

@samueljohn
Copy link
Contributor

Well...

xcrun otool -L $(brew list boost | grep 'python.*.dylib')
/homebrew/Cellar/boost/1.52.0/lib/libboost_python-mt.dylib:
    /homebrew/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /homebrew/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

so ... #worksforme ?

Perhaps I am lucky and NOT having the command line tools for Xcode made boost use the brewed python.
@2bits are you willing to test with your Xcode+CLT system?

@samueljohn
Copy link
Contributor

@myersjustinc could you please try:

  • brew rm $(brew deps mapnik --with-cairo)
  • brew rm pygobject
  • brew rm gobject-introspection
  • brew rm pygtk
  • brew rm python
  • open a new tap/shell
  • brew install python
  • Ensure which python is the brewed one
  • Double-check the brew doctor is fine (especially PATH issues)
  • Install any of the deps with certain options, if you prefer over the default.
  • brew install mapnik --with-cairo

Sorry, I know that sucks because building all these takes some time :-/
Perhaps not all of them needed to reinstall - but since you got the PyThreadState_Get: no current thread

In related, I am going to open a pull request #17032 with an update to mapnik which explicitly sets options to prefer homebrewed libs instead of letting scons find them (with it's defaults).

If all this does not help, we have to look more into the boost build.

@adamv
Copy link
Contributor

adamv commented Jan 12, 2013

Pulled #17032.

@myersjustinc
Copy link
Author

@samueljohn, that eventually worked, but it needed just a little bit of help.

I had to reinstall at least some form of boost to get the brew rm $(brew deps mapnik --with-cairo) to work, but after that everything else rm'd fine.

pygobject, gobject-introspection and pygtk all returned No such keg errors.

After reinstalling Python, running brew update to get the fix from #17032 and checking brew doctor, I went ahead and ran brew install mapnik --with-cairo, but I got the same PyThreadState_Get error because boost still brewed against the system Python:

/usr/local/Cellar/boost/1.52.0/lib/libboost_python-mt.dylib:
    /usr/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.2)

After that, though, removing boost and Mapnik and then building with brew install --with-icu --build-from-source boost and brew install mapnik --with-cairo worked just fine.

@adamv adamv closed this as completed Jan 12, 2013
@samueljohn
Copy link
Contributor

Asking @MikeMcQuaid as he is Mr. Bottle if the boost-bottle is build such that it links to system's python?

@MikeMcQuaid
Copy link
Member

Yes it links to system python and will continue to do so. Problems?

On Sunday, 13 January 2013, Samuel John wrote:

Asking @MikeMcQuaid https://github.com/mikemcquaid as he is Mr. Bottle
if the boost-bottle is build such that it links to system's python?


Reply to this email directly or view it on GitHubhttps://github.com//issues/16144#issuecomment-12192761.

Mike McQuaid
http://mikemcquaid.com

@samueljohn
Copy link
Contributor

When people run a brewed python, the bindings are not compatible (ABI-wise) and so we might see the errors like Fatal Python error: PyThreadState_Get: no current thread and similar. But I don't know what to do about it.

@MikeMcQuaid
Copy link
Member

I don't know really. Open to discussion but not motivated to fix it personally (if that's not too much of a dick move).

@samueljohn
Copy link
Contributor

Not using the boost bottle is the only work-around right now.
If we build the bottle assuming a brewed python, the people with system's python will get the same error.

@samueljohn
Copy link
Contributor

I could teach the brew doctor to check against which python boost and pygtk are built and if the currently active python is not that one, issue a warning with instructions (i.e. to brew install --force --build-from-source for boost).

@myersjustinc
Copy link
Author

That sounds reasonable and sounds like the easiest solution to me, but I haven't done any development on brew itself.

Is there a way (and does it make sense) to have brew install boost (for example) check whether the active Python is the system one or a brewed one and decide from that whether to use the bottle or build from source?

@samueljohn
Copy link
Contributor

Nice idea @myersjustinc, I am not sure if this would work. @MikeMcQuaid is it possible that the formula itself influences the logic that decides whether to pure a bottle or not?
Would be the best way to go, indeed.

@MikeMcQuaid
Copy link
Member

No but it could do. Could always add some option thing to the DSL which runs a check to decide whether to use the bottle. use_bottle? or something which defaults to true.

@samueljohn
Copy link
Contributor

Yay, I'll open an issue that this idea does not get forgotten. I think
we got quite reports related to bottles linking to system python and
people import the module in brewed python.

@otmezger
Copy link

otmezger commented Apr 2, 2013

@samueljohn

Hi, I'm having the same trouble with my homebrew installed version of mapnik on my mac running 10.8.3 with python 2.7.3 from homebrew also. Are there any updates on this topic?

The provided pkg works just fine with the python provided from apple, but I can't use mapnik at all with my homebew python.

@otmezger
Copy link

otmezger commented Apr 2, 2013

Here is what I did:
I ran the command otool -L $(brew list boost | grep 'python.*.dylib') and the output is:

/usr/local/Cellar/boost/1.53.0/lib/libboost_python-mt.dylib:
    /usr/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

As you see, something points to the old python... which is bad.

then, I removed boost and mapnik with brew rm boost and brew rm mapnik

then, I installed again, as wrote here by @myersjustinc: brew install --with-icu --build-from-source boost and brew install mapnik --with-cairo

I still get

olmo:Downloads olmo$ python 
Python 2.7.3 (default, Mar 15 2013, 13:15:41) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.27)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapnik
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

brew doctor returns a happy Your system is raring to brew. and I'm uptodate with brew.

What else is going wrong? What can I do?

Here is the crashreport and my console log: https://gist.github.com/otmezger/5295477

@samueljohn
Copy link
Contributor

Try to brew rm $(brew deps pygtk) and brew rm pygtk.

Then brew install pygtk --build-from-source.

Because that err you posted looks like a know thing with the gtk bottle.

@samueljohn
Copy link
Contributor

I posted too fast.
Perhaps the whole GTK thing is misplaced here (I misread). You
installed boost already from source. So I am not sure what the problem
really is.

@otmezger
Copy link

otmezger commented Apr 2, 2013

@samueljohn so, no GTK problem... I'm totally clueless. Any other ideas?

@myersjustinc
Copy link
Author

@otmezger, you might consider rebuilding icu4c as well. brew install --build-from-source icu4c

@otmezger
Copy link

otmezger commented Apr 2, 2013

@myersjustinc thanks, I'm brew rm icu4c and brew install --build-from-source icu4c.... do I need to reinstall boost and mapnik again after that?

@myersjustinc
Copy link
Author

@otmezger I think so, since boost depends on icu4c and mapnik in turn depends on boost.

@otmezger
Copy link

otmezger commented Apr 2, 2013

@myersjustinc ok, I installed icu4c from source, and mapnik still won't load. I'm going to reinstall boost and mapnik after having reinstalled icu4c, and will post here as soon as it's ready

@otmezger
Copy link

otmezger commented Apr 2, 2013

@myersjustinc ... nope... same as before. I keep getting

>>> import mapnik
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

:-(

@otmezger
Copy link

otmezger commented Apr 2, 2013

can I just delete everything (complete brew remove) and start over? Is there a way to do that, and does it makes sense?

@myersjustinc
Copy link
Author

Not sure on either of those questions. You might consider at least reinstalling your homebrew Python; that seemed to help some when I had this problem before.

@otmezger
Copy link

otmezger commented Apr 3, 2013

I deleted homebrew, and the mapnik binary installation. Then I reinstalled everything: brew install python and brew install mapnik. It installed ok, but the command tool -L $(brew list boost | grep 'python.*.dylib') still returns

/usr/local/Cellar/boost/1.53.0/lib/libboost_python-mt.dylib:
    /usr/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.2)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

importing mapnik still don't work on python 2.7.3 installed from homebrew.... why is this?

@myersjustinc
Copy link
Author

Wait, so building boost from source still built it against the system Python?

@otmezger
Copy link

otmezger commented Apr 3, 2013

@myersjustinc Now I did as you stated some months ago and IT WORKED!!!!!
I ran this comands:

brew rm $(brew deps mapnik --with-cairo)
brew rm mapnik
brew rm boost
brew update
brew doctor
brew install --with-icu --build-from-source boost
brew install mapnik --with-cairo

now, the command otool -L $(brew list boost | grep 'python.*.dylib') still shows this:

/usr/local/Cellar/boost/1.53.0/lib/libboost_python-mt.dylib:
    /usr/local/lib/libboost_python-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

so it shows to /usr/local/Frameworks...this is not correct, right? But python 2.7.3 (the brew one) can import mapnik :-)

@myersjustinc
Copy link
Author

/usr/local is correct—the /System/Library one is when you know something's built against the system Python.

Glad to hear it worked for you!

@samueljohn
Copy link
Contributor

so it shows to /usr/local/Frameworks...this is not correct, right?

That is correct. Brewed Python's framework is linked to there for
libs that need to find a Python.framework.

@hugovk
Copy link

hugovk commented Apr 19, 2013

@otmezger @myersjustinc Those commands also fix the Abort trap: 6 for me, thanks! I also get the same otool result.

@talaj
Copy link

talaj commented Nov 8, 2014

I hit on this issue on OS X 10.10 and solved it by brew remove python letting installed only python which comes with OS X.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants