Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

osm2pgsql compilation fails on latest revision #4544

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments
Closed

osm2pgsql compilation fails on latest revision #4544

openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments

Comments

@openstreetmap-trac
Copy link

Reporter: chris[at]thinkit.ca
[Submitted to the original trac issue database at 9.20am, Monday, 27th August 2012]

Trying to compile osm2pgsql on OSX 10.7.4. Tried using Homebrew, as while as compiling from source with XCode 4.4.1 and Command Line tools installed and run into the same issues, as homebrew compiles from --HEAD. I've even added the following to middle_pgsql.c which only leads to other issues (see below):

#ifndef  MAP_ANONYMOUS
#ifdef MAP_ANON
#define MAP_ANONYMOUS MAP_ANON
#endif
#endif

Results:

brew install --HEAD osm2pgsql           
==> Checking out http://svn.openstreetmap.org/applications/utils/export/osm2pgsq
==> ./autogen.sh
==> ./configure
==> make
/usr/local/bin/protoc-c --proto_path=protobuf --c_out=. protobuf/fileformat.proto
/usr/local/bin/protoc-c --proto_path=protobuf --c_out=. protobuf/osmformat.proto
make  all-recursive
c++ -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback   -g -O2 -MT build_geometry.o -MD -MP -MF .deps/build_geometry.Tpo -c -o build_geometry.o build_geometry.cpp
cc -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT input.o -MD -MP -MF .deps/input.Tpo -c -o input.o input.c
cc -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT output-pgsql.o -MD -MP -MF .deps/output-pgsql.Tpo -c -o output-pgsql.o output-pgsql.c
cc -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT rb.o -MD -MP -MF .deps/rb.Tpo -c -o rb.o rb.c
cc -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT middle-pgsql.o -MD -MP -MF .deps/middle-pgsql.Tpo -c -o middle-pgsql.o middle-pgsql.c
cc -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT osm2pgsql.o -MD -MP -MF .deps/osm2pgsql.Tpo -c -o osm2pgsql.o osm2pgsql.c
cc -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT sprompt.o -MD -MP -MF .deps/sprompt.Tpo -c -o sprompt.o sprompt.c
cc -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT UTF8sanitizer.o -MD -MP -MF .deps/UTF8sanitizer.Tpo -c -o UTF8sanitizer.o UTF8sanitizer.c
middle-pgsql.c:755:95: error: use of undeclared identifier 'MAP_ANONYMOUS'
        info = mmap(0, sizeof(struct progress_info)*noProcs, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
                                                                                              ^
mv -f .deps/sprompt.Tpo .deps/sprompt.Po
middle-pgsql.c:1076:95: error: use of undeclared identifier 'MAP_ANONYMOUS'
        info = mmap(0, sizeof(struct progress_info)*noProcs, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
                                                                                              ^
cc -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/local/Cellar/postgresql/9.1.4/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT expire-tiles.o -MD -MP -MF .deps/expire-tiles.Tpo -c -o expire-tiles.o expire-tiles.c
2 errors generated.
make[2]: *** [middle-pgsql.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/UTF8sanitizer.Tpo .deps/UTF8sanitizer.Po
mv -f .deps/input.Tpo .deps/input.Po
mv -f .deps/rb.Tpo .deps/rb.Po
mv -f .deps/osm2pgsql.Tpo .deps/osm2pgsql.Po
mv -f .deps/expire-tiles.Tpo .deps/expire-tiles.Po
mv -f .deps/output-pgsql.Tpo .deps/output-pgsql.Po
mv -f .deps/build_geometry.Tpo .deps/build_geometry.Po
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

After adding ifdefs:

make
make  all-recursive
gcc -std=gnu99 -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback  -D_THREAD_SAFE -pthread -I/usr/include -I/usr/include/libxml2 -I/usr/include  -I/usr/local/Cellar/geos/3.3.5/include -I/usr/local/include  -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -DVERSION='"0.80.0"'  -g -O2 -MT node-persistent-cache.o -MD -MP -MF .deps/node-persistent-cache.Tpo -c -o node-persistent-cache.o node-persistent-cache.c
node-persistent-cache.c: In function wait_for_outstanding_io:
node-persistent-cache.c:63: warning: implicit declaration of function aio_error64
node-persistent-cache.c:90: warning: implicit declaration of function aio_suspend64
node-persistent-cache.c: In function writeout_dirty_nodes:
node-persistent-cache.c:113: warning: implicit declaration of function lseek64
node-persistent-cache.c: In function persistent_cache_nodes_prefetch_async:
node-persistent-cache.c:296: error: invalid application of sizeof to incomplete type struct aiocb64 
node-persistent-cache.c:297: error: dereferencing pointer to incomplete type
node-persistent-cache.c:298: error: dereferencing pointer to incomplete type
node-persistent-cache.c:302: error: dereferencing pointer to incomplete type
node-persistent-cache.c:304: error: dereferencing pointer to incomplete type
node-persistent-cache.c:306: error: dereferencing pointer to incomplete type
node-persistent-cache.c:308: warning: implicit declaration of function aio_write64
node-persistent-cache.c:319: error: invalid application of sizeof to incomplete type struct aiocb64 
node-persistent-cache.c:321: error: dereferencing pointer to incomplete type
node-persistent-cache.c:322: error: dereferencing pointer to incomplete type
node-persistent-cache.c:325: error: dereferencing pointer to incomplete type
node-persistent-cache.c:327: error: dereferencing pointer to incomplete type
node-persistent-cache.c:329: error: dereferencing pointer to incomplete type
node-persistent-cache.c:332: warning: implicit declaration of function aio_read64
node-persistent-cache.c: In function init_node_persistent_cache:
node-persistent-cache.c:657: warning: implicit declaration of function posix_fallocate
make[2]: *** [node-persistent-cache.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
@openstreetmap-trac
Copy link
Author

Author: chris[at]thinkit.ca
[Added to the original trac issue at 1.11am, Tuesday, 28th August 2012]

Attached middle-pgsql.c with MAP_ANON mapping.

@openstreetmap-trac
Copy link
Author

Author: amm
[Added to the original trac issue at 3.47am, Tuesday, 28th August 2012]

SVN revision 28646 improved the configure scripts to check for the functions that aren't available on mac osx and either defined the missing function to alternatives or disabled the optional functionality

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

No branches or pull requests

1 participant