Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc1plus missing from conda env? #3080

Open
gwerbin opened this issue Aug 14, 2018 · 15 comments
Open

cc1plus missing from conda env? #3080

gwerbin opened this issue Aug 14, 2018 · 15 comments
Labels
stale::recovered [bot] recovered after being marked as stale

Comments

@gwerbin
Copy link

gwerbin commented Aug 14, 2018

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.

Actual Behavior

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.

Expected Behavior

python-crfsuite is installed successfully.

Steps to Reproduce

# 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 info

Again 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.

@gwerbin gwerbin changed the title "error trying to exec 'cc1plus': execvp: No such file or directory" cc1plus missing from conda env? Aug 14, 2018
@msarahan
Copy link
Contributor

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.

@gwerbin
Copy link
Author

gwerbin commented Aug 14, 2018

@msarahan thanks. Are there any docs on how to correctly patch the source during build? Or do you do everything in build.sh?

@gwerbin
Copy link
Author

gwerbin commented Aug 14, 2018

@msarahan
Copy link
Contributor

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") }}

@gwerbin
Copy link
Author

gwerbin commented Aug 26, 2018

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.

@ptrebert
Copy link

@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.

@adriennefranke
Copy link

@ptrebert This fixed the problem for me as well. Thank you!

@williamfgc
Copy link

williamfgc commented Jul 6, 2019

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.

@yskan
Copy link

yskan commented Feb 13, 2020

To those still having this problem after installing gxx_linux-64, if you are on ubuntu install build-essential package.

@github-actions
Copy link

github-actions bot commented Dec 2, 2022

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Dec 2, 2022
@gwerbin
Copy link
Author

gwerbin commented Dec 2, 2022

@ptrebert I never responded to your message, but no, I never resolved this. I ended up simply pip install-ing the packages I needed instead.

I think at this point it appears to be more of a "documentation bug" than anything.

@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels Dec 4, 2022
@github-project-automation github-project-automation bot moved this to 🆕 New in 🧭 Planning Feb 24, 2023
@nkuehnle
Copy link

nkuehnle commented Jul 10, 2024

I am having this problem after installing gxx_linux64 from conda-forge.

This is in a conda-managed R+Python environment. I'm trying to install an R package (Rcpp) from Github that isn't available on CRAN by using remotes::install(...) function

using C++ compiler: ‘x86_64-conda-linux-gnu-c++ (conda-forge gcc 13.2.0-13) 13.2.0’
x86_64-conda-linux-gnu-c++ -std=gnu++17 -I"/home/nkuehnle/miniconda/envs/testenv/lib/R/include" -DNDEBUG  -I'/home/nkuehnle/miniconda/envs/testenv/lib/R/library/Rcpp/include' -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/nkuehnle/miniconda/envs/testenv/include -I/home/nkuehnle/miniconda/envs/testenv/include -Wl,-rpath-link,/home/nkuehnle/miniconda/envs/testenv/lib    -fpic  -fvisibility-inlines-hidden  -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/nkuehnle/miniconda/envs/testenv/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1719533501095/work=/usr/local/src/conda/r-base-4.3.3 -fdebug-prefix-map=/home/nkuehnle/miniconda/envs/testenv=/usr/local/src/conda-prefix  -c RcppExports.cpp -o RcppExports.o
x86_64-conda-linux-gnu-c++: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
compilation terminated.
make: *** [/home/nkuehnle/miniconda/envs/testenv/lib/R/etc/Makeconf:200: RcppExports.o] Error 1

This is conda 24.5.0 and RedHat 8.8

@nkuehnle
Copy link

I found that linking cc1plus to my conda env's bin/ worked to resolve the cc1plus error:

ln -s $CONDA_PREFIX/libexec/gcc/x86_64-conda-linux-gnu/13.2.0/cc1plus $CONDA_PREFIX/bin/

I now get

x86_64-conda-linux-gnu-c++: fatal error: '-fuse-linker-plugin', but liblto_plugin.so not found
compilation terminated.

which is also in $CONDA_PREFIX/libexec/gcc/x86_64-conda-linux-gnu/13.2.0 but I've not yet been able to get x86_64-conda-linux-gnu-c++ to search it. I tried exporting LD_LIBRARY_PATH after some digging and passing -L during some small compilation tests without success.

@jeff999955
Copy link

I found that linking cc1plus to my conda env's bin/ worked to resolve the cc1plus error:

ln -s $CONDA_PREFIX/libexec/gcc/x86_64-conda-linux-gnu/13.2.0/cc1plus $CONDA_PREFIX/bin/

I now get

x86_64-conda-linux-gnu-c++: fatal error: '-fuse-linker-plugin', but liblto_plugin.so not found
compilation terminated.

which is also in $CONDA_PREFIX/libexec/gcc/x86_64-conda-linux-gnu/13.2.0 but I've not yet been able to get x86_64-conda-linux-gnu-c++ to search it. I tried exporting LD_LIBRARY_PATH after some digging and passing -L during some small compilation tests without success.

I also encountered the same issue after linking cc1plus. @nkuehnle have you come to a solution?

@nkuehnle
Copy link

I found that linking cc1plus to my conda env's bin/ worked to resolve the cc1plus error:

ln -s $CONDA_PREFIX/libexec/gcc/x86_64-conda-linux-gnu/13.2.0/cc1plus $CONDA_PREFIX/bin/

I now get

x86_64-conda-linux-gnu-c++: fatal error: '-fuse-linker-plugin', but liblto_plugin.so not found
compilation terminated.

which is also in $CONDA_PREFIX/libexec/gcc/x86_64-conda-linux-gnu/13.2.0 but I've not yet been able to get x86_64-conda-linux-gnu-c++ to search it. I tried exporting LD_LIBRARY_PATH after some digging and passing -L during some small compilation tests without success.

I also encountered the same issue after linking cc1plus. @nkuehnle have you come to a solution?

My solution was independent of conda and may not be generalized elsewhere or to all systems (but I only needed it to build reproducibly within the context of two local HPC environs/user spaces and a Docker container where I can control a lot of behaviors). In my case I got this to work by setting the path to a system installation of GCC using the ~/.R/Makevars file. In the event the user has their own I had a bash script that wraps the conda install which makes a copy of the old Makevars file and overwrite and restores it at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale::recovered [bot] recovered after being marked as stale
Projects
Status: 🆕 New
Development

No branches or pull requests

8 participants