bioconda / bioconda-recipes

Conda recipes for the bioconda channel.
https://bioconda.github.io
MIT License
1.64k stars 3.26k forks source link

fortran lib error while compiling R package in circleci #8649

Closed pkrog closed 6 years ago

pkrog commented 6 years ago

I've been trying to add my biodb package (https://github.com/pkrog/biodb) in the recipes (branch r-biodb). But I'm stuck with a linking error involving a misplaced -lgfortran flag. While this flag is strange since my code is only C code and use Rcpp to build, it is also misplaced inside the call to the linker (gcc) since it is not put at the end of the end but before the .o files.

Here the error:

gcc -std=gnu99 -shared -L/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/lib -L/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib -lgfortran -o biodb.so closeMatchPpm.o registerDynamicSymbol.o -L/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/lib -lR
/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/ld: cannot find -lgfortran

And here is the complete log:


====>> Spin up Environment
Build-agent version 0.0.4854-e88050b (2018-04-12T14:14:54+0000)
Starting container bioconda/bioconda-utils-build-env
  using image bioconda/bioconda-utils-build-env@sha256:58e494025933b9eb01a77266009bfcd4a7f60ae37af552431f9bc331811ad78d

Using build environment variables:
  BASH_ENV=/tmp/.bash_env-localbuild-1523980959
  CI=true
  CIRCLECI=true
  CIRCLE_BRANCH=r-biodb
  CIRCLE_BUILD_NUM=
  CIRCLE_JOB=build
  CIRCLE_NODE_INDEX=0
  CIRCLE_NODE_TOTAL=1
  CIRCLE_REPOSITORY_URL=git@github.com:bioconda/bioconda-recipes
  CIRCLE_SHA1=3493e0cc01479ebfd7881e42d6a8e1218f8a4e24
  CIRCLE_SHELL_ENV=/tmp/.bash_env-localbuild-1523980959
  CIRCLE_WORKING_DIRECTORY=~/project

====>> Checkout code
  #!/bin/sh
mkdir -p /root/project && cp -r /tmp/_circleci_local_build_repo/. /root/project
====>> Setup ssh
  #!/bin/bash -eo pipefail
mkdir -p ~/.ssh
ssh-keyscan -H github.com >> ~/.ssh/known_hosts

# github.com SSH-2.0-libssh_0.7.0
====>> Setup base system
  #!/bin/bash -eo pipefail
cat >> $BASH_ENV <<EOF
if [[ \$- == *u* ]] ; then
    set +u ; . /tmp/repo/docker-entrypoint-source ; set -u
else
    . /tmp/repo/docker-entrypoint-source
fi
EOF

====>> Download common definitions
  #!/bin/bash -eo pipefail
curl -s https://raw.githubusercontent.com/bioconda/bioconda-common/master/common.sh > .circleci/common.sh
====>> Setup bioconda-utils
  #!/bin/bash -eo pipefail
.circleci/setup.sh
From https://github.com/bioconda/bioconda-recipes
 * [new branch]          master     -> __upstream__wtkbhzsmkv/master
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
====>> Linting
  #!/bin/bash -eo pipefail
bioconda-utils lint recipes config.yml --git-range master HEAD
16:03:58 BIOCONDA INFO Recipes newly unblacklisted:

16:03:58 BIOCONDA INFO Recipes to consider according to git: 
recipes/r-biodb
 recipes/r-biodb
16:03:58 BIOCONDA INFO Recipes to lint:
recipes/r-biodb
====>> Testing
  #!/bin/bash -eo pipefail
bioconda-utils build recipes config.yml --git-range master HEAD
16:04:00 BIOCONDA INFO Recipes newly unblacklisted:

16:04:00 BIOCONDA INFO Recipes modified according to git: r-biodb
16:04:00 BIOCONDA INFO blacklist: blast/2.2.21, breakdancer, cap-mirseq, cgat-scripts, dcmtk, denovogear, fermikit, frc, metaprob, mgkit, mothur/1.36.1, openslide, osra/2.1.0, perl-compress-raw-zlib, perl-font-afm, perl-io-compress, plastid, prosic, r-pscbs/0.61.0, rust-overlaps, samtools/1.1, shorah, slang, smalt, soapec, somatic-sniper, transcomb, transrate-tools, trinity/2.1.1
16:04:00 BIOCONDA INFO Filtering recipes

Filtering 1 of 1 (100.0%) recipes/r-biodb
16:04:05 BIOCONDA INFO Building and testing 1 recipes in total
16:04:05 BIOCONDA INFO Recipes to build: 
r-biodb
16:04:05 BIOCONDA INFO Building and testing subdag 1 of 1 (1 recipes)
16:04:05 BIOCONDA INFO BUILD START recipes/r-biodb, env: CONDA_ALLOW_SOFTLINKS=false;CONDA_BAMTOOLS=2.4.1;CONDA_BOOST=1.64;CONDA_BZIP2=1.0;CONDA_DEFAULT_ENV=root;CONDA_GMP=5.1;CONDA_GSL=1.16;CONDA_HDF5=1.8.17;CONDA_HTSLIB=1.7;CONDA_NCURSES=5.9;CONDA_NPY=112;CONDA_PATH_BACKUP=/opt/rh/devtoolset-2/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;CONDA_PERL=5.22.0;CONDA_PS1_BACKUP=;CONDA_PY=27;CONDA_R=3.4.1;CONDA_ROOT=/opt/conda;CONDA_XZ=5.2;CONDA_ZLIB=1.2.11;LANG=en_US.UTF-8;MACOSX_DEPLOYMENT_TARGET=10.9;PATH=/root/project/miniconda/bin:/opt/conda/bin:/opt/rh/devtoolset-2/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
.......16:10:16 BIOCONDA ERROR COMMAND FAILED: /opt/conda/bin/conda build --no-anaconda-upload --channel bioconda --channel conda-forge --channel defaults recipes/r-biodb/meta.yaml
16:10:16 BIOCONDA ERROR STDOUT+STDERR:
INFO:filelock:Lock 140666407257592 acquired on /opt/conda/locks/L29wdC9jb25kYS9wa2dz
INFO:filelock:Lock 140666407257536 acquired on /opt/conda/locks/L29wdC9jb25kYS9jb25k
INFO:filelock:Lock 140666407257592 released on /opt/conda/locks/L29wdC9jb25kYS9wa2dz
INFO:filelock:Lock 140666407257536 released on /opt/conda/locks/L29wdC9jb25kYS9jb25k
INFO:filelock:Lock 140666407257536 acquired on /opt/conda/locks/L29wdC9jb25kYS9jb25k
INFO:filelock:Lock 140666407257536 acquired on /opt/conda/locks/L29wdC9jb25kYS9jb25k
INFO:filelock:Lock 140666407257536 released on /opt/conda/locks/L29wdC9jb25kYS9jb25k
INFO:filelock:Lock 140666407257760 acquired on /opt/conda/locks/L29wdC9jb25kYS9jb25k
INFO:filelock:Lock 140666407257760 acquired on /opt/conda/locks/L29wdC9jb25kYS9jb25k
INFO:filelock:Lock 140666407257760 released on /opt/conda/locks/L29wdC9jb25kYS9jb25k
+ source /opt/conda/bin/activate /opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place
+ /opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/bin/R CMD INSTALL --build .
* installing to library ‘/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/library’
* installing *source* package ‘biodb’ ...
** libs
gcc -std=gnu99 -I/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/include -DNDEBUG  -I/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/include -I"/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/library/Rcpp/include"   -fpic  -I/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/include  -c closeMatchPpm.c -o closeMatchPpm.o
gcc -std=gnu99 -I/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/include -DNDEBUG  -I/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/include -I"/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/library/Rcpp/include"   -fpic  -I/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/include  -c registerDynamicSymbol.c -o registerDynamicSymbol.o
gcc -std=gnu99 -shared -L/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/lib -L/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib -lgfortran -o biodb.so closeMatchPpm.o registerDynamicSymbol.o -L/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/lib -lR
/opt/rh/devtoolset-2/root/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [biodb.so] Error 1
ERROR: compilation failed for package ‘biodb’
* removing ‘/opt/conda/conda-bld/r-biodb_1523981046542/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/lib/R/library/biodb’

WARNING: conda-build appears to be out of date. You have version 2.1.18 but the
latest version is 3.8.1. Run

conda update -n root conda-build

to get the latest version.

BUILD START: r-biodb-1.0.1-0
updating index in: /opt/conda/conda-bld/linux-64
updating index in: /opt/conda/conda-bld/noarch

The following NEW packages will be INSTALLED:

    bzip2:           1.0.6-1           conda-forge
    ca-certificates: 2018.4.16-0       conda-forge
    cairo:           1.14.6-4          conda-forge
    curl:            7.54.1-0          conda-forge
    fontconfig:      2.12.1-6          conda-forge
    freetype:        2.7-1             conda-forge
    gettext:         0.19.8.1-0        conda-forge
    glib:            2.51.4-0          conda-forge
    graphite2:       1.3.11-0          conda-forge
    gsl:             2.1-2             conda-forge
    harfbuzz:        1.4.3-0           conda-forge
    icu:             58.2-0            conda-forge
    jpeg:            9b-2              conda-forge
    krb5:            1.14.6-0          conda-forge
    libffi:          3.2.1-3           conda-forge
    libgcc:          7.2.0-h69d50b8_2  defaults   
    libgcc-ng:       7.2.0-hdf63c60_3  defaults   
    libiconv:        1.15-0            conda-forge
    libpng:          1.6.28-1          conda-forge
    libssh2:         1.8.0-1           conda-forge
    libstdcxx-ng:    7.2.0-hdf63c60_3  defaults   
    libtiff:         4.0.7-0           conda-forge
    libxml2:         2.9.5-0           conda-forge
    ncurses:         5.9-10            conda-forge
    openssl:         1.0.2o-0          conda-forge
    pango:           1.40.4-0          conda-forge
    pcre:            8.41-1            conda-forge
    pixman:          0.34.0-1          conda-forge
    r-base:          3.3.2-5           conda-forge
    r-bitops:        1.0_6-r3.3.2_0    conda-forge
    r-codetools:     0.2_15-r3.3.2_0   conda-forge
    r-curl:          3.2-r3.3.2_0      conda-forge
    r-devtools:      1.13.5-r3.3.2_0   conda-forge
    r-digest:        0.6.12-r3.3.2_0   bioconda   
    r-git2r:         0.19.0-r3.3.2_0   conda-forge
    r-glue:          1.2.0-r3.3.2_0    conda-forge
    r-httr:          1.3.1-r3.3.2_0    conda-forge
    r-jsonlite:      0.9.19-r3.3.2_1   bioconda   
    r-magrittr:      1.5-r3.3.2_0      conda-forge
    r-memoise:       1.1.0-r3.3.2_0    conda-forge
    r-mime:          0.5-r3.3.2_0      conda-forge
    r-openssl:       1.0.1-r3.3.2_0    conda-forge
    r-plyr:          1.8.4-r3.3.2_0    conda-forge
    r-r.methodss3:   1.7.0-r3.3.2_0    bioconda   
    r-r.oo:          1.19.0-r3.3.2_0   bioconda   
    r-r.utils:       2.2.0-r3.3.2_0    bioconda   
    r-r6:            2.2.2-r3.3.2_0    conda-forge
    r-rcpp:          0.12.15-r3.3.2_0  conda-forge
    r-rcurl:         1.95_4.8-r3.3.2_0 conda-forge
    r-rstudioapi:    0.7-r3.3.2_0      conda-forge
    r-stringi:       1.1.7-r3.3.2_0    conda-forge
    r-stringr:       1.3.0-r3.3.2_0    conda-forge
    r-whisker:       0.3_2-r3.3.2_0    conda-forge
    r-withr:         2.1.1-r3.3.2_0    conda-forge
    r-xml:           3.98_1.6-r3.3.2_0 conda-forge
    readline:        6.2-0             conda-forge
    tk:              8.5.19-2          conda-forge
    xz:              5.2.3-0           conda-forge
    zlib:            1.2.8-3           conda-forge

Source cache directory is: /opt/conda/conda-bld/src_cache
Downloading source to cache: cpp_build.tar.gz
Downloading https://github.com/pkrog/biodb/archive/hotfix/cpp_build.tar.gz
Success
Extracting download
Package: r-biodb-1.0.1-0
source tree in: /opt/conda/conda-bld/r-biodb_1523981046542/work/biodb-hotfix-cpp_build
Traceback (most recent call last):
  File "/opt/conda/bin/conda-build", line 6, in <module>
    sys.exit(conda_build.cli.main_build.main())
  File "/opt/conda/lib/python3.6/site-packages/conda_build/cli/main_build.py", line 342, in main
    execute(sys.argv[1:])
  File "/opt/conda/lib/python3.6/site-packages/conda_build/cli/main_build.py", line 333, in execute
    noverify=args.no_verify)
  File "/opt/conda/lib/python3.6/site-packages/conda_build/api.py", line 97, in build
    need_source_download=need_source_download, config=config)
  File "/opt/conda/lib/python3.6/site-packages/conda_build/build.py", line 1524, in build_tree
    config=config)
  File "/opt/conda/lib/python3.6/site-packages/conda_build/build.py", line 1147, in build
    utils.check_call_env(cmd, env=env, cwd=src_dir)
  File "/opt/conda/lib/python3.6/site-packages/conda_build/utils.py", line 628, in check_call_env
    return _func_defaulting_env_to_os_environ(subprocess.check_call, *popenargs, **kwargs)
  File "/opt/conda/lib/python3.6/site-packages/conda_build/utils.py", line 624, in _func_defaulting_env_to_os_environ
    return func(_args, **kwargs)
  File "/opt/conda/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/bash', '-x', '-e', '/opt/conda/conda-bld/r-biodb_1523981046542/work/biodb-hotfix-cpp_build/conda_build.sh']' returned non-zero exit status 1.

16:11:05 BIOCONDA ERROR BUILD FAILED recipes/r-biodb, CONDA_ALLOW_SOFTLINKS=false;CONDA_BAMTOOLS=2.4.1;CONDA_BOOST=1.64;CONDA_BZIP2=1.0;CONDA_DEFAULT_ENV=root;CONDA_GMP=5.1;CONDA_GSL=1.16;CONDA_HDF5=1.8.17;CONDA_HTSLIB=1.7;CONDA_NCURSES=5.9;CONDA_NPY=112;CONDA_PATH_BACKUP=/opt/rh/devtoolset-2/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin;CONDA_PERL=5.22.0;CONDA_PS1_BACKUP=;CONDA_PY=27;CONDA_R=3.4.1;CONDA_ROOT=/opt/conda;CONDA_XZ=5.2;CONDA_ZLIB=1.2.11;LANG=en_US.UTF-8;MACOSX_DEPLOYMENT_TARGET=10.9;PATH=/root/project/miniconda/bin:/opt/conda/bin:/opt/rh/devtoolset-2/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
16:11:07 BIOCONDA ERROR BUILD SUMMARY: of 1 recipes, 1 failed and 0 were skipped. Details of recipes and environments follow.
16:11:07 BIOCONDA ERROR BUILD SUMMARY: FAILED recipe r-biodb-1.0.1-0.tar.bz2, environment CONDA_PY=27;CONDA_HTSLIB=1.7;CONDA_BOOST=1.64;CONDA_R=3.4.1;CONDA_PERL=5.22.0;CONDA_NPY=112;CONDA_NCURSES=5.9;CONDA_GSL=1.16;CONDA_GMP=5.1;CONDA_HDF5=1.8.17;MACOSX_DEPLOYMENT_TARGET=10.9;CONDA_ZLIB=1.2.11;CONDA_BZIP2=1.0;CONDA_XZ=5.2;CONDA_BAMTOOLS=2.4.1
Error: Exited with code 1
Step failed
Task failed
pkrog commented 6 years ago

Please, does anyone has an idea about what is happening?

pkrog commented 6 years ago

My package does not use fortran and compiles perfectly on macOS, Ubuntu and CentOS.

epruesse commented 6 years ago

@pkrog Can you open a PR for your recipe? Helping with errors is easier when we have the recipe and the build logs from the CI to look at directly.

pkrog commented 6 years ago

Thank you for your answer. Yes, I'll do that asap.

epruesse commented 6 years ago

@bioconda/review Do we have a policy to prefix R packages with r- as in r-biodb?

epruesse commented 6 years ago

Ah, nevermind, I see the package is already called r-biodb. Great. I thought that'd be more informative.

epruesse commented 6 years ago

@pkrog On the PR, please ping @bioconda/r for help. This looks like an Rcpp issue to me.

pkrog commented 6 years ago

See PR #8687.

pkrog commented 6 years ago

Error solved by adding gcc as build requirement.