Skip to content

libgeos_c not found when in non-standard location #45

@edbennett

Description

@edbennett

When libgeos is installed in a location not in the default system search path (as it is on our HPC system, where it is loaded via a module), the configure script fails to add the correct linker flag to the Makeovers file.

Relevant section of configure output:

checking for geos-config... /apps/libraries/geos/3.7.0/el7/AVX512/intel-2018/bin/geos-config
checking geos-config usability... yes
configure: GEOS: 3.7.0
checking GEOS version >= 3.3.0... yes
checking geos_c.h usability... yes
checking geos_c.h presence... yes
checking for geos_c.h... yes
checking geos: linking with -L/apps/libraries/geos/3.7.0/el7/AVX512/intel-2018/lib -lgeos_c... yes
checking for GEOS_init_r in -lgeos_c... yes
configure: Package CPP flags:  -I/apps/libraries/proj/4.9.3/el7/AVX512/intel-2018/include   -I/apps/libraries/geos/3.7.0/el7/AVX512/intel-2018/include -DPOSTGIS_GEOS_VERSION=35 -I./liblwgeom -DHAVE_LIBGEOM_INTERNAL_H
configure: Package LIBS:  -L/apps/libraries/proj/4.9.3/el7/AVX512/intel-2018/lib -lproj    -lgeos_c

But the final compilation step gives:

ld: cannot find -lgeos_c

Manually editing the second line of src/Makevars to include the -L/apps/libraries/geos/3.7.0/el7/AVX512/intel-2018/lib that configure already detected that it needs allows the library to link and install correctly.

I'm not good at autoconf, so I can't tell whether this is configure using some C++/linker flags that are not then used by R CMD INSTALL, or whether it's a logic bug in configure.ac where a variable is forgotten to be set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions