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

mac gfortran needs and cannot find cc1 #112

Open
minrk opened this issue Dec 20, 2018 · 5 comments
Open

mac gfortran needs and cannot find cc1 #112

minrk opened this issue Dec 20, 2018 · 5 comments

Comments

@minrk
Copy link

minrk commented Dec 20, 2018

CMake runs:

$FC --help -v

to determine certain flag support (-isysroot came up in conda-forge/netcdf-fortran-feedstock#28). However, running this with the conda gfortran on mac fails with:

cc1 -quiet -v ...
x86_64-apple-darwin13.4.0-gfortran: error trying to exec 'cc1': execvp: No such file or directory

causing cmake to misconfigure the gfortran compiler (omitting -isysroot in the above case).

Googling around suggests that this command should succeed, which it does on linux:

$ x86_64-conda_cos6-linux-gnu-gcc -print-prog-name=cc1
/opt/conda/bin/../libexec/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/cc1

but on mac, it doesn't find cc1:

$ x86_64-apple-darwin13.4.0-gfortran -print-prog-name=cc1
cc1

I'm not sure if there's a missing file, dependency, patch, or environment variable needed for finding cc1, but something appears to be missing.

@minrk
Copy link
Author

minrk commented Dec 20, 2018

seems like maybe gfortran_osx-64 should depend on gcc_osx-64 (or impl), but gcc doesn't appear to be packaged for mac.

@mingwandroid
Copy link
Contributor

Yeah, probably.

PRs welcome, gfortran is basically the same on conda-forge as it is on defaults. If you make a PR there then I will rebase on top of that.

Otherwise you'll need to add {{ compiler('c') }} as a work-around.

Cheers!

@jaimergp
Copy link

jaimergp commented Jan 8, 2020

Hey @minrk, did you get to solve this problem? I am seeing this exact situation in conda-forge/ambertools-feedstock#16 for MacOS, even with the C compiler in the requirements. Any suggestions or workarounds? Thanks!

@minrk
Copy link
Author

minrk commented Jan 9, 2020

The workaround for netcdf was to explicitly add sysroot:

if [[ $(uname) == Darwin ]]; then
  export FFLAGS="-isysroot $CONDA_BUILD_SYSROOT $FFLAGS"
fi

@jaimergp
Copy link

jaimergp commented Jan 9, 2020

Thanks for your answer! Yes, I have that line present too, but doesn't seem to have much on an effect :/

I guess there's something wrong with the upstream package itself.

Thanks again for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants