jeromerobert / hmat-oss

A hierarchical matrix C/C++ library
GNU General Public License v2.0
22 stars 11 forks source link

mingw build error at e02281a #44

Closed jschueller closed 8 years ago

jschueller commented 8 years ago

mingw-w64 32 bits (64 bits target is fine) fails to compile hmat since e02281a [notice the warning about size_t being 32 bits so 17179869184 doesn't fit:]

[  5%] Building CXX object CMakeFiles/hmat-oss.dir/src/h_matrix.cpp.obj
In file included from /home/schueller/projects/hmat-oss/src/h_matrix.hpp:35:0,
                 from /home/schueller/projects/hmat-oss/src/h_matrix.cpp:34:
/home/schueller/projects/hmat-oss/src/admissibility.hpp:69:66: warning: large integer implicitly truncated to unsigned type [-Woverflow]
                                  size_t maxElementsPerBlockAca = 17179869184);
                                                                  ^
In file included from /usr/i686-w64-mingw32/include/c++/5.3.0/vector:64:0,
                 from /home/schueller/projects/hmat-oss/src/h_matrix.cpp:31:
/usr/i686-w64-mingw32/include/c++/5.3.0/bits/stl_vector.h: In instantiation of ‘void std::vector<_Tp, _Alloc>::_M_initialize_dispatch(_Integer, _Integer, std::__true_type) [with _Integer = int; _Tp = hmat::HMatrix<float>*; _Alloc = std::allocator<hmat::HMatrix<float>*>]’:
/usr/i686-w64-mingw32/include/c++/5.3.0/bits/stl_vector.h:413:26:   required from ‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = int; _Tp = hmat::HMatrix<float>*; _Alloc = std::allocator<hmat::HMatrix<float>*>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<hmat::HMatrix<float>*>]’
/home/schueller/projects/hmat-oss/src/h_matrix.cpp:1593:48:   required from ‘void hmat::HMatrix<T>::inverse() [with T = float]’
/home/schueller/projects/hmat-oss/src/h_matrix.cpp:2283:16:   required from here
/usr/i686-w64-mingw32/include/c++/5.3.0/bits/stl_vector.h:1252:22: error: invalid conversion from ‘int’ to ‘std::vector<hmat::HMatrix<float>*, std::allocator<hmat::HMatrix<float>*> >::value_type {aka hmat::HMatrix<float>*}’ [-fpermissive]
    _M_fill_initialize(static_cast<size_type>(__n), __value);
                      ^
/usr/i686-w64-mingw32/include/c++/5.3.0/bits/stl_vector.h:1298:7: note:   initializing argument 2 of ‘void std::vector<_Tp, _Alloc>::_M_fill_initialize(std::vector<_Tp, _Alloc>::size_type, const value_type&) [with _Tp = hmat::HMatrix<float>*; _Alloc = std::allocator<hmat::HMatrix<float>*>; std::vector<_Tp, _Alloc>::size_type = unsigned int; std::vector<_Tp, _Alloc>::value_type = hmat::HMatrix<float>*]’
       _M_fill_initialize(size_type __n, const value_type& __value)
jeromerobert commented 8 years ago

I'm unable to reproduce this issue with Debian Testing:

$ i686-w64-mingw32-g++ --version
i686-w64-mingw32-g++ (GCC) 5.3.1 20160205
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Could you check if the jr/mingw branch (848ff23) fix the bug for you, before I merge it ?

jschueller commented 8 years ago

yes the build is ok now

jschueller commented 8 years ago

fyi I still get one overflow warning after those which were fixed: /home/schueller/projects/hmat-oss/src/c_default_interface.cpp:137:25: warning: large integer implicitly truncated to unsigned type [-Woverflow] p->max_aca_elements = 17179869184;