IQSS / Amelia

Amelia: A Package for Missing Data

Home Page:http://gking.harvard.edu/amelia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install Amelia due to compilation error

dsorato opened this issue · comments

Hello,
I cannot install Amelia in my R environment due to a compilation error:

/usr/bin/ld: cannot find -lgfortran

g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o Amelia.so em.o init.o -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
/usr/share/R/share/make/shlib.mk:10: recipe for target 'Amelia.so' failed
make: *** [Amelia.so] Error 1
ERROR: compilation failed for package ‘Amelia’
* removing ‘/home/user/R/x86_64-pc-linux-gnu-library/4.0/Amelia’

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

Altough I do have gcc, g++, and gfortran (all version 7.5.0) installed in my computer, the compilation process still fails.

among other things, the lgfortran wasn't correctly linked (which I was able to solve with sudo ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.5 /usr/lib/libgfortran.so)

I reinstalled both my R and C++ environments and I was able to install Amelia successfully, so the issue was clearly my environment.