njtierney / naniar

Tidy data structures, summaries, and visualisations for missing data
http://naniar.njtierney.com/
Other
650 stars 54 forks source link

Unable to install because of `norm` package #294

Closed jpark-ehc closed 1 year ago

jpark-ehc commented 2 years ago

Naniar has norm as an import and I'm unable to install the source. Now, I can install gfortran, it's not a big deal. I wanted to write up this issue since I couldn't find anything in the norm documentation about gfortran or in this package readme. It may be worth considering changing norm from import to suggests but I'm not sure if that's possible without breaking something. Looking at the norm package, it was last published in 2013.

install.packages("naniar")

===== Output ====

Installing package into ‘/home/joshuapark/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependency ‘norm’

trying URL 'https://cloud.r-project.org/src/contrib/norm_1.0-9.5.tar.gz'
Content type 'application/x-gzip' length 18173 bytes (17 KB)
==================================================
downloaded 17 KB

trying URL 'https://cloud.r-project.org/src/contrib/naniar_0.6.1.tar.gz'
Content type 'application/x-gzip' length 2781177 bytes (2.7 MB)
==================================================
downloaded 2.7 MB

* installing *source* package ‘norm’ ...
** package ‘norm’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -ffile-prefix-map=/build/r-base-crNhFx/r-base-4.1.2=. -flto=auto -ffat-lto-objects -fstack-protector-strong  -c norm.f -o norm.o
/bin/bash: line 1: gfortran: command not found
make: *** [/usr/lib/R/etc/Makeconf:191: norm.o] Error 127
ERROR: compilation failed for package ‘norm’
* removing ‘/home/joshuapark/R/x86_64-pc-linux-gnu-library/4.1/norm’
ERROR: dependency ‘norm’ is not available for package ‘naniar’
* removing ‘/home/joshuapark/R/x86_64-pc-linux-gnu-library/4.1/naniar’
njtierney commented 2 years ago

Hi @jpark-ehc !

Thanks for posting this issue

We need the norm package for the mcar_test function.

One solution could be to move norm to Suggests and then suggest it is installed when using the software, but I would prefer to avoid that if I could.

Can I ask what operating system you are using, and if you have encountered this with other packages that require Fortran?

jpark-ehc commented 2 years ago

I'm using Ubuntu Linux on Pop-Os

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 21.10

My solution to this issue was to run sudo apt-get install r-base-dev. This installs the correct version of gfortran so that I could install norm. Attempts to just install gfortran with sudo apt-get install gfortran-$version didn't seem to work.

I haven't had any other issues with this before because I don't believe I've had to install or use any packages that required fortran.

njtierney commented 1 year ago

Thanks for documenting this, I'm not sure if there's much I can do on my end here with norm and implementing the functions from that package locally would be out of scope for the time being