Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 280955 - sci-geosciences/mapnik-0.6.0 build failure: ld: cannot find -lmapnik
Summary: sci-geosciences/mapnik-0.6.0 build failure: ld: cannot find -lmapnik
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Steve Arnold
URL:
Whiteboard:
Keywords:
: 280957 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-10 04:47 UTC by vyp08
Modified: 2011-06-17 10:19 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mapnik-0.6.0: ld: cannot find -lmapnik (mapnik-0.6.0.fail.txt,5.61 KB, text/plain)
2009-08-17 04:47 UTC, vyp08
Details
emerge --info. (emerge--info.txt,3.74 KB, text/plain)
2009-08-20 12:08 UTC, vyp08
Details
Successful mapnik buildlog. (sci-geosciences:mapnik-0.6.0:20090821-033744.log,68.38 KB, text/plain)
2009-08-23 00:12 UTC, Steve Arnold
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vyp08 2009-08-10 04:47:26 UTC
Good day!

I try emerge mapnik-0.6.0 and get error:

#emerge mapnik
[...skip...]
*Configure complete*     
Now run "python scons/scons.py" to build or "python scons/scons.py install" to install
>>> Source configured.   
>>> Compiling source in /var/tmp/portage/sci-geosciences/mapnik-0.6.0/work/mapnik-0.6.0 ...
scons: Reading SConscript files ...
                         
Welcome to Mapnik...     
                         
Using previous successful configuration...
Re-configure by running "python scons/scons.py configure".
scons: done reading SConscript files.
scons: Building targets ...
i686-pc-linux-gnu-g++ -o plugins/input/raster/raster_datasource.os -c -DHAVE_LIBXML2 -ansi -Wall -pthread -ftemplate-
depth-100 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O2 -finline-functions -Wno-inline -DNDEBUG -fPIC -DN
one -Iinclude -I. -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/agg2 plugins/input/ra
ster/raster_datasource.cpp
i686-pc-linux-gnu-g++ -o plugins/input/raster/raster_featureset.os -c -DHAVE_LIBXML2 -ansi -Wall -pthread -ftemplate-
depth-100 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O2 -finline-functions -Wno-inline -DNDEBUG -fPIC -DN
one -Iinclude -I. -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/agg2 plugins/input/ra
ster/raster_featureset.cpp
i686-pc-linux-gnu-g++ -o plugins/input/raster/raster_info.os -c -DHAVE_LIBXML2 -ansi -Wall -pthread -ftemplate-depth-100 -DLINUX -DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O2 -finline-functions -Wno-inline -DNDEBUG -fPIC -DNone -Iinclude -I. -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/agg2 plugins/input/raster/raster_info.cpp           
i686-pc-linux-gnu-g++ -o plugins/input/raster/raster.input -Wl,-rpath,/usr/lib -shared plugins/input/raster/raster_datasource.os plugins/input/raster/raster_featureset.os plugins/input/raster/raster_info.os -Lsrc -L/usr/lib -lmapnik
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lmapnik
collect2: ld returned 1 exit status
scons: *** [plugins/input/raster/raster.input] Error 1
scons: building terminated because of errors.
[...skip...]

In my system I don't have libmapnik.so*. Where I can get it?

Best regards.



Reproducible: Always

Steps to Reproduce:
Comment 1 James Earl Spahlinger 2009-08-10 04:50:41 UTC
Please paste the output of 'emerge --info' into a bugzilla comment to assist the maintainers in resolving this issue

Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-08-10 20:19:56 UTC
*** Bug 280957 has been marked as a duplicate of this bug. ***
Comment 3 Wormo (RETIRED) gentoo-dev 2009-08-17 01:40:01 UTC
libmapnik is supposed to be created during the mapnik build, so it would be good if you attach a full build log in addition to 'emerge --info' already requested.
Comment 4 vyp08 2009-08-17 04:47:44 UTC
Created attachment 201494 [details]
mapnik-0.6.0: ld: cannot find -lmapnik
Comment 5 vyp08 2009-08-17 05:07:20 UTC
(In reply to comment #3)
> libmapnik is supposed to be created during the mapnik build, so it would be
> good if you attach a full build log in addition to 'emerge --info' already
> requested.
> 

Ok.

IMHO, scons try build plugins/input/raster before libmapnik.so. And because I not have previous version libmapnik.so in my gentoo, ld really cannot find libmapnik.so. :)
May be just comment lines 44-46 in ebuild?

Comment 6 Steve Arnold archtester gentoo-dev 2009-08-20 03:01:41 UTC
Based on the build log, I disabled cairo and enabled sqlite, but it still builds fine for me.  Please post your emerge --info as requested, otherwise I probably have no hope of ever reproducing this.
Comment 7 vyp08 2009-08-20 12:08:10 UTC
Created attachment 201775 [details]
emerge --info.
Comment 8 Steve Arnold archtester gentoo-dev 2009-08-21 02:47:39 UTC
I don't really see anything that stands out in your --info, plus this build setup uses scons, so I'd recommend updating to dev-util/scons-1.2.0-r1 if you still have an older version installed.  Other than that, I'm open to suggestions...

In the meanwhile, I'll see if I can get it to fail on another box or two.
Comment 9 Steve Arnold archtester gentoo-dev 2009-08-21 05:24:50 UTC
Nope, still builds for me, even on an older install:

$ emerge mapnik -vp

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sci-geosciences/mapnik-0.6.0  USE="curl python sqlite -cairo -debug -gdal -postgres" 0 kB [?=>1]

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Portage tree and overlays:
 [0] /usr/portage
 [1] /usr/local/portage
 [?] indicates that the source repository could not be determined

Please sync and make sure you're trying to build the latest mapnik; thanks.
Comment 10 vyp08 2009-08-21 05:56:27 UTC
> Please sync and make sure you're trying to build the latest mapnik; thanks.
[..]
ld: cannot find -lmapnik
[..]

Please try:
# emerge -C mapnik
Make sure that the library file "libmapnik.so*" is missing on your system (may be in your home dir or in /usr/local/lib, ..).
# emerge mapnik

If build ok, please, attach your build log. Thanks.

Comment 11 Steve Arnold archtester gentoo-dev 2009-08-23 00:12:53 UTC
Created attachment 201963 [details]
Successful mapnik buildlog.

I'm a little confused by your last comment, but here it is...
Comment 12 vyp08 2009-08-24 07:18:04 UTC
Thanks.
In your case, first building the libmapnik.so, and then plugins.
On my system scons attempts to gather first plugins and ld can't found library :((
Why? Because:
1. USE in my make.conf "-python".
2. "-python" leads to the fact that configure get option "BINDINGS=none".
3. scons try building plugins without library.

Therefore I'm comment lines 62,78,83 in mapnik-0.6.0.ebuild and emerge it.
Comment 13 Steve Arnold archtester gentoo-dev 2009-08-29 20:29:16 UTC
Well, I'm certainly not an SConscript guru-dude, but it sure looks like the correct order in the #### Builds #### listed at the end of the main SConstruct file excerpt below.  Of course, the order might mean nothing at all, so feel free to submit a patch if you know how to make it behave.  I'm still investigating, but I haven't seen anything I can tweak yet...

# export env so it is available in Sconscript files
Export('env')

# Build agg first, doesn't need anything special
if env['INTERNAL_LIBAGG']:
    SConscript('agg/SConscript')

# Build the core library
SConscript('src/SConscript')

# Build the c++ rundemo app if requested
if env['DEMO']:
    SConscript('demo/c++/SConscript')

# Build the pgsql2psqlite app if requested
if env['PGSQL2SQLITE']:
    SConscript('utils/pgsql2sqlite/SConscript')

# Build shapeindex and remove its dependency from the LIBS
if 'boost_program_options%s' % env['BOOST_APPEND'] in env['LIBS']:
    SConscript('utils/shapeindex/SConscript')
    env['LIBS'].remove('boost_program_options%s' % env['BOOST_APPEND'])
else :
    color_print(1,"WARNING: Cannot find boost_program_options. 'shapeindex' won'
t be available")

GDAL_BUILT = False
OGR_BUILT = False
# Build the requested and able-to-be-compiled input plug-ins
for plugin in env['REQUESTED_PLUGINS']:
    details = env['PLUGINS'][plugin]
    if details['lib'] in env['LIBS']:
        SConscript('plugins/input/%s/SConscript' % plugin)
        if plugin == 'ogr': OGR_BUILT = True
        if plugin == 'gdal': GDAL_BUILT = True
        if plugin == 'ogr' or plugin == 'gdal':
            if GDAL_BUILT and OGR_BUILT:
                env['LIBS'].remove(details['lib'])
        else:
            env['LIBS'].remove(details['lib'])
    elif not details['lib']:
        # build internal shape and raster plugins
        SConscript('plugins/input/%s/SConscript' % plugin)

# Build the Python bindings
if 'python' in env['BINDINGS']:
    SConscript('bindings/python/SConscript')
Comment 14 vyp08 2009-08-31 04:43:53 UTC
The original package "mapnik-0.6.0.tar.bz2" have similar behavior: plugins build first, but not linked with libmapnik.so. Why your add patch

46    sed -i -e "s:libraries \= \[:libraries \= \[\'mapnik\',:g" \ 
47        plugins/input/{gdal,postgis,shape,raster}/SConscript \
48        || die "sed 2 failed"
?

Without this patch all builds ok.
Comment 15 Steve Arnold archtester gentoo-dev 2009-10-10 01:21:39 UTC
The patch is there because it failed without it.  I have several systems here, mostly desktop x86/amd64/ppc, plus some embedded ppc and some x86-hardened, and they all work the same way.  All I can suggest is to keep mapnik in your overlay for now, and keep trying to figure out why your system acts differently wrt scons builds.
Comment 16 Steve Arnold archtester gentoo-dev 2009-11-02 01:58:07 UTC
I just added 0.6.1 to portage, and it seems to build fine with minimal changes to the scons build files (both with and without use=python).  Give it a try and see if it works for you.
Comment 17 Andreas K. Hüttel archtester gentoo-dev 2010-11-07 22:44:41 UTC
Is this still a problem for current mapnik?
Comment 18 vyp08 2010-11-08 07:24:27 UTC
Good day!

sci-geosciences/mapnik-0.7.1-r1 builded ok, thanks.
Comment 19 Tomáš Chvátal (RETIRED) gentoo-dev 2011-06-17 10:19:57 UTC
Fixed as per latest comment and my testing.