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

Problems configuring/building v3.0.23 on Lubuntu 20.04 #4164

Open
brunswick42 opened this issue Aug 5, 2020 · 3 comments
Open

Problems configuring/building v3.0.23 on Lubuntu 20.04 #4164

brunswick42 opened this issue Aug 5, 2020 · 3 comments
Assignees

Comments

@brunswick42
Copy link

brunswick42 commented Aug 5, 2020

I installed all of the dependencies, including the optional dependencies, that are listed in the v3.0.23 install guide. Following the source install instructions on the downloads page I ran:

git clone https://github.com/mapnik/mapnik.git
cd mapnik
git checkout v3.0.23
git submodule update --init
./configure

However, there were a few problems.

  • It could not find freetype-config.
  • It could not find the Proj library.
  • It could not find the data directories for ICU and GDAL

This is the output of the ./configure command:

scons: Reading SConscript files ...

Welcome to Mapnik...                                                                                                 
                                                                                                                     
Configuring build environment...
Configuring on Linux in *release mode*...
Checking for freetype-config... no
Checking for dlfcn.h support ... yes
Checking if compiler (c++) supports -std=c++11 flag... (cached) yes
Checking for C library z... yes
Checking for C++ library icuuc... yes
Checking for ICU version >= 4.2... found: icu 66.1
(cached) Checking for C++ library harfbuzz... yes
Checking for HarfBuzz version >= 0.9.34... found: HarfBuzz 2.6.4
Checking for HarfBuzz with freetype support
(cached) no
Searching for boost libs and headers... (cached) 
Using default boost lib dir: /usr/lib                                                                                
Using default boost include dir: /usr/include                                                                        
Checking for C++ header file boost/version.hpp... yes
Checking for Boost version >= 1.47... yes
Found boost lib version... 1_71
Checking for C++ library boost_system... yes
Checking for C++ library boost_filesystem... yes
Checking for C++ library boost_regex... yes
Checking for C++ library boost_program_options... yes
Checking whether Boost was compiled with C++11 scoped enums ... yes
Checking if boost_regex was built with ICU unicode support... (cached) yes
Checking for C library jpeg... yes
Checking for C library proj... no
Could not find optional header or shared library for proj
Checking for C library png... yes
Checking for C library webp... yes
Checking for C library tiff... yes
Checking for PROJ_LIB directory...Failed to detect (mapnik-config will have null value)
Checking for ICU data directory...Failed to detect (mapnik-config will have null value)
Checking for GDAL data directory...Failed to detect (mapnik-config will have null value)
Checking for pkg-config... yes
Checking for requested plugins dependencies...
Checking for pg_config... yes
Checking for C library sqlite3... yes
Checking if SQLite supports RTREE... (cached) yes
Checking for gdal-config --libs... yes
Checking for gdal-config --cflags... yes
Checking for name of gdal library... yes
Checking for C++ library gdal... yes
Checking for pg_config... yes
Checking if gdal is ogr enabled... yes
Checking for gdal-config --libs... yes
Checking for gdal-config --cflags... yes
Checking for name of ogr library... yes
Checking for C++ library gdal... yes
Checking for cairo... yes
Checking for cairo lib and include paths... yes
Checking for cairo freetype font support ... yes

Exiting... the following required dependencies were not found:                                                       
   - freetype-config (freetype-config program | try setting FREETYPE_CONFIG SCons option or configure with FREETYPE_LIBS & FREETYPE_INCLUDES)                                                                                             
   - harfbuzz-with-freetype-support                                                                                  

See '/home/tstewart/code/mapnik/config.log' for details on possible problems.                                        

Also, these OPTIONAL dependencies were not found:                                                                    
   - proj (Proj.4 C Projections library | configure with PROJ_LIBS & PROJ_INCLUDES | more info: http://trac.osgeo.org/proj/)                                                                                                              

Set custom paths to these libraries and header files on the command-line or in a file called 'config.py'             
    ie. $ python scons/scons.py BOOST_INCLUDES=/usr/local/include BOOST_LIBS=/usr/local/lib

Once all required dependencies are found a local 'config.py' will be saved and then install:                         
    $ sudo python scons/scons.py install

To view available path variables:                                                                                    
    $ python scons/scons.py --help or -h                                                                             

To view overall SCons help options:                                                                                  
    $ python scons/scons.py --help-options or -H                                                                     
                                                                                                                     
More info: https://github.com/mapnik/mapnik/wiki/Mapnik-Installation

I've been able to resolve a few of these problems, but I am not sure if my solutions are the best way to go about it.

Missing freetype-config:
''freetype-config'' is depreciated and ''pkg-config'' should be used instead. A fix for this is available and was merged with master in #3892, but SConstruct in v3.0.23 doesn't include them. Adding those checks resolves the freetype-config dependency.

Missing Proj library:
Issue #4117 provides a solution, use ./configure CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"

But that still leaves the missing data directories, and I am not sure what to do about that. It finds GDAL and ICU, but it can't find those directories. I searched the issues and found #3865, which suggests that configure use icu-config but that was removed from libicu-dev.

Do I need to set ICU_DATA and GDAL_DATA manually? I'm new to Mapnik and these libraries, and I don't know how to do that.
Is there a better solution to the freetype-config dependency that doesn't involve editing the SConstruct file?

@artemp
Copy link
Member

artemp commented Aug 6, 2020

''freetype-config'' is depreciated and ''pkg-config'' should be used instead.

agree^, i'll look into "cherry-picking" #3892 into v3.0.x branch.

Have you tried setting FREETYPE_INCLUDE and FREETYPE_LIBS as an alternative to freetype-config ?

@artemp artemp self-assigned this Aug 6, 2020
@artemp
Copy link
Member

artemp commented Aug 6, 2020

@tstewart-writer Have you tried pulling dependencies via bootstrap script?

./bootstrap.sh
./configure && make

@brunswick42
Copy link
Author

brunswick42 commented Aug 6, 2020

I set FREETYPE_LIBS/FREETYPE_INCLUDES as shown here:
./configure FREETYPE_LIBS=/usr/lib/x86_64-linux-gnu/ FREETYPE_INCLUDES=/usr/include/freetype2/ CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"
and it worked. It found the library and everything was good.

I also pulled the dependencies with boostrap.sh but ./configure failed.

Inheriting from mapnik-settings.env
scons: Reading SConscript files ...

Welcome to Mapnik...                                                                                                 
                                                                                                                     
Configuring build environment...
SCons CONFIG found: 'config.py', variables will be inherited...
Configuring on Linux in *release mode*...
Checking for dlfcn.h support ... no
Checking if compiler (clang++) supports -std=c++11 flag... (cached) no
C++ compiler does not support C++11 standard (-std=c++11), which is required. Please upgrade your compiler

The clang-10 package is installed. From the contributing documentation, my understanding is that bootstrap is meant to set up a standardized configuration for development and testing purposes. This might be better suited to another issue, but I'd like to understand the regular installation process because I want to update the documentation, probably starting with the installation docs.

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