bcgsc / biobloom

Create Bloom filters for a given reference and then use it to categorize sequences
http://www.bcgsc.ca/platform/bioinfo/software/biobloomtools
GNU General Public License v3.0
75 stars 15 forks source link

Problems compiling BBT on MacOS #30

Closed emreerhan closed 5 years ago

emreerhan commented 6 years ago

Hey @JustinChu,

I'm trying to figure out how to compile BBT in order to update it's formula to migrate it from brewsci/homebrew-science to brewsci/homebrew-bio.

I've downloaded the source code of BBT version 2.1.1, however I'm having difficulty compiling it on MacOS.

The error I get on MacOS Sierra is:

In file included from SeqEval.cpp:1:0:
../Common/SeqEval.h: In function 'bool SeqEval::evalSingle(const string&, const BloomFilter&, double, const BloomFilter*)':
../Common/SeqEval.h:59:23: error: invalid conversion from 'const uint64_t* {aka const long long unsigned int*}' to 'const size_t* {aka const long unsigned int*}' [-fpermissive]
   if (filter.contains(*itr)) {
                       ^~~~

Repeated for every instance of converting from const uint64_t to const size_t in that file.

My g++ version is:

> g++ --version
g++ (Homebrew GCC 7.3.0_1) 7.3.0

Do you know if this is a problem with my compiler? Or do you have other suggestions?

Thanks

JustinChu commented 6 years ago

It is an issue with the compiler and my code. On typical compilers, size_t is the same as uint64_t but they don't have to be. I have to make sure when I make changes to the code to cast the type if I need to.

I think I might retroactively add the fix it to the current version since I just updated it (For now I'll set the release to pre-release).

JustinChu commented 6 years ago

Since you are using gcc it might not be a compiler issue exactly but more of a mac issue. I don't have mac so it might take me some time to fix.

Mederer1993 commented 6 years ago

Hey!

Today I spent basically all day trying to get BBT to work on my new MacBook Pro. With the trick in another thread (https://github.com/bcgsc/biobloom/issues/34#issuecomment-413436802) I was finally able to start compiling, but now I'm having the same problem with invalid conversion from 'const uint64_t {aka const long long unsigned int}' to 'const size_t {aka const long unsigned int}' [-fpermissive]...

@JustinChu Have you figured out a solution yet?

JustinChu commented 6 years ago

Hi @Mederer1993, It's been on my TODO for a while. Can you try to compile this branch for me: https://github.com/bcgsc/biobloom/tree/MAC_OS_BUGFIX

Remember to run:

#First time
git submodule update --init
#If already initialized
git submodule update

I've had trouble reproducing the error since I don't generally work in a Mac environment and not all Mac OS setups seem to be generating this error. Thanks.

Mederer1993 commented 6 years ago

Hey!

Thank you very much for the quick response. Unfortunately I am getting the same error messages with the invalid conversions...

I understand that it is difficult. I'll keep playing with it thank you!

JustinChu commented 6 years ago

Hey @Mederer1993, I've pushed a bunch of changes to the master branch. @mohamadi has helped me test the code on his Mac and it seems to compile (gcc-5) Let me know if the master branch works for you. Don't forget to update the submodule.

Mederer1993 commented 6 years ago

Hey!

Thank you I’ll try it out today! And thank‘s for indicating the gcc version that worked for you. I’ve been trying it with gcc-8 and also gcc-6! I’ll let you if it worked for me :)