[gdal-dev] Building GDAL 3.0.0 with Proj 6.0.0

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Building GDAL 3.0.0 with Proj 6.0.0

joshl
Hello,

I'm having trouble getting gdal to build with proj on linux. They are both
brought in as git submodules in a git repo and get built via cmake.

To get proj 6.0.0 to build, I had to add a small modification to its
CMakeLists.txt where it uses both the src and include folders for the
include_directories command (did not have include folder originally):
/include_directories(${PROJ4_SOURCE_DIR}/src ${PROJ4_SOURCE_DIR}/include)/

If I don't do this it will error with the following since proj/common.hpp is
in the include folder:
<proj path>/src/proj_internal.h:61:27: fatal error: proj/common.hpp: No such
file or directory

For gdal, an error occurs during the configure step. If I manually run our
configure command (or a stripped down version just using just  -with-proj)
in the gdal dir, it will fail trying to find symbols for proj:
checking for PROJ >= 6 library... checking for proj_create_from_wkt in
-lproj... no
checking for proj_create_from_wkt in -lproj... no
checking for internal_proj_create_from_wkt in -lproj... no
checking for internal_proj_create_from_wkt in -lproj... no
checking for internal_proj_create_from_wkt in -linternalproj... no
checking for internal_proj_create_from_wkt in -linternalproj... (cached) no
configure: error: PROJ 6 symbols not found

A similar failure is seen on this stack exchange post here:
https://gis.stackexchange.com/questions/317109/build-gdal-with-proj-version-6

The most common solution I found googling around seems to be using
--with-static-proj4 but that is no longer recognized as a configure script
option in gdal 3. I checked out the commit hash for gdal 2.4.1 and tried to
use --with-static-proj4 but I got the same error.

A team member had suggested that maybe proj wasn't built with all the
necessary features for gdal so it can't find those require symbols...

Not sure what the right move is from here so any suggestions are
appreciated.

-Josh



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
Sorry, just saw the other thread regarding this issue. At a glance didn't
seem to have the same build issue as I did but I'll comb through when I have
more time later to see it any of those suggestions moves the needle.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

James Klassen-2
In reply to this post by joshl
Did you set ./configure --with-proj=${INSTALL_DIR}?

Where INSTALL_DIR is the install directory (prefix) of proj/gdal.

I also had to set:

export LDFLAGS="-L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib"

to get gdal to actually link against the new proj (vs the system
installed one).


On 5/15/19 3:27 PM, joshl wrote:

> Hello,
>
> I'm having trouble getting gdal to build with proj on linux. They are both
> brought in as git submodules in a git repo and get built via cmake.
>
> To get proj 6.0.0 to build, I had to add a small modification to its
> CMakeLists.txt where it uses both the src and include folders for the
> include_directories command (did not have include folder originally):
> /include_directories(${PROJ4_SOURCE_DIR}/src ${PROJ4_SOURCE_DIR}/include)/
>
> If I don't do this it will error with the following since proj/common.hpp is
> in the include folder:
> <proj path>/src/proj_internal.h:61:27: fatal error: proj/common.hpp: No such
> file or directory
>
> For gdal, an error occurs during the configure step. If I manually run our
> configure command (or a stripped down version just using just  -with-proj)
> in the gdal dir, it will fail trying to find symbols for proj:
> checking for PROJ >= 6 library... checking for proj_create_from_wkt in
> -lproj... no
> checking for proj_create_from_wkt in -lproj... no
> checking for internal_proj_create_from_wkt in -lproj... no
> checking for internal_proj_create_from_wkt in -lproj... no
> checking for internal_proj_create_from_wkt in -linternalproj... no
> checking for internal_proj_create_from_wkt in -linternalproj... (cached) no
> configure: error: PROJ 6 symbols not found
>
> A similar failure is seen on this stack exchange post here:
> https://gis.stackexchange.com/questions/317109/build-gdal-with-proj-version-6
>
> The most common solution I found googling around seems to be using
> --with-static-proj4 but that is no longer recognized as a configure script
> option in gdal 3. I checked out the commit hash for gdal 2.4.1 and tried to
> use --with-static-proj4 but I got the same error.
>
> A team member had suggested that maybe proj wasn't built with all the
> necessary features for gdal so it can't find those require symbols...
>
> Not sure what the right move is from here so any suggestions are
> appreciated.
>
> -Josh
>
>
>
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
Tried doing the LDFLAGS export but got the same errors. My full manual
./configure command (just running on command line) that I'm testing (to at
least get past this error) in the gdal git submodule dir is here:

*projInstallDir*='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4'
*gdalInstallDir*='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/gdal'
export LDFLAGS="-L$*projInstallDir*/lib -Wl,-rpath,$*projInstallDir*/lib"

./configure \
--with-proj=$*projInstallDir*/lib \
--prefix=$*gdalInstallDir*


James Klassen-2 wrote
> export LDFLAGS="-L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib"





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

Richard Duivenvoorde
On 16/05/2019 16.53, joshl wrote:

> Tried doing the LDFLAGS export but got the same errors. My full manual
> ./configure command (just running on command line) that I'm testing (to at
> least get past this error) in the gdal git submodule dir is here:
>
> *projInstallDir*='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4'
> *gdalInstallDir*='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/gdal'
> export LDFLAGS="-L$*projInstallDir*/lib -Wl,-rpath,$*projInstallDir*/lib"
>
> ./configure \
> --with-proj=$*projInstallDir*/lib \
> --prefix=$*gdalInstallDir*
>
> James Klassen-2 wrote
>> export LDFLAGS="-L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib"

Hi James,

Not sure if it is comparable with your setup, but I was just able to
compile QGIS with GDAL 3.0.0 with Proj 6.0.0 on Debian testing, by doing
this 'renaming' trick:

https://trac.osgeo.org/gdal/wiki/BuildingOnUnixGDAL25dev

checking if libgdal.so was indeed linked to libinternalproj.

and then ( as Even proposed in
https://lists.osgeo.org/pipermail/qgis-developer/2019-May/057309.html )
using -DCMAKE_CXX_FLAGS=-DPROJ_RENAME_SYMBOLS in the ccmake of QGIS

( but as said, maybe your setup is more complex, and I understand just
half what I'm doing :-) )

Regards,

Richard Duivenvoorde
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

Simon Eves
Well, I'm glad it's not just me. I was getting worried there for a while...

On Thu, May 16, 2019 at 8:02 AM Richard Duivenvoorde <[hidden email]> wrote:
On 16/05/2019 16.53, joshl wrote:
> Tried doing the LDFLAGS export but got the same errors. My full manual
> ./configure command (just running on command line) that I'm testing (to at
> least get past this error) in the gdal git submodule dir is here:
>
> *projInstallDir*='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4'
> *gdalInstallDir*='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/gdal'
> export LDFLAGS="-L$*projInstallDir*/lib -Wl,-rpath,$*projInstallDir*/lib"
>
> ./configure \
> --with-proj=$*projInstallDir*/lib \
> --prefix=$*gdalInstallDir*
>
> James Klassen-2 wrote
>> export LDFLAGS="-L${INSTALL_DIR}/lib -Wl,-rpath,${INSTALL_DIR}/lib"

Hi James,

Not sure if it is comparable with your setup, but I was just able to
compile QGIS with GDAL 3.0.0 with Proj 6.0.0 on Debian testing, by doing
this 'renaming' trick:

https://trac.osgeo.org/gdal/wiki/BuildingOnUnixGDAL25dev

checking if libgdal.so was indeed linked to libinternalproj.

and then ( as Even proposed in
https://lists.osgeo.org/pipermail/qgis-developer/2019-May/057309.html )
using -DCMAKE_CXX_FLAGS=-DPROJ_RENAME_SYMBOLS in the ccmake of QGIS

( but as said, maybe your setup is more complex, and I understand just
half what I'm doing :-) )

Regards,

Richard Duivenvoorde
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev


--

Simon Eves
Senior Graphics Engineer, Rendering Group
OmniSci, 1 Front St. #2650, San Francisco, CA 94111, USA


Email: [hidden email] | Cell: 415.902.1996



_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
In reply to this post by Richard Duivenvoorde
Thanks for the info Richard.

Right now I'm having issues running proj's ./configure. We build sqlite3
statically using the sqlite-amalgamation, the version we use is 3.26.0.

Using https://trac.osgeo.org/gdal/wiki/BuildingOnUnixGDAL25dev as a guide,
the configure script is unable to find sqlite3.

The error is:
checking for SQLITE3... configure: error: Package requirements (sqlite3 >=
3.7) were not met:
No package 'sqlite3' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables SQLITE3_CFLAGS
and SQLITE3_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.


The manual test commands I am using:
projSubmoduleDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/ThirdParty/proj.4'
cd $projSubmoduleDir
sqlite3InstallDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build'
ls $sqlite3InstallDir/lib
libsqlite3.a  libz.a

./autogen.sh
projInstallDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4'
CXXFLAGS="-DPROJ_RENAME_SYMBOLS -O2"
CFLAGS=$CXXFLAGS
LDFLAGS="-L$sqlite3InstallDir/lib"
./configure --prefix=$projInstallDir

--disable-static wasn't listed in ./configure -h but I think the same thing
can be had with --enable-static=no. Either way I still get the sqlite3
error.





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

Even Rouault-2
On jeudi 16 mai 2019 10:35:22 CDT joshl wrote:

> Thanks for the info Richard.
>
> Right now I'm having issues running proj's ./configure. We build sqlite3
> statically using the sqlite-amalgamation, the version we use is 3.26.0.
>
> Using https://trac.osgeo.org/gdal/wiki/BuildingOnUnixGDAL25dev as a guide,
> the configure script is unable to find sqlite3.
>
> The error is:
> checking for SQLITE3... configure: error: Package requirements (sqlite3 >=
> 3.7) were not met:
> No package 'sqlite3' found
> Consider adjusting the PKG_CONFIG_PATH environment variable if you
> installed software in a non-standard prefix.
> Alternatively, you may set the environment variables SQLITE3_CFLAGS
> and SQLITE3_LIBS to avoid the need to call pkg-config.
> See the pkg-config man page for more details.
>
>
> The manual test commands I am using:
> projSubmoduleDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/ThirdPart
> y/proj.4' cd $projSubmoduleDir
> sqlite3InstallDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build'
> ls $sqlite3InstallDir/lib
> libsqlite3.a  libz.a
>
> ./autogen.sh
> projInstallDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/Third
> Party/proj.4' CXXFLAGS="-DPROJ_RENAME_SYMBOLS -O2"
> CFLAGS=$CXXFLAGS
> LDFLAGS="-L$sqlite3InstallDir/lib"
> ./configure --prefix=$projInstallDir
>
> --disable-static wasn't listed in ./configure -h but I think the same thing
> can be had with --enable-static=no. Either way I still get the sqlite3
> error.

Did you try the hints given in the error message

That is set

PKG_CONFIG_PATH="$sqlite3InstallDir/lib/pkgconfig"

or

SQLITE3_CFLAGS="-I$sqlite3InstallDir/include"
SQLITE3_LIBS="-L$sqlite3InstallDir/lib -lsqlite3"

Even


--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
Thanks Even, setting up the two SQLITE3 vars seemed to get past one of the
sqlite errors, but now I need to find out where our manually built sqlite3
binary is since its complaining about that now. Though I'm not sure which
flags that info will need to get passed to.

current error output:
checking for SQLITE3... yes
checking for sqlite3... no
configure: error: Please install sqlite3 binary.

current PROJ 6 manual install test commands:
projDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/ThirdParty/proj.4'
projInstallDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4'
sqlite3Dir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/ThirdParty/sqlite-amalgamation'
sqlite3InstallDir='/home/loshjawrence/clonesRedo/agi-asset-pipeline/build'

ls $sqlite3InstallDir/lib
libsqlite3.a  libz.a

ls $sqlite3Dir
CMakeLists.txt  shell.c  sqlite3.c  sqlite3.h  sqlite3ext.h

cd $projDir

./autogen.sh
export CXXFLAGS="-DPROJ_RENAME_SYMBOLS -O2"
export CFLAGS=$CXXFLAGS
export SQLITE3_CFLAGS="-I$sqlite3Dir"
export SQLITE3_LIBS="-L$sqlite3InstallDir/lib -lsqlite3"
./configure --prefix=$projInstallDir




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

Even Rouault-2
On jeudi 16 mai 2019 11:46:53 CDT joshl wrote:
> Thanks Even, setting up the two SQLITE3 vars seemed to get past one of the
> sqlite errors, but now I need to find out where our manually built sqlite3
> binary is since its complaining about that now. Though I'm not sure which
> flags that info will need to get passed to.

Just make sure the PATH contains the directory where the sqlite3 binary is, so
likely

PATH="$sqlite3InstallDir/bin:"$PATH"

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
We have a sqlite3_shell binary that gets built, not sure if this is
interchangeable / same thing as the sqlite3 binary that it wants.

ls $sqlite3InstallDir/bin
sqlite3_shell




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
For the error:
checking for SQLITE3... yes
checking for sqlite3... no
configure: error: Please install sqlite3 binary.

I first tried adding the install dir of our sqlite3 shell executable to the
$PATH var:
> ls $sqlite3InstallDir/bin
sqlite3_shell
> PATH="$sqlite3InstallDir/bin:$PATH"
> echo $PATH | sed 's#\:#\n#g' | grep build/bin
/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/bin

Still got the error, so I tried actually installing sqlite3 to see what the
name of the official executable was:
>sudo apt-get update
>sudo apt-get install sqlite3
>ls -la /usr/bin | grep sqlite3
sqlite3

With the real one installed I tried running again just to see if it could
find it but still got the error (verified $PATH included /usr/bin). I also
tried renaming our cmake generated SQLITE3_EXE named sqlite3_shell to
sqlite3 to see if it could find it, but it did not.

So at the moment I am unsure how to get the configure script to discover an
executable named sqlite3...






--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
Ok, was able to get the proj configure script to go all the way through with
the official sqlite3 binary installed via apt-get and using our generated
libsqlite3.a and the amalgamation files for the include files

Now I just need to figure out how to get the proj configure script to use a
user generated sqlite3 binary.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
I removed the official sqlite3 binary. Then I renamed our sqlite3_shell
(binary we generate but for some reason has a _shell appended)but like
before, configure couldn't discover it.

I did a
sudo mv $sqlite3InstallDir/bin/sqlite3 /usr/bin
and it was able to find it. I tried other directories listed for echo $PATH
and it was able to find it. Even though the full path of
$sqlite3InstallDir/bin was listed in echo $PATH, configure couldn't discover
it.

I guessed this meant what I saw for $PATH from the command line was
different than what configure saw for $PATH, so I stuck an export in front
of PATH="$sqlite3InstallDir/bin":$PATH and then it was able to find it.
Hopefully not many more issues ahead of me...





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
Looking at the solution on
https://trac.osgeo.org/gdal/wiki/BuildingOnUnixGDAL25dev

I was only able to build proj 6 as a static library. There was an error when
I tried to use --enable-shared=yes:
 -Wl,libproj.so.15 -o .libs/libproj.so.15.1.0
/usr/bin/x86_64-linux-gnu-ld:
/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/lib/libsqlite3.a(sqlite3.c.o):
relocation R_X86_64_PC32 against symbol `sqlite3_free' can not be used when
making a shared object; recompile with -fPIC

I tried adding -fPIC to the export CXXFLAGS= command before running the proj
configure script but that didn't resolve the error generated during make -j4

I also tried continuing on with the static prog library (without doing those
other renaming and patchelf commands) but kept getting the same errors about
gdal's configure script not being able to find proj.

Is a shared proj libarary required for this to work?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
Trying to go through the instructions as-is (apt-get install sqlite3 bin and
lib, rename proj's .so libs, run patchelf, etc.) from
https://trac.osgeo.org/gdal/wiki/BuildingOnUnixGDAL25dev

The gdal configure script is still unable to find proj. Looking through the
config.log, I see there are two -lproj flags in some gcc command involved
with test compile with a proj function, wonder if that's causing issues.
Also it thinks it should link statically so I guess it's not detecting the
shared lib from any provided path?

Part of config.log where it starts to do the test compiles:
configure:34790: checking how to link PROJ library
configure:34831: result: link statically.
configure:34954: checking for proj_create in -lproj
configure:34979: gcc -o conftest -DHAVE_AVX_AT_COMPILE_TIME
-DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2 -fPIC  
conftest.c -lproj
-L/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4/lib
-lproj  -lsqlite3 -lexpat -ljpeg -lpng -lz -lpthread -lm -lrt -ldl  -lpcre
>&5
/usr/bin/x86_64-linux-gnu-ld: cannot find -lproj
/usr/bin/x86_64-linux-gnu-ld: cannot find -lproj
collect2: error: ld returned 1 exit status
configure:34979: $? = 1



> ls
> /home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4/lib
libinternalproj.so  libinternalproj.so.15  libinternalproj.so.15.1.0
pkgconfig



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
I tried copying the body the test program that the configure script uses to
see if the specified proj is usable. Running the gcc command manually:
gcc testprogram.c -o testprogram -L$projInstallDir/lib
-Wl,-rpath,$projInstallDir/lib -I$projDir/include -I$projDir/src

Using -L -Wl -rpath to specify the proj library got passed the "cannot find
-lproj error" but now it can't find the reference for proj_create function
(which is in $projDir/src/proj.h):

/tmp/cc4Ky0RR.o: In function `main':
testprogram.c:(.text+0xa): undefined reference to `proj_create'
collect2: error: ld returned 1 exit status



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
Nevermind, got it to run with minimal flags.
> gcc testprogram.c -o testprogram -L$projInstallDir/lib -lproj
> ldd testprogram
        linux-vdso.so.1 (0x00007fffcb57f000)
        libproj.so.15 =>
/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4/lib/libproj.so.15
(0x00007f3f9db1b000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3f9d720000)
        libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
(0x00007f3f9d410000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f3f9d1f0000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f3f9ce60000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3f9cac0000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f3f9c890000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3f9e400000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3f9c680000)



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
If I try to run the gdal configure script with a --with-proj targeting a
static proj 6 lib I get complaints about not being able to find proj 6
symbols named internal_proj* when the configure script does various test
compiles for proj. These functions don't seem to exist in src and include
directories. Is this what the CXXFLAGS="-DPROJ_RENAME_SYMBOLS -O2" is for?




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building GDAL 3.0.0 with Proj 6.0.0

joshl
When the configure script checks for the proj library it fails because it
can't find the "proj.h" file,even though the proj.h files directory was
specifically included in the cxxflags.

checking for PROJ >= 6 library... checking for proj_create_from_wkt in
-lproj... no
...
checking for internal_proj_create_from_wkt in -lproj... yes
configure: error: proj.h not found

The spot in the config.log for this error is pasted below. The g++ command
has the correct -I arg as the proj.h file is in that directory so I don't
know why it can't see it? Is there an obvious reason why it wouldn't be able
to find it? I would do a manual test of the g++ command but the body of the
test program it fails on is not printed in this case (like it usually is).

configure:24274: checking for internal_proj_create_from_wkt in -lproj
configure:24299: g++ -o conftest -DHAVE_AVX_AT_COMPILE_TIME
-DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME
-I/home/loshjawrence/clonesRedo/agi-asset-pipeline/ThirdParty/proj.4/src
-fPIC   conftest.cpp -lproj
-L/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/proj.4/lib
-lproj -lsqlite3 -lz
-L/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/zlib
-L/home/loshjawrence/clonesRedo/agi-asset-pipeline/build/ThirdParty/zlib/lib
-lpthread -lm -lrt -ldl  >&5
configure:24299: $? = 0
configure:24308: result: yes
configure:24453: error: proj.h not found




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev