Install dependencies on Windows via vcpkg - GenericMappingTools/gmt GitHub Wiki

For some software, e.g. CMake, Ninja, Ghostscript, GraphicsMagick and FFmpeg, you can download binary installers to install them. If there is an option to add it to the system PATH, remember to tick it.

For other dependency libraries, it's recommended to install them via vcpkg. To use vcpkg, make sure you have met the prerequisites:

Open a command prompt, and install vcpkg with:

cd C:\
git clone https://github.com/microsoft/vcpkg
cd C:\vcpkg
.\bootstrap-vcpkg.bat

After installing vcpkg, you can install the GMT dependency libraries with (it may take more than 30 minutes):

# Build and install libraries
# If you want to build x64 libraries (recommended)
vcpkg install netcdf-c gdal[core,tools,default-features] pcre fftw3[core,threads] clapack openblas --triplet x64-windows

# If you want to build x86 libraries
vcpkg install netcdf-c gdal[core,tools,default-features] pcre fftw3[core,threads] clapack openblas --triplet x86-windows

# hook up user-wide integration (note: requires admin on first use)
vcpkg integrate install

After installing these dependency libraries, you also need to add vcpkg's bin path (i.e. C:\vcpkg\installed\x64-windows\bin) and GDAL's bin path (i.e. C:\vcpkg\installed\x64-windows\tools\gdal), to the system environmental variable PATH, so that GMT executables can find the DLL shared libraries and the GDAL tools (gdal_translate and ogr2ogr).