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

Does not build on 32 bit architectures #111

Closed tillea closed 3 years ago

tillea commented 6 years ago

Hi, since snap is distributed in Debian there is an attempt made to provide the program on different hardware architectures. There are also 32 bit architectures which all fail to build with the error

g++ -std=gnu++98 -MMD -ISNAPLib -Wdate-time -D_FORTIFY_SOURCE=2  -c -o SNAPLib/GenericFile_HDFS.o SNAPLib/GenericFile_HDFS.cpp
SNAPLib/SortedDataWriter.cpp: In member function 'bool SortedDataFilterSupplier::mergeSort()':
SNAPLib/SortedDataWriter.cpp:338:70: error: no matching function for call to 'max(long unsigned int, _int64)'
             min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block
                                                                      ^
In file included from /usr/include/c++/6/algorithm:61:0,
                 from SNAPLib/stdafx.h:13,
                 from SNAPLib/SortedDataWriter.cpp:19:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:265:5: note:   template argument deduction/substitution failed:
SNAPLib/SortedDataWriter.cpp:338:70: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and '_int64 {aka long long int}')
             min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block
                                                                      ^
In file included from /usr/include/c++/6/algorithm:61:0,
                 from SNAPLib/stdafx.h:13,
                 from SNAPLib/SortedDataWriter.cpp:19:
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note:   template argument deduction/substitution failed:
SNAPLib/SortedDataWriter.cpp:338:70: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and '_int64 {aka long long int}')
             min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block
                                                                      ^

I wonder whether the code can be made more portable. Or do you explicit target at 64Bit architectures exclusively? Kind regards, Andreas.

bolosky commented 6 years ago

Yes, it’s explicitly for 64 bit architectures only. It uses a data structure that’s a hash table index of the human genome, which will always be too big to fit in 32 bits of memory space because the genome itself has over 3 billion bases.

From: Andreas Tille [mailto:notifications@github.com] Sent: Wednesday, December 20, 2017 2:41 AM To: amplab/snap snap@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [amplab/snap] Does not build on 32 bit architectures (#111)

Hi, since snap is distributed in Debian there is an attempt made to provide the program on different hardware architectures. There are also 32 bit architectures which all fail to build with the error

g++ -std=gnu++98 -MMD -ISNAPLib -Wdate-time -D_FORTIFY_SOURCE=2 -c -o SNAPLib/GenericFile_HDFS.o SNAPLib/GenericFile_HDFS.cpp

SNAPLib/SortedDataWriter.cpp: In member function 'bool SortedDataFilterSupplier::mergeSort()':

SNAPLib/SortedDataWriter.cpp:338:70: error: no matching function for call to 'max(long unsigned int, _int64)'

         min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block

                                                                  ^

In file included from /usr/include/c++/6/algorithm:61:0,

             from SNAPLib/stdafx.h:13,

             from SNAPLib/SortedDataWriter.cpp:19:

/usr/include/c++/6/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)

 max(const _Tp& __a, const _Tp& __b, _Compare __comp)

 ^~~

/usr/include/c++/6/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:

SNAPLib/SortedDataWriter.cpp:338:70: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and '_int64 {aka long long int}')

         min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block

                                                                  ^

In file included from /usr/include/c++/6/algorithm:61:0,

             from SNAPLib/stdafx.h:13,

             from SNAPLib/SortedDataWriter.cpp:19:

/usr/include/c++/6/bits/stl_algobase.h:219:5: note: candidate: template const _Tp& std::max(const _Tp&, const _Tp&)

 max(const _Tp& __a, const _Tp& __b)

 ^~~

/usr/include/c++/6/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:

SNAPLib/SortedDataWriter.cpp:338:70: note: deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and '_int64 {aka long long int}')

         min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block

                                                                  ^

I wonder whether the code can be made more portable. Or do you explicit target at 64Bit architectures exclusively? Kind regards, Andreas.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Famplab%2Fsnap%2Fissues%2F111&data=02%7C01%7Cbolosky%40microsoft.com%7C59b9a8296bc844f5e6d708d547961d9f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636493632437473748&sdata=ir9hJKa6SK1F47j1vrkWt2%2BYJK6V%2FilyedbYcZT3gm8%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA752WAZU8qKlqpvynN6FTxL36XtRFTLks5tCOQngaJpZM4RIND8&data=02%7C01%7Cbolosky%40microsoft.com%7C59b9a8296bc844f5e6d708d547961d9f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636493632437473748&sdata=eYUN4aZClaX%2FSxhEgmdYYSp2cQIvWobJh79K3Q29sAo%3D&reserved=0.

tillea commented 6 years ago

On Wed, Dec 20, 2017 at 05:32:09PM +0000, Bill Bolosky wrote:

Yes, it’s explicitly for 64 bit architectures only. It uses a data structure that’s a hash table index of the human genome, which will always be too big to fit in 32 bits of memory space because the genome itself has over 3 billion bases.

Thanks for the explanation. I'll restrict the package to 64 bit architectures only. However, in any case I'd recommend to check the syntax even for 64bit. May be some future g++ might be even more picky

Kind regards, Andreas.