[gdal-dev] GDAL and proj dll name.

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

[gdal-dev] GDAL and proj dll name.

Tamas Szekeres
Hi,

As far as I see the current cmake builds of proj4/proj6 includes the proj version number into the dll names like proj_4_9.dll for a Windows build. 

However the GDAL build (like for https://github.com/OSGeo/gdal/blob/v2.4.4/gdal/ogr/ogrct.cpp) still using the default proj.dll name which cannot be configured in the opt file.

It is true that if we set the PROJSO config option properly the problem disappears, something like:

Gdal.SetConfigOption("PROJSO", "proj_4_9.dll");

But that could also be avoided if there was a compile time setting to specify the proj dll name. Does it make sense to establish a compile time option for this purpose?

Thanks,

Tamas

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

Re: GDAL and proj dll name.

Even Rouault-2
Hi Tamas,

> However the GDAL build (like for
> https://github.com/OSGeo/gdal/blob/v2.4.4/gdal/ogr/ogrct.cpp) still using
> the default proj.dll name which cannot be configured in the opt file.

It can. You need to define -DPROJ_STATIC for that. -DPROJ_STATIC is a bit
confusing. It didn't mean a static build, but something that was linked at
build time (either a static or dynamic lib), to be opposed at being loaded at
runtime with LoadLibrary(). That's what you want to use.

# PROJ stuff
# Uncomment the following lines to link PROJ library statically. Otherwise
# it will be linked dynamically during runtime.
# To use the new API of proj5 or later, use
#PROJ_FLAGS = -DPROJ_STATIC -DPROJ_VERSION=5
# for proj 4.x:
#PROJ_FLAGS = -DPROJ_STATIC -DPROJ_VERSION=4

#PROJ_INCLUDE = -Id:\projects\proj.4\src
#PROJ_LIBRARY = d:\projects\proj.4\src\proj_i.lib

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: GDAL and proj dll name.

Tamas Szekeres
Hi Even,

Thank you, I've not considered to modify the linking behavior of proj.dll at this stage, but as far as it solves the problem I'm fine with it.

Best regards,

Tamas


Even Rouault <[hidden email]> ezt írta (időpont: 2020. jan. 22., Sze, 15:01):
Hi Tamas,

> However the GDAL build (like for
> https://github.com/OSGeo/gdal/blob/v2.4.4/gdal/ogr/ogrct.cpp) still using
> the default proj.dll name which cannot be configured in the opt file.

It can. You need to define -DPROJ_STATIC for that. -DPROJ_STATIC is a bit
confusing. It didn't mean a static build, but something that was linked at
build time (either a static or dynamic lib), to be opposed at being loaded at
runtime with LoadLibrary(). That's what you want to use.

# PROJ stuff
# Uncomment the following lines to link PROJ library statically. Otherwise
# it will be linked dynamically during runtime.
# To use the new API of proj5 or later, use
#PROJ_FLAGS = -DPROJ_STATIC -DPROJ_VERSION=5
# for proj 4.x:
#PROJ_FLAGS = -DPROJ_STATIC -DPROJ_VERSION=4

#PROJ_INCLUDE = -Id:\projects\proj.4\src
#PROJ_LIBRARY = d:\projects\proj.4\src\proj_i.lib

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: GDAL and proj dll name.

Joaquim Luis

FYI, this is what I do with my build. Since I want to control the DLL name I’ve added  this lines to  src\ lib_proj.cmake

 

# If a renaming of the proj dll has been set in ConfigUser.cmake

if (WIN32 AND PROJ4_DLL_RENAME)

set_target_properties(${PROJ_CORE_TARGET} PROPERTIES RUNTIME_OUTPUT_NAME ${PROJ4_DLL_RENAME})

endif (WIN32 AND PROJ4_DLL_RENAME)

 

and in a ConfigUser.cmake file (included in the main CMakeLists.txt file) I have

 

set (PROJ4_DLL_RENAME proj_w${BITAGE})

 

where BITAGE is either 32 or 64.

 

If there is interest for such a solution I could make a PR for it

 

 

Joaquim

 

 

From: gdal-dev <[hidden email]> On Behalf Of Tamas Szekeres
Sent: Wednesday, January 22, 2020 3:49 PM
To: Even Rouault <[hidden email]>
Cc: gdal-dev <[hidden email]>
Subject: Re: [gdal-dev] GDAL and proj dll name.

 

Hi Even,

 

Thank you, I've not considered to modify the linking behavior of proj.dll at this stage, but as far as it solves the problem I'm fine with it.

 

Best regards,

 

Tamas

 

 

Even Rouault <[hidden email]> ezt írta (időpont: 2020. jan. 22., Sze, 15:01):

Hi Tamas,

> However the GDAL build (like for
> https://github.com/OSGeo/gdal/blob/v2.4.4/gdal/ogr/ogrct.cpp) still using
> the default proj.dll name which cannot be configured in the opt file.

It can. You need to define -DPROJ_STATIC for that. -DPROJ_STATIC is a bit
confusing. It didn't mean a static build, but something that was linked at
build time (either a static or dynamic lib), to be opposed at being loaded at
runtime with LoadLibrary(). That's what you want to use.

# PROJ stuff
# Uncomment the following lines to link PROJ library statically. Otherwise
# it will be linked dynamically during runtime.
# To use the new API of proj5 or later, use
#PROJ_FLAGS = -DPROJ_STATIC -DPROJ_VERSION=5
# for proj 4.x:
#PROJ_FLAGS = -DPROJ_STATIC -DPROJ_VERSION=4

#PROJ_INCLUDE = -Id:\projects\proj.4\src
#PROJ_LIBRARY = d:\projects\proj.4\src\proj_i.lib

Even


--
Spatialys - Geospatial professional services
http://www.spatialys.com


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