luntergroup / octopus

Bayesian haplotype-based mutation calling
MIT License
302 stars 38 forks source link

Compilation error with gcc 7.3 #105

Closed DaGaMs closed 4 years ago

DaGaMs commented 4 years ago

Describe the bug A clear and concise description of what the bug is.

I'm trying to compile Octopus on the BDI/WTCHG cluster. I'm using existing modules:

module load Boost/1.67.0-foss-2018b CMake/3.12.1-GCCcore-7.3.0 Python/3.7.0-foss-2018b GMP/6.1.2-GCCcore-7.3.0
export PATH="/apps/well/git/2.20.1/bin:$PATH"
export PATH="/apps/well/htslib/1.8/bin:$PATH"
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/apps/well/htslib/1.8/lib/pkgconfig"

I get the following compilation error:

[  9%] Building CXX object src/CMakeFiles/octopus.dir/main.cpp.o
In file included from /users/ludwig/benjamin/sharedscratch/octopus/src/core/models/pairhmm/simd_pair_hmm_factory.hpp:12:0,
                 from /users/ludwig/benjamin/sharedscratch/octopus/src/core/models/pairhmm/pair_hmm.hpp:27,
                 from /users/ludwig/benjamin/sharedscratch/octopus/src/core/models/haplotype_likelihood_model.hpp:26,
                 from /users/ludwig/benjamin/sharedscratch/octopus/src/core/models/haplotype_likelihood_array.hpp:24,
                 from /users/ludwig/benjamin/sharedscratch/octopus/src/core/callers/caller.hpp:24,
                 from /users/ludwig/benjamin/sharedscratch/octopus/src/core/callers/caller_factory.hpp:11,
                 from /users/ludwig/benjamin/sharedscratch/octopus/src/config/option_collation.hpp:17,
                 from /users/ludwig/benjamin/sharedscratch/octopus/src/main.cpp:14:
/users/ludwig/benjamin/sharedscratch/octopus/src/core/models/pairhmm/avx512_pair_hmm_impl.hpp: In static member function 'static octopus::hmm::simd::AVX512PairHMMInstructionSet<BandSize, ScoreTp>::VectorType octopus::hmm::simd::AVX512PairHMMInstructionSet<BandSize, ScoreTp>::do_vectorise_zero_set_last(octopus::hmm::simd::AVX512PairHMMInstructionSet<BandSize, ScoreTp>::ScoreType, short int)':
/users/ludwig/benjamin/sharedscratch/octopus/src/core/models/pairhmm/avx512_pair_hmm_impl.hpp:216:40: error: there are no arguments to '_mm512_set_epi16' that depend on a template parameter, so a declaration of '_mm512_set_epi16' must be available [-fpermissive]
                                        _mm512_set_epi16(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));
                                        ^~~~~~~~~~~~~~~~
/users/ludwig/benjamin/sharedscratch/octopus/src/core/models/pairhmm/avx512_pair_hmm_impl.hpp:216:40: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
make[2]: *** [src/CMakeFiles/octopus.dir/main.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/octopus.dir/all] Error 2
make: *** [all] Error 2

I tried editing the CMakeList.txt file in src/, adding -fpermissive and removing -Werror, but this leads to


/users/ludwig/benjamin/sharedscratch/octopus/src/core/models/pairhmm/avx512_pair_hmm_impl.hpp:182:15: error: could not convert '{{<expression error>}}' from '<brace-enclosed initializer list>' to 'octopus::hmm::simd::AVX512PairHMMInstructionSet<32, short int>::VectorType {aka std::array<__vector(8) long long int, 1>}'```

**Version**
the latest git HEAD (8be1c4c5d6eaa53e4e4af7d7f12489a0513e39c1)
dancooke commented 4 years ago

Hi Ben,

Best way to install on the cluster is to use the provided installation script with automatic dependency installation:

$ git clone https://github.com/luntergroup/octopus.git
$ octopus/scripts/install.py --install-dependencies

Note that the resulting binary will only work on AVX-512 capable machines (E & F nodes).

DaGaMs commented 4 years ago

Thanks. Using homebrew to download all dependencies seems a bit heavy handed. I usually try to use existing boost and other libraries. But as long as it works, I'm happy.

Anyway, I still think it might be worth figuring out why some gcc versions don't like something about that avx512_pair_hmm_impl.hpp file.

DaGaMs commented 4 years ago

Now getting a linker error:

Linking CXX executable octopus
/gpfs2/well/ludwig/users/benjamin/octopus/build/brew/bin/ld: /gpfs2/well/ludwig/users/benjamin/octopus/build/brew/lib/libcurl.so.4: undefined reference to `SSL_CTX_set_ciphersuites@OPENSSL_1_1_1'
/gpfs2/well/ludwig/users/benjamin/octopus/build/brew/bin/ld: /gpfs2/well/ludwig/users/benjamin/octopus/build/brew/lib/libcurl.so.4: undefined reference to `SSL_CTX_set_keylog_callback@OPENSSL_1_1_1'
/gpfs2/well/ludwig/users/benjamin/octopus/build/brew/bin/ld: /gpfs2/well/ludwig/users/benjamin/octopus/build/brew/lib/libcurl.so.4: undefined reference to `SSL_CTX_set_post_handshake_auth@OPENSSL_1_1_1'
collect2: error: ld returned 1 exit status
make[2]: *** [src/octopus] Error 1
make[1]: *** [src/CMakeFiles/octopus.dir/all] Error 2
make: *** [all] Error 2

Seems that libcurl has some dependencies which are installed by brew, but not linked?

DaGaMs commented 4 years ago

For what it's worth, I fixed this by manually doing brew link --force openssl in the brew directory before compiling. For some reason, homebrew didn't link openssl:

openssl@1.1 is keg-only, which means it was not symlinked into /gpfs2/well/ludwig/users/benjamin/octopus/build/brew, because this is an alternate version of another formula.