CoGAPS Installation Problem - clang compiler does not support '-march=native'
0
0
Entering edit mode
MayerAdam • 0
@112a00fa
Last seen 22 months ago
Baltimore, MD

The most recent CoGAPS Version 3.18.0 fails to install on my computer. Version 3.15.2 installs correctly.

I think this may be due to a C++ compiling error on Mac with M1 Pro chip. See: https://stackoverflow.com/questions/65966969/why-does-march-native-not-work-on-apple-m1

Is there any way to change the clang version used when compiling CoGAPS?

Thanks!


Old packages: 'CoGAPS'
Update all/some/none? [a/s/n]: 
a
Package which is only available in source form, and may need
  compilation of C/C++/Fortran: ‘CoGAPS’
Do you want to attempt to install these from sources? (Yes/no/cancel) yes
installing the source package ‘CoGAPS’

trying URL 'https://bioconductor.org/packages/3.16/bioc/src/contrib/CoGAPS_3.18.0.tar.gz'
Content type 'application/x-gzip' length 20839969 bytes (19.9 MB)
==================================================
downloaded 19.9 MB

* installing *source* package ‘CoGAPS’ ...
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -arch arm64 -std=gnu++14 accepts -g... yes
checking how to run the C++ preprocessor... clang++ -arch arm64 -std=gnu++14 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether clang++ -arch arm64 -std=gnu++14 accepts -g... (cached) yes
./configure: line 2752: AX_COMPILER_VENDOR: command not found
./configure: line 2753: AX_COMPILER_VERSION: command not found
./configure: line 2764: AX_OPENMP: command not found
building on  compiler version 
Using AVX instructions if available
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DBOOST_MATH_PROMOTE_DOUBLE_POLICY=0 -DGAPS_DISABLE_CHECKPOINTS -D__GAPS_R_BUILD__ -Iinclude -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/BH/include' -I/opt/R/arm64/include  -march=native  -fPIC  -falign-functions=64 -Wall -g -O2  -c Cogaps.cpp -o Cogaps.o
clang: error: the clang compiler does not support '-march=native'
make: *** [Cogaps.o] Error 1
ERROR: compilation failed for package ‘CoGAPS’
CoGAPS clang • 1.8k views
ADD COMMENT
1
Entering edit mode

Thanks for the bug report. I'm one of the CoGAPS developers and I've wrestled with this issue also--one question though first: are your mac OS and Xcode tools both updated to the newest version? There have been some C issues ironed out in recent releases, and in the past updating has fixed this issue for me.

In parallel, I'm looking into this error and trying to reproduce it on my own M1 mac. I will reply to this comment with a link to the fix on github.

ADD REPLY
1
Entering edit mode

Been working on this. Could you install from github, using our master branch? I removed the flag but it won't be reflected in the Bioconductor release yet.

devtools::install_github("FertigLab/CoGAPS")

Let me know how it goes, J

ADD REPLY
0
Entering edit mode

I just installed the package. The compilation did not fail this time!

There appears to be a few minor errors during the installation:

  1. Commands not recognized in lines 2752, 2753, and 2764
  2. An issue with enumeration "GAPS_ALL_PHASES" in GapsRunner

However, these errors do not impede installation, and the tests check out at the end.

Thanks for your help!

Below is the output during installation:

> devtools::install_github("FertigLab/CoGAPS")
Downloading GitHub repo FertigLab/CoGAPS@HEAD
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/h0/6kjj0x9n7qbcqcdhjg_nw3fm0000gn/T/RtmpyaMUMG/remotes447255ec8351/FertigLab-CoGAPS-02a0b62/DESCRIPTION’ ...
─  preparing ‘CoGAPS’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  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 ‘CoGAPS_3.15.2.tar.gz’

* installing *source* package ‘CoGAPS’ ...
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -arch arm64 -std=gnu++14 accepts -g... yes
checking how to run the C++ preprocessor... clang++ -arch arm64 -std=gnu++14 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether clang++ -arch arm64 -std=gnu++14 accepts -g... (cached) yes
./configure: line 2752: AX_COMPILER_VENDOR: command not found
./configure: line 2753: AX_COMPILER_VERSION: command not found
./configure: line 2764: AX_OPENMP: command not found
building on  compiler version 
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DBOOST_MATH_PROMOTE_DOUBLE_POLICY=0 -DGAPS_DISABLE_CHECKPOINTS -D__GAPS_R_BUILD__ -Iinclude -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/BH/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c Cogaps.cpp -o Cogaps.o
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DBOOST_MATH_PROMOTE_DOUBLE_POLICY=0 -DGAPS_DISABLE_CHECKPOINTS -D__GAPS_R_BUILD__ -Iinclude -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/BH/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c GapsParameters.cpp -o GapsParameters.o
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DBOOST_MATH_PROMOTE_DOUBLE_POLICY=0 -DGAPS_DISABLE_CHECKPOINTS -D__GAPS_R_BUILD__ -Iinclude -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/BH/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c GapsResult.cpp -o GapsResult.o
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DBOOST_MATH_PROMOTE_DOUBLE_POLICY=0 -DGAPS_DISABLE_CHECKPOINTS -D__GAPS_R_BUILD__ -Iinclude -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/BH/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c GapsRunner.cpp -o GapsRunner.o
GapsRunner.cpp:430:13: warning: enumeration value 'GAPS_ALL_PHASES' not handled in switch [-Wswitch]
    switch (phase)
            ^~~~~
... <<Deleted lines here>>
9 warnings generated.
... <<Deleted lines here>>
ld: warning: -undefined dynamic_lookup may not work with chained fixups
installing to /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/00LOCK-CoGAPS/00new/CoGAPS/libs
** R
** data
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (CoGAPS)
ADD REPLY
0
Entering edit mode

Thanks for the reply! My apologies for the very late response.

MacOS Version: 12.5 Xcode tools version: 14.0.0 (This is the same as clang --version, right?)

(base) XXX ~ % clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ADD REPLY

Login before adding your answer.

Traffic: 386 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6