Discussion:
[conda] conda-build: specifying runtime compiler dependencies when builtime jinja2 syntax is used
Paul Madden
2018-07-24 00:14:40 UTC
Permalink
I'm building an MPICH library with the following meta.yaml:

package:
name: conda-mpich
version: 3.2


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


source:
fn: mpich-3.2.tar.gz
url: http://www.mpich.org/static/downloads/3.2/mpich-3.2.tar.gz
sha256: 0778679a6b693d7b7caff37ff9d2856dc2bfc51318bf8373859bfa74253da3dc

The package builds fine, but later I run into this:

$ conda create -y -n mpichtest --use-local conda-mpich
Solving environment: done


## Package Plan ##


environment location: /home/spire/pmadden/miniconda3/envs/mpichtest


added / updated specs:
- conda-mpich




The following NEW packages will be INSTALLED:


conda-mpich: 3.2-h9ac9557_0 local
libgcc-ng: 7.2.0-hdf63c60_3
libgfortran-ng: 7.2.0-hdf63c60_3


Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate mpichtest
#
# To deactivate an active environment, use
#
# $ conda deactivate


$ conda activate mpichtest


(mpichtest) $ mpifort q.f90 -o q
/home/pmadden/miniconda3/envs/mpichtest/bin/mpifort: line 369: x86_64-
conda_cos6-linux-gnu-gfortran: command not found

Obviously I need gcc and gfortran installed in my runtime environment, not
just the underlying libraries, which appear to be all that the {{
compiler('fortran') }} syntax propagates to run requirements (correctly, I
would think). I tried updating my meta.yaml with

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

run:
- {{ compiler('c') }}
- {{ compiler('fortran') }}

But that didn't help. I tried "host" instead of "run", too, though I didn't
expect that to be right.

If I manually install gfortran_impl_linux-64 into my activated "mpichtest"
environment, all's well, so I'm tempted to add that to my run requirements
in meta.yaml. But is that the correct solution? It seems counter to the
idea of using the jinja2 syntax to avoid saying too much. (I only care
about Linux now -- presumably I could use "# [linux]", etc. to install
different compilers for different platforms.)

Is there a more elegant way to do this?

thanks,
paul
--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+***@continuum.io.
To post to this group, send email to ***@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/054c584d-44c3-489c-a23e-98e405f39dd2%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
Loading...