neherlab / nextalign

🧬 Viral genome reference alignment
MIT License
12 stars 2 forks source link

troubleshooting install on MacOS #24

Closed jameshadfield closed 3 years ago

jameshadfield commented 3 years ago

@ivan-aksamentov here's my progress so far

OS: MacOS version 11.1 Bash: GNU bash, version 5.1.4(1)-release (x86_64-apple-darwin20.2.0) Conda 4.9.2

conda activate nextalign # empty conda env
conda install python=3.8
conda install -c conda-forge conan
conda install -c anaconda cmake 
conda install -c conda-forge clang # apple ships with v12, conda installs v11
conda install -c conda-forge cppcheck
cd nextalign
git submodule update --init --recursive
make prod # I'm interested in the binary, not dev work

Error 1

scripts/build_locally.sh: line 18: realpath: command not found
make: *** [dev-nowatch] Error 127

realpath isn’t available on MacOS but can be installed via brew install coreutils

Solution: instruct MacOS uses to install coreutils via homebrew

Error 2

make dev-nowatch
...
benchmark/1.5.2: Downloaded recipe revision 0
boost_base/1.68.0@bincrafters/stable: Not found in local cache, looking in remotes...
boost_base/1.68.0@bincrafters/stable: Trying with 'conan-center'...
ERROR: Unable to find 'boost_base/1.68.0@bincrafters/stable' in remotes

And it appears that boost doesn’t exist in Conan using the default remote(s)?

$ conan search Boost* -r=conan-center
There are no packages matching the 'Boost*' pattern

I added the bincrafters remote and this fixed it

conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan

Solution: instruct uses to add the bincrafters conan remote

Error 3

$ make prod
...
 CMake Error at conanbuildinfo.cmake:402 (message):
  Detected a mismatch for the compiler version between your conan profile
  settings and CMake:

  Compiler version specified in your conan profile: 10

  Compiler version detected in CMake: 12.0

  Please check your conan profile settings (conan profile show
  [default|your_profile_name])

This is a PATH issue - the default MacOS clang compiler is v12, but I installed a conda version of ~10~ 11, which comes first on PATH. Note that this is happening in the “Install dependencies” part of build_locally.sh so cmake is being called by conan, not the script, and I can’t work out how to change the cmake options so that it looks at the correct compiler!

$ which -a clang
/Users/enigma/miniconda3/envs/nextalign/bin/clang
/usr/bin/clang

Tried a few things without success:

ivan-aksamentov commented 3 years ago

Hey James @jameshadfield ,

Thanks so much. I don't have a mac handy so your help is very appreciated!

Error 1

realpath: command not found

Solution: instruct MacOS uses to install coreutils via homebrew

It's probably also true for Linux. Alternatively, we might try to get rid of realpath. It's probably not that vital.

Error 2

Solution: instruct uses to add the bincrafters conan remote

Yes, sorry about that. For Linux it's currently in the conan installation script. Should totally tell users. Alternatively, we might use a local conan config somehow (stored in the repo) instead of the global one. The remotes are in ~/.conan/remotes.json.

Error 3

Detected a mismatch for the compiler version between your conan profile settings and CMake:

I think it might be similar but worse version of "Trobleshooting tip #1":

  1. I have a newer version of a compiler, but conan and cmake keep using the old one

https://github.com/neherlab/nextalign#1-i-have-a-newer-version-of-a-compiler-but-conan-and-cmake-keep-using-the-old-one

Conan remembers things in a few places:

Cmake also remembers some things during build files generation, including the compiler in the build directory.

So, currently, switching compilers basically means wiping the build directories, removing the global conan profile, creating a new one and basically starting from scratch. It's as inconvenient as it sounds and a major pain and should be solved. The solution (or at least a part of it) that we need to implement is:

The other issue with the current build I don't like is that it's getting pretty complex and is based almost entirely on bash. Maybe we could leverage conanfile in Python format to make it look like something reasonable. But that would require quite a bit of work.

P.S. If users stumble upon this issue: The goal here is to setup a native macOS build (with prospect to further setup a CI and produce binaries), but if you just want to build and run Nextalign on Apple, you could use Docker dev build or a prebuilt images.

ivan-aksamentov commented 3 years ago

I forgot to mention that as a CMake-based app, none of these steps are mandatory. That is, usage of conan or build script is purely a "convenience" feature, mostly for day-to-day development. And, if it all becomes inconvenient, it can (and should!) be safely dumped.

Theoretically, one should be able to build Nextalign as any other CMake app or library. In fact, most of these would not come with conan config or build scripts. For example, a CMake GUI can be used, or a CLI version of it. Dependencies would have to be installed manually in this case, of course.

Based on that, maybe we could have separate build scripts for Mac and Windows with their alternative paths to do things? That would also be a good option. And also conda, maybe it can be of some use?

I'd be very glad to hear from devs on how to improve the build, because, honestly, I am not happy about it.

jameshadfield commented 3 years ago

Thanks @ivan-aksamentov that was really helpful - It helped me identify that conda hadn't installed clang++ which was the problem ;) the following steps resolved the error (but I've now got another!)

Error 3

Edit: I thought the following seps resolved this issue, but it came back!

conda install -c anaconda clangxx # NOTE: downgrades conda's clang & clang++ to v10
rm -rf .build
rm -rf ~/.conan
./tools/install-conan
make prod
# see below for new error :(

Error 4

Edit: I now cannot reproduce this error after following the above steps, as I run into error 3 again, however I can get here using MacOS's native clang (v12)

make prod
... # conan downloads lots of packages (I think)

benchmark/1.5.2: Configuring sources in /Users/enigma/.conan/data/benchmark/1.5.2/_/_/source
Downloading v1.5.2.tar.gz completed [156.48k]                                            

benchmark/1.5.2: Copying sources to build folder
benchmark/1.5.2: Building your package in /Users/enigma/.conan/data/benchmark/1.5.2/_/_/build/9a8d9a889d380b0427ca28d9b20d6b9048add91f
benchmark/1.5.2: Generator cmake created conanbuildinfo.cmake
benchmark/1.5.2: Calling build()
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Adjusting fPIC flag (ON)
-- Conan: C++ stdlib: libstdc++
-- Failed to find LLVM FileCheck
-- Found Git: /usr/local/bin/git (found version "2.30.0") 
-- git Version: v0.0.0
-- Version: 0.0.0
-- Performing Test HAVE_CXX_FLAG_STD_CXX11
-- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Failed
-- Performing Test HAVE_CXX_FLAG_STD_CXX0X
-- Performing Test HAVE_CXX_FLAG_STD_CXX0X - Failed
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Failed
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Failed
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Failed
-- Performing Test HAVE_CXX_FLAG_WERROR
-- Performing Test HAVE_CXX_FLAG_WERROR - Failed
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Failed
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Failed
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED - Failed
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Failed
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- failed to compile
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- failed to compile
CMake Error at source_subfolder/CMakeLists.txt:260 (message):
  Failed to determine the source files for the regular expression backend
ivan-aksamentov commented 3 years ago

@jameshadfield Hmmm no idea.

Sounds like if compiler did not have a necessary regex feature, which should be available from any C++11-compliant compiler, way back in the days of Clang 3.x or so.

In what context does this error appear? What does it build? Is it during the build of one of the dependencies? Or is this during Nextalign build itself?

I wonder if it's all conda quirks. What happens if you run without it, just on a completely vanilla OS X?

jameshadfield commented 3 years ago

I wonder if it's all conda quirks. What happens if you run without it, just on a completely vanilla OS X?

Yes, I wondered this myself

clang --version # MacOS default: Apple clang version 12.0.0 (clang-1200.0.32.28)
clang++ --version # same output as clang, above
rm -rf .build
rm -rf ~/.conan
./tools/install-conan
make prod # dies almost immediately

 - Install dependencies 
ERROR: Invalid setting 'libstdc++11' is not a valid 'settings.compiler.libcxx' value.
Possible values are ['libc++', 'libstdc++']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
make: *** [prod] Error 1

For what it's worth,

cat ~/.conan/profiles/default 
[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=12.0
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]

Manually changing the conan config to compiler.libcxx=libstdc++ allows this to proceed and I run into Error 4 (see above)

ivan-aksamentov commented 3 years ago

I think this line

conan profile update settings.compiler.libcxx=libstdc++11 default

in tools/install-conan is only relevant for GCC and breaks clang. Can you wipe everything and install conan without this line? The default for Clang is libc++, so the settings.compiler.libcxx profile entry should be either non-existent or libc++, I think.

Maybe there's a common denominator for this value between GCC and Clang, or maybe it should not be added with clang. It alters binary ABI (inlcuding for the dependencies), so we should be careful for the release binaries.

AppleClang 12 is almost the same as Clang 10 (source), so it should definitely have HAVE_STD_REGEX and HAVE_CXX_FLAG_STD_CXX11. These checks each compile and run a small executable, so there is something wrong with either compiling or running these. I suspect the settings.compiler.libcxx is the offending part.

ivan-aksamentov commented 3 years ago

Alternatively, benchmarks is not a vital part of running Nextalign, so it can be commented out.

A few places have to be altered:

Maybe we could make it optional somehow. The conan part might be tricky. Python-based conanfile might be more convenient in this.

jameshadfield commented 3 years ago

Getting closer!

After removing the line in tools/install-conan as you suggested I can now get up to the actual building of Nextalign. Yay!

Here's the current error. I don't have experience writing C/C++ so apologies for not being able to troubleshoot this that well!

Click to see build output from `make prod` ``` - Build Scanning dependencies of target nextalign [ 3%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/align/alignPairwise.cpp.o [ 6%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/align/getGapOpenCloseScores.cpp.o [ 12%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/alphabet/aminoacids.cpp.o [ 16%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/io/gene.io.cpp.o [ 12%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/alphabet/nucleotides.cpp.o [ 19%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/io/parseGeneMapGff.cpp.o [ 22%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/io/parseSequences.cpp.o /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/src/alphabet/nucleotides.cpp:77:10: error: no matching function for call to 'map' return map(seq, std::function(toNucleotide)); ^~~ /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/src/alphabet/../utils/map.h:7:19: note: candidate template ignored: substitution failure [with Input = char, Output = Nucleotide]: template template argument has different template parameters than its corresponding template template parameter Container map(const Container& input, std::function op) { ^ /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/src/alphabet/nucleotides.cpp:81:10: error: no matching function for call to 'map' return map(seq, std::function(nucToChar)); ^~~ /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/src/alphabet/../utils/map.h:7:19: note: candidate template ignored: substitution failure [with Input = Nucleotide, Output = char]: template template argument has different template parameters than its corresponding template template parameter Container map(const Container& input, std::function op) { ^ [ 25%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/match/matchAa.cpp.o /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/src/alphabet/aminoacids.cpp:97:10: error: no matching function for call to 'map' return map(seq, std::function(charToAa)); ^~~ /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/src/alphabet/../utils/map.h:7:19: note: candidate template ignored: substitution failure [with Input = char, Output = Aminoacid]: template template argument has different template parameters than its corresponding template template parameter Container map(const Container& input, std::function op) { ^ /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/src/alphabet/aminoacids.cpp:101:10: error: no matching function for call to 'map' return map(seq, std::function(aaToChar)); ^~~ /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/src/alphabet/../utils/map.h:7:19: note: candidate template ignored: substitution failure [with Input = Aminoacid, Output = char]: template template argument has different template parameters than its corresponding template template parameter Container map(const Container& input, std::function op) { ^ 2 errors generated. make[3]: *** [packages/nextalign/CMakeFiles/nextalign.dir/src/alphabet/nucleotides.cpp.o] Error 1 make[3]: *** Waiting for unfinished jobs.... 2 errors generated. make[3]: *** [packages/nextalign/CMakeFiles/nextalign.dir/src/alphabet/aminoacids.cpp.o] Error 1 make[2]: *** [packages/nextalign/CMakeFiles/nextalign.dir/all] Error 2 make[1]: *** [all] Error 2 make: *** [prod] Error 2 ```
ivan-aksamentov commented 3 years ago

@jameshadfield Cool! This one looks like a bug. I am going to try with Clang and see what's going on.

UPDATE: yep, can reproduce

ivan-aksamentov commented 3 years ago

@jameshadfield Should be fixed in https://github.com/neherlab/nextalign/pull/25

I also found another warning after that, the fix is incoming. But it should compile now.

jameshadfield commented 3 years ago

Thanks @ivan-aksamentov! I get one warning but also a number of type errors which prevent it from compiling such as error: unknown type name 'u_int'

Click to see build output from `make prod` ``` - Build Scanning dependencies of target nextalign [ 6%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/alphabet/aminoacids.cpp.o [ 6%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/alphabet/nucleotides.cpp.o [ 9%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/translate/decode.cpp.o [ 12%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/translate/extractGene.cpp.o [ 16%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/nextalign.cpp.o [ 19%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/match/matchNuc.cpp.o [ 22%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/translate/mapCoordinates.cpp.o [ 25%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/translate/translateGenes.cpp.o [ 29%] Building CXX object packages/nextalign/CMakeFiles/nextalign.dir/src/translate/translate.cpp.o [ 32%] Linking CXX static library libnextalign.a [ 51%] Built target nextalign Scanning dependencies of target nextalign_benchmarks Scanning dependencies of target nextalign_tests Scanning dependencies of target nextalign_cli [ 54%] Building CXX object packages/nextalign/benchmarks/CMakeFiles/nextalign_benchmarks.dir/src/main.cpp.o /Users/enigma/projects/nextstrain/nextalign/packages/nextalign/benchmarks/src/Nextalign.benchmark.h:30:1: warning: There is an unknown macro here somewhere. Configuration is required. If BENCHMARK_DEFINE_F is a macro then please configure it. [unknownMacro] BENCHMARK_DEFINE_F(NextalignAverageBench, Average)(benchmark::State& st) { ^ [ 58%] Building CXX object packages/nextalign_cli/CMakeFiles/nextalign_cli.dir/src/cli.cpp.o [ 61%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/extractGene.test.cpp.o [ 64%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/alignPairwiseWithCodons.test.cpp.o [ 67%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/decode.test.cpp.o [ 70%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/mapCoordinates.test.cpp.o [ 74%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/alignPairwise.test.cpp.o In file included from /Users/enigma/projects/nextstrain/nextalign/packages/nextalign_cli/src/cli.cpp:4: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/pipeline.h:23: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/atomic.h:42: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/tbb_machine.h:258: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/machine/macos_common.h:29: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/sysctl.h:83: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/ucred.h:101:2: error: unknown type name 'u_int' u_int cr_version; /* structure layout version */ ^ In file included from /Users/enigma/projects/nextstrain/nextalign/packages/nextalign_cli/src/cli.cpp:4: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/pipeline.h:23: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/atomic.h:42: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/tbb_machine.h:258: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/machine/macos_common.h:29: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/sysctl.h:84: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/proc.h:114:2: error: unknown type name 'u_int' u_int p_estcpu; /* Time averaged value of p_cpticks. */ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/proc.h:119:2: error: unknown type name 'u_int' u_int p_swtime; /* Time swapped in or out. */ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/proc.h:120:2: error: unknown type name 'u_int' u_int p_slptime; /* Time since last blocked. */ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/proc.h:134:2: error: unknown type name 'u_char'; did you mean 'char'? u_char p_priority; /* Process priority. */ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/proc.h:135:2: error: unknown type name 'u_char'; did you mean 'char'? u_char p_usrpri; /* User-priority based on p_cpu and p_nice. */ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/proc.h:140:2: error: unknown type name 'u_short'; did you mean 'short'? u_short p_xstat; /* Exit status for wait; also stop signal. */ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/proc.h:141:2: error: unknown type name 'u_short'; did you mean 'short'? u_short p_acflag; /* Accounting flags. */ ^ In file included from /Users/enigma/projects/nextstrain/nextalign/packages/nextalign_cli/src/cli.cpp:4: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/pipeline.h:23: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/atomic.h:42: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/tbb_machine.h:258: In file included from /Users/enigma/.conan/data/tbb/2020.3/_/_/package/6a83d7f783e7ee89a83cf2fe72b5f5f67538e2a6/include/tbb/machine/macos_common.h:29: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include/sys/sysctl.h:769:23: error: unknown type name 'u_int' int sysctl(int *, u_int, void *, size_t *, void *, size_t); ^ [ 77%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/parseGeneMapGff.test.cpp.o [ 80%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/parseSequences.test.cpp.o [ 83%] Linking CXX executable nextalign_benchmarks /Users/enigma/projects/nextstrain/nextalign/packages/nextalign_cli/src/cli.cpp:308:19: warning: loop variable 'gene' of type 'const std::__1::basic_string' creates a copy from type 'const std::__1::basic_string' [-Wrange-loop-analysis] for (const auto gene : genes) { ^ /Users/enigma/projects/nextstrain/nextalign/packages/nextalign_cli/src/cli.cpp:308:8: note: use reference type 'const std::__1::basic_string &' to prevent copying for (const auto gene : genes) { ^~~~~~~~~~~~~~~~~ & [ 83%] Built target nextalign_benchmarks [ 87%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/removeGaps.test.cpp.o [ 90%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/stripInsertions.test.cpp.o [ 93%] Building CXX object packages/nextalign/tests/CMakeFiles/nextalign_tests.dir/translate.test.cpp.o 1 warning and 9 errors generated. make[3]: *** [packages/nextalign_cli/CMakeFiles/nextalign_cli.dir/src/cli.cpp.o] Error 1 make[2]: *** [packages/nextalign_cli/CMakeFiles/nextalign_cli.dir/all] Error 2 make[2]: *** Waiting for unfinished jobs.... [ 96%] Linking CXX executable nextalign_tests [ 96%] Built target nextalign_tests make[1]: *** [all] Error 2 make: *** [prod] Error 2 ```
ivan-aksamentov commented 3 years ago

Oh no! Looks like Intel TBB relies on some system stuff, and the stuff in MacOSX11.1.sdk for some reason does not meet it's expectations. The only way for me is to google it...

ivan-aksamentov commented 3 years ago

I am not sure what "11.1" refers to here. But it seems that it's not the same as "12" in the compiler version. Could that be it?

I don't want to break your computer, but it seems that the compiler toolchain should be updated after every OS update and maybe Xcode update.

xcode-select --install

Do it it your own risk though! Maybe we could try it on a cloud Mac or TravisCI/CircleCI to make sure we don't break anything.

https://stackoverflow.com/questions/46872922/broken-c-std-libraries-on-macos-high-sierra-10-13/47401866#47401866

ivan-aksamentov commented 3 years ago

Also, before that, maybe try to comment out the

include(packages/cmake/CFlags.cmake)

line here

https://github.com/neherlab/nextalign/blob/0d42853b010e21eade5f362046709ad553dce091/CMakeLists.txt#L6

It might add a few compiler-specific flags. But unlikely a problem.

jameshadfield commented 3 years ago

I am not sure what "11.1" refers to here. But it seems that it's not the same as "12" in the compiler version. Could that be it?

11.1 here is referring to the MacOS version I'm running ("Big Sur"). It's also not an intel processor (apple M1) if that makes any difference. (That's one of the reasons I'm keen to build it locally.)

Also, before that, maybe try to comment out include(packages/cmake/CFlags.cmake)

Didn't help unfortunately.

but it seems that the compiler toolchain should be updated after every OS update and maybe Xcode update

Gave this a shot, but I'm on a fresh OS install so this was unlikely to be it

$xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
jameshadfield commented 3 years ago

~Googling led me to this stackoverflow answer but, having very little C/C++ experience, I offer no comment!~ This answer seems more relevant.

Will resume debugging tomorrow. Thanks for all the help today!

ivan-aksamentov commented 3 years ago

not an intel processor (apple M1)

Oh wow! Intel TBB depends heavily on hardware-specifics. That might be tricky. Tools and libraries might not have caught up for Apple silicon just yet :(

But here we strangely have Intel TBB compiling fine, and then system headers problem. Maybe we could try and update the TBB version.

Thanks so much for trying all that!

ivan-aksamentov commented 3 years ago

Nextalign is moved into Nextclade repo, let's continue there https://github.com/nextstrain/nextclade/issues/315