Skip to content

omega-h: fix -std=c++11 build error#8543

Merged
adamjstewart merged 1 commit intodevelopfrom
balay/xsdk-omega-h-fix-cxx11
Jun 23, 2018
Merged

omega-h: fix -std=c++11 build error#8543
adamjstewart merged 1 commit intodevelopfrom
balay/xsdk-omega-h-fix-cxx11

Conversation

@balay
Copy link
Copy Markdown
Contributor

@balay balay commented Jun 22, 2018

cd /tmp/balay/spack-stage/spack-stage-joxtpr/omega_h-9.13.4/spack-build/src && /home/balay/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/openmpi-3.1.0-7ws4tgx4z3o
ru5g5skjrxs5sobpeiyef/bin/mpic++   -Domega_h_EXPORTS -I/home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/src -I/tmp/bala
y/spack-stage/spack-stage-joxtpr/omega_h-9.13.4/spack-build/src -I/home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/tpl
-I/home/balay/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/zlib-1.2.11-5nus6knzumx4ik2yl44jxtgtsl7d54xb/include  -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/omega_h.di
r/Omega_h_map.cpp.o -c /home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/src/Omega_h_map.cpp
In file included from /usr/include/c++/5/chrono:35:0,
                 from /home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/src/Omega_h_timer.hpp:4,
                 from /home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/src/Omega_h_timer.cpp:1:
/usr/include/c++/5/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 \
  ^

#8542

cc: @ibaned @tgamblin

@balay balay added the xSDK label Jun 22, 2018
@balay balay force-pushed the balay/xsdk-omega-h-fix-cxx11 branch from 1cb9b76 to 95e864d Compare June 22, 2018 12:17
Copy link
Copy Markdown
Contributor

@ibaned ibaned left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @balay !

@adamjstewart
Copy link
Copy Markdown
Member

@scheibelp @becker33 was there another way to insert CXX flags with CMakePackage or is this the recommended approach?

@scheibelp
Copy link
Copy Markdown
Member

scheibelp commented Jun 22, 2018

This is fine. However, if at some point you wanted to customize compiler flags (in compilers.yaml) and have those automatically passed to the CMake build system (i.e. express them as -DCMAKE_..._FLAGS=...), and merge with the CXX11 flag dictated by the package (i.e. added in this PR), then based on https://spack.readthedocs.io/en/latest/packaging_guide.html?highlight=flag_handler#compiler-flags, an alternative to setting this option directly would be to implement the following function:

def flag_handler(self, name, flags):
    flags = list(flags)
    if name == 'cxxflags':
        flags.append(self.compiler.cxx11_flag)
    return (None, None, flags)

cd /tmp/balay/spack-stage/spack-stage-joxtpr/omega_h-9.13.4/spack-build/src && /home/balay/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/openmpi-3.1.0-7ws4tgx4z3o
ru5g5skjrxs5sobpeiyef/bin/mpic++   -Domega_h_EXPORTS -I/home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/src -I/tmp/bala
y/spack-stage/spack-stage-joxtpr/omega_h-9.13.4/spack-build/src -I/home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/tpl
-I/home/balay/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/zlib-1.2.11-5nus6knzumx4ik2yl44jxtgtsl7d54xb/include  -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/omega_h.di
r/Omega_h_map.cpp.o -c /home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/src/Omega_h_map.cpp
In file included from /usr/include/c++/5/chrono:35:0,
                 from /home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/src/Omega_h_timer.hpp:4,
                 from /home/balay/spack/var/spack/stage/omega-h-9.13.4-th4b67fz5es6cbgcar742jxamjt3tqjb/omega_h-9.13.4/src/Omega_h_timer.cpp:1:
/usr/include/c++/5/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 \
  ^
@balay balay force-pushed the balay/xsdk-omega-h-fix-cxx11 branch from 95e864d to 1b3c720 Compare June 23, 2018 02:48
@balay
Copy link
Copy Markdown
Contributor Author

balay commented Jun 23, 2018

@scheibelp Thanks! updated the PR

@adamjstewart adamjstewart merged commit e1661ff into develop Jun 23, 2018
@balay balay deleted the balay/xsdk-omega-h-fix-cxx11 branch June 24, 2018 03:04
@adamjstewart adamjstewart mentioned this pull request Jul 6, 2018
@alalazo alalazo mentioned this pull request Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants