Skip to content
This repository has been archived by the owner on Dec 3, 2018. It is now read-only.

Boost 1.60 #88

Closed
wilhelmberg opened this issue May 6, 2016 · 27 comments
Closed

Boost 1.60 #88

wilhelmberg opened this issue May 6, 2016 · 27 comments

Comments

@wilhelmberg
Copy link
Contributor

refs
mapnik/mapnik#3333
mapnik/mapnik-packaging@c2b4603

@springmeyer seeing this on Windows:

expression_node.obj : error LNK2019: unresolved external symbol "public: class std::vector<int,class std::allocator<int> > __cdecl boost::re_detail_106000::icu_regex_traits_implementation::do_transform(int const *,int const *,class icu_56::Collator const *)const " (?do_transform@icu_regex_traits_implementation@re_detail_106000@boost@@QEBA?AV?$vector@HV?$allocator@H@std@@@std@@PEBH0PEBVCollator@icu_56@@@Z) referenced in function "public: class std::vector<int,class std::allocator<int> > __cdecl boost::re_detail_106000::icu_regex_traits_implementation::transform(int const *,int const *)const " (?transform@icu_regex_traits_implementation@re_detail_106000@boost@@QEBA?AV?$vector@HV?$allocator@H@std@@@std@@PEBH0@Z) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]
expression_node.obj : error LNK2019: unresolved external symbol "public: bool __cdecl boost::icu_regex_traits::isctype(int,unsigned __int64)const " (?isctype@icu_regex_traits@boost@@QEBA_NH_K@Z) referenced in function "class boost::u16_to_u32_iterator<wchar_t const *,int> __cdecl boost::re_detail_106000::re_is_set_member<class boost::u16_to_u32_iterator<wchar_t const *,int>,int,class boost::icu_regex_traits,unsigned __int64>(class boost::u16_to_u32_iterator<wchar_t const *,int>,class boost::u16_to_u32_iterator<wchar_t const *,int>,struct boost::re_detail_106000::re_set_long<unsigned __int64> const *,struct boost::re_detail_106000::regex_data<int,class boost::icu_regex_traits> const &,bool)" (??$re_is_set_member@V?$u16_to_u32_iterator@PEB_WH@boost@@HVicu_regex_traits@2@_K@re_detail_106000@boost@@YA?AV?$u16_to_u32_iterator@PEB_WH@1@V21@0PEBU?$re_set_long@_K@01@AEBU?$regex_data@HVicu_regex_traits@boost@@@01@_N@Z) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]
expression_node.obj : error LNK2019: unresolved external symbol "private: class boost::basic_regex<int,class boost::icu_regex_traits> & __cdecl boost::basic_regex<int,class boost::icu_regex_traits>::do_assign(int const *,int const *,unsigned int)" (?do_assign@?$basic_regex@HVicu_regex_traits@boost@@@boost@@AEAAAEAV12@PEBH0I@Z) referenced in function "class boost::basic_regex<int,class boost::icu_regex_traits> __cdecl boost::re_detail_106000::do_make_u32regex<wchar_t const *>(wchar_t const *,wchar_t const *,unsigned int,struct boost::mpl::int_<2> const *)" (??$do_make_u32regex@PEB_W@re_detail_106000@boost@@YA?AV?$basic_regex@HVicu_regex_traits@boost@@@1@PEB_W0IPEBU?$int_@$01@mpl@1@@Z) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]
lib\mapnik.dll : fatal error LNK1120: 3 unresolved externals [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]
@springmeyer
Copy link

@BergWerkGIS if you are seeing this locally it may be the same problem I had whereby older boost versions were still around and conflicting. I had to clean out my installation directory completely of boost libs and headers and then the problem went away. If you are seeing this remotely on a clean build then it may be that the icu configure check is failing and boost is being built without ICU support. I saw this and came up with this quick fix that enables ICU no matter what the configure check says (which works nicely): https://github.com/mapnik/mapnik-packaging/blob/master/osx/patches/boost_icu_check.diff

@wilhelmberg
Copy link
Contributor Author

wilhelmberg commented May 7, 2016

Yes, locally, but I'm 99% percent sure I got rid of all leftovers of previous (boost) builds.
Tried twice locally, but haven't tried remotely yet.

quick fix that enables ICU no matter what the configure check says

Quite a sophisticated fix 😏

@springmeyer
Copy link

@BergWerkGIS still broken or working now?

@wilhelmberg
Copy link
Contributor Author

@springmeyer still broken.

Currently hitting

c:\mb\windows-builds-64\packages\mapnik-master\include\mapnik/util/variant.hpp(27): 
fatal error C1083: Cannot open include file: 'mapbox/variant.hpp': No such file or directory 
(compiling source file ..\..\src\renderer_common\render_group_symbolizer.cpp) 
[c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]

Despite having added "../deps/mapbox/variant/include/" to common_includes:
mapnik/mapnik-gyp@6f393f9

@wilhelmberg
Copy link
Contributor Author

Ah, had a typo in common_includes, past that now.

Local ([email protected]) errors are similar to those on AppVeyor ([email protected]):
e.g. https://ci.appveyor.com/project/Mapbox/mapnik/build/1.0.965#L1021

Additionally to AppVeyor I get the errors mentioned in the original post locally.

@wilhelmberg
Copy link
Contributor Author

@springmeyer @artemp

Getting those errors with mapnik-json.
Tried with [email protected], [email protected] and [email protected] beta.

My hunch is that maybe boost doesn't use C++14 features with VS2015 (hit the same problem with OSRM).

Any other ideas?

"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\topojson.vcxproj.metaproj" (default target) (24) ->
"c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj" (default target) (25) ->
(ClCompile target) -> 
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/spirit/home/qi/detail/assign_to.hpp(152): error C2440: 'static_cast': cannot convert from 'const std::vector<mapnik::json::json_object_element,std::allocator<_Ty>>' to 'mapnik::json::json_value' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/spirit/home/qi/detail/assign_to.hpp(152): error C2440: 'static_cast': cannot convert from 'const double' to 'mapnik::json::json_value' (compiling source file ..\..\src\json\mapnik_json_geometry_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2679: binary '=': no operator found which takes a right-hand operand of type 'double' (or there is no acceptable conversion) (compiling source file ..\..\src\json\mapnik_json_feature_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2672: 'boost::proto::detail::check_reference': no matching overloaded function found (compiling source file ..\..\src\json\mapnik_json_feature_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2679: binary '=': no operator found which takes a right-hand operand of type 'double' (or there is no acceptable conversion) (compiling source file ..\..\src\json\mapnik_json_feature_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2672: 'boost::type_of::typeof_register_type': no matching overloaded function found (compiling source file ..\..\src\json\mapnik_json_feature_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2027: use of undefined type 'boost::type_of::msvc_extract_type<boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_and_hidden_nested_result_type,boost::type_of::msvc_extract_type_default_param>::id2type_impl<true>' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2955: 'boost::type': use of class template requires template argument list (compiling source file ..\..\src\json\mapnik_json_feature_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2955: 'boost::mpl::if_c': use of class template requires template argument list (compiling source file ..\..\src\json\mapnik_json_feature_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2039: 'type': is not a member of 'boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_result_type' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2027: use of undefined type 'boost::type_of::msvc_extract_type<boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_and_hidden_nested_result_type,boost::type_of::msvc_extract_type_default_param>::id2type_impl<true>' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2039: 'type': is not a member of 'boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_result_type' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2679: binary '=': no operator found which takes a right-hand operand of type 'double' (or there is no acceptable conversion) (compiling source file ..\..\src\json\mapnik_topojson_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2672: 'boost::proto::detail::check_reference': no matching overloaded function found (compiling source file ..\..\src\json\mapnik_topojson_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2679: binary '=': no operator found which takes a right-hand operand of type 'double' (or there is no acceptable conversion) (compiling source file ..\..\src\json\mapnik_topojson_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2672: 'boost::type_of::typeof_register_type': no matching overloaded function found (compiling source file ..\..\src\json\mapnik_topojson_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2027: use of undefined type 'boost::type_of::msvc_extract_type<boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_and_hidden_nested_result_type,boost::type_of::msvc_extract_type_default_param>::id2type_impl<true>' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2955: 'boost::type': use of class template requires template argument list (compiling source file ..\..\src\json\mapnik_topojson_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2955: 'boost::mpl::if_c': use of class template requires template argument list (compiling source file ..\..\src\json\mapnik_topojson_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2039: 'type': is not a member of 'boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_result_type' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2027: use of undefined type 'boost::type_of::msvc_extract_type<boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_and_hidden_nested_result_type,boost::type_of::msvc_extract_type_default_param>::id2type_impl<true>' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2039: 'type': is not a member of 'boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_result_type' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]

@springmeyer
Copy link

@artemp - this looks like something to do with your recent json commits - it will block the release: can you take a look?

@artemp
Copy link
Contributor

artemp commented May 12, 2016

@springmeyer - looks like it doh.. will take a look

@artemp
Copy link
Contributor

artemp commented May 12, 2016

@BergWerkGIS - can you elaborate re: "My hunch is that maybe boost doesn't use C++14 features with VS2015 (hit the same problem with OSRM)." ? What was the issue with OSRM/boost c++14?

@wilhelmberg
Copy link
Contributor Author

If C++14 features are the problem I could go through Macros that describe C++14 features not supported and comment them, rebuild and see if it helps.

AFAIK latest VS2015 Update 2 should support all C++14 (and some C++17) features, but boost doesn't use them (screenshot from 1.61 beta):

image

@wilhelmberg
Copy link
Contributor Author

Oops, we commented at the same time.

What was the issue with OSRM/boost c++14?

Problem was that OSRM code used some specific C++14 boost features.
But that didn't compile as boost disables C++14 with VS2015.

@artemp
Copy link
Contributor

artemp commented May 12, 2016

We're not using any c++14 features only c++11.

Reading through errors I noticed:

 c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/proto/transform/default.hpp(154): error C2027: use of undefined type 'boost::type_of::msvc_extract_type<boost::proto::detail::default_assign<Grammar>::impl<Expr &,State,Data>::nested_and_hidden_nested_result_type,boost::type_of::msvc_extract_type_default_param>::id2type_impl<true>' [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik-json.vcxproj]

which indicates that perhaps boost is not configured and/or built correctly ?
http://www.boost.org/doc/libs/1_60_0/boost/typeof/msvc/typeof_impl.hpp <--- various workarounds specific for VC++ that maybe not activated with VS2015 ?

@daniel-j-h
Copy link

Problem was that OSRM code used some specific C++14 boost features.

Interesting, which ones in particular? OSRM is stuck on C++11 at the moment, I can't remember us doing the switch.

@wilhelmberg
Copy link
Contributor Author

@daniel-j-h I thought there was a c++14 branch that I tried, didn't I?

@daniel-j-h
Copy link

Ah sorry, yes I forgot about Project-OSRM/osrm-backend#1975 --- never landed though since we're blocked mainly by Project-OSRM/node-osrm#153.

@wilhelmberg
Copy link
Contributor Author

Reopening this issue as it is about [email protected] and mapnik/mapnik@dc84943 was tested with [email protected].

Next step: try with [email protected].

@wilhelmberg wilhelmberg reopened this May 13, 2016
@wilhelmberg
Copy link
Contributor Author

Errors with [email protected] still persist:

"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) (27) ->
(Link target) -> 
  expression_node.obj : error LNK2019: unresolved external symbol "public: class std::vector<int,class std::allocator<int> > __cdecl boost::re_detail_106000::icu_regex_traits_implementation::do_transform(int const *,int const *,class icu_56::Collator const *)const " (?do_transform@icu_regex_traits_implementation@re_detail_106000@boost@@QEBA?AV?$vector@HV?$allocator@H@std@@@std@@PEBH0PEBVCollator@icu_56@@@Z) referenced in function "public: class std::vector<int,class std::allocator<int> > __cdecl boost::re_detail_106000::icu_regex_traits_implementation::transform(int const *,int const *)const " (?transform@icu_regex_traits_implementation@re_detail_106000@boost@@QEBA?AV?$vector@HV?$allocator@H@std@@@std@@PEBH0@Z) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]
  expression_node.obj : error LNK2019: unresolved external symbol "public: bool __cdecl boost::icu_regex_traits::isctype(int,unsigned __int64)const " (?isctype@icu_regex_traits@boost@@QEBA_NH_K@Z) referenced in function "class boost::u16_to_u32_iterator<wchar_t const *,int> __cdecl boost::re_detail_106000::re_is_set_member<class boost::u16_to_u32_iterator<wchar_t const *,int>,int,class boost::icu_regex_traits,unsigned __int64>(class boost::u16_to_u32_iterator<wchar_t const *,int>,class boost::u16_to_u32_iterator<wchar_t const *,int>,struct boost::re_detail_106000::re_set_long<unsigned __int64> const *,struct boost::re_detail_106000::regex_data<int,class boost::icu_regex_traits> const &,bool)" (??$re_is_set_member@V?$u16_to_u32_iterator@PEB_WH@boost@@HVicu_regex_traits@2@_K@re_detail_106000@boost@@YA?AV?$u16_to_u32_iterator@PEB_WH@1@V21@0PEBU?$re_set_long@_K@01@AEBU?$regex_data@HVicu_regex_traits@boost@@@01@_N@Z) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]
  expression_node.obj : error LNK2019: unresolved external symbol "private: class boost::basic_regex<int,class boost::icu_regex_traits> & __cdecl boost::basic_regex<int,class boost::icu_regex_traits>::do_assign(int const *,int const *,unsigned int)" (?do_assign@?$basic_regex@HVicu_regex_traits@boost@@@boost@@AEAAAEAV12@PEBH0I@Z) referenced in function "class boost::basic_regex<int,class boost::icu_regex_traits> __cdecl boost::re_detail_106000::do_make_u32regex<wchar_t const *>(wchar_t const *,wchar_t const *,unsigned int,struct boost::mpl::int_<2> const *)" (??$do_make_u32regex@PEB_W@re_detail_106000@boost@@YA?AV?$basic_regex@HVicu_regex_traits@boost@@@1@PEB_W0IPEBU?$int_@$01@mpl@1@@Z) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]
  lib\mapnik.dll : fatal error LNK1120: 3 unresolved externals [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]

@artemp
Copy link
Contributor

artemp commented May 13, 2016

@BergWerkGIS - this above looks familiar, was boost-regex built with correct ICU etc ?

@wilhelmberg
Copy link
Contributor Author

I think I found the problem, seems something has changed with boost build.
References cannot be found because they are not exported properly.
BOOST_REGEX_DECL should be set to BOOST_SYMBOL_EXPORT (__declspec (dllexport)) but it is not, thus icu_regex_traits not being available.

Investigating ...

@wilhelmberg
Copy link
Contributor Author

ha, found the real reason: utility has_icu.exe fails to build, thus ICU cannot be detected 😏

@wilhelmberg
Copy link
Contributor Author

Got a successful mapnikbuild going:

  • started boost build
  • canceled boost build after config stage
  • manually changed bin.v2\project-cache.jam and set has_icu builds to true
  • started a second boost/mapnik build -> went through

Still trying to figure out why has_icu.exe doesn't build.
Tried with [email protected] and [email protected].
Completely removed all files between tries, including %TEMP%\b2*.cmd.


Probably a typo in one of the scripts or jam files.

rsp/manifest files:


Interesting that has_icu.exe seems to get built in Debug when doing a Release build.
We've run into build problems before when boostrelease builds failed because they were looking for ICU debug builds.

image

@wilhelmberg
Copy link
Contributor Author

Couldn't find any error messages of failed has_icu.exe build with the default settings.


After un-commenting #define BOOST_HAS_ICU in boost\regex\user.hpp I get this in bin.v2\config.log (using [email protected] and [email protected]):

file bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_test.obj.rsp
"libs\regex\build\has_icu_test.cpp" -Fo"bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_test.obj"    -TP /Z7 /Od /Ob0 /W4 /GR /MDd /Zc:forScope /Zc:wchar_t /favor:blend /wd4675 /EHs -c 
-DBOOST_ALL_NO_LIB=1 
-DBOOST_HAS_ICU=1 
"-I." 
"-Ic:\mb\windows-builds-64\packages\icu\include"
compile-c-c++ bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_test.obj

    call "C:\Users\ADMINI~1\AppData\Local\Temp\2\b2_msvc_14.0_vcvarsall_amd64.cmd" >nul
cl /Zm800 -nologo @"bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_test.obj.rsp" 

has_icu_test.cpp

file bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_exe.exe.rsp

"bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_test.obj"    
msvc.link bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_exe.exe

        call "C:\Users\ADMINI~1\AppData\Local\Temp\2\b2_msvc_14.0_vcvarsall_amd64.cmd" >nul
link /NOLOGO /INCREMENTAL:NO /DEBUG /MACHINE:X64 /MANIFEST /subsystem:console /out:"bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_exe.exe"  c:\mb\windows-builds-64\packages\icu\lib64\icuuc.lib @"bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_exe.exe.rsp"
        if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

has_icu_test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class icu_56::Collator * __cdecl icu_56::Collator::createInstance(class icu_56::Locale const &,enum UErrorCode &)" (__imp_?createInstance@Collator@icu_56@@SAPEAV12@AEBVLocale@2@AEAW4UErrorCode@@@Z) referenced in function main
bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_exe.exe : fatal error LNK1120: 1 unresolved externals
...failed msvc.link bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_exe.exe bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_exe.pdb...
...removing bin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi\has_icu_exe.pdb
...skipped <pbin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi>has_icu.output for lack of <pbin.v2\libs\regex\build\msvc-14.0\debug\address-model-64\threading-multi>has_icu_exe.exe...
...failed updating 2 targets...
...skipped 1 target...
...updated 8 targets...
...found 1 target...
...updating 1 target...

@wilhelmberg
Copy link
Contributor Author

Alright, I'm down to the root cause: ICU detection on Windows seems to be flawed in [email protected]/1.61 and the library references (icu*.lib) not set correctly, despite passing ICU_PATH and ICU_LINK to b2.


I created a new VS2015 solution based on regex/build/[email protected].
After setting include and linker properties correctly it builds just fine.

Running it I get U_FILE_ACCESS_ERROR despite having set ICU_DATA before:

image

@wilhelmberg
Copy link
Contributor Author

Before I pointed ICU_DATA to the icudt56l.dat (~7MB) we distribute with mapnik, which seems to be a stripped down version => U_FILE_ACCESS_ERROR.

Pointing ICU_DATA to icu\source\data\in\icudt56l.dat (~24MB) makes U_FILE_ACCESS_ERROR go away.

Next, looking into making boost find icu again.

@wilhelmberg
Copy link
Contributor Author

wilhelmberg commented May 17, 2016

Finally 🎉 works again with [email protected] 🎉 and [email protected] 🎉.


[email protected] shows 2 errors (/cc @artemp ):

"c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj" (ClCompile target) (1) ->
(ClCompile target) -> 
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/spirit/home/support/attributes.hpp(1036): error C2672: 'swap': no matching overloaded function found (compiling source file ..\..\src\image_filter_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]
  c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\mapnik-sdk\include\boost/spirit/home/support/attributes.hpp(1036): error C2784: 'void boost::spirit::swap(boost::spirit::multi_pass<T,Policies> &,boost::spirit::multi_pass<T,Policies> &)': could not deduce template argument for 'boost::spirit::multi_pass<T,Policies> &' from 'mapnik::color' (compiling source file ..\..\src\image_filter_grammar.cpp) [c:\mb\windows-builds-64\packages\mapnik-master\mapnik-gyp\build\mapnik.vcxproj]

Takeaways

/cc @springmeyer wrt https://github.com/mapnik/mapnik-packaging/blob/master/osx/patches/boost_icu_check.diff

  • Folder containing the ICU DLLs has to be added to the %PATH%
  • ICU_DATA has to be set to icu\source\data\in\ where the bigger icudt56l.dat resides and not the trimmed down one we ship with mapnik
  • %INCLUDE% env var needs to also point to icu\include
  • ICU_LINK has changed (or we've been doing it wrong and it was just luck that it worked with [email protected]). It has to look like this:
SET ICU_LINK="/LIBPATH:%PKGDIR%\icu\lib64 icuuc.lib icuin.lib icudt.lib"

Commit f85b64e

@springmeyer
Copy link

Thank you thank you thank you @BergWerkGIS

@wilhelmberg
Copy link
Contributor Author

boost quest to be continued for 1.61 #90

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

No branches or pull requests

4 participants