[Proj] Failing to correctly configure, compile and run Proj locally

Dr Rainer Woitok rainer.woitok at gmail.com
Tue Aug 9 07:04:05 EST 2016


having recently cloned Proj from the Git repository at


I want to configure, compile, and use it only locally in my home direct-
ory.  For that I run the commands:

   $ export PREFIX=$HOME PROD=proj
   $ cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo  \
           -D CMAKE_COLOR_MAKEFILE=OFF         \
           -D CMAKE_LEGACY_CYGWIN_WIN32=0      \
           -D CONVERT_DATA=ON                  \
           -D DATADIR="$PREFIX/share/$PROD"    \
           -D DOCDIR="$PREFIX/doc/$PROD"       \
           -D INCLUDEDIR="$PREFIX/include"     \
           -D LIBDIR="$PREFIX/lib"             \
           -D MANDIR="$PREFIX/man"             \
           -D PROJ_BIN_SUBDIR=bin              \
           -D PROJ_DATA_SUBDIR="share/$PROD"   \
           -D PROJ_DOC_SUBDIR="doc/$PROD"      \
           -D PROJ_INCLUDE_SUBDIR=include      \
           -D PROJ_LIB_SUBDIR=lib              \
           -LAH ..
   $ cmake --build . --target all --target install

Apart from plenty of warnings regarding the redefinition of the constant
"M_TWOPI", the compilation succeeds.  However, the resulting "proj" bin-
ary refuses to run  as long as  environment variable "PROJ_LIB" does not
explicitly hold the path to "share/proj/":

$ env|grep PROJ
$ proj +init=epsg:32661
Rel. 4.9.3, dd Month yyyy
projection initialization failure
cause: no system list, errno: 2

program abnormally terminated
$ export PROJ_LIB=$HOME/share/proj
$ proj +init=epsg:32661

Is there a way to  configure Proj in such a way  that it's not necessary
to correctly set environment variable "PROJ_LIB" at runtime?

Any pointers welcome :-)


More information about the Proj mailing list