RSpectra icon indicating copy to clipboard operation
RSpectra copied to clipboard

Installation error on Ubuntu 18.04

Open chuk-yong opened this issue 7 years ago • 5 comments

Hi! Was trying to install Quanteda and it complain that RSpectra is needed. When trying to install, these errors popped up: `../inst/include/RMatOp/RealShift_matrix.h:31:60: required from here /usr/lib/R/site-library/RcppEigen/include/Eigen/src/Core/CoreEvaluators.h:960:8: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type {aka __vector(2) double}’ [-Wignored-attributes] g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RSpectra.so eigs_gen.o eigs_sym.o matops.o register_routines.o svds.o -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR /usr/bin/x86_64-linux-gnu-ld: cannot find -lgfortran collect2: error: ld returned 1 exit status /usr/share/R/share/make/shlib.mk:6: recipe for target 'RSpectra.so' failed make: *** [RSpectra.so] Error 1 ERROR: compilation failed for package ‘RSpectra’

  • removing ‘/home/chubuntu/R/x86_64-pc-linux-gnu-library/3.4/RSpectra’ Warning in install.packages : installation of package ‘RSpectra’ had non-zero exit status

The downloaded source packages are in ‘/tmp/RtmpI1Gl2k/downloaded_packages’`

May I know how to resolve this?

chuk-yong avatar Oct 18 '18 23:10 chuk-yong

As the error message indicates, you need to install the gfortran library.

yixuan avatar Oct 19 '18 00:10 yixuan

I already had gfortran installed: gfortran is already the newest version (4:7.3.0-3ubuntu2.1)

the error message: /usr/bin/x86_64-linux-gnu-ld: cannot find -lgfortran

but /usr/bin/x86_64-linux-gnu-ld is not a directory. So what is the package looking for?

chuk-yong avatar Oct 19 '18 15:10 chuk-yong

Including the development files? You need something like libgfortran-7-dev in Ubuntu.

yixuan avatar Oct 19 '18 16:10 yixuan

yep...got that too.

libgfortran-7-dev is already the newest version (7.3.0-27ubuntu1~18.04). libgfortran-7-dev set to manually installed. The following packages were automatically install

chuk-yong avatar Oct 21 '18 12:10 chuk-yong

Then I really have no clue. Seems like a system setting problem. The only workaround I can think of is to manually add your libgfortran path to the Makevars file:

PKG_LIBS = -L/path/to/libgfortran $(BLAS_LIBS) $(FLIBS)

yixuan avatar Oct 25 '18 10:10 yixuan