[GRASS-dev] Official GRASS conda recipes?

Hi,

I take the opportunity of the recent post from Michael Barton about compiling GRASS in a conda environment on OSX.

GRASS provides many python tools and API. Many python developers, especially in the scientific community, use conda to manage packages and environments.

It would be great if there was a set a consistent, up-to-date conda GRASS packages on conda-forge for the 3 main OS.

Looking at the amount of recipes already existing, it seems that there is an interest:

https://anaconda.org/search?q=grass
https://github.com/search?q=grass+conda

Unfortunately, none of them are up-to-date, some are for Linux, other for OSX, none for Windows, and none are on conda-forge. All of them rely on a good amount of patches to allow the compilation.

All the main GRASS dependencies are already in conda-forge, so the main issue would be to have GRASS compile correctly.

I have a tiny experience in building binary conda package (https://github.com/lrntct/swashes-conda), but I lack the understanding of the GRASS building process to patcg and fix the build on different platforms.

If there is interest from the development team, I would be glad to help.

Cheers,
Laurent

On Sun, May 31, 2020 at 10:10 AM Laurent C. <lrntct@gmail.com> wrote:

It would be great if there was a set a consistent, up-to-date conda GRASS packages on conda-forge for the 3 main OS.

Looking at the amount of recipes already existing, it seems that there is an interest:

https://anaconda.org/search?q=grass
https://github.com/search?q=grass+conda

Unfortunately, none of them are up-to-date, some are for Linux, other for OSX, none for Windows, and none are on conda-forge.

Hi Laurent,

That would be great. Here is how far I got:

conda-based compilation:

https://github.com/GRASS-GIS/grass-gis-experimental-ci/tree/conda-compile

conda package recipe (macOS & Linux):

https://github.com/csdms-stack/grass-recipe/pull/1

Homebrew:

https://github.com/GRASS-GIS/grass-gis-experimental-ci/tree/homebrew-osgeo4mac

All of them rely on a good amount of patches to allow the compilation.

The patches are same or similar, so it would make sense to have the fix in place or at least the patch in the source code itself both to share it and to keep the workaround visible.

Best,
Vaclav

Hi Vaclav,

For the last week I’ve tried to build grass with conda-build on Linux. It failed in different ways. Even the available online recipes that are supposed to work (CSDMS, iota2), fail to build on my computer.
The grass build system is a bit confusing, sometimes it completes while failing to build most of the tools. The grass78 binary will work, but basically nothing else will.
I have almost zero knowledge of autotools and the build system of GRASS seems quite complex. Therefore I do not understand which issues the patches in the existing recipes are supposed to solve, and how to solve the compilation problems I ran into.
I believe this work should be undertaken by someone who understands how the build system works.
In the only conda binary package I made, I solved the building issues by switching the original Makefile for a CMakeLists. But it was a very simple software. Building grass with cmake is likely to require quite a bit of work. And my knowledge of cmake is very slim anyway.

This is a topic of interest to me, and I would be glad to help, but I am afraid I can’t do much.

Best,
Laurent

Le lun. 1 juin 2020 à 21:09, Vaclav Petras <wenzeslaus@gmail.com> a écrit :

On Sun, May 31, 2020 at 10:10 AM Laurent C. <lrntct@gmail.com> wrote:

It would be great if there was a set a consistent, up-to-date conda GRASS packages on conda-forge for the 3 main OS.

Looking at the amount of recipes already existing, it seems that there is an interest:

https://anaconda.org/search?q=grass
https://github.com/search?q=grass+conda

Unfortunately, none of them are up-to-date, some are for Linux, other for OSX, none for Windows, and none are on conda-forge.

Hi Laurent,

That would be great. Here is how far I got:

conda-based compilation:

https://github.com/GRASS-GIS/grass-gis-experimental-ci/tree/conda-compile

conda package recipe (macOS & Linux):

https://github.com/csdms-stack/grass-recipe/pull/1

Homebrew:

https://github.com/GRASS-GIS/grass-gis-experimental-ci/tree/homebrew-osgeo4mac

All of them rely on a good amount of patches to allow the compilation.

The patches are same or similar, so it would make sense to have the fix in place or at least the patch in the source code itself both to share it and to keep the workaround visible.

Best,
Vaclav

Hi Laurent,

Thanks for looking into this. Here are some further pointers I can give you.

On Mon, Jun 8, 2020 at 12:43 PM Laurent C. <lrntct@gmail.com> wrote:

The grass build system is a bit confusing, sometimes it completes while failing to build most of the tools. The grass78 binary will work, but basically nothing else will.

The fail or pass should be signaled by a return code and visually by the list of failing directories. The “grass78 binary” is Python script, so more a general executable, than a binary. Its compilation does not depend on the rest. This actually applies to most of the GRASS GIS which is overall quite modular and failure to build one part does not influence other parts. Well, that of course does not apply to things which are actually dependent on something, such as C modules which depend at least on the gis library.

In the only conda binary package I made, I solved the building issues by switching the original Makefile for a CMakeLists. But it was a very simple software. Building grass with cmake is likely to require quite a bit of work. And my knowledge of cmake is very slim anyway.

Please see the relevant PR:

https://github.com/OSGeo/grass/pull/348

Best,

Vaclav