rivas-lab / snpnet

snpnet - Efficient Lasso Solver for Large-scale genetic variant data
18 stars 3 forks source link

Installation error: Bad CPU type in executable #3

Closed garyzhubc closed 3 years ago

garyzhubc commented 3 years ago

When I was trying to install glmnetPlus on latest Mac OS this error showed up so that installation cannot complete.

> install_github("junyangq/glmnetPlus")
Downloading GitHub repo junyangq/glmnetPlus@HEAD
✓  checking for file ‘/private/var/folders/w8/9_5f04c54b585y1kjq898d180000gn/T/RtmpkfueRA/remotesac6688274dc/junyangq-glmnetPlus-755b0e5/DESCRIPTION’ ...
─  preparing ‘glmnetPlus’:
✓  checking DESCRIPTION meta-information ...
─  cleaning src
✓  checking vignette meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘glmnetPlus_2.0-16.tar.gz’

* installing *source* package ‘glmnetPlus’ ...
** using staged installation
** libs
gfortran -mmacosx-version-min=10.13 -fno-optimize-sibling-calls  -fPIC  -Wall -g -O2  -c glmnet5dp.f -o glmnet5dp.o
gfortran-4.2: error trying to exec '/usr/local/bin/i686-apple-darwin8-gfortran-4.2': execvp: Bad CPU type in executable
yk-tanigawa commented 3 years ago

Hi Peiyuan,

Thank you for your interest in our approach and for reporting the installation error.

Would you mind posting the error to the glmnetPlus repo along with the types of CPU you have in your environment?

If you are using a new mac with Apple Silicon, you may find it useful to checkout gfortran alternatives: https://github.com/fxcoudert/gfortran-for-macOS I personally don't have such machines but you may find it useful to check out some of the information.

I will also ask our colleagues if somebody is aware of the issue.

RuilinLi commented 3 years ago

I suspect this is because the gfortran compiler was built for a different architecture. This might be relevant https://cran.r-project.org/bin/macosx/tools/

Alternatively, if you have a working C/C++ compiler you can take a look at our new implementation at compact branch. It worked on my older Macbook Pro using clang, but we haven't done extensive testing on MacOS.

garyzhubc commented 3 years ago

Thanks this is fixed by following the GitHub link. Although my Mac is still using Intel, the new Mac OS system requires reinstalling gfortran to the newest build.