R包的编译错误

Compilation error of R package

我想编译 hsphase 包(R 包在 CRAN 中可用)。

我在 R install.packages("hsphase") 中使用了这个命令。

我遇到了以下错误:

g++ -m64 -shared -L/usr/lib64/R/lib -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o hsphase.so FastDist.o MAF.o Ohd.o TypeConversion.o block.o block4Phase.o co.o diag.o hsp.o main.o memory.o oh.o swDetect.o [1] 0 -L/usr/lib64/R/lib -lRlapack -L/usr/lib64/R/lib -lRblas -lgfortran -lm -lquadmath -fopenmp -L/usr/lib64/R/lib -lR
g++: error: [1]: No such file or directory
g++: error: 0: No such file or directory
/usr/share/R/make/shlib.mk:6: recipe for target 'hsphase.so' failed
make: *** [hsphase.so] Error 1
ERROR: compilation failed for package ‘hsphase’
* removing ‘/home/mhf/R/x86_64-redhat-linux-gnu-library/3.3/hsphase’

The downloaded source packages are in
    ‘/tmp/RtmpYukJQa/downloaded_packages’
Warning message:
In install.packages("hsphase") :
  installation of package ‘hsphase’ had non-zero exit status

我正在使用 fedora 24。

g++版本: gcc 版本 6.1.1 20160621 (Red Hat 6.1.1-3) (GCC)

请检查 link 标志: 这是什么: [1] 0

我在 scr/Makevars 文件中注释了这一行:

#PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(SHLIB_OPENMP_CXXFLAGS)

现在,我可以编译包了。