Riccardo Buscicchio
Riccardo Buscicchio

Reputation: 141

Building conda package with C++ extensions fails to find headers

I am building locally a conda package. I have reduced its structure to the MWE below:

.
├── build.sh
├── cythonwrap.pyx
├── pythonmodule.py
├── lib
│   ├── function.cpp
│   └── header.h
├── meta.yml
└── setup.py

function.cpp requires shared libraries headers (fftw3.h). I am building the conda package locally in a fresh conda environment.

Conda ships compilers as metapackages (cxx-compiler for g++) and shared libraries (e.g. gsl and fftw3) to avoid dependencies on the host environment where the package is built.

This are installed and available in the host environment, with link and headers in the conda environment ./lib and ./include/ folders.

Nonetheless, when building the package it stops because it could not locate the fftw3.h header. Could someone provide a mw meta.yaml recipe for this kind of situation?

Here is the one that doesn't work:

package:
  name: mypackage
  version: 0.0

source:
  path: ./

build:
  number: 0
  preserve_egg_dir: True

requirements:
  build:
    - python
    - {{ compiler('cxx') }}  # This will automatically include the C++ compiler
    - Cython
    - numpy
  host:
    - Cython
    - python
    - fftw
  run:
    - python
    - Cython

about:
  home: ...
  license: ...
  summary: "..."
  description: "..."
  dev_url: http://myurl
  doc_source_url: ...

Upvotes: 1

Views: 173

Answers (0)

Related Questions