[GRASS-user] Failure to compile GRASS GIS 7.8 with Proj 6 and GDAL 3

Dears,

I cannot get GRASS GIS 7.8 to compile with

eselect gcc show
x86_64-pc-linux-gnu-9.2.0

+

make --version
GNU Make 4.2.1

+
zlib version 1.2.11-r3
+

eselect python show
python3.7

+

flex --version
flex 2.6.4

+

proj
Rel. 6.0.0, March 1st, 2019

+

geos-config --version
3.7.0

+

gdal-config --version
3.0.4

+

make distclean
./configure --with-freetype=yes --with-freetype-includes="/usr/include/freetype2/" --with-readline --with-geos
make

The `error.log` here: https://pastebin.com/rEgMmcPT
Running make from inside few directories with error(s): https://pastebin.com/PisKVBHP

Hi Nikos,

PROJ is moving fast, please use the latest PROJ 6 release 6.3.0

On Sat, Feb 1, 2020 at 8:36 PM Nikos Alexandris <nik@nikosalexandris.net> wrote:

Dears,

I cannot get GRASS GIS 7.8 to compile with
proj
Rel. 6.0.0, March 1st, 2019

if possible, never use a x.0.0 release of any software, these new major releases are usually full of bugs.

Markus M

+

geos-config --version
3.7.0

+

gdal-config --version
3.0.4

+

make distclean
./configure --with-freetype=yes --with-freetype-includes=“/usr/include/freetype2/” --with-readline --with-geos
make


The `error.log` here: [https://pastebin.com/rEgMmcPT](https://pastebin.com/rEgMmcPT)
Running make from inside few directories with error(s): [https://pastebin.com/PisKVBHP](https://pastebin.com/PisKVBHP)
_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[https://lists.osgeo.org/mailman/listinfo/grass-user](https://lists.osgeo.org/mailman/listinfo/grass-user)

Markus Metz:

Hi Nikos,

PROJ is moving fast, please use the latest PROJ 6 release 6.3.0

On Sat, Feb 1, 2020 at 8:36 PM Nikos Alexandris <nik@nikosalexandris.net>
wrote:

Dears,

I cannot get GRASS GIS 7.8 to compile with
proj
Rel. 6.0.0, March 1st, 2019

if possible, never use a x.0.0 release of any software, these new major
releases are usually full of bugs.

Markus M

Thank you Markus!
I got it working, more or less. Recompiling only PROJ did away most of
the errors but a few. I guess I need to recompile PROJ (+GEOS), then
GDAL, then the rest.

Cheers, Nikos

Hi Nikos,

On Sun, Feb 2, 2020 at 10:40 AM Nikos Alexandris
<nik@nikosalexandris.net> wrote:
...

I got it working, more or less. Recompiling only PROJ did away most of
the errors but a few. I guess I need to recompile PROJ (+GEOS), then
GDAL, then the rest.

Would you mind to then add/update the relevant section in

https://grasswiki.osgeo.org/wiki/Compile_and_Install
?

thanks
Markus

On 2020-02-02 10:40, Nikos Alexandris wrote:

Markus Metz:

Hi Nikos,

PROJ is moving fast, please use the latest PROJ 6 release 6.3.0

On Sat, Feb 1, 2020 at 8:36 PM Nikos Alexandris <nik@nikosalexandris.net>
wrote:

Dears,

I cannot get GRASS GIS 7.8 to compile with
proj
Rel. 6.0.0, March 1st, 2019

if possible, never use a x.0.0 release of any software, these new major
releases are usually full of bugs.

Markus M

Thank you Markus!
I got it working, more or less. Recompiling only PROJ did away most of
the errors but a few. I guess I need to recompile PROJ (+GEOS), then
GDAL, then the rest.

Yes, IME the compile sequence to satisfy dependencies is (with optional in parentheses):

geos, proj, (netcdf), libgeotiff, (spatialite), GDAL, GRASS

* Nikos Alexandris <nik@nikosalexandris.net> [2020-02-02 10:40:11 +0100]:

Markus Metz:

Hi Nikos,

PROJ is moving fast, please use the latest PROJ 6 release 6.3.0

On Sat, Feb 1, 2020 at 8:36 PM Nikos Alexandris <nik@nikosalexandris.net>
wrote:

Dears,

I cannot get GRASS GIS 7.8 to compile with
proj
Rel. 6.0.0, March 1st, 2019

if possible, never use a x.0.0 release of any software, these new major
releases are usually full of bugs.

Markus M

Thank you Markus!
I got it working, more or less. Recompiling only PROJ did away most of
the errors but a few. I guess I need to recompile PROJ (+GEOS), then
GDAL, then the rest.

Still need to fix a few more:

Errors in:
/osgeo/grass/general/g.proj
/osgeo/grass/general/g.region
/osgeo/grass/raster/r.horizon
/osgeo/grass/raster/r.sun
/osgeo/grass/raster3d/r3.out.netcdf

for DIRECTORY in /osgeo/grass/general/g.proj /osgeo/grass/general/g.region /osgeo/grass/raster/r.horizon /osgeo/grass/raster/r.sun /osgeo/grass/raster3d/r3.out.netcdf ;do cd $DIRECTORY && make ;echo ;done

: && gcc -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -Wl,--export-dynamic  -L/usr/lib64/ -Wl,-rpath-link,/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -o /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/g.proj OBJ.x86_64-pc-linux-gnu/create.o OBJ.x86_64-pc-linux-gnu/datumtrans.o OBJ.x86_64-pc-linux-gnu/input.o OBJ.x86_64-pc-linux-gnu/list_codes.o OBJ.x86_64-pc-linux-gnu/main.o OBJ.x86_64-pc-linux-gnu/output.o    -lgrass_gproj.7.8 -lgrass_gis.7.8 -L/usr/local/lib -lgdal -L/usr/lib64/ -lproj    -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_remarks'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_normalize_for_visualization'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_scope'
collect2: error: ld returned 1 exit status
make: *** [../../include/Make/Module.make:18: /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/g.proj] Error 1

: && gcc -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -Wl,--export-dynamic  -L/usr/lib64/ -Wl,-rpath-link,/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -o /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/g.region OBJ.x86_64-pc-linux-gnu/adjust.o OBJ.x86_64-pc-linux-gnu/main.o OBJ.x86_64-pc-linux-gnu/printwindow.o OBJ.x86_64-pc-linux-gnu/zoom.o    -lgrass_gproj.7.8 -lgrass_vector.7.8 -lgrass_dig2.7.8 -lgrass_g3d.7.8 -lgrass_raster.7.8 -lgrass_gis.7.8 -lm  -L/usr/lib64/ -lproj    -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_remarks'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_normalize_for_visualization'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_scope'
collect2: error: ld returned 1 exit status
make: *** [../../include/Make/Module.make:18: /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/g.region] Error 1

: && gcc -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -Wl,--export-dynamic  -L/usr/lib64/ -Wl,-rpath-link,/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -o /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/r.horizon OBJ.x86_64-pc-linux-gnu/main.o    -lgrass_gproj.7.8 -lgrass_raster.7.8 -lgrass_gis.7.8 -lm  -L/usr/lib64/ -lproj    -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_remarks'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_normalize_for_visualization'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_scope'
collect2: error: ld returned 1 exit status
make: *** [../../include/Make/Module.make:18: /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/r.horizon] Error 1

: && gcc -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -Wl,--export-dynamic  -L/usr/lib64/ -Wl,-rpath-link,/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -o /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/r.sun OBJ.x86_64-pc-linux-gnu/main.o OBJ.x86_64-pc-linux-gnu/rsunlib.o    -lgrass_gproj.7.8 -lgrass_raster.7.8 -lgrass_gis.7.8 -lm  -lgrass_gmath.7.8 -L/usr/lib64/ -lproj  -lgomp   -lOpenCL  -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_remarks'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_normalize_for_visualization'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_scope'
collect2: error: ld returned 1 exit status
make: *** [../../include/Make/Module.make:18: /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/r.sun] Error 1

: && gcc -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -L/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -Wl,--export-dynamic  -L/usr/lib64/ -Wl,-rpath-link,/osgeo/grass/dist.x86_64-pc-linux-gnu/lib -o /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/r3.out.netcdf OBJ.x86_64-pc-linux-gnu/main.o    -lgrass_g3d.7.8 -lgrass_gproj.7.8 -lgrass_gis.7.8 -L/usr/local/lib -lgdal -L/usr/lib64 -lnetcdf -L/usr/lib64/ -lproj  -lgrass_datetime.7.8   -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_remarks'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_normalize_for_visualization'
/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /osgeo/grass/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.8.so: undefined reference to `proj_get_scope'
collect2: error: ld returned 1 exit status
make: *** [../../include/Make/Module.make:18: /osgeo/grass/dist.x86_64-pc-linux-gnu/bin/r3.out.netcdf] Error 1

Nikos

* Markus Neteler <neteler@osgeo.org> [2020-02-02 10:43:51 +0100]:

Hi Nikos,

On Sun, Feb 2, 2020 at 10:40 AM Nikos Alexandris
<nik@nikosalexandris.net> wrote:
...

I got it working, more or less. Recompiling only PROJ did away most of
the errors but a few. I guess I need to recompile PROJ (+GEOS), then
GDAL, then the rest.

Would you mind to then add/update the relevant section in

https://grasswiki.osgeo.org/wiki/Compile_and_Install
?

Of course I will, but the https://trac.osgeo.org/grass/wiki/FuntooLinux
wiki page. Not the generic, which I think is still valid.

Nikos

* Nikos Alexandris <nik@nikosalexandris.net> [2020-02-03 18:15:31 +0100]:

* Nikos Alexandris <nik@nikosalexandris.net> [2020-02-02 10:40:11 +0100]:

Markus Metz:

Hi Nikos,

PROJ is moving fast, please use the latest PROJ 6 release 6.3.0

On Sat, Feb 1, 2020 at 8:36 PM Nikos Alexandris <nik@nikosalexandris.net>
wrote:

Dears,

I cannot get GRASS GIS 7.8 to compile with
proj
Rel. 6.0.0, March 1st, 2019

if possible, never use a x.0.0 release of any software, these new major
releases are usually full of bugs.

Markus M

Thank you Markus!
I got it working, more or less. Recompiling only PROJ did away most of
the errors but a few. I guess I need to recompile PROJ (+GEOS), then
GDAL, then the rest.

Still need to fix a few more:

Errors in:
/osgeo/grass/general/g.proj
/osgeo/grass/general/g.region
/osgeo/grass/raster/r.horizon
/osgeo/grass/raster/r.sun
/osgeo/grass/raster3d/r3.out.netcdf

```

Fixed, I had to remove left-over files from previous PROJ
installation(s).

(...why is there no `make uninstall` for PROJ, GEOS, etc.?)

Nikos

Hi Nikos,

On Mon, Feb 3, 2020 at 7:28 PM Nikos Alexandris <nik@nikosalexandris.net> wrote:

I got it working, more or less. Recompiling only PROJ did away most of
the errors but a few. I guess I need to recompile PROJ (+GEOS), then
GDAL, then the rest.

Still need to fix a few more:

Errors in:
/osgeo/grass/general/g.proj
/osgeo/grass/general/g.region
/osgeo/grass/raster/r.horizon
/osgeo/grass/raster/r.sun
/osgeo/grass/raster3d/r3.out.netcdf

Fixed, I had to remove left-over files from previous PROJ
installation(s).

(…why is there no make uninstall for PROJ, GEOS, etc.?)

if you compile from source, it is mostly your responsibility to clean up old installations. Generally, cleaning up should happen in
${prefix}/lib[64]
${prefix}/include
${prefix}/share

regarding PROJ, cleaning up ${prefix}/share with the proj.db and grids is quite important because PROJ is evolving fast and any leftovers from a previous installation might confuse software compiled against PROJ.

Regarding GDAL compilation against PROJ, there was in GDAL 2 the configure option
–with-static-proj4=ARG Compile with PROJ.4 statically (deprecated, use --with-proj instead) (ARG=no or path)
in GDAL 3 there is only
–with-proj=ARG Compile with PROJ.x (ARG=yes or path)

This static proj linking in GDAL does not mean to link against a static PROJ library, but to statically link against a given dynamic PROJ library, i.e. the same PROJ library used at compile time will also be used at run time. This is important to make sure that GDAL is not suddenly picking a different PROJ library at run time when a new PROJ library becomes available.

I ran in all these problems myself when adding support for PROJ 4, 5, and 6 in GRASS.

Markus M

* Markus Metz <markus.metz.giswork@gmail.com> [2020-02-03 22:35:26 +0100]:

Hi Nikos,

On Mon, Feb 3, 2020 at 7:28 PM Nikos Alexandris <nik@nikosalexandris.net>
wrote:

>>I got it working, more or less. Recompiling only PROJ did away most of
>>the errors but a few. I guess I need to recompile PROJ (+GEOS), then
>>GDAL, then the rest.
>
>Still need to fix a few more:
>
>Errors in:
>/osgeo/grass/general/g.proj
>/osgeo/grass/general/g.region
>/osgeo/grass/raster/r.horizon
>/osgeo/grass/raster/r.sun
>/osgeo/grass/raster3d/r3.out.netcdf
>
>```

Fixed, I had to remove left-over files from previous PROJ
installation(s).

(...why is there no `make uninstall` for PROJ, GEOS, etc.?)

if you compile from source, it is mostly your responsibility to clean up
old installations.

(Is there a good reason not to provide for `make uninstall` besides
more workload? --I actually have no idea what it takes to do so!)

Generally, cleaning up should happen in
${prefix}/lib[64]
${prefix}/include
${prefix}/share

Do you create yourself a "hardcoded" list of files you need to remove?
Otherwise, it's a time consuming hunting of files here and there.

regarding PROJ, cleaning up ${prefix}/share with the proj.db and grids is
quite important because PROJ is evolving fast and any leftovers from a
previous installation might confuse software compiled against PROJ.

That I forgot to remove :D.
Won't existing files be overwritten by `make install` as root?

Regarding GDAL compilation against PROJ, there was in GDAL 2 the configure
option
--with-static-proj4=ARG Compile with PROJ.4 statically (deprecated, use
--with-proj instead) (ARG=no or path)
in GDAL 3 there is only
--with-proj=ARG Compile with PROJ.x (ARG=yes or path)

This static proj linking in GDAL does not mean to link against a static
PROJ library, but to statically link against a given dynamic PROJ library,
i.e. the same PROJ library used at compile time will also be used at run
time. This is important to make sure that GDAL is not suddenly picking a
different PROJ library at run time when a new PROJ library becomes
available.

I ran in all these problems myself when adding support for PROJ 4, 5, and 6
in GRASS.

Markus M

Thank you Markus, Nikos

* Nikos Alexandris <nik@nikosalexandris.net> [2020-02-04 16:51:33 +0100]:

regarding PROJ, cleaning up ${prefix}/share with the proj.db and grids is
quite important because PROJ is evolving fast and any leftovers from a
previous installation might confuse software compiled against PROJ.

That I forgot to remove :D.
Won't existing files be overwritten by `make install` as root?

Actually, I did remote the `share/proj` directory too before
re-installing PROJ.

Nikos