Bioconductor / Rhtslib

HTSlib high-throughput sequencing library as an R package
https://bioconductor.org/packages/Rhtslib
11 stars 11 forks source link

Force a compiler to use ~/.R/Makevars rather than r/3.6.2/lib/R/etc/Makeconf #15

Closed akhst7 closed 4 years ago

akhst7 commented 4 years ago

Trying to install the latest Rhtslib 1.7 but it fails. A following is an excerpt of the installer output;

Loading required package: usethis
Bioconductor version 3.10 (BiocManager 1.30.10), ?BiocManager::install for help

Attaching package: ‘BiocManager’

The following object is masked from ‘package:devtools’:

    install

Loading required package: magrittr

All my packages loaded Fri Jan  3 19:47:45 2020* installing *source* package ‘Rhtslib’ ...
** using non-staged installation via StagedInstall field
** libs
cd "htslib-1.7" && make -f "/usr/local/Cellar/r/3.6.2/lib/R/etc/Makeconf" -f "Makefile.Rhtslib"
Makefile.Rhtslib:128: warning: overriding commands for target `.c.o'
/usr/local/Cellar/r/3.6.2/lib/R/etc/Makeconf:168: warning: ignoring old commands for target `.c.o'
clang -g -O2  -fpic -I. -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -D_FILE_OFFSET_BITS=64 -c -o kfunc.o kfunc.c
In file included from kfunc.c:30:
/usr/local/include/stdlib.h:131:19: error: expected function body after function declarator
void     abort(void) __cold __dead2;
                     ^
/usr/local/include/stdlib.h:134:25: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
double   atof(const char *);

I think the issue is clang is not using the correct arguments for OSX Catalina which I have it in ~/.R/Makevars but for some reasons, the complier does not see Makevars. Is there any way to let the complier point to the Makevars instead of Makeconf ?

My system info;

sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.2
BuildVersion:   19C57

gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/9.2.0_3/libexec/gcc/x86_64-apple-darwin19/9.2.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: ../configure --build=x86_64-apple-darwin19 --prefix=/usr/local/Cellar/gcc/9.2.0_3 --libdir=/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-9 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 9.2.0_3' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
Thread model: posix
gcc version 9.2.0 (Homebrew GCC 9.2.0_3)

clang -v
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-apple-darwin19.2.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

 .R/Makevars
LLVM_LOC = /usr/local/opt/llvm
CC=$(LLVM_LOC)/bin/clang -fopenmp
CXX=$(LLVM_LOC)/bin/clang++ -fopenmp

CC=clang
CXX=clang++
CXX11=clang++

CFLAGS = -g -O3 -Wall -pipe -pedantic -Wno-nonnull -std=gnu99 -mtune=native -pipe
CXXFLAGS = -g -O3 -Wall -pipe -Wno-nonnull -pedantic -std=c++11 -mtune=native
CXX11FLAGS = -g -O3 -Wall -pipe -Wno-nonnull -pedantic -std=c++11 -mtune=native

LDFLAGS=-L/usr/local/opt/gettext/lib -L$(LLVM_LOC)/lib -Wl,-rpath,$(LLVM_LOC)/lib
CPPFLAGS=-I/usr/local/opt/gettext/include -I$(LLVM_LOC)/include
hpages commented 4 years ago

...the complier does not see Makevars. Is there any way to let the complier point to the Makevars instead of Makeconf?

Sorry but you can't point a compiler to a Makevars or Makeconf. That doesn't make sense.

So you know that the settings in /usr/local/Cellar/r/3.6.2/lib/R/etc/Makeconf are bad and you're trying to override them with your own settings? Doesn't that simply mean that your R installation is broken? Note that you could always try to repair it by fixing the settings in /usr/local/Cellar/r/3.6.2/lib/R/etc/Makeconf (why keep the current settings if you know they don't work) even though it would probably be more useful to understand why you ended up with a broken R installation in the first place.

In any case, that doesn't sound like an Rhtslib problem.

Also any reason why you didn't install R official binaries for Mac or the Rhtslilb Mac binary that is provided by Bioconductor? Rhtslib is a Bioconductor package and the standard way to install a Bioconductor package is with:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("Rhtslib")

On a Mac this will install the Mac binary.

hpages commented 4 years ago

See https://github.com/Bioconductor/Rhtslib/issues/14#issuecomment-547097988 for why you should use the "official R Mac binary".

hpages commented 4 years ago

No news = good news (I guess)