mapnik / python-mapnik

Python bindings for mapnik
GNU Lesser General Public License v2.1
157 stars 90 forks source link

Install problem with 'mapnik::proj_transform' #250

Open JBacc1 opened 2 years ago

JBacc1 commented 2 years ago

Install of python-mapnik failed with errors citing 'mapnik::proj_transform' at: sudo python3 setup.py install

I'm no linux specialist, but last command run was: clang++ -DNDEBUG -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/mapnik_proj_transform.cpp -o build/temp.linux-x86_64-3.7/src/mapnik_proj_transform.o -I/usr/local/include -I/usr/local/include/mapnik/agg -I/usr/local/include/mapnik/deps -I/home/jb/OSM/mapnik/mason_packages/.link/include -I/home/jb/OSM/mapnik/mason_packages/.link/include/freetype2 -I/home/jb/OSM/mapnik/mason_packages/.link/include/libpng16 -I/home/jb/OSM/mapnik/mason_packages/linux-x86_64/libgdal/2.2.3/include -I/home/jb/OSM/mapnik/mason_packages/.link/include/cairo -I/home/jb/OSM/mapnik/mason_packages/.link/include/pixman-1 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ -DMAPNIK_PROJ_VERSION=70201 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DSVG_RENDERER -std=c++14 -DU_USING_ICU_NAMESPACE=0 -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility-inlines-hidden -pthread -ftemplate-depth-300 -O3

with error message:

src/mapnik_proj_transform.cpp:51:44: error: no member named 'source' in 'mapnik::proj_transform'
        return boost::python::make_tuple(p.source(),p.dest());
                                         ~ ^
src/mapnik_proj_transform.cpp:51:55: error: no member named 'dest' in 'mapnik::proj_transform'                                      
        return boost::python::make_tuple(p.source(),p.dest());
                                                    ~ ^
src/mapnik_proj_transform.cpp:65:27: error: no member named 'source' in 'mapnik::proj_transform'                                    
          << "from " << t.source().params() << " to: " << t.dest().params();
                        ~ ^
src/mapnik_proj_transform.cpp:65:61: error: no member named 'dest' in 'mapnik::proj_transform'                                      
          << "from " << t.source().params() << " to: " << t.dest().params();
                                                          ~ ^
src/mapnik_proj_transform.cpp:79:28: error: no member named 'dest' in 'mapnik::proj_transform'                                      
          << "from " <<  t.dest().params() << " to: " << t.source().params();
                         ~ ^
src/mapnik_proj_transform.cpp:79:60: error: no member named 'source' in 'mapnik::proj_transform'                                    
          << "from " <<  t.dest().params() << " to: " << t.source().params();
                                                         ~ ^
src/mapnik_proj_transform.cpp:91:27: error: no member named 'source' in 'mapnik::proj_transform'                                    
          << "from " << t.source().params() << " to: " << t.dest().params();
                        ~ ^
src/mapnik_proj_transform.cpp:91:61: error: no member named 'dest' in 'mapnik::proj_transform'                                      
          << "from " << t.source().params() << " to: " << t.dest().params();
                                                          ~ ^
src/mapnik_proj_transform.cpp:103:28: error: no member named 'dest' in 'mapnik::proj_transform'                                     
          << "from " <<  t.dest().params() << " to: " << t.source().params();
                         ~ ^
src/mapnik_proj_transform.cpp:103:60: error: no member named 'source' in 'mapnik::proj_transform'                                   
          << "from " <<  t.dest().params() << " to: " << t.source().params();
                                                         ~ ^
src/mapnik_proj_transform.cpp:115:27: error: no member named 'source' in 'mapnik::proj_transform'                                   
          << "from " << t.source().params() << " to: " << t.dest().params();
                        ~ ^
src/mapnik_proj_transform.cpp:115:61: error: no member named 'dest' in 'mapnik::proj_transform'                                     
          << "from " << t.source().params() << " to: " << t.dest().params();
                                                          ~ ^
src/mapnik_proj_transform.cpp:127:28: error: no member named 'dest' in 'mapnik::proj_transform'                                     
          << "from " <<  t.dest().params() << " to: " << t.source().params();
                         ~ ^
src/mapnik_proj_transform.cpp:127:60: error: no member named 'source' in 'mapnik::proj_transform'                                   
          << "from " <<  t.dest().params() << " to: " << t.source().params();
                                                         ~ ^
14 errors generated.                                                                                                                
error: command 'clang++' failed with exit status 1

Don't know if more info is needed, but I'm in a dead end.

mathisloge commented 2 years ago

looks like you are using mapnik@master to build python-mapnik.

mapnik@master have been updated to support proj >7.2.0 and therefore had some breaking changes.

You would need to change all occurences of << "from " << t.dest().params() << " to: " << t.source().params() to << proj_transform_->definition()

Or pull the proj6 branch in.

JBacc1 commented 2 years ago

Hello, Thanks for your answer. I changed the mapnik_proj_transform.cpp as you adviced, but the errors are still there. Are there other files to check as well? Or I'll have to dig deeper and find how to get the proj6 be used. Or wait for the mapnik and python-mapnik to be compatible. Thanks, JB. For completion, the command clang++ -DNDEBUG -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c src/mapnik_proj_transform.cpp -o build/temp.linux-x86_64-3.7/src/mapnik_proj_transform.o -I/usr/local/include -I/usr/local/include/mapnik/agg -I/usr/local/include/mapnik/deps -I/home/jb/OSM/mapnik/mason_packages/.link/include -I/home/jb/OSM/mapnik/mason_packages/.link/include/freetype2 -I/home/jb/OSM/mapnik/mason_packages/.link/include/libpng16 -I/home/jb/OSM/mapnik/mason_packages/linux-x86_64/libgdal/2.2.3/include -I/home/jb/OSM/mapnik/mason_packages/.link/include/cairo -I/home/jb/OSM/mapnik/mason_packages/.link/include/pixman-1 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ -DMAPNIK_PROJ_VERSION=70201 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DSVG_RENDERER -std=c++14 -DU_USING_ICU_NAMESPACE=0 -D_GLIBCXX_USE_CXX11_ABI=0 -fvisibility-inlines-hidden -pthread -ftemplate-depth-300 -O3

will get:

src/mapnik_proj_transform.cpp:51:44: error: no member named 'source' in 'mapnik::proj_transform'
        return boost::python::make_tuple(p.source(),p.dest());
                                         ~ ^
src/mapnik_proj_transform.cpp:51:55: error: no member named 'dest' in 'mapnik::proj_transform'                                      
        return boost::python::make_tuple(p.source(),p.dest());
                                                    ~ ^
src/mapnik_proj_transform.cpp:65:14: error: 'proj_transform' does not refer to a value                                              
          << proj_transform->definition();
             ^
/usr/local/include/mapnik/proj_transform.hpp:38:19: note: declared here                                                             
class MAPNIK_DECL proj_transform : private util::noncopyable
                  ^
src/mapnik_proj_transform.cpp:80:4: error: 'proj_transform' does not refer to a value                                               
<< proj_transform->definition();
   ^
/usr/local/include/mapnik/proj_transform.hpp:38:19: note: declared here                                                             
class MAPNIK_DECL proj_transform : private util::noncopyable
                  ^
src/mapnik_proj_transform.cpp:93:4: error: 'proj_transform' does not refer to a value                                               
<< proj_transform->definition();
   ^
/usr/local/include/mapnik/proj_transform.hpp:38:19: note: declared here                                                             
class MAPNIK_DECL proj_transform : private util::noncopyable
                  ^
src/mapnik_proj_transform.cpp:106:4: error: 'proj_transform' does not refer to a value                                              
<< proj_transform->definition();
   ^
/usr/local/include/mapnik/proj_transform.hpp:38:19: note: declared here                                                             
class MAPNIK_DECL proj_transform : private util::noncopyable
                  ^
src/mapnik_proj_transform.cpp:119:4: error: 'proj_transform' does not refer to a value                                              
<< proj_transform->definition();
   ^
/usr/local/include/mapnik/proj_transform.hpp:38:19: note: declared here                                                             
class MAPNIK_DECL proj_transform : private util::noncopyable
                  ^
src/mapnik_proj_transform.cpp:132:4: error: 'proj_transform' does not refer to a value                                              
<< proj_transform->definition();
   ^
/usr/local/include/mapnik/proj_transform.hpp:38:19: note: declared here                                                             
class MAPNIK_DECL proj_transform : private util::noncopyable
                  ^
8 errors generated.                                                                                                                 
error: command 'clang++' failed with exit status 1
mathisloge commented 2 years ago

you need to use the correct variables. https://github.com/mapnik/python-mapnik/commit/ca66af65204d68a5496a94d36d69bf61144daf3b and https://github.com/mapnik/python-mapnik/commit/feec9afa66131b074c40359529e498eab0d79a02 are looking like the necessary changes you would need to apply. But you can also just merge proj6 branch into your local master branch.

braandl commented 7 months ago

looks like you are using mapnik@master to build python-mapnik.

mapnik@master have been updated to support proj >7.2.0 and therefore had some breaking changes.

You would need to change all occurences of << "from " << t.dest().params() << " to: " << t.source().params() to << proj_transform_->definition()

Or pull the proj6 branch in.

I do get the same error with proj@9.2.1 and any other version I tried. Any ideas?