Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build from source #77

Open
7PintsOfCherryGarcia opened this issue Oct 30, 2023 · 3 comments
Open

Can't build from source #77

7PintsOfCherryGarcia opened this issue Oct 30, 2023 · 3 comments

Comments

@7PintsOfCherryGarcia
Copy link

7PintsOfCherryGarcia commented Oct 30, 2023

Get the following compilation error when compiling ntHashIterator.hpp:
Building on Fedora 36
gcc (GCC) 12.2.1 20221121

g++ -DHAVE_CONFIG_H -I.  -I./Common -I/home/jregalado/Software/ntCard -fopenmp  -Wall -Wextra -Werror -O3 -MT ntcard-ntcard.o -MD -MP -MF .deps/ntcard-ntcard.Tpo -c -o ntcard-ntcard.o `test -f 'ntcard.cpp' || echo './'`ntcard.cpp
In file included from vendor/ntHash/ntHashIterator.hpp:6,
                 from ntcard.cpp:2:
In function ‘bool NTMC64(const char*, unsigned int, unsigned int, uint64_t&, uint64_t&, unsigned int&, uint64_t*)’,
    inlined from ‘bool NTMC64(const char*, unsigned int, unsigned int, uint64_t&, uint64_t&, unsigned int&, uint64_t*)’ at vendor/ntHash/nthash.hpp:467:13,
    inlined from ‘void ntHashIterator::init()’ at vendor/ntHash/ntHashIterator.hpp:66:53,
    inlined from ‘ntHashIterator::ntHashIterator(const std::string&, unsigned int, unsigned int)’ at vendor/ntHash/ntHashIterator.hpp:41:13,
    inlined from ‘void ntRead(const std::string&, const std::vector<unsigned int>&, uint16_t*, size_t*)’ at ntcard.cpp:151:38:
vendor/ntHash/nthash.hpp:489:17: error: array subscript 1 is outside array bounds of ‘void [8]’ [-Werror=array-bounds]
  489 |         hVal[i] =  tVal;
      |         ~~~~~~~~^~~~~~~
In constructor ‘ntHashIterator::ntHashIterator(const std::string&, unsigned int, unsigned int)’,
    inlined from ‘void ntRead(const std::string&, const std::vector<unsigned int>&, uint16_t*, size_t*)’ at ntcard.cpp:151:38:
vendor/ntHash/ntHashIterator.hpp:39:58: note: at offset 8 into object of size 8 allocated by ‘operator new []’
   39 |      m_seq(seq), m_h(h), m_k(k), m_hVec(new uint64_t[h]), m_pos(0)
@lcoombe
Copy link
Member

lcoombe commented Nov 2, 2023

Hi @7PintsOfCherryGarcia,

Is installing via conda an option for you? We generally recommend this for easier installation: https://bioconda.github.io/recipes/ntcard/README.html

@7PintsOfCherryGarcia
Copy link
Author

I can, but I am playing with the code modifying some things and need to compile from source. So far haven't been able to debug the out of bounds error that I am getting.

@jwcodee
Copy link
Member

jwcodee commented Nov 8, 2023

Hi @7PintsOfCherryGarcia, can you update your gcc compiler and try again? This is a common compiler bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants