YMa-lab / CARD

GNU General Public License v3.0
80 stars 20 forks source link

Error in CARD installation in MacOS #67

Closed krigia closed 3 months ago

krigia commented 4 months ago

Hello CARD team @YingMa0107 @YMalab I am getting the following error while I try to install CARD package in Rstudio ( R version 4.2 and 4.3).

ERROR: package installation failed Error: Failed to install 'CARD' from GitHub: ! System command 'R' failed In addition: Warning message: In i.p(...) : installation of package ‘RcppArmadillo’ had non-zero exit status

I tried to installed RcppArmadillo package, homebrew and gfortran. Although they are installed, still the problem is not fixed: Please see below:

remotes::install_github("YMa-lab/CARD")

Downloading GitHub repo YMa-lab/CARD@HEAD Skipping 3 packages not available: Biobase, SummarizedExperiment, SingleCellExperiment ── R CMD build ───────────────────────────────────────────────────────────────── checking for file ‘/private/var/folders/r_/ddb8mb3d0rz133mss2sjgz00000gr/T/R✔ checking for file ‘/private/var/folders/r/ddb8mb3d0rz13_3mss2sjgz00000gr/T/Rtmpx3ukVU/remotesb1f2b1f1a4e/YMa-lab-CARD-2d64b91/DESCRIPTION’ ─ preparing ‘CARD’: ✔ checking DESCRIPTION meta-information ... ─ cleaning src ─ installing the package to process help pages

─ installing source package ‘CARD’ ... using staged installation libs using C++ compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’ using C++11 using SDK: ‘’ clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Users/kgiannikou/Library/R/arm64/4.3/library/Rcpp/include' -I'/Users/kgiannikou/Library/R/arm64/4.3/library/RcppArmadillo/include' -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -Wall -pedantic -fdiagnostics-color=always -c CARDfree.cpp -o CARDfree.o clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Users/kgiannikou/Library/R/arm64/4.3/library/Rcpp/include' -I'/Users/kgiannikou/Library/R/arm64/4.3/library/RcppArmadillo/include' -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -Wall -pedantic -fdiagnostics-color=always -c CARDref.cpp -o CARDref.o clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Users/kgiannikou/Library/R/arm64/4.3/library/Rcpp/include' -I'/Users/kgiannikou/Library/R/arm64/4.3/library/RcppArmadillo/include' -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -Wall -pedantic -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o clang++ -arch arm64 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o CARD.so CARDfree.o CARDref.o RcppExports.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0 -L/opt/gfortran/lib -lgfortran -lemutlsw -lquadmath -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation **ld: warning: directory not found for option '-L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0' ld: warning: directory not found for option '-L/opt/gfortran/lib' ld: library not found for -lgfortran clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [CARD.so] Error 1 ERROR: compilation failed for package ‘CARD’ ─ removing ‘/private/var/folders/r/ddb8mb3d0rz13_3mss2sjgz00000gr/T/RtmpSo46vj/Rinstb2292b012d8e/CARD’**

ERROR: package installation failed Error: Failed to install 'CARD' from GitHub: ! System command 'R' failed_

I would greatly appreciate your help.

Thank you

krigia commented 4 months ago

@YingMa0107 @YMalab I created a personal token as required but I am still getting the same error as above. Please advise. Thank you

YMalab commented 4 months ago

Hi @krigia,

Thank you for your interest in our package.

The problem is because you don't have gfortran installed. Previously, I followed this to install CARD on a relatively new MacBook M2 system. Hope this helps.

1. install brew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. export PATH:
export PATH="/opt/homebrew/bin:$PATH"

3. source .zshrc, your case might be souce ~/.bashrc
either source ~/.zshrc or source ~/.bashrc

4. install gcc:
brew install

5. check your gcc version, mine is 13, so ****/gcc/13, replace your own version number
export FLIBS="-L/opt/homebrew/lib/gcc/13 -lgfortran -lquadmath -lm"

6. check gfortran version:
gfortran --version

7. check if gfortran exists:
find /opt/homebrew -name libgfortran.a

8. make a ~/.R foilder and modify MakeVars
mkdir -p ~/.R
vim ~/.R/Makevars
FLIBS=-L/opt/homebrew/lib/gcc/13 -lgfortran -lquadmath -lm
krigia commented 4 months ago

@YMalab Thank you for your respond. I have installed gfortran successfully. this is not a problem. However, will follow your instructions above and see what I get. Thank you.

krigia commented 3 months ago

@YMalab @YingMa0107

THANK YOU. I am getting multiple warnings.

Warning: replacing previous import ‘RcppML::nmf’ by ‘NMF::nmf’ when loading ‘CARD’ ** help * installing help indices building package indices installing vignettes testing if installed package can be loaded from temporary location Warning: replacing previous import ‘RcppML::nmf’ by ‘NMF::nmf’ when loading ‘CARD’ checking absolute paths in shared objects and dynamic libraries testing if installed package can be loaded from final location Warning: replacing previous import ‘RcppML::nmf’ by ‘NMF::nmf’ when loading ‘CARD’ ** testing if installed package keeps a record of temporary installation path

How can this affect the CARD downstream analysis? To sure where exactly to replace previous import ‘RcppML::nmf’ by ‘NMF::nmf’ when loading ‘CARD’. Please advise. Thank you. From: YMalab @.> Sent: Wednesday, February 28, 2024 1:38 PM To: YMa-lab/CARD @.> Cc: Giannikou, Krinio @.>; Mention @.> Subject: Re: [YMa-lab/CARD] Error in CARD installation in MacOS (Issue #67)

    External Email - Use Caution

Hi @krigiahttps://secure-web.cisco.com/1fiMFwlXdQRu03JyjBm7jUOGTHlWzmPgHfrIJJDJ_kIOZtZZHn721LD991nKmm9HRWhCkI3Y8AvgPLxxL3nnx1QHu0J2OvdyvRhb8Vfvx4zHW5497QQ-n0kT_8IYbLrnIzE4YSyRI6Y4Pyi-kkumOV3Hwn9gzQ8sIs1GG9rikBGIlm27LY504u8J5up1VnGCxsCU_PR1B-7JLMaYdCBWDRkaCjYJubCueo2nfAgNT9GwAGR3fEApE_2lFRsBvaqjoJX0uFTx7FebAcOWMR_LfF5oc173ypkRQaNShGQ4rnOU8KlYqminnQYTrkhMxnUcsTFpledtTTdE_nSKCHZ3WSw/https%3A%2F%2Fgithub.com%2Fkrigia,

Thank you for your interest in our package.

The problem is because you don't have gfortran installed. Previously, I followed this to install CARD on a relatively new MacBook M2 system. Hope this helps.

`1. install brew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.shhttps://secure-web.cisco.com/1LdHga7KOd-1Ydd9cPIrEUKSmkpuJ5aIUFJDY4kfjZ6lk4IIQkEafimU2lWSBRirAFCkt5S5U6UUOM_-K3VBhL60AEAnWEn7iYrQCyMNuQPGpG-MFzpUfpnwR4dote2tZFHNbQMZ6Ie3ReapTAaLZS6LrSFtofXYapKfltdQREEXfJ_0DC5ZK_S_sNapFtfoYdshceQwTWC5kls0tl-6z8vVtmq0Etd5E6J706KcssL5zb3MrENLlhefeCVzfQo0UOOQsC3vRH1BULPkzqLTJ7jheLa73Kn9RPtosbqr2KfG_ne6MWR2foUcAmpg03uExLB5tDWo46kzk5zT8H27sUw/https%3A%2F%2Fraw.githubusercontent.com%2FHomebrew%2Finstall%2FHEAD%2Finstall.sh)"

  1. export PATH: export PATH="/opt/homebrew/bin:$PATH"

  2. source .zshrc, your case might be souce ~/.bashrc either source ~/.zshrc or source ~/.bashrc

  3. install gcc: brew install

  4. check your gcc version, mine is 13, so ****/gcc/13, replace your own version number export FLIBS="-L/opt/homebrew/lib/gcc/13 -lgfortran -lquadmath -lm"

  5. check gfortran version: gfortran --version

  6. check if gfortran exists: find /opt/homebrew -name libgfortran.a

  7. make a ~/.R foilder and modify MakeVars mkdir -p ~/.R vim ~/.R/Makevars FLIBS=-L/opt/homebrew/lib/gcc/13 -lgfortran -lquadmath -lm`

— Reply to this email directly, view it on GitHubhttps://secure-web.cisco.com/1VsTU5JhnEaikU7-p-mYmltIUm-8WfkWPZA7qSotw_P7Vtu0auEMfWBRyHmev-m5V6eFrWQaAzdGuFEpAuPb5Jn0hhObfRHi-xFgJVOpzCHIqIsB64_vijWbHmrGPF6pXb0kkTEuaaCWwue26-9MUgeZR8s9o7Nar__B1sSHVtBykrjTjJkECcAGNtrWGkWNXqkVCqmYVuavNf2bvF2wXhIfW-EtEGs4UpqUlTMMb89f_zedmzk9zE8QIN30ewTLLtUIutDDgozB5SsBGeqcGaNZGrBUX3pnFG1RwhUd11zthYmU8K41Ty8xg4rCLafr9dU51DUU1qWE5TALT7_TkeQ/https%3A%2F%2Fgithub.com%2FYMa-lab%2FCARD%2Fissues%2F67%23issuecomment-1969878067, or unsubscribehttps://secure-web.cisco.com/1LcQ_MMoMmN2Zglx-YXxeQaiecEOFts4VWfVNXMQsjbtUzvkZl3aT97yjqZ8GzzbCsXebRFsizju-l-SiF1nUjZ3EQAtDLulp7WRBLlUNeRuUMBUoaxOtDiS0cCrp-sjuvRjGYUniGHmfAZqPN51eoEddWg-VQCrvFi1T4mNfotIjjIC133pb2MfkIf1_dT1JSZA0c8np2zppNsopS5b4NKEaVijRmqASbEXvGVMmpjHYOAKG3jC5KdSwZtKtHvn2bbqjYXMeuY9frLn3lIwqOIHGLMble601xOg5XbjLD8bl0N3ephb6LQK-0Qld2HA0/https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAXYDRTLFWYTCOLWFQPVSP7DYV6IUPAVCNFSM6AAAAABD5EQXRKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRZHA3TQMBWG4. You are receiving this because you were mentioned.Message ID: @.***> The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline https://www.massgeneralbrigham.org/complianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.

krigia commented 3 months ago

@YingMa0107 @YMalab issue solved. Thank you