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

Add latest postgis version #685

Merged
merged 12 commits into from Apr 30, 2019
Merged

Add latest postgis version #685

merged 12 commits into from Apr 30, 2019

Conversation

ingalls
Copy link
Contributor

@ingalls ingalls commented Apr 18, 2019

Followup to #678 which updates to build the latest version of postgis (2.5.2) using the latest mason supported version of postgres (10.3). Also adds support for the corresponding version of libpq.

cc/ @springmeyer

@ingalls ingalls self-assigned this Apr 18, 2019
@springmeyer
Copy link
Contributor

@ingalls this looks good, but I noticed a few issues. One is unrelated to this PR and I've already fixed (the syntax of the protobuf 3.4.1 script was not valid bash and the binary was missing). The other thing I've noticed is that, when attempting a triggered build, the postgis configure fails to find GDAL on linux:

checking for library containing GDALAllRegister... no
configure: error: could not find GDAL

https://travis-ci.org/mapbox/mason/jobs/521853307. Not sure what is up. Are you seeing that locally on linux if you do ./mason build postgis 2.5.2

@ingalls
Copy link
Contributor Author

ingalls commented Apr 19, 2019

@springmeyer hmm not seeing the GDAL error you are seeing

checking for pcre.h... yes
TOPOLOGY: Topology support requested
RASTER: Raster support requested
checking GDAL version... 2.2.2
checking for OGR enabled... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking ogr_api.h usability... yes
checking ogr_api.h presence... yes
checking for ogr_api.h... yes
checking cpl_conv.h usability... yes
checking cpl_conv.h presence... yes
checking for cpl_conv.h... yes
checking for library containing GDALAllRegister... none required
checking for library containing OGRRegisterAll... none required
enabling PostgreSQL extension support...
configure: creating ./config.status

@springmeyer
Copy link
Contributor

Replicated locally. From config.log I see this:

configure:17620: checking for library containing GDALAllRegister
configure:17651: /usr/bin/clang -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -I/Users/travis/build/mapbox/mason/mason_packages/osx-x86_64/libedit/3.1/include -I/Users/travis/build/mapbox/mason/mason_packages/osx-x86_64/ncurses/6.1/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -arch x86_64 -mmacosx-version-min=10.8  -O3 -DNDEBUG -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -I/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/gdal/2.2.3/include -Wl,-search_paths_first -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -arch x86_64 -mmacosx-version-min=10.8       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/gdal/2.2.3/lib -lgdal       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/geos/3.6.2/lib -lgeos_c -lgeos      -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/zlib/system/lib -lz       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/libtiff/4.0.8/lib -ltiff       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/jpeg_turbo/1.5.2/lib -ljpeg       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/proj/4.9.3/lib -lproj       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/libpng/1.6.32/lib -lpng       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/json-c/0.12.1/lib -ljson-c       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/protobuf_c/1.3.0/lib -lprotobuf-c       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/protobuf/3.4.1/lib -lprotobuf-lite       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/expat/2.2.4/lib -lexpat       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/proj/4.9.3/lib -lproj       -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/libxml2/2.9.3/lib -lxml2 -Wl,-lc++ -Wl,/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/gdal/2.2.3/lib/libgdal.a -Wl,/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/postgres/10.3/lib/libpq.a -liconv conftest.c -L/Users/danespringmeyer/projects/mason/mason_packages/osx-x86_64/gdal/2.2.3/lib -lgdal >&5
conftest.c:53:9: warning: 'NDEBUG' macro redefined [-Wmacro-redefined]
#define NDEBUG 0
        ^
<command line>:1:9: note: previous definition is here
#define NDEBUG 1
        ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "_sqlite3_auto_extension", referenced from:
      OGR2SQLITE_Register() in libgdal.a(ogrsqlitevirtualogr.o)
...

So I think the problem is that the GDAL version pulled in depends on sqlite3 (it may not have before). So, postgis needs to add support for statically linking it during the configure.

@springmeyer
Copy link
Contributor

Travis is still hitting:

configure:17620: checking for library containing GDALAllRegister
configure:17651: clang -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -I/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/libedit/3.1/include -I/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/ncurses/6.1/include -fPIC  -O3 -DNDEBUG -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -I/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/gdal/2.2.3/include        -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/gdal/2.2.3/lib -lgdal       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/geos/3.6.2/lib -lgeos_c -lgeos      -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/zlib/system/lib -lz       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/libtiff/4.0.8/lib -ltiff       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/jpeg_turbo/1.5.2/lib -ljpeg       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/proj/4.9.3/lib -lsqlite3       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/proj/4.9.3/lib -lproj       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/libpng/1.6.32/lib -lpng       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/json-c/0.12.1/lib -ljson-c       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/protobuf_c/1.3.0/lib -lprotobuf-c       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/protobuf/3.4.1/lib -lprotobuf-lite       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/expat/2.2.4/lib -lexpat       -L/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/libxml2/2.9.3/lib -lxml2 /home/travis/build/mapbox/mason/mason_packages/linux-x86_64/gdal/2.2.3/lib/libgdal.a -lgeos_c -lgeos -lxml2 -lproj -lexpat -lpng -ljson-c -lprotobuf-c -lprotobuf-lite -ltiff -ljpeg /home/travis/build/mapbox/mason/mason_packages/linux-x86_64/postgres/10.3/lib/libpq.a -pthread -ldl -lz -lstdc++ -lm conftest.c -lgdal -lgeos_c -lgeos -lxml2 -lproj -lexpat -lpng -ljson-c -lprotobuf-c -lprotobuf-lite -ltiff -ljpeg /home/travis/build/mapbox/mason/mason_packages/linux-x86_64/postgres/10.3/lib/libpq.a -pthread -ldl -lz -lstdc++ -lm >&5
/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/gdal/2.2.3/lib/libgdal.a(cadlayer.o): In function `CADLayer::CADLayer(CADFile*)':
cadlayer.cpp:(.text+0x66): undefined reference to `std::__detail::_Prime_rehash_policy::_M_next_bkt(unsigned long) const'
/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/gdal/2.2.3/lib/libgdal.a(cadlayer.o): In function `std::_Hashtable<std::string, std::string, std::allocator<std::string>, std::__detail::_Identity, std::equal_to<std::string>, std::hash<std::string>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, true, true> >::_M_insert_unique_node(unsigned long, unsigned long, std::__detail::_Hash_node<std::string, true>*)':
cadlayer.cpp:(.text._ZNSt10_HashtableISsSsSaISsENSt8__detail9_IdentityESt8equal_toISsESt4hashISsENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb1ELb1ELb1EEEE21_M_insert_unique_nodeEmmPNS1_10_Hash_nodeISsLb1EEE[_ZNSt10_HashtableISsSsSaISsENSt8__detail9_IdentityESt8equal_toISsESt4hashISsENS1_18_Mod_range_hashingENS1_20_Default_ranged_hashENS1_20_Prime_rehash_policyENS1_17_Hashtable_traitsILb1ELb1ELb1EEEE21_M_insert_unique_nodeEmmPNS1_10_Hash_nodeISsLb1EEE]+0x34): undefined reference to `std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const'
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)

@springmeyer
Copy link
Contributor

rust-lang/rust#14404 seems to indicate that undefined reference to std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const'` indicates a compiler mismatch: so the gdal version was compiled with a compiler too old to work with the latest compiler mason is using (clang 5 after d989d50). So, I'm going to try pushing a new GDAL version and binary and see if we can configure against that.

@springmeyer
Copy link
Contributor

@ingalls okay, this should be working now: https://travis-ci.org/mapbox/mason/builds/524647990. Can you try installing the binaries and see if they do what you need/expect? Also @boblannon there are gdal 2.4.1 binaries now available too, via this branch.

@ingalls
Copy link
Contributor Author

ingalls commented Apr 30, 2019

@springmeyer just tested in mapbox-places-address, everything seems to be working perfectly!

@springmeyer
Copy link
Contributor

Great, @ingalls, then this is ready to merge.

@springmeyer springmeyer merged commit e90a36b into master Apr 30, 2019
@springmeyer springmeyer deleted the postgis branch April 30, 2019 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants