Not sure if this is an issue with conda-build, conda itself, or the feedstock I'm using, but the latter seems very unlikely considering the error.
Error message, verbatim except I replaced by home directory with "$HOME":
$HOME/software/conda-tools/conda-recipes/build/python-crfsuite_1534275923647/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc
-DNDEBUG -g -fwrapv -O3 -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -I$HOME/software/conda-tools/conda-recipes/build/python-crfsuite_1534275923647/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeho
ld_placehold_placehold_placehold_placehold_placehold_placeh/include -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-m
ap=${PREFIX}=/usr/local/src/conda-prefix -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -fPIC -Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include -Ipycrfsuite -I
$HOME/software/conda-tools/conda-recipes/build/python-crfsuite_1534275923647/_h_env_placehold_placehold_placehold_placehold_pla
cehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/include/python3.6m -c pycrfsuite/_pycrfsuite.cpp -o build/temp.linux
-x86_64-3.6/pycrfsuite/_pycrfsuite.o
x86_64-conda_cos6-linux-gnu-cc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command '$HOME/software/conda-tools/conda-recipes/build/python-crfsuite_1534275923647/_build_env/bin/x86_64-conda_co
s6-linux-gnu-cc' failed with exit status 1
which cc works, but which cc1plus indicates that cc1plus can't be found.
python-crfsuite is installed successfully.
# just a demo recipe to show the problem
git clone https://github.com/conda-forge/python-crfsuite-feedstock
# it fail in an env
conda create -y -p ./build-env python=3.6 conda-build gcc_linux-64 gxx_linux-64 gfortran_linux-64
conda activate ./build-env
conda build ./python-crfsuite-feedstock
# and it fails in base
conda deactivate
conda install conda-build gcc_linux-64 gxx_linux-64 gfortran_linux-64
Output of conda infoAgain redacting my home dir:
active environment : conda-tools
active env location : $HOME/.local/pyenv/versions/miniconda3-latest/envs/conda-tools
shell level : 1
user config file : $HOME/.condarc
populated config files : $HOME/.condarc
conda version : 4.5.10
conda-build version : 3.12.1
python version : 3.6.5.final.0
base environment : $HOME/.local/pyenv/versions/miniconda3-latest (writable)
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/linux-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/linux-64
https://repo.anaconda.com/pkgs/pro/noarch
package cache : $HOME/.local/pyenv/versions/miniconda3-latest/pkgs
$HOME/.conda/pkgs
envs directories : $HOME/.local/pyenv/versions/miniconda3-latest/envs
$HOME/.conda/envs
platform : linux-64
user-agent : conda/4.5.10 requests/2.18.4 CPython/3.6.5 Linux/3.10.0-514.26.2.el7.x86_64 rhel/7.3 glibc/2.17
UID:GID : 51757:51714
netrc file : None
offline mode : False
The Conda version I'm showing here was installed with Pyenv, but it fails with a system-wide Conda installation as well. Same error.
cc1plus may be hard-coded in your recipe's source code somewhere. Our compiler tools are all prefixed. See https://conda.io/docs/user-guide/tasks/build-packages/compiler-tools.html#using-the-compiler-packages for more info.
You probably need to patch your makefile or otherwise figure out where that's getting hardcoded, and probably just remove it (or figure out which env var to use instead). Any env var will probably be what make falls back to, so that's why simple removal of hard-coding may be enough.
@msarahan thanks. Are there any docs on how to correctly patch the source during build? Or do you do everything in build.sh?
I just checked and I don't see the string cc1plus anywhere in the source for python-crfsuite (https://github.com/scrapinghub/python-crfsuite) or its vendored libs (https://github.com/chokkan/crfsuite/tree/dc5b6c7b726de90ca63cbf269e6476e18f1dd0d9 , https://github.com/chokkan/liblbfgs/tree/57678b188ae34c2fb2ed36baf54f9a58b4260d1c)
Here's a good guide on patches: https://github.com/ilastik/ilastik/wiki/Creating-patches-for-Conda-recipes
You might need to explicitly list a c++ compiler, in addition to c:
{{ compiler("c") }}
{{ compiler("cxx") }}
I wasn't able to get this to work even with the {{ compiler("cxx") }} line added. And when I install gxx_linux-64 in my environment, the cc1plus binary just isn't there.
@gwerbin
Since the issue is rather old, I presume it was fixed one way or another - for people stumbling upon this issue because of error trying to exec 'cc1plus': execvp: No such file or directory, installing gxx_linux-64 in addition to gcc_linux-64 in the conda environment fixed the problem for me.
@ptrebert This fixed the problem for me as well. Thank you!
I experience the same issue on MacOS using the equivalent clang compiler packages. The workaround implied instructing cmake to build with the system compilers, while still installing the anaconda compiler tools for testing.
To those still having this problem after installing gxx_linux-64, if you are on ubuntu install build-essential package.
Most helpful comment
@gwerbin
Since the issue is rather old, I presume it was fixed one way or another - for people stumbling upon this issue because of
error trying to exec 'cc1plus': execvp: No such file or directory, installinggxx_linux-64in addition togcc_linux-64in the conda environment fixed the problem for me.