Project

General

Profile

Is PROJ v6 supported?

Added by Thiago dos Santos almost 5 years ago

Dear all,

I have replaced PROJ 4 with the newer PROJ 6 (https://proj.org/news.html#id28) on my Ubuntu system.

Now I am trying to recompile CDO to benefit from the newer PROJ. I am using the "--with-proj=" configure argument, but CDO doesn't seem to find proj's header file:

checking proj_api.h usability... no
checking proj_api.h presence... no
checking for proj_api.h... no
checking for library containing pj_init... -lproj

However, the files are there:

ls /opt/software/lib/libproj.*
rwxr-xr-x 1 root root 48M May 25 02:57 /opt/software/lib/libproj.so.15.1.0
lrwxrwxrwx 1 root root 17 May 25 02:57 /opt/software/lib/libproj.so.15 > libproj.so.15.1.0
lrwxrwxrwx 1 root root 17 May 25 02:57 /opt/software/lib/libproj.so -> libproj.so.15.1.0
rwxr-xr-x 1 root root 973 May 25 02:57 /opt/software/lib/libproj.la
rw-r--r-
1 root root 127M May 25 02:57 /opt/software/lib/libproj.a

ls /opt/software/include/proj*
rw-r--r-- 1 root root 20K May 25 02:57 /opt/software/include/proj_symbol_rename.h
rw-r--r-- 1 root root 42K May 25 02:57 /opt/software/include/proj.h
rw-r--r-- 1 root root 34K May 25 02:57 /opt/software/include/proj_experimental.h
rw-r--r-- 1 root root 23K May 25 02:57 /opt/software/include/proj_constants.h
rw-r--r-- 1 root root 8.2K May 25 02:57 /opt/software/include/proj_api.h

I am also receiving some errors during the compilation (which halts at some point):

In file included from grid.cc:29:
/opt/software/include/proj_api.h:37:2: error: #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
#error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
^~~

mv -f .deps/libcdo_la-field2.Tpo .deps/libcdo_la-field2.Plo
/bin/bash ../libtool --tag=CXX --mode=compile g++-8 -DHAVE_CONFIG_H -I. -I../libcdi/src -I/usr/include -I/opt/software/include -I/opt/software/include -I/usr/include/libxml2 -I/usr/include -I/opt/software/lib/include -I/usr/include -I/opt/software/include -I/opt/software/include -I/opt/software/include -DgFortran -I/usr/include -I/usr/include/udunits2 -march=native -g -O2 -fopenmp -MT libcdo_la-grid_proj.lo -MD -MP -MF .deps/libcdo_la-grid_proj.Tpo -c -o libcdo_la-grid_proj.lo `test -f 'grid_proj.cc' || echo './'`grid_proj.cc
libtool: compile: g++-8 -DHAVE_CONFIG_H -I. -I../libcdi/src -I/usr/include -I/opt/software/include -I/opt/software/include -I/usr/include/libxml2 -I/usr/include -I/opt/software/lib/include -I/usr/include -I/opt/software/include -I/opt/software/include -I/opt/software/include -DgFortran -I/usr/include -I/usr/include/udunits2 -march=native -g -O2 -fopenmp -MT libcdo_la-grid_proj.lo -MD -MP -MF .deps/libcdo_la-grid_proj.Tpo -c grid_proj.cc -fPIC -DPIC -o .libs/libcdo_la-grid_proj.o
In file included from grid_proj.cc:22:
/opt/software/include/proj_api.h:37:2: error: #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
#error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
^~~

Makefile:1818: recipe for target 'libcdo_la-grid.lo' failed
make[2]: * [libcdo_la-grid.lo] Error 1
make[2]:
Waiting for unfinished jobs....
mv -f .deps/libcdo_la-cdo_features.Tpo .deps/libcdo_la-cdo_features.Plo
libtool: compile: g++-8 -DHAVE_CONFIG_H -I. -I../libcdi/src -I/usr/include -I/opt/software/include -I/opt/software/include -I/usr/include/libxml2 -I/usr/include -I/opt/software/lib/include -I/usr/include -I/opt/software/include -I/opt/software/include -I/opt/software/include -DgFortran -I/usr/include -I/usr/include/udunits2 -march=native -g -O2 -fopenmp -MT libcdo_la-fieldmer.lo -MD -MP -MF .deps/libcdo_la-fieldmer.Tpo -c fieldmer.cc -o libcdo_la-fieldmer.o >/dev/null 2>&1
Makefile:1825: recipe for target 'libcdo_la-grid_proj.lo' failed
make[2]:
[libcdo_la-grid_proj.lo] Error 1
libtool: compile: g++-8 -DHAVE_CONFIG_H -I. -I../libcdi/src -I/usr/include -I/opt/software/include -I/opt/software/include -I/usr/include/libxml2 -I/usr/include -I/opt/software/lib/include -I/usr/include -I/opt/software/include -I/opt/software/include -I/opt/software/include -DgFortran -I/usr/include -I/usr/include/udunits2 -march=native -g -O2 -fopenmp -MT libcdo_la-fieldzon.lo -MD -MP -MF .deps/libcdo_la-fieldzon.Tpo -c fieldzon.cc -o libcdo_la-fieldzon.o >/dev/null 2>&1
libtool: compile: g++-8 -DHAVE_CONFIG_H -I. -I../libcdi/src -I/usr/include -I/opt/software/include -I/opt/software/include -I/usr/include/libxml2 -I/usr/include -I/opt/software/lib/include -I/usr/include -I/opt/software/include -I/opt/software/include -I/opt/software/include -DgFortran -I/usr/include -I/usr/include/udunits2 -march=native -g -O2 -fopenmp -MT libcdo_la-gradsdeslib.lo -MD -MP -MF .deps/libcdo_la-gradsdeslib.Tpo -c gradsdeslib.cc -o libcdo_la-gradsdeslib.o >/dev/null 2>&1
mv -f .deps/libcdo_la-fieldmem.Tpo .deps/libcdo_la-fieldmem.Plo
mv -f .deps/libcdo_la-fieldmer.Tpo .deps/libcdo_la-fieldmer.Plo
mv -f .deps/libcdo_la-gradsdeslib.Tpo .deps/libcdo_la-gradsdeslib.Plo
mv -f .deps/libcdo_la-fieldzon.Tpo .deps/libcdo_la-fieldzon.Plo
cdo.cc: In function ‘void __static_initialization_and_destruction_0(int, int)’:
cdo.cc:1930:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
}
^
mv -f .deps/cdo-cdo.Tpo .deps/cdo-cdo.Po
make[2]: Leaving directory '/home/thiago/Downloads/cdo-1.9.6/src'
Makefile:939: recipe for target 'all' failed
make[1]:
[all] Error 2
make[1]: Leaving directory '/home/thiago/Downloads/cdo-1.9.6/src'
Makefile:486: recipe for target 'all-recursive' failed
make: *
* [all-recursive] Error 1

Now, I know there have been some changes in proj_api.h (https://github.com/OSGeo/proj.4/issues/836), but I am not sure if they are the culprit for the error I am receiving above.

Am I missing something? Or is PROJ 6 not yet supported by CDO?

Cheers,
Thiago.


Replies (2)

RE: Is PROJ v6 supported? - Added by Oliver Heidmann almost 5 years ago

Hello Thiago,

we currently do not support v6. We only support the usage of v6 with the use of ACCEPT_USE_OF_DEPRECATED_PROJ_API_H which uses the old api.
We will have to adapt cdo to the interface changes in v6/v7. We are planning to do this a few months before v7 releases.
For now you can configure cdo with CFLAGS="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" is available in v6 and will be removed in v7 together with the old api.

Cheers,
Oliver.

RE: Is PROJ v6 supported? - Added by Thiago dos Santos almost 5 years ago

Hi Oliver,

Thanks for the hint. CDO now builds fine with PROJ 6.0.0 - all I had to do was to add the "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" argument to both CFLAGS and CXXFLAGS.

Thanks for keeping CDO on a par with all the up-to-date software out there.

Cheers,
Thiago

    (1-2/2)