conda-forge / compilers-feedstock

A conda-smithy repository for compilers.
BSD 3-Clause "New" or "Revised" License
9 stars 17 forks source link

Headers are missing #53

Open dirkgr opened 1 year ago

dirkgr commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

On OSX:

> conda create -n broken-compilers -y
> conda activate broken-compilers
> conda install c-compiler compilers cxx-compiler -c conda-forge -y
> which clang
/opt/miniconda3/envs/broken-compilers/bin/clang
> echo << EOF > test.cpp
#include <iostream>

int main() {
  std::cout << "Hello, World!" << std::endl;
  return 0;
}
EOF
> clang test.cpp
In file included from test.cpp:1:
In file included from /opt/miniconda3/envs/vegas/bin/../include/c++/v1/iostream:37:
In file included from /opt/miniconda3/envs/vegas/bin/../include/c++/v1/ios:214:
In file included from /opt/miniconda3/envs/vegas/bin/../include/c++/v1/__locale:15:
In file included from /opt/miniconda3/envs/vegas/bin/../include/c++/v1/cctype:38:
/opt/miniconda3/envs/vegas/bin/../include/c++/v1/ctype.h:38:15: fatal error: 'ctype.h' file not found
#include_next <ctype.h>
              ^~~~~~~~~
1 error generated.

Installed packages

# packages in environment at /opt/miniconda3/envs/broken-compilers:
#
# Name                    Version                   Build  Channel
c-compiler                1.5.2                hbf74d83_0    conda-forge
ca-certificates           2022.12.7            h033912b_0    conda-forge
cctools                   973.0.1             h76f1dac_11    conda-forge
cctools_osx-64            973.0.1             hcc6d90d_11    conda-forge
clang                     14.0.6               h694c41f_0    conda-forge
clang-14                  14.0.6          default_h55ffa42_0    conda-forge
clang_osx-64              14.0.6               h3113cd8_4    conda-forge
clangxx                   14.0.6          default_h55ffa42_0    conda-forge
clangxx_osx-64            14.0.6               h6f97653_4    conda-forge
compiler-rt               14.0.6               h613da45_0    conda-forge
compiler-rt_osx-64        14.0.6               h8d5cb93_0
compilers                 1.5.2                h694c41f_0    conda-forge
cxx-compiler              1.5.2                hb8565cd_0    conda-forge
fortran-compiler          1.5.2                haad3a49_0    conda-forge
gfortran                  11.3.0               h2c809b3_0    conda-forge
gfortran_impl_osx-64      11.3.0              h1f927f5_27    conda-forge
gfortran_osx-64           11.3.0               h18f7dce_0    conda-forge
gmp                       6.2.1                h2e338ed_0    conda-forge
isl                       0.25                 hb486fe8_0    conda-forge
ld64                      609                 hc6ad406_11    conda-forge
ld64_osx-64               609                 hfd63004_11    conda-forge
libclang-cpp14            14.0.6          default_h55ffa42_0    conda-forge
libcxx                    14.0.6               hccf4f1f_0    conda-forge
libgfortran               5.0.0           11_3_0_h97931a8_27    conda-forge
libgfortran-devel_osx-64  11.3.0              h824d247_27    conda-forge
libgfortran5              11.3.0              h082f757_27    conda-forge
libiconv                  1.17                 hac89ed1_0    conda-forge
libllvm14                 14.0.6               h5b596cc_1    conda-forge
libzlib                   1.2.13               hfd90126_4    conda-forge
llvm-openmp               15.0.6               h61d9ccf_0    conda-forge
llvm-tools                14.0.6               h5b596cc_1    conda-forge
mpc                       1.2.1                hbb51d92_0    conda-forge
mpfr                      4.1.0                h0f52abe_1    conda-forge
openssl                   3.0.7                hfd90126_1    conda-forge
sigtool                   0.1.3                h88f4db0_0    conda-forge
tapi                      1100.0.11            h9ce4665_0    conda-forge
zlib                      1.2.13               hfd90126_4    conda-forge

Environment info

active environment : broken-compilers
    active env location : /opt/miniconda3/envs/broken-compilers
            shell level : 3
       user config file : /Users/dirkgr/.condarc
 populated config files :
          conda version : 22.11.1
    conda-build version : not installed
         python version : 3.8.3.final.0
       virtual packages : __archspec=1=x86_64
                          __osx=10.16=0
                          __unix=0=0
       base environment : /opt/miniconda3  (writable)
      conda av data dir : /opt/miniconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/miniconda3/pkgs
                          /Users/dirkgr/.conda/pkgs
       envs directories : /opt/miniconda3/envs
                          /Users/dirkgr/.conda/envs
               platform : osx-64
             user-agent : conda/22.11.1 requests/2.28.1 CPython/3.8.3 Darwin/21.6.0 OSX/10.16
                UID:GID : 501:20
             netrc file : /Users/dirkgr/.netrc
           offline mode : False
isuruf commented 1 year ago

First, use the C++ compiler clang++ instead of clang when compiling a C++ executable. This seems to be an issue with your xcode installation. Do you have xcode installed?

dirkgr commented 1 year ago

clang++ has the same result, and when I conda deactivate, it compiles just fine with the same clang++ test.cpp command.