omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
711 stars 156 forks source link

Compilation ( go install ) unable to locate header file #150

Open handoyog opened 7 years ago

handoyog commented 7 years ago

This installation command : $ go install github.com/omniscale/imposm3/cmd/imposm3

unable to find "geos_c.h"

Context

go install github.com/omniscale/imposm3/cmd/imposm3

Seems unable to find "geos_c.h" as it is shown here :

github.com/omniscale/imposm3/geom/geos

src/github.com/omniscale/imposm3/geom/geos/coords.go:5:20: fatal error: geos_c.h: No such file or directory

include "geos_c.h"

                ^

Compilation Terminated.

It seems ignoring what I put in the LD_LIBRARY_PATH export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/usr/share/lib:/usr/local/lib:/opt/postgres/geos/lib/:

The Installation is on OpenIndiana 201705, an OpenSolaris derived.

How do I get go to find the header in the designated destination ? Using go

Expected Behavior

Actual Behavior

Possible Fix

Steps to Reproduce

  1. go install github.com/omniscale/imposm3/cmd/imposm3

Context

I can't compile

Your Environment

olt commented 7 years ago

I can't really help you with Solaris. However, LD_LIBRARY_PATH is only used at runtime. You can try to set CFLAGS=-I/path/to/geos/include so that it can find the geos_c.h file.

handoyog commented 7 years ago

Hi olt,

It seems "go install" does not pick up environment variable CFLAGS

is there any other clues ? Someone who develops / compile imposm3 should understands what environment variables which "go install" uses to search and use headers

olt commented 7 years ago

Someone who develops / compile imposm3 should understands what environment variables which "go install" uses to search and use headers

I can recommend https://golang.org/cmd/cgo/ for more background information. For go install you actually have to use CGO_CFLAGS.

dragonxtek commented 6 years ago

did you install libgeos-dev?