conda-forge / compilers-feedstock

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

configure returns "error: C compiler cannot create executables" for x86_64-apple-darwin13.4.0-clang #11

Closed joseph-long closed 4 years ago

joseph-long commented 5 years ago

I'm trying to package a cantankerous old C library (libnova) for macOS and Linux. When I conda build meta.yaml I get to ./configure in my build.sh and then see

checking for gcc... x86_64-apple-darwin13.4.0-clang
checking whether the C compiler works... no
configure: error: in `/Users/jlong/miniconda3/conda-bld/libnova_1565153615378/work':
configure: error: C compiler cannot create executables

the underlying error from config.log appears to be

ld: warning: directory not found for option '-L/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib'
ld: library not found for -lSystem
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation

meta.yaml

# Note: there are many handy hints in comments in this example -- remove them when you've finalized your recipe

# Jinja variables help maintain the recipe as you'll update the version only here.
# Using the name variable with the URL in line 14 is convenient
# when copying and pasting from another recipe, but not really needed.
{% set name = "libnova" %}
{% set version = "0.16" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  # for reasons unknown, the maintainers never published the 0.16 release on their SourceForge
  # however, distributions picked it up anyway. see https://packages.debian.org/buster/libnova-dev
  url: http://deb.debian.org/debian/pool/main/libn/libnova/libnova_{{version}}.orig.tar.xz
  sha256: 5dea5b29cba777ab8de4fd30cdfdbc1728fe1b3c573902270c1106bad55439a2

build:
  number: 0

requirements:
  build:
    # If your project compiles code (such as a C extension) then add the required compilers as separate entries here.
    # Compilers are named 'c', 'cxx' and 'fortran'.
    - autoconf
    - automake
    - libtool
    - {{ compiler('c') }}

about:
  home: http://libnova.sourceforge.net/
  license: LGPL-2.1
  license_file: COPYING
  summary: 'Celestial Mechanics, Astrometry and Astrodynamics Library'

  # The remaining entries in this section are optional, but recommended.
  description: |
    libnova is a general purpose, double precision, Celestial Mechanics,
    Astrometry and Astrodynamics library. The intended audience of libnova is
    C / C++ programmers, astronomers and anyone else interested in
    calculating positions of astronomical objects or celestial mechanics.
    libnova is the calculation engine used by the Nova project and most
    importantly, is free software.

extra:
  recipe-maintainers:
    - joseph-long

build.sh

./autogen.sh
./configure --prefix=$PREFIX
make
make install
config.log excerpt
configure:3582: checking whether the C compiler works
configure:3604: x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/include -fdebug-prefix-map=/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/work=/usr/local/src/conda/libnova-0.16 -fdebug-prefix-map=/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl=/usr/local/src/conda-prefix -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib -L/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib conftest.c  >&5
ld: warning: directory not found for option '-L/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib'
ld: library not found for -lSystem
clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3608: $? = 1
configure:3646: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libnova"
| #define PACKAGE_TARNAME "libnova"
| #define PACKAGE_VERSION "UNKNOWN"
| #define PACKAGE_STRING "libnova UNKNOWN"
| #define PACKAGE_BUGREPORT "lgirdwood (at) gmail (dot) com"
| #define PACKAGE_URL ""
| #define PACKAGE "libnova"
| #define VERSION "UNKNOWN"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3651: error: in `/Users/jlong/miniconda3/conda-bld/libnova_1565153137317/work':
configure:3653: error: C compiler cannot create executables
See `config.log' for more details


Environment (conda list):

``` $ conda list # packages in environment at /Users/jlong/miniconda3: # # Name Version Build Channel aiofiles 0.4.0 pypi_0 pypi aiohttp 3.5.4 pypi_0 pypi alabaster 0.7.12 py37_0 aotools 0.5 pypi_0 pypi appnope 0.1.0 py37_1000 conda-forge asn1crypto 0.24.0 py37_0 astroid 2.1.0 pypi_0 pypi astropy 3.2.1 py37h1de35cc_0 async-timeout 3.0.1 pypi_0 pypi atomicwrites 1.3.0 py37_1 attrs 19.1.0 py37_1 autoconf 2.69 pl526he370928_5 automake 1.16.1 pl526_0 autopep8 1.4.3 pypi_0 pypi babel 2.6.0 py37_0 backcall 0.1.0 py37_0 beautifulsoup4 4.7.1 py37_1 blas 1.0 mkl bleach 3.1.0 py37_0 blinker 1.4 pypi_0 pypi blosc 1.15.1 h0a44026_1002 conda-forge breathe 4.13.0.post0 pypi_0 pypi bzip2 1.0.6 h1de35cc_1002 conda-forge ca-certificates 2019.5.15 0 certifi 2019.6.16 py37_1 cffi 1.12.3 py37hb5b8e2f_0 chardet 3.0.4 py37_1 click 7.0 pypi_0 pypi cloudpickle 1.0.0 py_0 commonmark 0.9.0 pypi_0 pypi conda 4.7.10 py37_0 conda-build 3.18.9 py37_0 conda-env 2.6.0 1 conda-package-handling 1.3.10 py37_0 cryptography 2.6.1 py37ha12b0ac_0 cycler 0.10.0 py_1 conda-forge cython 0.29.7 py37h0a44026_0 cytoolz 0.9.0.1 py37h470a237_1 conda-forge dask-core 1.2.2 py_0 decorator 4.4.0 py37_1 defusedxml 0.6.0 py_0 dnspython 1.16.0 pypi_0 pypi doc8 0.8.0 pypi_0 pypi docutils 0.14 py37_0 doodads 0.0.1.dev0 dev_0 ds9 8.0.1 0 http://ssb.stsci.edu/astroconda entrypoints 0.3 py37_1000 conda-forge eventlet 0.25.0 pypi_0 pypi feedgenerator 1.9 pypi_0 pypi ffmpeg 4.1 heb45b42_1000 conda-forge filelock 3.0.12 py_0 flask 1.1.1 pypi_0 pypi flask-socketio 4.2.1 pypi_0 pypi freetype 2.9.1 h5a5313f_1004 conda-forge future 0.17.1 pypi_0 pypi gettext 0.19.8.1 hcca000d_1001 conda-forge glob2 0.7 py_0 gmp 6.1.2 h0a44026_1000 conda-forge gnutls 3.6.5 h53004b3_1001 conda-forge greenlet 0.4.15 pypi_0 pypi h11 0.8.1 pypi_0 pypi h2 3.1.1 pypi_0 pypi h5py 2.9.0 pypi_0 pypi hdf5 1.10.4 nompi_h646315f_1105 conda-forge hpack 3.0.0 pypi_0 pypi httpcore 0.3.0 pypi_0 pypi httptools 0.0.13 pypi_0 pypi hyperframe 5.2.0 pypi_0 pypi icu 58.2 h4b95b61_1 idna 2.8 py37_0 imageio 2.5.0 py37_0 imagesize 1.1.0 py37_0 intel-openmp 2019.3 199 ipykernel 5.1.0 py37h24bf2e0_1001 conda-forge ipython 7.5.0 py37h39e3cac_0 ipython_genutils 0.2.0 py_1 conda-forge isort 4.3.4 pypi_0 pypi itsdangerous 1.1.0 pypi_0 pypi jedi 0.13.3 py37_0 jinja2 2.10.1 py37_0 joblib 0.13.2 py37_0 jpeg 9c h1de35cc_1001 conda-forge jplephem 2.9 pypi_0 pypi jsonschema 3.0.1 py37_0 jupyter_client 5.2.4 py37_0 jupyter_core 4.4.0 py37_0 jupyterlab 0.35.5 py37hf63ae98_0 jupyterlab_server 0.2.0 py37_0 kiwisolver 1.1.0 py37h0a44026_0 lazy-object-proxy 1.3.1 pypi_0 pypi libarchive 3.3.3 h786848e_5 libcxx 4.0.1 hcfea43d_1 libcxxabi 4.0.1 hcfea43d_1 libedit 3.1.20181209 hb402a30_0 libffi 3.2.1 h475c297_4 libgfortran 3.0.1 h93005f0_2 libiconv 1.15 h1de35cc_1004 conda-forge liblief 0.9.0 h2a1bed3_2 libpng 1.6.37 ha441bb4_0 libsodium 1.0.16 h1de35cc_1001 conda-forge libtiff 4.0.10 h79f4b77_1001 conda-forge libtool 2.4.6 h1de35cc_5 libxml2 2.9.9 hab757c2_0 llvm-openmp 4.0.1 hcfea43d_1 lz4-c 1.8.1.2 h1de35cc_0 lzo 2.10 h362108e_2 m4 1.4.18 h1de35cc_1 markdown 3.1.1 pypi_0 pypi markupsafe 1.1.1 py37h1de35cc_0 matplotlib 3.1.0 py37h54f8f79_0 mccabe 0.6.1 pypi_0 pypi mistune 0.8.4 py37h1de35cc_1000 conda-forge mkl 2019.3 199 mkl_fft 1.0.12 py37h5e564d8_0 mkl_random 1.0.2 py37h27c97d8_0 monotonic 1.5 pypi_0 pypi more-itertools 7.0.0 py37_0 multidict 4.5.2 pypi_0 pypi nbconvert 5.5.0 py_0 nbformat 4.4.0 py_1 conda-forge ncurses 6.1 h0a44026_1 netifaces 0.10.9 pypi_0 pypi nettle 3.4.1 h1de35cc_1002 conda-forge networkx 2.3 py_0 notebook 5.7.8 py37_0 numpy 1.16.4 py37hacdab7b_0 numpy-base 1.16.4 py37h6575580_0 olefile 0.46 py37_0 openblas 0.3.3 hdc02c5d_1001 conda-forge openh264 1.8.0 hd9629dc_1000 conda-forge openssl 1.1.1c h1de35cc_1 packaging 19.0 py37_0 pandoc 2.5 0 conda-forge pandocfilters 1.4.2 py_1 conda-forge parso 0.4.0 py_0 pbr 5.2.1 pypi_0 pypi pelican 4.0.1 pypi_0 pypi perl 5.26.2 h4e221da_0 pexpect 4.7.0 py37_0 photutils 0.6 py37_0 http://ssb.stsci.edu/astroconda pickleshare 0.7.5 py37_1000 conda-forge pillow 6.0.0 py37hb68e598_0 pip 19.1.1 py37_0 pkginfo 1.5.0.1 py37_0 pluggy 0.11.0 py_0 poppy 0.8.1.dev1327 dev_0 prometheus_client 0.6.0 py37_0 prompt_toolkit 2.0.9 py37_0 psutil 5.6.2 py37h1de35cc_0 ptyprocess 0.6.0 py37_1000 conda-forge py 1.8.0 py37_0 py-lief 0.9.0 py37h1413db1_2 pycodestyle 2.5.0 pypi_0 pypi pycosat 0.6.3 py37h1de35cc_0 pycparser 2.19 py37_0 pydicom 1.2.2 pypi_0 pypi pygame 1.9.4 pypi_0 pypi pygments 2.4.0 py_0 pyklip 1.1 dev_0 pylint 2.2.2 pypi_0 pypi pyopenssl 19.0.0 py37_0 pyparsing 2.4.0 py_0 pyrsistent 0.14.11 py37h1de35cc_0 pysocks 1.7.0 py37_0 pytest 4.5.0 py37_0 pytest-arraydiff 0.3 py37h39e3cac_0 pytest-astropy 0.5.0 py37_0 pytest-asyncio 0.10.0 pypi_0 pypi pytest-doctestplus 0.3.0 py37_0 pytest-openfiles 0.3.2 py37_0 pytest-remotedata 0.3.1 py37_0 python 3.7.3 h359304d_0 python-dateutil 2.8.0 py37_0 python-engineio 3.9.3 pypi_0 pypi python-libarchive-c 2.8 py37_6 python-socketio 4.3.1 pypi_0 pypi python.app 2 py37_9 pytz 2019.1 py_0 pywavelets 1.0.3 py37h1d22016_1 pyyaml 3.13 pypi_0 pypi pyzmq 18.0.0 py37h0a44026_0 readline 7.0 h1de35cc_5 recommonmark 0.5.0 pypi_0 pypi requests 2.21.0 py37_0 requests-async 0.5.0 pypi_0 pypi restructuredtext-lint 1.3.0 pypi_0 pypi rfc3986 1.3.2 pypi_0 pypi rope 0.12.0 pypi_0 pypi ruamel_yaml 0.15.46 py37h1de35cc_0 sanic 19.6.2 pypi_0 pypi scikit-image 0.15.0 py37h0a44026_0 scikit-learn 0.20.3 py37h27c97d8_0 scipy 1.2.1 py37h1410ff5_0 send2trash 1.5.0 py37_0 setuptools 41.0.1 py37_0 sgp4 1.4 pypi_0 pypi shortuuid 0.5.0 pypi_0 pypi six 1.12.0 py37_0 skyfield 1.11 pypi_0 pypi slackclient 2.1.0 pypi_0 pypi sly 0.3 pypi_0 pypi smartypants 2.0.1 pypi_0 pypi snowballstemmer 1.2.1 py37_0 soupsieve 1.9.2 py37_0 sphinx 2.1.0 py_0 sphinx-rtd-theme 0.4.3 pypi_0 pypi sphinxcontrib-applehelp 1.0.1 py_0 sphinxcontrib-devhelp 1.0.1 py_0 sphinxcontrib-htmlhelp 1.0.2 py_0 sphinxcontrib-jsmath 1.0.1 py_0 sphinxcontrib-qthelp 1.0.2 py_0 sphinxcontrib-serializinghtml 1.1.3 py_0 sqlite 3.28.0 ha441bb4_0 sshuttle 0.78.5 pypi_0 pypi stevedore 1.30.1 pypi_0 pypi sup 0.1.0 dev_0 terminado 0.8.2 py37_0 testpath 0.4.2 py37_1000 conda-forge tk 8.6.8 ha441bb4_0 toml 0.10.0 pypi_0 pypi toolz 0.9.0 py_1 conda-forge tornado 6.0.2 py37h1de35cc_0 tqdm 4.32.1 py_0 traitlets 4.3.2 py37_1000 conda-forge typogrify 2.0.7 pypi_0 pypi ujson 1.35 pypi_0 pypi unidecode 1.1.1 pypi_0 pypi urllib3 1.24.2 py37_0 uvloop 0.12.2 pypi_0 pypi vizzy 0.1.0 dev_0 wcwidth 0.1.7 py_1 conda-forge webencodings 0.5.1 py_1 conda-forge websockets 6.0 pypi_0 pypi werkzeug 0.15.5 pypi_0 pypi wheel 0.33.4 py37_0 wrapt 1.11.1 pypi_0 pypi x264 1!152.20180717 h1de35cc_1001 conda-forge xz 5.2.4 h1de35cc_4 yaml 0.1.7 hc338f04_2 yarl 1.3.0 pypi_0 pypi zeromq 4.3.1 h0a44026_3 zlib 1.2.11 h1de35cc_3 zstd 1.3.7 h5bba6e5_0 ```


Details about conda and system ( conda info ):

``` $ conda info active environment : base active env location : /Users/jlong/miniconda3 shell level : 1 user config file : /Users/jlong/.condarc populated config files : /Users/jlong/.condarc conda version : 4.7.10 conda-build version : 3.18.9 python version : 3.7.3.final.0 virtual packages : base environment : /Users/jlong/miniconda3 (writable) channel URLs : http://ssb.stsci.edu/astroconda/osx-64 http://ssb.stsci.edu/astroconda/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 : /Users/jlong/miniconda3/pkgs /Users/jlong/.conda/pkgs envs directories : /Users/jlong/miniconda3/envs /Users/jlong/.conda/envs platform : osx-64 user-agent : conda/4.7.10 requests/2.21.0 CPython/3.7.3 Darwin/18.7.0 OSX/10.14.6 UID:GID : 501:20 netrc file : None offline mode : False ```
joseph-long commented 5 years ago

It appears that you may need a full Xcode install to run conda-build (not just the command line tools), but I don't currently have the disk space to check this theory. The same recipe appears to build for Linux, at any rate.

chrisburr commented 5 years ago

I think you only need the 10.9 SDK (~40MB) and the appropriate conda_build_config.yaml in your home directory as described here: https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html#macos-sdk

isuruf commented 4 years ago

This was fixed sometime ago