mritchielab / FLAMES

A framework for performing single-cell and bulk read full-length analysis of mutations and splicing.
https://mritchielab.github.io/FLAMES/
GNU General Public License v3.0
20 stars 9 forks source link

compilation fails on aarch64 / arm64 #7

Closed kevinushey closed 1 year ago

kevinushey commented 2 years ago

When I try to build this package from sources on my M1 macOS machine, I see:

* installing *source* package ‘FLAMES’ ...
** using staged installation
** libs
clang++ -std=gnu++17 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rcpp/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rhtslib/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/zlibbioc/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c RcppExports.cpp -o RcppExports.o
clang -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rcpp/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rhtslib/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/zlibbioc/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -Wno-implicit-function-declaration  -c bam.c -o bam.o
clang++ -std=gnu++17 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rcpp/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rhtslib/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/zlibbioc/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c edit_dist.cpp -o edit_dist.o
clang++ -std=gnu++17 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rcpp/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rhtslib/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/zlibbioc/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c fastq_utils.cpp -o fastq_utils.o
clang++ -std=gnu++17 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rcpp/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rhtslib/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/zlibbioc/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c match_cell_barcode.cpp -o match_cell_barcode.o
clang++ -std=gnu++17 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rcpp/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rhtslib/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/zlibbioc/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c merge_bulk.cpp -o merge_bulk.o
clang -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rcpp/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/Rhtslib/include' -I'/Users/kevin/Library/R/homebrew/aarch64/4.1/zlibbioc/include' -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -Wno-implicit-function-declaration  -c ssw.c -o ssw.o
In file included from ssw.c:39:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/emmintrin.h:13:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/xmmintrin.h:13:
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:50:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:129:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:159:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:189:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:216:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:239:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:260:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:287:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:310:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:331:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:352:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:373:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:394:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:416:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:439:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:461:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:483:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_paddusw((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:504:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_psubb((__v8qi)__m1, (__v8qi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include/mmintrin.h:525:12: error: invalid conversion
      between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
    return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Would it be possible to avoid the use of intrinsics on arm64 / aarch64?

ChangqingW commented 2 years ago

Perhaps we could apply the changes from https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library/commit/e2c7ccca74633ac61150d55e7c03270ab049b439

Yikun commented 1 year ago

@ChangqingW Looks like we should put sse2neon.h to put the to https://github.com/OliverVoogd/FLAMES/tree/master/src/utility/ssw folder?

Otherwise:

g++ -std=gnu++17 -I"/home/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/home/biocbuild/bbs-3.17-bioc/R/library/Rcpp/include' -I'/home/biocbuild/bbs-3.17-bioc/R/library/Rhtslib/include' -I'/home/biocbuild/bbs-3.17-bioc/R/library/zlibbioc/include' -I/usr/local/include    -fPIC  -g -O2  -Wall -c utility/ssw/ssw_cpp.cpp -o utility/ssw/ssw_cpp.o
In file included from utility/ssw/ssw_cpp.cpp:6:
utility/ssw/ssw.h:19:10: fatal error: sse2neon.h: No such file or directory
   19 | #include "sse2neon.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [/home/biocbuild/bbs-3.17-bioc/R/etc/Makeconf:198: utility/ssw/ssw_cpp.o] Error 1
ERROR: compilation failed for package ‘FLAMES’
* removing ‘/home/biocbuild/bbs-3.17-bioc/R/library/FLAMES’

[1] Related: https://github.com/Yikun/BBS/issues/7 [2] [Bioc-devel] Support for Linux ARM64: https://stat.ethz.ch/pipermail/bioc-devel/2023-January/019398.html [3] Mac M1 also failed: https://bioconductor.org/checkResults/3.17/bioc-mac-arm64-LATEST/FLAMES/kjohnson2-install.html

ChangqingW commented 1 year ago

@ChangqingW Looks like we should put sse2neon.h to put the to https://github.com/OliverVoogd/FLAMES/tree/master/src/utility/ssw folder?

Otherwise:

g++ -std=gnu++17 -I"/home/biocbuild/bbs-3.17-bioc/R/include" -DNDEBUG -D_FILE_OFFSET_BITS=64 -I'/home/biocbuild/bbs-3.17-bioc/R/library/Rcpp/include' -I'/home/biocbuild/bbs-3.17-bioc/R/library/Rhtslib/include' -I'/home/biocbuild/bbs-3.17-bioc/R/library/zlibbioc/include' -I/usr/local/include    -fPIC  -g -O2  -Wall -c utility/ssw/ssw_cpp.cpp -o utility/ssw/ssw_cpp.o
In file included from utility/ssw/ssw_cpp.cpp:6:
utility/ssw/ssw.h:19:10: fatal error: sse2neon.h: No such file or directory
   19 | #include "sse2neon.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [/home/biocbuild/bbs-3.17-bioc/R/etc/Makeconf:198: utility/ssw/ssw_cpp.o] Error 1
ERROR: compilation failed for package ‘FLAMES’
* removing ‘/home/biocbuild/bbs-3.17-bioc/R/library/FLAMES’

[1] Related: Yikun/BBS#7 [2] [Bioc-devel] Support for Linux ARM64: https://stat.ethz.ch/pipermail/bioc-devel/2023-January/019398.html [3] Mac M1 also failed: https://bioconductor.org/checkResults/3.17/bioc-mac-arm64-LATEST/FLAMES/kjohnson2-install.html

Done. Could you check if this fixed the problem? I don't have an arm machine. Feel free to make a PR.

Yikun commented 1 year ago
$ uname -m
aarch64

$ /home/biocbuild/bbs-3.17-bioc/R/bin/R
R Under development (unstable) (2023-01-14 r83615) -- "Unsuffered Consequences"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu (64-bit)

> BiocManager::install("OliverVoogd/FLAMES")
installing to /home/biocbuild/bbs-3.17-bioc/R/library/00LOCK-FLAMES/00new/FLAMES/libs
** R
** 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 (FLAMES)

> BiocManager::install("OliverVoogd/FLAMES")
Bioconductor version 3.17 (BiocManager 1.30.19), R Under development (unstable)
  (2023-01-14 r83615)
Installing github package(s) 'OliverVoogd/FLAMES'
Skipping install of 'FLAMES' from a github remote, the SHA1 (42363bce) has not changed since last install.
  Use `force = TRUE` to force installation

@ChangqingW Many thanks! I validated it in a Linux aarch64, it works!

Please let me know if I can help more. : )

tom91136 commented 5 months ago

Hi @OliverVoogd, the missing sse2neon.h header issue showed up again in BioC 3.19, I think the fix only made it to older branches?