ratt-ru / meqtrees-timba

software system for implementing and solving arbitrary Measurement Equations
4 stars 5 forks source link

Compilation fails on Ubuntu 18.04 #37

Closed gijzelaerr closed 6 years ago

gijzelaerr commented 6 years ago
[ 27%] Building CXX object MEQ/CMakeFiles/meq.dir/src/VellsSlicer.cc.o
cd /packaging/kern/packaging/build/meqtrees-timba/obj-x86_64-linux-gnu/MEQ && /usr/bin/c++  -DHAVE_AIPSPP -DHAVE_GDBM -DMAKE_LOFAR_SYMBOLS_GLOBAL -DSTRIP_CUDA -DUSE_STD_COMPLEX -DUSE_THREADS -D_GNU_SOURCE -Dmeq_EXPORTS -I/packaging/kern/packaging/build/meqtrees-timba/obj-x86_64-linux-gnu/include -I/usr/include/casacore -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -I/packaging/kern/packaging/build/meqtrees-timba/obj-x86_64-linux-gnu/MEQ  -march=native -O2 -pipe -O3 -DNDEBUG -fPIC   -fPIC -Wno-deprecated -Wno-unknown-pragmas -o CMakeFiles/meq.dir/src/VellsSlicer.cc.o -c /packaging/kern/packaging/build/meqtrees-timba/MEQ/src/VellsSlicer.cc
In file included from /packaging/kern/packaging/build/meqtrees-timba/obj-x86_64-linux-gnu/include/MEQ/VellsSlicer.h:1:0,
                 from /packaging/kern/packaging/build/meqtrees-timba/MEQ/src/VellsSlicer.cc:27:
/packaging/kern/packaging/build/meqtrees-timba/MEQ/src/VellsSlicer.h: In member function ‘const T* Meq::ConstVellsSlicer<T, N>::pdata()’:
/packaging/kern/packaging/build/meqtrees-timba/MEQ/src/VellsSlicer.h:217:58: error: cannot call member function ‘void* Meq::VellsSlicer0::pdata()’ without object
       { return static_cast<const T*>(VellsSlicer0::pdata()); }
                                                          ^
/packaging/kern/packaging/build/meqtrees-timba/MEQ/src/VellsSlicer.h: In constructor ‘Meq::VellsSlicer<T, N>::VellsSlicer(Meq::Vells&, const int*)’:
/packaging/kern/packaging/build/meqtrees-timba/MEQ/src/VellsSlicer.h:243:26: error: no matching function for call to ‘Meq::VellsSlicer<T, N>::init(Meq::Vells&, const int*&, int)’
         init(vells,axes,N);
                          ^
/packaging/kern/packaging/build/meqtrees-timba/MEQ/src/VellsSlicer.h:168:12: note: candidate: void Meq::VellsSlicer0::init(Meq::Vells&, const LoShape&)
       void init (Vells &vells,const LoShape &axes)
            ^~~~
/packaging/kern/packaging/build/meqtrees-timba/MEQ/src/VellsSlicer.h:168:12: note:   candidate expects 2 arguments, 3 provided
MEQ/CMakeFiles/meq.dir/build.make:713: recipe for target 'MEQ/CMakeFiles/meq.dir/src/VellsSlicer.cc.o' failed
gijzelaerr commented 6 years ago

I find it weird since it looks like these are issues with timba itself and not one of the dependencies... investigating.

o-smirnov commented 6 years ago

Gah, stupid C++ shizzle...

o-smirnov commented 6 years ago

OK, they are both rather simple errors. I guess g++ has gotten stricter about templates. In the past it didn't bother to compile templated methods that were never instantiated, so if something went unused, it never got checked.

Here, https://github.com/ska-sa/meqtrees-timba/blob/master/MEQ/src/VellsSlicer.h#L217 it should say ConstVellsSlicer0.

This init() call at https://github.com/ska-sa/meqtrees-timba/blob/master/MEQ/src/VellsSlicer.h#L243 should be removed.

gijzelaerr commented 6 years ago

cool, will fix them when i have time.

gijzelaerr commented 6 years ago

There is much more :/ Looks mostly like namespace issues though. I'll push the changes to a branch

In file included from /usr/include/c++/7/math.h:36:0,
                 from /code/MeqNodes/src/FITSUtils.h:41,
                 from /code/build/include/MeqNodes/FITSUtils.h:1,
                 from /code/MeqNodes/src/FITSUtils.cc:24:
/usr/include/c++/7/cmath:1781:64: error: expected identifier before '::' token
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                                                ^~
/usr/include/c++/7/cmath:1781:66: error: declaration of '__value' not in a namespace surrounding '::'
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                                                  ^~~~~~~
/usr/include/c++/7/cmath:1781:66: error: '__value' should have been declared inside '::'
/usr/include/c++/7/cmath:1781:66: error: redeclaration of 'template<class _Tp> constexpr const int __value'
/usr/include/c++/7/cmath:97:56: note: previous declaration 'template<class _Tp> constexpr const int __value<_Tp>'
     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                                        ^~~~~~~
/usr/include/c++/7/cmath:1781:73: error: expected ';' before ',' token
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                                                         ^
/usr/include/c++/7/cmath:1799:47: error: '__is_integer' was not declared in this scope
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                               ^~~~~~~~~~~~

and

In file included from /usr/include/c++/7/math.h:36:0,
                 from /code/MeqNodes/src/FITSUtils.h:41,
                 from /code/build/include/MeqNodes/FITSUtils.h:1,
                 from /code/MeqNodes/src/FITSUtils.cc:24:
/usr/include/c++/7/cmath:1853:63: error: wrong number of template arguments (1, should be 2)

and

In file included from /usr/include/c++/7/math.h:36:0,
                 from /code/MeqNodes/src/FITSUtils.h:41,
                 from /code/build/include/MeqNodes/FITSUtils.h:1,
                 from /code/MeqNodes/src/FITSUtils.cc:24:
/usr/include/c++/7/cmath:1853:64: error: expected identifier before '::' token
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                                                ^~
/usr/include/c++/7/cmath:1853:66: error: declaration of '__value' not in a namespace surrounding '::'
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                                                  ^~~~~~~
/usr/include/c++/7/cmath:1853:66: error: '__value' should have been declared inside '::'
/usr/include/c++/7/cmath:1853:66: error: redeclaration of 'template<class _Tp> constexpr const int __value'
/usr/include/c++/7/cmath:97:56: note: previous declaration 'template<class _Tp> constexpr const int __value<_Tp>'
     typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                                        ^~~~~~~
/usr/include/c++/7/cmath:1853:73: error: expected ';' before ',' token
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
                                                                         ^
In file included from /code/MeqNodes/src/FITSUtils.h:41:0,
                 from /code/build/include/MeqNodes/FITSUtils.h:1,
                 from /code/MeqNodes/src/FITSUtils.cc:24:
/usr/include/c++/7/math.h:38:12: error: 'Meq::std::abs' has not been declared
 using std::abs;

and

/usr/include/c++/7/cmath:1168:11: error: '::logbl' has not been declared                                                                           [1819/1819]
   using ::logbl;
           ^~~~~
/usr/include/c++/7/cmath:1170:11: error: '::lrint' has not been declared
   using ::lrint;
           ^~~~~
/usr/include/c++/7/cmath:1171:11: error: '::lrintf' has not been declared
   using ::lrintf;
           ^~~~~~
/usr/include/c++/7/cmath:1172:11: error: '::lrintl' has not been declared
   using ::lrintl;
           ^~~~~~
/usr/include/c++/7/cmath:1174:11: error: '::lround' has not been declared
   using ::lround;
           ^~~~~~
/usr/include/c++/7/cmath:1175:11: error: '::lroundf' has not been declared
   using ::lroundf;
           ^~~~~~~
/usr/include/c++/7/cmath:1176:11: error: '::lroundl' has not been declared
   using ::lroundl;
           ^~~~~~~
/usr/include/c++/7/cmath:1178:11: error: '::nan' has not been declared
   using ::nan;
           ^~~
/usr/include/c++/7/cmath:1179:11: error: '::nanf' has not been declared
   using ::nanf;
           ^~~~
gijzelaerr commented 6 years ago

Full build log on travis

https://travis-ci.org/ska-sa/meqtrees-timba/builds/354313125?utm_source=github_status&utm_medium=notification

gijzelaerr commented 6 years ago

this has been fixed in the meanwhile