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

compilation problem on Snow leopard Mac osx in SortedDataWriter.cpp #51

Closed
pcantalupo opened this issue May 15, 2015 · 2 comments
Closed

Comments

@pcantalupo
Copy link

Hello,

Just tried to compile SNAP with latest code but got following error:

++ -O3 -Wno-format -MMD -ISNAPLib -msse   -c -o SNAPLib/SortedDataWriter.o SNAPLib/SortedDataWriter.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, long long unsigned int)'
             min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block
                                                                      ^
SNAPLib/SortedDataWriter.cpp:338:70: 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/SortedDataWriter.cpp:19:
/usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/bits/stl_algobase.h:261:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(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:261:5: note:   template argument deduction/substitution failed:
SNAPLib/SortedDataWriter.cpp:338:70: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long unsigned int')
             min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block
                                                                      ^
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/SortedDataWriter.cpp:19:
/usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/bits/stl_algobase.h:217:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/local/homebrew/Cellar/gcc/4.9.2_1/include/c++/4.9.2/bits/stl_algobase.h:217:5: note:   template argument deduction/substitution failed:
SNAPLib/SortedDataWriter.cpp:338:70: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long unsigned int')
             min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size()))); // 128kB to 8MB buffer space per block
                                                                      ^
make: *** [SNAPLib/SortedDataWriter.o] Error 1

Is this related to the previous problem that I had #40 (comment)?

Thank you

@jakewendt
Copy link

I changed SNAPLib/SortedDataWriter.cpp line 338 from ...

min(1UL << 23, max(1UL << 17, bufferSpace / blocks.size())));

... to ...

min(1UL << 23, max<long unsigned>(1UL << 17, bufferSpace / blocks.size())));

and it compiled.

@pcantalupo
Copy link
Author

That worked for me. Thank you muchly 👍

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

2 participants