Skip to content

Commit

Permalink
Release V3.2.0 (#29)
Browse files Browse the repository at this point in the history
* Release v3.2.0.100
Closes #18, closes #23, closes #11 

* updated links and build instructions

* geos was cached. rebuilt windows packages

* tests configuration update

* updated test targets
  • Loading branch information
MaxRev-Dev committed Dec 12, 2020
1 parent f53f3bc commit 76b614c
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 215 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ NuGet: [MaxRev.Gdal.WindowsRuntime.Minimal](https://www.nuget.org/packages/MaxRe
- [Can't compile on Windows](#q-cant-compile-on-windows)
- [Can I compile it on Ubuntu or another unix-based system?](#q-can-i-compile-it-on-ubuntu-or-another-unix-based-system)
- [In some methods performance is slower on Unix](#q-in-some-methods-performance-is-slower-on-unix)
- [OSGeo.OGR.SpatialReference throws System.EntryPointNotFoundException exception](#q--osgeoogrspatialreference-throws-systementrypointnotfoundexception-exception)
* [About and Contacts](#about-and-contacts)


Expand Down Expand Up @@ -80,9 +81,9 @@ It's quite tricky. Enter [win](win/) directory to find out how.

## How to compile on Unix

Current version targets **GDAL 3.1.0** with **minimal drivers**
Current version targets **GDAL 3.2.0** with **minimal drivers**

Drivers included PROJ6, SQLITE3, GEOS(3.8), HDF4, HDF5, GEOTIFF, JPEG, PNG, LIBZ, LERC, CURL
Drivers included PROJ(7.2.0), SQLITE3, GEOS(3.9.0beta2), HDF4, HDF5, GEOTIFF, JPEG, PNG, LIBZ, LERC, CURL

<details>
<summary>Configure summary of current version</summary>
Expand Down Expand Up @@ -185,14 +186,13 @@ Drivers included PROJ6, SQLITE3, GEOS(3.8), HDF4, HDF5, GEOTIFF, JPEG, PNG, LIBZ

## Building runtime libraries

Current version is targeting GDAL 3.1.0 version. Each runtime has to be build separately, but this can be done concurrently as they are using different contexts (build folders). Main operating bindings (in gdalcore package) are build from **linux**.
Current version is targeting **GDAL 3.2.0** version. Each runtime has to be build separately, but this can be done concurrently as they are using different contexts (build folders). Main operating bindings (in gdalcore package) are build from **linux**.

To make everything work smoothly, each configuration targets same drivers and their versions respectively.

- Configuration files of unix runtime - `unix/GdalCore.opt`
- Configuration of windows runtime - `win/CONFIGVARS.bat`
- - Patched configuration - `win/presource/gdal-nmake.opt`
- Patched makefile - `win/presource/gdal-makefile.vc`
- After **VCPKG** integration finished configuration is shared between runtimes - `shared/GdalCore.opt`
- Overrides for `nmake.opt` on windows - `win/presource/gdal-nmake.opt`
- Patched makefile - `win/presource/gdal-makefile.vc`

To build for a specific runtime, see the **README.md** in respective directory.

Expand All @@ -205,16 +205,11 @@ To build for a specific runtime, see the **README.md** in respective directory.

### Packaging

1. I'm using debian for example:
1. I'm using [CentOS 7](https://docs.microsoft.com/en-us/dotnet/core/install/linux-centos#centos-7-) for example:

```bash
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/debian/9/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get install apt-transport-https && apt-get update && apt-get install dotnet-sdk-2.2
rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo apt-get install apt-transport-https && apt-get update && apt-get install dotnet-sdk-5.0
```

2. And then just
Expand Down Expand Up @@ -249,6 +244,10 @@ A: The main reason I'm compiling it on CentOS - glibc of version 2.17. It's the

A: Use of [older version](https://github.com/MaxRev-Dev/gdal.netcore/issues/1) of GLIBC might be [a reason](https://github.com/MaxRev-Dev/gdal.netcore/issues/6). But It's not a fault of build engine.

#### Q: OSGeo.OGR.SpatialReference throws System.EntryPointNotFoundException exception

A: That's a problem with swig bindings. Please, use **SpatialReference** type from **OSR** namespace. More info [here](https://github.com/MaxRev-Dev/gdal.netcore/issues/2#issuecomment-539716268) and [here](https://github.com/MaxRev-Dev/gdal.netcore/issues/11#issuecomment-651465581).


## About and Contacts

Expand All @@ -257,3 +256,4 @@ based on https://github.com/OSGeo/gdal && https://github.com/jgoday/gdal
Contact me: [Telegram - MaxRev](http://t.me/maxrev)

Enjoy!

14 changes: 7 additions & 7 deletions gdalcore.linuxruntime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Platform>x64</Platform>
<DebugType>portable</DebugType>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<Copyright>MaxRev © 2020</Copyright>
<Authors>MaxRev</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -12,16 +12,16 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/MaxRev-Dev/gdal.netcore</RepositoryUrl>
<Version>3.1.2.110</Version>
<Description>GDAL (3.1.2) minimal libraries package.
Drivers included PROJ (7.1.1), GEOS (3.8.0beta2), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5
Targets linux-x64 runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[3.1,3.0,2.2,2.1].
<Version>3.2.0.100</Version>
<Description>GDAL (3.2.0) minimal libraries package.
Drivers included PROJ (7.2.0), GEOS (3.9.0beta2), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5
Targets linux-x64 runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[2.1,3.1], net5.0
</Description>
<AssemblyName>MaxRev.Gdal.LinuxRuntime.Minimal</AssemblyName>
<RootNamespace />
<PackageReleaseNotes>
- GDAL 3.2.0
- built on CentOS 7 (glibc - 2.17)
- GDAL 3.1.2
- targets .NET5 and .NET Core LTS
- built with vcpkg</PackageReleaseNotes>
</PropertyGroup>

Expand Down
8 changes: 4 additions & 4 deletions gdalcore.loader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Platform>x64</Platform>
<DebugType>portable</DebugType>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<Copyright>MaxRev © 2020</Copyright>
<Authors>MaxRev</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -13,8 +13,8 @@
<RepositoryType>git</RepositoryType>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<RepositoryUrl>https://github.com/MaxRev-Dev/gdal.netcore</RepositoryUrl>
<Version>3.1.2.110</Version>
<Description>GDAL (3.1.2) bindings for dotnet core (now linux-x64 and win-x64).
<Version>3.2.0.100</Version>
<Description>GDAL (3.2.0) bindings for dotnet core (now linux-x64 and win-x64).
Bridge between gdal and netcore.
Use dependency package for target runtime to get drivers.
Works in docker containers without pkg installations!!
Expand All @@ -24,7 +24,7 @@ Just call - GdalBase.ConfigureAll()
<AssemblyName>MaxRev.Gdal.Core</AssemblyName>
<PackageReleaseNotes>
- built on CentOS 7 (glibc - 2.17)
- GDAL Version 3.1.2
- GDAL Version 3.2.0
- built with vcpkg</PackageReleaseNotes>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
Expand Down
19 changes: 10 additions & 9 deletions gdalcore.windowsruntime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Platform>x64</Platform>
<DebugType>portable</DebugType>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<Copyright>MaxRev © 2020</Copyright>
<Authors>MaxRev</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -12,17 +12,18 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/MaxRev-Dev/gdal.netcore</RepositoryUrl>
<Version>3.1.2.110</Version>
<Description>GDAL (3.1.2) minimal libraries package.
Drivers included PROJ (7.1.1), GEOS (3.8.0beta2), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5
Targets win-x64 runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[3.1,3.0,2.2,2.1].
<Version>3.2.0.110</Version>
<Description>GDAL (3.2.0) minimal libraries package.
Drivers included PROJ (7.2.0), GEOS (3.9.0beta2), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5
Targets win-x64 runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[2.1,3.1], net5.0
</Description>
<AssemblyName>MaxRev.Gdal.WindowsRuntime.Minimal</AssemblyName>
<RootNamespace />
<AssemblyName>MaxRev.Gdal.WindowsRuntime.Minimal</AssemblyName>
<PackageReleaseNotes>
- GDAL 3.1.2
- GDAL 3.2.0
- targets .NET5 and .NET Core LTS
- Sync build with linux runtime
- Built with vcpkg</PackageReleaseNotes>
- Built with vcpkg
- updated GEOS. previous was cached</PackageReleaseNotes>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

Expand Down
Binary file modified maxrev.gdal.core.libshared/proj.db
Binary file not shown.
1 change: 1 addition & 0 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="github" value="https://nuget.pkg.github.com/MaxRev-Dev/index.json" />
<add key="local" value="nuget" />
</packageSources>
</configuration>
9 changes: 5 additions & 4 deletions shared/GdalCore.opt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ BUILD_ROOT=$(ROOTDIR_)/build-$(BASE_RUNTIME_RID)

GDAL_ROOT=$(BUILD_ROOT)/gdal-source
GDAL_REPO=https://github.com/OSGeo/gdal.git
GDAL_COMMIT_VER=v3.1.2
GDAL_COMMIT_VER=v3.2.0

PROJ_ROOT=$(BUILD_ROOT)/proj-source
PROJ_REPO=https://github.com/OSGeo/PROJ.git
PROJ_COMMIT_VER=dd91c93ca44cbe3cf4f6f7c94a8f225aefa4b408
PROJ_COMMIT_VER=7.2.0

GEOS_ROOT=$(BUILD_ROOT)/geos-source
GEOS_REPO=https://github.com/libgeos/geos.git
GEOS_COMMIT_VER=ff05d9755d189771147acb3105bd9c9cfff730ff
GEOS_COMMIT_VER=3.9.0beta2

# ---------------------- VCPKG ----------------------

Expand All @@ -27,7 +27,8 @@ VCPKG_COMMIT_VER=5dc53211caedebf4387d590155ed53ee44161f10

# we won't use these for now (too many boost deps):
# -----: libgeotiff libhdfs3 libkml netcdf-c
VCPKG_REQUIRE=tiff expat xerces-c libpng libiconv zlib
# tiff was disabled (gdal on linux can't link v3.2.0)
VCPKG_REQUIRE=expat xerces-c libpng libiconv zlib

# windows runtime requires more packages and tools
# because they are not preinstalled like on linux
Expand Down
8 changes: 4 additions & 4 deletions test/GdalCore-XUnit/GdalCore-XUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>GdalCore_XUnit</RootNamespace>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MaxRev.Gdal.Core" Version="3.1.2.110" />
<PackageReference Include="MaxRev.Gdal.LinuxRuntime.Minimal" Version="3.1.2.110" />
<PackageReference Include="MaxRev.Gdal.WindowsRuntime.Minimal" Version="3.1.2.110" />
<PackageReference Include="MaxRev.Gdal.Core" Version="3.2.0.100" />
<PackageReference Include="MaxRev.Gdal.LinuxRuntime.Minimal" Version="3.2.0.100" />
<PackageReference Include="MaxRev.Gdal.WindowsRuntime.Minimal" Version="3.2.0.110" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
Expand Down
8 changes: 4 additions & 4 deletions test/GdalCoreTest/GdalCoreTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<Platforms>x64</Platforms>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<StartupObject>GdalCoreTest.Program</StartupObject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MaxRev.Gdal.Core" Version="3.1.2.110" />
<PackageReference Include="MaxRev.Gdal.LinuxRuntime.Minimal" Version="3.1.2.110" />
<PackageReference Include="MaxRev.Gdal.WindowsRuntime.Minimal" Version="3.1.2.110" />
<PackageReference Include="MaxRev.Gdal.Core" Version="3.2.0.100" />
<PackageReference Include="MaxRev.Gdal.LinuxRuntime.Minimal" Version="3.2.0.100" />
<PackageReference Include="MaxRev.Gdal.WindowsRuntime.Minimal" Version="3.2.0.110" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.5" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions unix/gdal-makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ CFLAGS="-fPIC" \
--with-libz=${VCPKG_INSTALLED} \
--with-jpeg=${VCPKG_INSTALLED} \
--with-expat=${VCPKG_INSTALLED} \
--with-libtiff=${VCPKG_INSTALLED} \
--with-libtiff=internal \
--with-xerces=${VCPKG_INSTALLED} \
--without-cfitsio \
--without-cryptopp \
Expand Down Expand Up @@ -131,7 +131,7 @@ configure_proj:
@cd $(PROJ_ROOT) && ./autogen.sh

@cd $(PROJ_ROOT) && ./configure \
--with-curl=$(VCPKG_INSTALLED)/share/curl/curl-config \
--with-curl=$(VCPKG_INSTALLED_DYNAMIC)/share/curl/curl-config \
--prefix=$(BUILD_ROOT)/proj-build \
LIBS="-L$(VCPKG_INSTALLED)/lib -lsqlite3 \
-L$(VCPKG_INSTALLED)/lib -ltiff \
Expand Down
35 changes: 14 additions & 21 deletions win/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
## Windows build scripts for GDAL

**ATTENTION**: *In plans to use **nmake** instead of batch scripts for future releases. Some of main batch files are not complete currently. For HDF4 driver - JPEG library must be copied to drivers folder on startup.*

## Table of contents

- [Windows build scripts for GDAL](#windows-build-scripts-for-gdal)
Expand All @@ -15,43 +13,38 @@ In this folder you can find bat scripts to fetch sources and build some GDAL dri

### Prerequisites:

1. [Visual Studio Build Tools](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16). Recommended versions - vs15.6 (2017) and vs16.5(2019) (**nmake** and to retarget **libpng** to v142 toolset)
1. [Visual Studio Build Tools (with ATL)](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16). Recommended versions - vs15.6 (2017) and vs16.5(2019) (**nmake** and to retarget **libpng** to v142 toolset)

2. [CMake](https://cmake.org/download/) and MinGW-w64 must be installed and available in PATH. I'm using [x86_x64_posix_seh](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z) (required almost all drivers)

3. [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.1.201-windows-x64-installer) and [Nuget.exe](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) - for building and publishing packages

4. Check `CONFIGVARS.bat` first! **vcvars** variable must point to the actual location of **vcvarsall.bat** build environment configurator.

5. It's **recommended** to use **presource** folder that contains configuration files for **gdal** and **geotiff**, instead of direct modifying files in repo. They will be automatically replaced when the source is refreshed from repo via batch file. Call `fetchgdal.bat` to refresh/reset gdal repo.
3. [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet/5.0) and [Nuget.exe](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) - for building and publishing packages

6. Check build-output folders in **presource/gdal-nmake.opt**. For example (all instructions are available in **presource/gdal-nmake.opt**):
6. Check build-output folders in **gdal-nmake.opt**. For example:

```makefile
# for jpeg library
JPEGDIR = $(BUILD_ROOT)\libjpeg-build\include
JPEG_LIB = $(BUILD_ROOT)\libjpeg-build\lib\jpeg.lib
JPEGDIR = $(BUILD_ROOT_VCPKG)\libjpeg-build\include
JPEG_LIB = $(BUILD_ROOT_VCPKG)\libjpeg-build\lib\jpeg.lib
```

### Building: (in cmd)

1. ```ALL_INSTALL.bat ```- installs all configured drivers (check output, some of them may fail when config in wrong).

2. ```gdal-fetch.bat``` - fetches gdal source.

3. ```gdal-build.bat``` - attempts to build gdal.

4. ```gdal-csharp.bat``` - generates interface and copies gdal lib and wrappers to the package output folder.
1. `init.bat` - calls initializer **vcvars64.bat**
2. `nmake -f vcpkg-makefile.vc` - installs libraries specified in `GdalCore.opt` .
3. `nmake build-proj` - configures and builds PROJ
4. `nmake build-geos` - configures and builds GEOS
5. `nmake build-gdal` - configures and builds GDAL
6. `nmake collect interface` - generates bindings and creates packages

5. ```final-copydrivers.bat``` - copies all gdal drivers to the package output folder.

Optional (build PCL)

6. ```cd .. && dotnet pack -c Release -o nuget gdalcore.windowsruntime.csproj``` - to create a package
6. `nmake pack` - generates bindings and creates packages
7. `nmake test` - run tests for created packages

And finally.

Use **dumpbin** or **dependency walker** to check gdal's dependencies. Test packages before bringing them to prod.
You can use **dumpbin** or **dependency walker** to check gdal's dependencies. Please ensure the tests are passing before bringing them to prod.

### ISSUES

Expand Down
5 changes: 3 additions & 2 deletions win/gdal-nmake.opt
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,9 @@ PNGDIR = $(BUILD_ROOT_VCPKG)\include
PNG_LIB = $(BUILD_ROOT_VCPKG)\lib\libpng16.lib

# if using an external libtiff library. Must be libtiff >= 4.0
TIFF_INC = -I$(BUILD_ROOT_VCPKG)\include
TIFF_LIB = $(BUILD_ROOT_VCPKG)\lib\tiff.lib
# WARN: this was disabled to make sync build with linux
#TIFF_INC = -I$(BUILD_ROOT_VCPKG)\include
#TIFF_LIB = $(BUILD_ROOT_VCPKG)\lib\tiff.lib

# if using an external libgeotiff library
#GEOTIFF_INC = -Ic:/warmerda/libgeotiff -Ic:/warmerda/libgeotiff/libxtiff
Expand Down
2 changes: 1 addition & 1 deletion win/getgeos.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ setlocal enabledelayedexpansion enableextensions
set back=%cd%
call %~dp0configvars
set key=geos
nmake -f gdal-makefile.vc fetch-geos
nmake -f makefile.vc fetch-geos
cd %_buildroot_%/%key%-source
set bindir=%_buildroot_%/%key%-build
if exist "%bindir%" rd /s /q "%bindir%"
Expand Down
2 changes: 1 addition & 1 deletion win/makefile.vc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ packdev: hostfix31

test:
cd $(TEST_DIR)
dotnet add package MaxRev.Gdal.Core -s $(NUGET_)
dotnet add package MaxRev.Gdal.WindowsRuntime.Minimal -s $(NUGET_)
dotnet add package MaxRev.Gdal.Core -s $(NUGET_)
dotnet test
cd $(MAKEDIR)

0 comments on commit 76b614c

Please sign in to comment.