Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify gcc version in a conda recipe?

It is common to use a Jinja function to specify that a given package needs a C++ compiler...

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}

However there does not seem to be a clear way to specify that a given recipe requires gcc9.

I am seeing the above resolve to gcc12 in conda-forge.

Does anyone know how to control this knob?

like image 493
WilderField Avatar asked Sep 06 '25 03:09

WilderField


1 Answers

I was able to achieve this using conda build variants...

Which means, put another file in your recipe folder called conda_build_config.yaml.

In that file specify (gcc9 as example):

c_compiler_version: # [unix]
  - 9.3.0 # [linux]

cxx_compiler_version:
  - 9.3.0 # [linux]
like image 161
WilderField Avatar answered Sep 07 '25 22:09

WilderField