Skip to content

CI: Install ninja to speed up building GMT source code - #986

Merged
seisman merged 1 commit into
masterfrom
install-ninja-to-speedup
Mar 2, 2021
Merged

CI: Install ninja to speed up building GMT source code#986
seisman merged 1 commit into
masterfrom
install-ninja-to-speedup

Conversation

@seisman

@seisman seisman commented Mar 2, 2021

Copy link
Copy Markdown
Member

Description of proposed changes

With the upstream PR GenericMappingTools/gmt#4883 merged, it's possible to use ninja to build GMT, which is much faster.

We only need to install ninja.

Without ninja (https://github.com/GenericMappingTools/pygmt/actions/runs/612306243), building GMT takes ~3.5 minutes on Linux and ~8.5 minutes on macOS.

Now (https://github.com/GenericMappingTools/pygmt/actions/runs/612798172), it takes ~2.5 minutes on Linux and 5 minutes on macOS.

Fixes #

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@seisman
seisman marked this pull request as ready for review March 2, 2021 04:05
@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Mar 2, 2021
@seisman seisman added this to the 0.3.1 milestone Mar 2, 2021
@seisman
seisman requested a review from a team March 2, 2021 04:26
Comment on lines -82 to +84
run: conda install cmake libblas libcblas liblapack fftw gdal ghostscript libnetcdf hdf5 zlib curl pcre ipython pytest pytest-cov pytest-mpl
run: |
conda install ninja cmake libblas libcblas liblapack fftw gdal ghostscript \
libnetcdf hdf5 zlib curl pcre ipython pytest pytest-cov pytest-mpl

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added ninja and also split the long command into two lines.

@weiji14 weiji14 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice speedup on the benchmarks!

@seisman
seisman merged commit af481b7 into master Mar 2, 2021
@seisman
seisman deleted the install-ninja-to-speedup branch March 2, 2021 04:33
@weiji14

weiji14 commented Mar 2, 2021

Copy link
Copy Markdown
Member

Actually, just noticed that total CI time on macOS is still 15 min before and after. But that's ok I guess since Linux is still faster by 1 minute.

sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants