[GRASS-dev] libgrass_gmath.so: cannot restore segment+Permission denied

Glynn Clements glynn at gclements.plus.com
Wed Oct 18 13:08:44 EDT 2006

madhu wrote:

> i have installed grass-6.2 after sucessful compilation on my fedora-4 sysytem
> i have somemap sets with me which r doenloaded from sites
> but once i clicked
> file->import->Rastermap->multiple formats using GDAL
> its giving the problem like this
>                   r.in.gdal: error while loading shared libraries: 
> /usr/local/grass-6.2.0RC2/lib/libgrass_gmath.so: cannot restore segment 
> prot after reloc: Permission denied
> but in /usr/local/grass-6.2.0RC2/lib i have     libgrass_gmath.so     file
> and i linked to /usr/lib also
> can anybody help me to solve this problem

I believe that this is an SELinux issue.

Two possible solutions:

1. Don't use --with-blas or --with-lapack when compiling GRASS; they
aren't used at present.

If you didn't use those options, the problem is with a different
static library. FFTW is the next most likely candidate. While you can
disable FFTW with --without-fftw, a few modules need it. It isn't
particularly important, but it isn't completely useless either.

2. Use chcon to change the security settings for libgrass_gmath.so
(this issue doesn't normally affect other GRASS libraries). Look up
the error message:

	"cannot restore segment prot after reloc"

(including the quotes) using Google to find some clues.

BTW, to anyone building GRASS for distribution: don't use --with-blas
and/or --with-lapack. Doing so causes problems for no real gain. GRASS
itself doesn't use the functions which require BLAS/LAPACK, and anyone
writing code which does use those functions can build GRASS from

The problems aren't limited to the fact that BLAS/LAPACK cause
relocations (DT_TEXTREL) in libgrass_gmath, but they also add a
dependency on libg2c, which isn't included with newer versions of gcc.

Also, unless --without-fftw is used, FFTW should be a shared library
(or at least compiled with -fPIC), otherwise that will cause

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list