I’m getting started on making Github Actions, and I thought I would start by making one that compiles a C++ library, in one of my private repos. The action I made uses ubuntu (20.04) and does what I intended it to do. So I decided to try it on Windows since I also need to compile it there.
Unfortunately, it is not so easy now since the workflow crashes because g++ can’t find a library that I need in order to compile my library. The library that I need is GMP (a C library), and the error message is:
In file included from D:/a/linear-arrangement-library/linear-arrangement-library/lal/generate/rand_ulab_rooted_trees.hpp:50, from D:/a/linear-arrangement-library/linear-arrangement-library/lal/generate/rand_ulab_free_trees.hpp:50, from D:/a/linear-arrangement-library/linear-arrangement-library/lal/generate/rand_ulab_free_trees.cpp:42: D:/a/linear-arrangement-library/linear-arrangement-library/lal/numeric/integer.hpp:45:10: fatal error: gmp.h: No such file or directory #include <gmp.h> ^~~~~~~ compilation terminated.
I think that either:
- GMP is installed but the compiler can’t find it.
- the GMP library is missing in the (windows) runner machine
Since I don’t know in which situation I find myself in, I’ll make questions for each of them. Most of them are very specific and few are general. I would be very happy if someone answered them.
(1) How do I know that GMP is installed? More generally, how do I know if a certain resource (a library, compiler, or a certain version of a compiler, library, …) is installed? How do I find out the appropriate paths of a library for a compiler to use it properly?
(2) I browsed Github Marketplace but I couldn’t find any action to setup GMP. Any advice on how to install GMP on Windows? If the library is to be installed by my
.yml file then the installation will happen every time the action is run: is there a way to ensure it’s done only once? My main interest for the latter is to reduce execution time.
Thank you very much.