GWW / scsnv

scSNV Mapping tool for 10X Single Cell Data
MIT License
22 stars 4 forks source link

MacOS Compatibility #32

Closed wgsim closed 10 months ago

wgsim commented 11 months ago

Thank you for the awesome tool!

I'm wondering if this tool is checked on compatibility with MacOS.

I've tried to configure & make it several times on my Mac (Ventura OS), but it returned some errors.

The first one is that [Ld: Library 'System' is not found] written in external/htslib/config.log. So I tried to htslib manually make, and it worked. But, after that, another error was returned: [ In file included from ~/github/scsnv/src/iprocessor.cpp:23: In file included from ~/github/scsnv/include/iprocessor.hpp:32: In file included from ~/github/scsnv/include/pileup_worker.hpp:24: "~/github/scsnv/include/bamgenes.hpp:160:18: error: no matching function for call to 'min' rstart = std::min(next.b->core.pos, rstart);

/Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/algorithm/min.h:40:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('hts_pos_t' (aka 'long long') vs. 'long') min(const _Tp& a, const _Tp& b) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/algorithm/min.h:51:1: note: candidate template ignored: could not match 'initializer_list<_Tp>' against 'hts_pos_t' (aka 'long long') min(initializer_list<_Tp> t, _Compare comp) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/algorithm/min.h:60:1: note: candidate function template not viable: requires single argument 't', but 2 arguments were provided min(initializer_list<_Tp> t) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__algorithm/min.h:31:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided min(const _Tp& a, const _Tp& __b, _Compare __comp) ^ 4 warnings and 1 error generated. ]

I checked it perfectly on the Linux system. Could you please respond to this error or MacOS compatibility? Thank you!

GWW commented 11 months ago

Hi,

I unfortunately do not have access to a Mac anymore. However, I have pushed a change to the repository that should fix the above error. Please pull the latest changes and try compiling again. If you have any other issues I am happy to try to help with them.

Thanks

wgsim commented 11 months ago

Thank you for your fast response!

Based on your change, the previous error is solved. However, there seems to still be an OS issue.

[ 59%] Building C object src/CMakeFiles/scsnvlib.dir/bwa/utils.c.o [ 61%] Building C object src/CMakeFiles/scsnvlib.dir/bwa/kthread.c.o [ 63%] Building C object src/CMakeFiles/scsnvlib.dir/bwa/ksw.c.o In file included from ~/github/scsnv/src/bwa/ksw.c:29: /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/emmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"

error "This header is only meant to be used on x86 and x64 architecture"

^ In file included from ~/github/scsnv/src/bwa/ksw.c:29: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/emmintrin.h:17: /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/xmmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"

error "This header is only meant to be used on x86 and x64 architecture"

^ In file included from ~/github/scsnv/src/bwa/ksw.c:29: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/emmintrin.h:17: In file included from /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/xmmintrin.h:17: /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/mmintrin.h:14:2: error: "This header is only meant to be used on x86 and x64 architecture"

error "This header is only meant to be used on x86 and x64 architecture"

^ /Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/mmintrin.h:54: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/15.0.0/include/mmintrin.h:133: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/15.0.0/include/mmintrin.h:163: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/15.0.0/include/mmintrin.h:193: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/15.0.0/include/mmintrin.h:220: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/15.0.0/include/mmintrin.h:243: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/15.0.0/include/mmintrin.h:264: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/15.0.0/include/mmintrin.h:291: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/15.0.0/include/mmintrin.h:314: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/15.0.0/include/mmintrin.h:335: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/15.0.0/include/mmintrin.h:356: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/15.0.0/include/mmintrin.h:377: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/15.0.0/include/mmintrin.h:398: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/15.0.0/include/mmintrin.h:420: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/15.0.0/include/mmintrin.h:443: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/15.0.0/include/mmintrin.h:465: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); ^~~~~~~~~~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=]

Thanks!

GWW commented 11 months ago

That loooks like an issue compiling BWA-mem. I unfortunately do not have access to the new Apple Silicon to play around with the issue. You could try manually building BWA-mem in the external/bwa folder.

GWW commented 10 months ago

Hi, I gained access to an MacbookPro M3Pro.

I have updated the build instructions and build files to work with OSX now. You will need to reclone everything and follow the build instructions in the readme.

Let me know if you have any issues.