amplab / snap

Scalable Nucleotide Alignment Program -- a fast and accurate read aligner for high-throughput sequencing data
https://www.microsoft.com/en-us/research/project/snap/
Apache License 2.0
287 stars 66 forks source link

OSX compilation #40

Closed blahah closed 9 years ago

blahah commented 9 years ago

Just a heads up that the dev branch can't be compiled on OSX:

g++-4.8 -O3 -Wno-format -MMD -ISNAPLib -msse   -c -o SNAPLib/Bam.o SNAPLib/Bam.cpp
g++-4.8 -O3 -Wno-format -MMD -ISNAPLib -msse   -c -o SNAPLib/CommandProcessor.o SNAPLib/CommandProcessor.cpp
g++-4.8 -O3 -Wno-format -MMD -ISNAPLib -msse   -c -o SNAPLib/Compat.o SNAPLib/Compat.cpp
SNAPLib/Compat.cpp: In function 'bool connectNamedPipes(NamedPipe*)':
SNAPLib/Compat.cpp:2045:12: error: expected ';' before 'lock'
      flock lock;
            ^
SNAPLib/Compat.cpp:2046:6: error: 'lock' was not declared in this scope
      lock.l_type = F_UNLCK;
      ^
SNAPLib/Compat.cpp: In function 'NamedPipe* OpenNamedPipe(const char*, bool)':
SNAPLib/Compat.cpp:2104:12: error: expected ';' before 'lock'
      flock lock;
            ^
SNAPLib/Compat.cpp:2105:6: error: 'lock' was not declared in this scope
      lock.l_type = F_WRLCK;
      ^
make: *** [SNAPLib/Compat.o] Error 1
sjackman commented 9 years ago

Also this.

g++ -O3 -Wno-format -MMD -ISNAPLib -msse   -c -o SNAPLib/Error.o SNAPLib/Error.cpp
SNAPLib/DataWriter.cpp:318:29: error: no matching function for call to 'min'
    batches[current].used = min(bufferSize, batchOffset + bytes);
                            ^~~
blahah commented 9 years ago

@sjackman see https://github.com/amplab/snap/pull/32

pcantalupo commented 9 years ago

I am trying to compile on a Snow leopard Mac OSX. Running make works until reaching this command:

$ g++ -O3 -Wno-format -MMD -ISNAPLib -msse   -c -o SNAPLib/DataWriter.o SNAPLib/DataWriter.cpp
SNAPLib/DataWriter.cpp: In member function 'virtual void AsyncDataWriter::advance(GenomeDistance, GenomeLocation)':
SNAPLib/DataWriter.cpp:318:64: error: no matching function for call to 'min(const size_t&, long long unsigned int)'
     batches[current].used = min(bufferSize, batchOffset + bytes);
                                                                ^
SNAPLib/DataWriter.cpp:318:64: note: candidates are:
In file included from /usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/algorithm:61:0,
                 from SNAPLib/stdafx.h:13,
                 from SNAPLib/DataWriter.cpp:19:
/usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/bits/stl_algobase.h:240:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^
/usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/bits/stl_algobase.h:240:5: note:   template argument deduction/substitution failed:
SNAPLib/DataWriter.cpp:318:64: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long unsigned int')
     batches[current].used = min(bufferSize, batchOffset + bytes);
                                                                ^
In file included from /usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/algorithm:61:0,
                 from SNAPLib/stdafx.h:13,
                 from SNAPLib/DataWriter.cpp:19:
/usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/bits/stl_algobase.h:194:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/bits/stl_algobase.h:194:5: note:   template argument deduction/substitution failed:
SNAPLib/DataWriter.cpp:318:64: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long unsigned int')
     batches[current].used = min(bufferSize, batchOffset + bytes);
                                                                ^

Any ideas what to try?

Thank you,

Paul

blahah commented 9 years ago

@pcantalupo yes, I fixed this bug in #32. See https://github.com/amplab/snap/pull/32/files.

bolosky commented 9 years ago

Merged pull request into dev. We'll handle master by integrating dev changes back into it.