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

CMakeLists.txt needs -std=c++1 for cmake < 3.1 #3

Open
nschiraldi opened this issue Oct 22, 2018 · 0 comments
Open

CMakeLists.txt needs -std=c++1 for cmake < 3.1 #3

nschiraldi opened this issue Oct 22, 2018 · 0 comments

Comments

@nschiraldi
Copy link

Build is failing on RHEL7 with cmake=2.8.12.2 and gcc=4.8.2

running install
running bdist_egg
running egg_info
writing src/tda.egg-info/PKG-INFO
writing dependency_links to src/tda.egg-info/dependency_links.txt
writing top-level names to src/tda.egg-info/top_level.txt
reading manifest file 'src/tda.egg-info/SOURCES.txt'
writing manifest file 'src/tda.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
-- pybind11 v2.2.3
-- Configuring done
-- Generating done
-- Build files have been written to: /network/rit/lab/schiraldilab/bin/TDA/build/temp.linux-x86_64-3.6
[  8%] [  8%] Building CXX object CMakeFiles/tda.dir/algorithms/CubicalRipser_2dim/src/dense_cubical_grids.cpp.o
Building CXX object CMakeFiles/tda.dir/algorithms/CubicalRipser_2dim/src/cubicalripser_2dim.cpp.o
In file included from /usr/include/c++/4.8.2/unordered_map:35:0,
                 from /network/rit/lab/schiraldilab/bin/TDA/algorithms/CubicalRipser_2dim/src/cubicalripser_2dim.cpp:31:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \

To fix, added following to CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)
set(CMAKE_CXX_FLAGS "-fpermissive")
if (CMAKE_VERSION VERSION_LESS "3.1")
  if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  endif ()
else ()
  set (CMAKE_CXX_STANDARD 11)
endif ()
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

1 participant