lucabaldini / xpedaq

Data acquisition software for the X-ray polarimetry explorers
GNU General Public License v2.0
0 stars 0 forks source link

xpepeds does not compile under Fedora 23 32 bit #95

Closed lucabaldini closed 8 years ago

lucabaldini commented 8 years ago
g++ -c -pipe -std=c++11 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -std=gnu++98 -Wno-deprecated -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include -I. -I.. -I../gui -I../daq -I../utils -I../qcustomplot -I../quickusb-2.15.2 -Imoc -o build/xpepedsWindow.o xpepedsWindow.cpp
In file included from /usr/include/c++/5.3.1/array:35:0,
                 from ./pedestalsMap.h:4,
                 from ../gui/pDisplayWindow.h:9,
                 from xpepedsWindow.h:27,
                 from xpepedsWindow.cpp:23:
/usr/include/c++/5.3.1/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support \
  ^
In file included from ../gui/pDisplayWindow.h:9:0,
                 from xpepedsWindow.h:27,
                 from xpepedsWindow.cpp:23:
./pedestalsMap.h:14:16: error: ‘array’ in namespace ‘std’ does not name a template type
   typedef std::array<double, kNPedestal> arr_t;
                ^
./pedestalsMap.h:26:39: error: expected ‘)’ before ‘const’
     PedestalsMapData(pedestals::arr_t const &data);
                                       ^
./pedestalsMap.h:37:24: error: ‘std::shared_ptr’ has not been declared
                   std::shared_ptr<pColorMapOptions> options);
                        ^
./pedestalsMap.h:37:34: error: expected ‘,’ or ‘...’ before ‘<’ token
                   std::shared_ptr<pColorMapOptions> options);
                                  ^
./pedestalsMap.h:47:10: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
     std::shared_ptr<pColorMapOptions> m_options;
          ^
./pedestalsMap.h:11:13: warning: ‘pedestals::kNx’ defined but not used [-Wunused-variable]
   const int kNx = static_cast<int>(xpoldetector::kNumPixelsX);
             ^
./pedestalsMap.h:12:13: warning: ‘pedestals::kNy’ defined but not used [-Wunused-variable]
   const int kNy = static_cast<int>(xpoldetector::kNumPixelsY);
             ^
Makefile:961: recipe for target 'build/xpepedsWindow.o' failed
make: *** [build/xpepedsWindow.o] Error 1
lucabaldini commented 8 years ago
[lbaldini@pcglast45 xpepeds]$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/5.3.1/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --disable-libgcj --with-isl --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 5.3.1 20160406 (Red Hat 5.3.1-6) (GCC) 
lucabaldini commented 8 years ago

Apparently the issue is that in the compiler command

g++ -c -pipe -std=gnu++11 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -std=gnu++98 -Wno-deprecated -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include -I. -I.. -I../gui -I../daq -I../utils -I../qcustomplot -I../quickusb-2.15.2 -Imoc -o build/pDisplayWindow.o ../gui/pDisplayWindow.cpp

we have both -std=gnu++11 and -std=gnu++98. Removing the second by hand fixes the issue, but I'm not sure how to persuade Qt.

lucabaldini commented 8 years ago

Same exact error on Fedora 23 64 bit---it really looks like something having to do with gcc 5?

lucabaldini commented 8 years ago

This seems to be fixed by a

QMAKE_CXXFLAGS_RELEASE -= -std=gnu++98

I pushed a fix---Alberto, can you test it on your system? And feel free to reopen this if there's any issue.