Skip to content

Building GMT on Windows #4718

Closed
Closed

Description

@joa-quim

Not sure that an issue is the best place but we cam move this later to a more convenient place.

I have placed a copy of my dependencies here. It has also my ConfigUser.cmake. Note that this file is not completely ready to use but it should not need more editing than uncomment and set to appropriate path the line with

#set (DEPS_ROOT C:/Dropbox/libs_JL)

Here, C:/Dropbox/libs_JL should be replaced with the path where the files in the above link are stored.
Those files are more than one needs when building GMT but they are needed at run time when the dependencies-of-dependencies are checked by the system. But since I did that selection manually from my dependencies pool it's not unlikely that some are still missing. Need feedback on this.

There is also a batch file called SYMLINKA_DLLs_VC14.bat that, again after minor edition, allows the creation of symlinks on a common directory that, when added to Windows path, takes charge of the dependency finding. This even allows creating a Windows installer.

Need some input for a curl or wget command to download http://fct-gmt.ualg.pt/gmtdependswin/ all at once.

@Esteban82 I think now you can try to build a Windows version.

Activity

  1. added
    feature request
    on Jan 29, 2021
  2. Esteban82 commented on Jan 30, 2021

    @Esteban82
    Member

    Many thanks @joa-quim. I was trying to build in ubuntu. But I will see this post when I try on Windows.

  3. Squadzone commented on Feb 19, 2021

    @Squadzone

    i also tried build gmt on windows system using building instruction on wiki, but need to change command Install dependencies on Windows via vcpkg

    before

    vcpkg install netcdf-c gdal pcre fftw3[core,threads] clapack openblas --triplet x64-windows
    

    after

    vcpkg install netcdf-c gdal pcre fftw3[core,threads] clapack openblas glib --triplet x64-windows
    

    and this is my ConfigUser.cmake

    set (CMAKE_INSTALL_PREFIX "C:/programs/gmt6dev")
    set (GMT_INSTALL_MODULE_LINKS TRUE)
    set (GMT_ENABLE_OPENMP TRUE)
    set (GSHHG_ROOT "C:/programs/gmt6dev/share/coast")
    set (COPY_GSHHG TRUE)
    set (DCW_ROOT "C:/programs/gmt6dev/share/dcw")
    set (COPY_DCW TRUE)
    set (GRAPHICSMAGICK_RMS "0.005")
    set (GMT_USE_THREADS TRUE)
    set (GDAL_LIBRARY "D:/gmt_build_dev/vcpkg/installed/x64-windows/lib/gdal_i.lib")
    set (CURL_INCLUDE_DIR "D:/gmt_build_dev/vcpkg/installed/x64-windows/include")
    enable_testing()
    set (DO_EXAMPLES TRUE)
    set (DO_TESTS TRUE)
    set (DO_ANIMATIONS TRUE)
    set (DO_API_TESTS ON)
    

    Get this warning

    Could NOT find UnixCommands (missing: CP GZIP MV RM)
    Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
    

    But no problem on build process
    building process takes ~1.5hours including build vcpkg on my pc (Xeon 3.60ghz 4cores 8threads 64Gb rams)

    testing example using batch script (my modified script) works fine

  4. joa-quim commented on Feb 19, 2021

    @joa-quim
    MemberAuthor

    I think you need to run cmake from a MSYS aware shell (or Git bash). Building GDAL in vcpkg may take 2 or 3 hours. I don't know where they have they minds setting a recipe that takes that long. My recipe above (when made to work) with ninja takes less than a minute to build GMT.

  5. Squadzone commented on Feb 19, 2021

    @Squadzone

    yes, we can eliminated that warning using git bash or msys, but im trying using windows without linux environment and see if this build works or not, and the result its good

  6. maxrjones commented on Jul 13, 2021

    @maxrjones
    Member

    I think you need to run cmake from a MSYS aware shell (or Git bash). Building GDAL in vcpkg may take 2 or 3 hours. I don't know where they have they minds setting a recipe that takes that long. My recipe above (when made to work) with ninja takes less than a minute to build GMT.

    @joa-quim can you clarify whether you use the vcpkg related flags from BUILDING.md (i.e., -DCMAKE_TOOLCHAIN_FILE and -DCMAKE_GENERATOR_PLATFORM) when building with the recipe above (using the .bat and ConfigUser.cmake shared in gmtdependswin)? If so, how do you specify ninja as the build generator? Currently it takes me about 5 minutes to configure using the BUILDING.md instructions and Git bash and it would be nice to cut that down with ninja.

  7. joa-quim commented on Jul 13, 2021

    @joa-quim
    MemberAuthor

    I don't use any vcpkg stuff in my buildings. The dependencies I build them one by one depending on the building system (cmake, nmake, etc) and have the crazy work of finding out how to change the name of the DLLs to have the _w64 suffix. This has saved my builds to have nearly zero dependency dll conflicts.

    For ninja I do

    cmake -G "Ninja" -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DBUILD_LIBPROJ_SHARED=on C:\progs_cygw\GMTdev\gmt5\master
    

    The GMT build time is ~30 sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions