mapbox / windows-builds

DEPRECATED! build scripts for mapnik dependencies, mapnik, node-mapnik, node, libosmiom, osmium-tool
38 stars 22 forks source link

mapnik Python bindings fail with VS2015 Update 3 #92

Open wilhelmberg opened 8 years ago

wilhelmberg commented 8 years ago

/cc @artemp @springmeyer

AppVeyor doesn't build bail on a Python bindings build error so I don't know exactly for how long this has been failing.

Maybe just a missing reference to freetype.lib:

29>Link:
        Creating library lib/python2.7/mapnik/_mapnik.lib and object lib/python2.7/mapnik/_mapnik.exp
     Linker: LibDef Total time = 0.00196s PB: 410066944 [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\lib\python2.7\mapnik\_mapnik.pyd] 
29>mapnik_font_engine.obj : error LNK2019: unresolved external symbol "class mapnik::freetype_engine const volatile * __cdecl boost::get_pointer<class mapnik::freetype_engine const volatile >(class mapnik::freetype_engine const volatile *)" (??$get_pointer@$$CDVfreetype_engine@mapnik@@@boost@@YAPEDVfreetype_engine@mapnik@@PEDV12@@Z) referenced in function "public: static struct _object * __cdecl boost::python::objects::make_instance_impl<class mapnik::freetype_engine,struct boost::python::objects::pointer_holder<class mapnik::freetype_engine *,class mapnik::freetype_engine>,struct boost::python::objects::make_ptr_instance<class mapnik::freetype_engine,struct boost::python::objects::pointer_holder<class mapnik::freetype_engine *,class mapnik::freetype_engine> > >::execute<class mapnik::freetype_engine *>(class mapnik::freetype_engine * &)" (??$execute@PEAVfreetype_engine@mapnik@@@?$make_instance_impl@Vfreetype_engine@mapnik@@U?$pointer_holder@PEAVfreetype_engine@mapnik@@V12@@objects@python@boost@@U?$make_ptr_instance@Vfreetype_engine@mapnik@@U?$pointer_holder@PEAVfreetype_engine@mapnik@@V12@@objects@python@boost@@@456@@objects@python@boost@@SAPEAU_object@@AEAPEAVfreetype_engine@mapnik@@@Z) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\_mapnik.vcxproj]
29>lib/python2.7/mapnik/_mapnik.pyd : fatal error LNK1120: 1 unresolved externals [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\_mapnik.vcxproj]
     Linker:   Wait PDB close Total time = 0.00130s PB: 413396992 [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\lib\python2.7\mapnik\_mapnik.pyd] 
     Linker:   Wait type merge Total time = 0.35704s PB: 388227072 [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\lib\python2.7\mapnik\_mapnik.pyd] 
     Linker: Final Total time = 2.66497s < 88804153009 - 88830802662 > PB: 35565568 [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\lib\python2.7\mapnik\_mapnik.pyd] 
29>Done Building Project "c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\_mapnik.vcxproj" (default targets) -- FAILED.
"c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.sln" (default target) (1) ->
"c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\_mapnik.vcxproj.metaproj" (default target) (2) ->
"c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\_mapnik.vcxproj" (default target) (29) ->
(Link target) -> 
  mapnik_font_engine.obj : error LNK2019: unresolved external symbol "class mapnik::freetype_engine const volatile * __cdecl boost::get_pointer<class mapnik::freetype_engine const volatile >(class mapnik::freetype_engine const volatile *)" (??$get_pointer@$$CDVfreetype_engine@mapnik@@@boost@@YAPEDVfreetype_engine@mapnik@@PEDV12@@Z) referenced in function "public: static struct _object * __cdecl boost::python::objects::make_instance_impl<class mapnik::freetype_engine,struct boost::python::objects::pointer_holder<class mapnik::freetype_engine *,class mapnik::freetype_engine>,struct boost::python::objects::make_ptr_instance<class mapnik::freetype_engine,struct boost::python::objects::pointer_holder<class mapnik::freetype_engine *,class mapnik::freetype_engine> > >::execute<class mapnik::freetype_engine *>(class mapnik::freetype_engine * &)" (??$execute@PEAVfreetype_engine@mapnik@@@?$make_instance_impl@Vfreetype_engine@mapnik@@U?$pointer_holder@PEAVfreetype_engine@mapnik@@V12@@objects@python@boost@@U?$make_ptr_instance@Vfreetype_engine@mapnik@@U?$pointer_holder@PEAVfreetype_engine@mapnik@@V12@@objects@python@boost@@@456@@objects@python@boost@@SAPEAU_object@@AEAPEAVfreetype_engine@mapnik@@@Z) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\_mapnik.vcxproj]
  lib/python2.7/mapnik/_mapnik.pyd : fatal error LNK1120: 1 unresolved externals [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\_mapnik.vcxproj]
springmeyer commented 8 years ago

Seems like this might be related to https://github.com/mapnik/python-mapnik/blob/master/src/boost_std_shared_shim.hpp. Could BOOST_NO_CXX11_SMART_PTR be being set to true in this build?

wilhelmberg commented 8 years ago

Could BOOST_NO_CXX11_SMART_PTR be being set to true in this build?

As far as I can tell that's not the problem. Used compiler switches /E, /E, /P, /EP to dump all preprocessor directives to files and looking through them couldn't find any reference to BOOST_NO_CXX11_SMART_PTR.

wilhelmberg commented 8 years ago

Also tried additionally linking to freetype.lib, but the output of the /VERBOSE linker switch tells me that it is not used. Being already linked into to mapnik.dll before.

Unused libraries:
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk/lib/\freetype.lib
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk/lib/\libboost_regex-vc140-mt-1_60.lib
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk/lib/\icuin.lib
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib\amd64\OLDNAMES.lib
  C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64\uuid.lib
stoicio commented 7 years ago

Hello ! I am running into the same error as above. Is there a resolution for this ? Or as a temporary fix will switching to a old commit help ?

wilhelmberg commented 7 years ago

@mbhala as temporary workaround till we find a solution you can use the pre-built Windows mapnik SDK without Python bindings.

64-bit: https://mapnik.s3.amazonaws.com/dist/dev/mapnik-win-sdk-v3.0.11-163-g00e5d00-x64-14.0.7z

32-bit: https://mapnik.s3.amazonaws.com/dist/dev/mapnik-win-sdk-v3.0.11-163-g00e5d00-x86-14.0.7z

jadavbheda commented 7 years ago

If any one still wants to compile one on their own, they can do so after uninstalling VS 2015 update 2.

Below are the steps that I followed:

Dependencies:

Download link - [Important note* - Make sure you install VS2015 without 'update 3'. If you go with recommended installation wizzard then it will automatically install the update 3. Hence, choose the custom installation option and uncheck the 'update 3' checkbox.]

  • Python 2.7 32 bit installed into C:\Python27 [No. 64-bit version of python is not going to work. Don't even experiment!]

git installed into C:\Program Files (x86)\Git

Mapbox script:

thisisbinod commented 7 years ago

Any update on this?

wilhelmberg commented 7 years ago

@thisisbinod currently no update, but we plan on testing with VS2017 within a few weeks.

alex85k commented 7 years ago

Here is the bug description: https://connect.microsoft.com/VisualStudio/Feedback/Details/2852624 http://stackoverflow.com/questions/38261530/unresolved-external-symbols-since-visual-studio-2015-update-3-boost-python-link

wilhelmberg commented 7 years ago

^^ /cc @springmeyer @artemp

alex85k commented 7 years ago

The suggested workaround worked for pyosimium: https://github.com/osmcode/pyosmium/pull/35/commits/3fa34712ac067fc8f4030ef944c6c2ab1915b83f

springmeyer commented 7 years ago

Thank you so much for that insight @alex85k. We should try this with mapnik.

alex85k commented 7 years ago

I am certified Google&StackOverflow user :) The only problem with this workaround is that additional get_pointer functions should not be defined twice.