Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebrew build fails: ld: symbol(s) not found for architecture x86_64 #1957

Closed
nextstopsun opened this issue Jul 20, 2013 · 18 comments
Closed
Milestone

Comments

@nextstopsun
Copy link

I'm trying to solve an issue with cairo https://groups.google.com/forum/#!topic/mapnik/wDCZx9232FE

So I've decided to reinstall everything (cairo, boost, mapnik) from scratch.
But I get an error when installing mapnik.

brew install --with-cairo --with-gdal --with-geos --with-postgresql mapnik
==> Downloading http://mapnik.s3.amazonaws.com/dist/v2.2.0/mapnik-v2.2.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/mapnik-2.2.0.tar.bz2
==> /usr/local/opt/python/bin/python2 scons/scons.py configure CC="cc" CXX="c++" JOBS=4 PREFIX=/usr/local/Cellar/mapnik/2.2.0 ICU_INCLUDES=/usr/local/opt/icu4c/include ICU_LIBS=/usr/local/opt/icu4c/lib PY
==> /usr/local/opt/python/bin/python2 scons/scons.py install
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"c++" -o plugins/input/csv/csv_datasource.os -c -ansi -Wall -ftemplate-depth-300 -O3 -fno-strict-aliasing -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts -fPIC -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_TIFF -DBIGINT -DBOOST_REGEX_HAS_ICU -DDARWIN -DMAPNIK_THREADSAFE -DNDEBUG -Ideps -Ideps/clipper/include -Ideps/agg/include -I. -Iinclude -I/usr/local/Cellar/gdal/1.10.0/include -I/usr/local/Cellar/postgresql/9.2.4/include -I/usr/local/Cellar/libtiff/4.0.3/include -I/usr/local/Cellar/proj/4.8.0/include -I/usr/local/Cellar/jpeg/8d/include -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2 -I/usr/local/Cellar/freetype/2.4.11/include -I/usr/local/Cellar/freetype/2.4.11/include/freetype2 -I/usr/local/Cellar/icu4c/51.1/include -I/usr/local/Cellar/boost/1.54.0/include -I/usr/include plugins/input/csv/csv_datasource.cpp
scons: *** [src/libmapnik.dylib] Error 1
scons: building terminated because of errors.

How to resolve this?
OS X version is 10.8.4

@springmeyer
Copy link
Member

The actual undefined symbols is not showing up in that error output. It looks like you need to rerun the install with the --verbose flag. The problem is likely not Mapnik but rather one of the dependencies is broken and needs rebuilt. You will not know which one until you can get an error indicating the particular symbol that is missing.

@nextstopsun
Copy link
Author

Dane, thanks for reply.

When doing
brew install --with-cairo --with-gdal --with-geos --with-postgresql --verbose mapnik

I have a verbose output of an error:

Install file: "deps/agg/include/agg_vpgen_segmentator.h" as "/usr/local/Cellar/mapnik/2.2.0/include/mapnik/agg/agg_vpgen_segmentator.h"
Undefined symbols for architecture x86_64:
"boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&, std::codecvt<wchar_t, char, __mbstate_t> const&)", referenced from:
mapnik::datasource_cache::register_datasources(std::string const&) in datasource_cache.os
mapnik::freetype_engine::register_fonts(std::string const&, bool) in font_engine_freetype.os
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"c++" -o plugins/input/csv/csv_datasource.os -c -ansi -Wall -ftemplate-depth-300 -O3 -fno-strict-aliasing -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts -fPIC -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_TIFF -DBIGINT -DBOOST_REGEX_HAS_ICU -DDARWIN -DMAPNIK_THREADSAFE -DNDEBUG -Ideps -Ideps/clipper/include -Ideps/agg/include -I. -Iinclude -I/usr/local/Cellar/gdal/1.10.0/include -I/usr/local/Cellar/postgresql/9.2.4/include -I/usr/local/Cellar/libtiff/4.0.3/include -I/usr/local/Cellar/proj/4.8.0/include -I/usr/local/Cellar/jpeg/8d/include -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2 -I/usr/local/Cellar/freetype/2.4.11/include -I/usr/local/Cellar/freetype/2.4.11/include/freetype2 -I/usr/local/Cellar/icu4c/51.1/include -I/usr/local/Cellar/boost/1.54.0/include -I/usr/include plugins/input/csv/csv_datasource.cpp
scons: *** [src/libmapnik.dylib] Error 1
"c++" -o plugins/input/gdal/gdal_datasource.os -c -ansi -Wall -ftemplate-depth-300 -O3 -fno-strict-aliasing -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts -fPIC -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_TIFF -DBIGINT -DBOOST_REGEX_HAS_ICU -DDARWIN -DMAPNIK_THREADSAFE -DNDEBUG -Ideps -Ideps/clipper/include -Ideps/agg/include -I. -Iinclude -I/usr/local/Cellar/gdal/1.10.0/include -I/usr/local/Cellar/postgresql/9.2.4/include -I/usr/local/Cellar/libtiff/4.0.3/include -I/usr/local/Cellar/proj/4.8.0/include -I/usr/local/Cellar/jpeg/8d/include -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2 -I/usr/local/Cellar/freetype/2.4.11/include -I/usr/local/Cellar/freetype/2.4.11/include/freetype2 -I/usr/local/Cellar/icu4c/51.1/include -I/usr/local/Cellar/boost/1.54.0/include -I/usr/include plugins/input/gdal/gdal_datasource.cpp
scons: building terminated because of errors.

I guess that has something to do with freetype lib. I reinstalled it from Homebrew, but that doesn't help. Any clues?

@springmeyer
Copy link
Member

No you have a problem with boost. Likely duplicate versions on your system. Remove boost and reinstall it.

On Jul 22, 2013, at 12:38 AM, Nikolai Lebedev notifications@github.com wrote:

Dane, thanks for reply.

When doing
brew install --with-cairo --with-gdal --with-geos --with-postgresql --verbose mapnik

I have a verbose output of an error:

Install file: "deps/agg/include/agg_vpgen_segmentator.h" as "/usr/local/Cellar/mapnik/2.2.0/include/mapnik/agg/agg_vpgen_segmentator.h"
Undefined symbols for architecture x86_64:
"boost::filesystem::path_traits::dispatch(boost::filesystem::directory_entry const&, std::string&, std::codecvt const&)", referenced from:
mapnik::datasource_cache::register_datasources(std::string const&) in datasource_cache.os
mapnik::freetype_engine::register_fonts(std::string const&, bool) in font_engine_freetype.os
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"c++" -o plugins/input/csv/csv_datasource.os -c -ansi -Wall -ftemplate-depth-300 -O3 -fno-strict-aliasing -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts -fPIC -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_TIFF -DBIGINT -DBOOST_REGEX_HAS_ICU -DDARWIN -DMAPNIK_THREADSAFE -DNDEBUG -Ideps -Ideps/clipper/include -Ideps/agg/include -I. -Iinclude -I/usr/local/Cellar/gdal/1.10.0/include -I/usr/local/Cellar/postgresql/9.2.4/include -I/usr/local/Cellar/libtiff/4.0.3/include -I/usr/local/Cellar/proj/4.8.0/include -I/usr/local/Cellar/jpeg/8d/include -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2 -I/usr/local/Cellar/freetype/2.4.11/include -I/usr/local/Cellar/freetype/2.4.11/include/freetype2 -I/usr/local/Cellar/icu4c/51.1/include -I/usr/local/Cellar/boost/1.54.0/include -I/usr/include plugins/input/csv/csv_datasource.cpp
scons: *** [src/libmapnik.dylib] Error 1
"c++" -o plugins/input/gdal/gdal_datasource.os -c -ansi -Wall -ftemplate-depth-300 -O3 -fno-strict-aliasing -finline-functions -Wno-inline -Wno-parentheses -Wno-char-subscripts -fPIC -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_TIFF -DBIGINT -DBOOST_REGEX_HAS_ICU -DDARWIN -DMAPNIK_THREADSAFE -DNDEBUG -Ideps -Ideps/clipper/include -Ideps/agg/include -I. -Iinclude -I/usr/local/Cellar/gdal/1.10.0/include -I/usr/local/Cellar/postgresql/9.2.4/include -I/usr/local/Cellar/libtiff/4.0.3/include -I/usr/local/Cellar/proj/4.8.0/include -I/usr/local/Cellar/jpeg/8d/include -I/usr/local/Cellar/libxml2/2.9.1/include/libxml2 -I/usr/local/Cellar/freetype/2.4.11/include -I/usr/local/Cellar/freetype/2.4.11/include/freetype2 -I/usr/local/Cellar/icu4c/51.1/include -I/usr/local/Cellar/boost/1.54.0/include -I/usr/include plugins/input/gdal/gdal_datasource.cpp
scons: building terminated because of errors.

I guess that has something to do with freetype lib. I reinstalled it from Homebrew, but that doesn't help. Any clues?


Reply to this email directly or view it on GitHub.

@nextstopsun
Copy link
Author

I did that several times already, but it didn't help. Is it obligatory for mapnik to build boost with --with-mpi flag? Although I've built open-mpi from scratch, boost doesn't get built with this option. Is it somehow related to this issue? Homebrew/legacy-homebrew#21304

@springmeyer
Copy link
Member

no, Mapnik does not need boost build with mpi so that is unrelated. But it does look like some change in the boost build with homebrew is breaking things (or maybe just the upgrade to boost 1.54).

@springmeyer
Copy link
Member

btw, can you paste more of your verbose output? You cut off the actual line that links libmapnik.dylib.

@nextstopsun
Copy link
Author

Sure, here is the full output https://gist.github.com/nlebedev/6055590
Dane, thank you very very much for your help.

@springmeyer
Copy link
Member

do you maybe have a folder at /usr/include/boost ? I doubt you do, but let me know.

@springmeyer
Copy link
Member

also what does the output of brew unlink boost give?

@nextstopsun
Copy link
Author

Checked for boost folder in /usr/include - nope, don't have it.
brew unlink boost seems ok to me:
bash-3.2$ brew unlink boost
Unlinking /usr/local/Cellar/boost/1.54.0... 116 links removed

@springmeyer
Copy link
Member

okay, sounds good. So, this is mysterious then. I cannot replicate - the exact above command you ran brew install --with-cairo --with-gdal --with-geos --with-postgresql --verbose mapnik works fine for me.

What does brew doctor report for you?

@nextstopsun
Copy link
Author

$ brew doctor Your system is ready to brew.

What does your brew info boost report?

Maybe reinstalling python helps?
Do you build against system or homebrew python?

@springmeyer
Copy link
Member

system python. I refuse to use homebrew'ed python as it creates too many problems currently: #1838

@springmeyer
Copy link
Member

$ brew info boost
boost: stable 1.54.0 (bottled), HEAD
http://www.boost.org
/usr/local/Cellar/boost/1.54.0 (9811 files, 346M) *
  Poured from bottle
From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/boost.rb
==> Options
--universal
    Build a universal binary
--with-c++11
    Compile using Clang, std=c++11 and stdlib=libc++
--with-icu
    Build regexp engine with icu support
--with-mpi
    Build with mpi support
--without-python
    Build without python support
--without-single
    Disable building single-threading variant
--without-static
    Disable building static library variant

@nextstopsun
Copy link
Author

Thanks, Dane, nailed it. I reinstalled boost without any flags, so it reports boost: stable 1.54.0 (bottled), HEAD.
Mapnik installed fine after that.
Is it the --with-icu flag that crashes the installation, or anything else special about bottled boost?

@springmeyer
Copy link
Member

--with-c++11 could surely break things (for the time being). Not sure about the other flags. --with-icu ideally would work because for proper unicode support in mapnik you ideally want boost built with icu support (although I rarely ever attempt this with homebrew boost).

@nextstopsun
Copy link
Author

Yes, you're right! It's --with-c++11 that breaks stuff. --with-mpi doesn't work anyway, so the only option for mapnik is to brew install --with-icu boost. Maybe mapnik should be built with c++11 too?

@springmeyer
Copy link
Member

@NLebedev - mapnik will soon (in master) move to requiring it be built with c++11, but the v2.2.0 still needs to be build with normally (aka with -ansi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants