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

gfortran --help -v is missing cc1 #11

Closed
jaimergp opened this issue Jan 8, 2020 · 7 comments · Fixed by conda-forge/gfortran_impl_osx-64-feedstock#47
Closed

gfortran --help -v is missing cc1 #11

jaimergp opened this issue Jan 8, 2020 · 7 comments · Fixed by conda-forge/gfortran_impl_osx-64-feedstock#47

Comments

@jaimergp
Copy link
Member

jaimergp commented Jan 8, 2020

Issue:

I am trying to build this recipe (conda-forge/ambertools-feedstock#16) using CMake and it's working perfectly in Linux (both 64 and PowerPC), but fails in OSX. The main problem is the same exact situation described in this other issue (AnacondaRecipes/aggregate#112). In other words, CMake fails to configure gfortran with -isysroot because $FC --help -v fails due to the missing cc1 binary (available in the Linux builds through gcc, I guess).

Are there any workarounds or suggestions to fix this behavior?

Thanks!


Environment (conda list):
$ conda list
    bc:                   1.07.1-h0b31af3_0          conda-forge
    bison:                3.4-h6de7cb9_1             conda-forge
    bzip2:                1.0.8-h0b31af3_2           conda-forge
    ca-certificates:      2019.11.28-hecc5488_0      conda-forge
    cctools:              921-h5ba7a2e_4             conda-forge
    clang:                9.0.1-default_hf57f61e_0   conda-forge
    clang_osx-64:         9.0.1-h05bbb7f_0           conda-forge
    clangxx:              9.0.1-default_hf57f61e_0   conda-forge
    clangxx_osx-64:       9.0.1-h05bbb7f_0           conda-forge
    cmake:                3.16.2-hd28f656_0          conda-forge
    compiler-rt:          9.0.1-h6a512c6_0           conda-forge
    compiler-rt_osx-64:   9.0.1-h6a512c6_0           conda-forge
    expat:                2.2.5-h4a8c4bd_1004        conda-forge
    flex:                 2.6.4-habec0da_1004        conda-forge
    gfortran_impl_osx-64: 7.3.0-hf4212f2_2           conda-forge
    gfortran_osx-64:      7.3.0-h22b1bf0_6           conda-forge
    gmp:                  6.1.2-h0a44026_1000        conda-forge
    isl:                  0.19-0                     conda-forge
    krb5:                 1.16.4-h1752a42_0          conda-forge
    ld64:                 409.12-h3c32e8a_4          conda-forge
    libcurl:              7.65.3-h16faf7d_0          conda-forge
    libcxx:               9.0.1-1                    conda-forge
    libedit:              3.1.20170329-hcfe32e1_1001 conda-forge
    libgfortran:          4.0.0-2                    conda-forge
    libiconv:             1.15-h01d97ff_1005         conda-forge
    libllvm9:             9.0.1-ha1b3eb9_0           conda-forge
    libssh2:              1.8.2-hcdc9a53_2           conda-forge
    libuv:                1.34.0-h0b31af3_0          conda-forge
    llvm-openmp:          9.0.1-h40edb58_0           conda-forge
    m4:                   1.4.18-h1de35cc_1001       conda-forge
    make:                 4.2.1-h1de35cc_2004        conda-forge
    mpc:                  1.1.0-h4160ff4_1006        conda-forge
    mpfr:                 4.0.2-h44b798e_0           conda-forge
    ncurses:              6.1-h0a44026_1002          conda-forge
    openssl:              1.1.1d-h0b31af3_0          conda-forge
    patch:                2.7.6-h1de35cc_1001        conda-forge
    perl:                 5.26.2-haec8ef5_1006       conda-forge
    rhash:                1.3.6-h1de35cc_1001        conda-forge
    tapi:                 1000.10.8-ha1b3eb9_4       conda-forge
    tcsh:                 6.22.02-hed1e85f_0         conda-forge
    tk:                   8.6.10-hbbe82c9_0          conda-forge
    xz:                   5.2.4-h1de35cc_1001        conda-forge
    zlib:                 1.2.11-h0b31af3_1006       conda-forge

Details about conda and system ( conda info ):
$ conda info
     active environment : base
    active env location : /usr/local/miniconda
            shell level : 1
       user config file : /Users/runner/.condarc
 populated config files : /Users/runner/.condarc
          conda version : 4.8.0
    conda-build version : 3.18.11
         python version : 3.7.4.final.0
       virtual packages : __osx=10.13.6
       base environment : /usr/local/miniconda  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          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 : /usr/local/miniconda/pkgs
                          /Users/runner/.conda/pkgs
       envs directories : /usr/local/miniconda/envs
                          /Users/runner/.conda/envs
               platform : osx-64
             user-agent : conda/4.8.0 requests/2.22.0 CPython/3.7.4 Darwin/17.7.0 OSX/10.13.6
                UID:GID : 501:20
             netrc file : None
           offline mode : False

==> /Users/runner/.condarc <==
add_pip_as_python_dependency: False
auto_update_conda: False
channels:
  - conda-forge
  - defaults
show_channel_urls: True


@chrisburr
Copy link
Member

A similar issue has showed up in conda-forge/staged-recipes#10569. There is a hack there which is hopefully enough to allow someone to fix this feedstock (sorry, too little time at the moment to do it myself).

Copying over a summary from conda-forge/staged-recipes#10569:

This can be reproduced using

x86_64-apple-darwin13.4.0-gfortran -E -dM - </dev/null

Looking at the verbose output it is trying to run:

cc1 -E -quiet -v -D__DYNAMIC__ - -fPIC -mmacosx-version-min=10.9 -mtune=generic -dM

The -quiet argument must also be removed from the arguments as this isn't supported by clang

@beckermr
Copy link
Member

We probably should patch the underlying build of gfortran, but this will take time to locate and fix I suspect.

@beckermr
Copy link
Member

@isuruf Any hints on where this should be patched? I am grepping the code but not finding much.

@ndevenish
Copy link

A similar issue has showed up in conda-forge/staged-recipes#10569. There is a hack there which is hopefully enough to allow someone to fix this feedstock (sorry, too little time at the moment to do it myself).

Unfortunately, it looks like the hack is "Drop support for OSX".

Anyone got any more ideas on this?

@jaimergp
Copy link
Member Author

My (I think still working) solution to this is:

  1. Create a cc1 wrapper in subdir of your recipe.
  2. Add that subdir to PATH in your build.sh for osx.

@ndevenish
Copy link

My (I think still working) solution to this is:

  1. Create a cc1 wrapper in subdir of your recipe.
  2. Add that subdir to PATH in your build.sh for osx.

Thanks, that seems a reasonable workaround

@beckermr
Copy link
Member

Thanks @jaimergp! I assume that somewhere in the gfortran source code or the configuration we pass to it the flags are set or computed. If we can find that location, we can patch the build or set our input flags correctly.

edoapra added a commit to ltalirz/nwchem-feedstock that referenced this issue May 19, 2021
ltalirz added a commit to conda-forge/nwchem-feedstock that referenced this issue May 19, 2021
* add macos build
* don't link librt (does not exist on macos)
* add link option to fix link problem using CFLAGS_FORGA
   workaround for conda-forge/gfortran_osx-64-feedstock#11 (comment)
* add patch to fix detection of gfortran version
* MNT: Re-rendered with conda-build 3.21.4, conda-smithy 3.10.1, and conda-forge-pinning 2021.05.18.06.34.34

Co-authored-by: conda-forge-linter <[email protected]>
Co-authored-by: Edoardo Aprà <[email protected]>
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

Successfully merging a pull request may close this issue.

4 participants