Skip to content
Snippets Groups Projects
Commit 32c84bea authored by Dave Moxey's avatar Dave Moxey
Browse files

Fixes for C++11

parent fbdd6ef8
No related branches found
No related tags found
No related merge requests found
Showing
with 44 additions and 22 deletions
......@@ -2,6 +2,28 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
# Nektar++ requires C++11. Try to infer this for older CMake versions (less than
# 3.1.0)
IF ("${CMAKE_VERSION}" VERSION_LESS "3.1")
IF (NOT MSVC)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
IF (COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSE()
MESSAGE(FATAL_ERROR "Nektar++ requires a compiler with C++11 support.")
ENDIF()
ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
MESSAGE(FATAL_ERROR "Nektar++ requires full C++11 support: please upgrade to Visual Studio 2013 or later")
ENDIF()
ELSE()
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
ENDIF()
# Default install location
IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE PATH "" FORCE)
......
......@@ -61,7 +61,7 @@ SessionReaderSharedPtr SessionReader_CreateInstance(py::list &ns)
void export_SessionReader()
{
py::class_<SessionReader,
boost::shared_ptr<SessionReader>,
std::shared_ptr<SessionReader>,
boost::noncopyable>(
"SessionReader", py::no_init)
......
......@@ -37,7 +37,7 @@ void export_Basis()
;
py::class_<Basis,
boost::shared_ptr<Basis> >(
std::shared_ptr<Basis> >(
"Basis", py::no_init)
.def("Create", &Basis_Create)
......
......@@ -6,7 +6,7 @@
using namespace Nektar::LibUtilities;
typedef boost::shared_ptr<Points<double> > PointsSharedPtr;
typedef std::shared_ptr<Points<double> > PointsSharedPtr;
PointsSharedPtr Points_Create(const PointsKey &pts)
{
......@@ -34,7 +34,7 @@ void export_Points()
;
py::class_<Points<double>,
boost::shared_ptr<Points<double> >,
std::shared_ptr<Points<double> >,
boost::noncopyable>(
"Points", py::no_init)
.def("Create", &Points_Create)
......
......@@ -9,7 +9,7 @@ using namespace Nektar::SpatialDomains;
void export_Expansion()
{
py::class_<Expansion,
boost::shared_ptr<Expansion>, py::bases<StdExpansion>,
std::shared_ptr<Expansion>, py::bases<StdExpansion>,
boost::noncopyable>(
"Expansion", py::no_init)
......
......@@ -7,7 +7,7 @@ using namespace Nektar::LocalRegions;
void export_QuadExp()
{
py::class_<QuadExp, py::bases<Expansion, StdRegions::StdQuadExp>,
boost::shared_ptr<QuadExp> >(
std::shared_ptr<QuadExp> >(
"QuadExp", py::init<const LibUtilities::BasisKey&,
const LibUtilities::BasisKey&,
const SpatialDomains::QuadGeomSharedPtr &>());
......
......@@ -7,7 +7,7 @@ using namespace Nektar::LocalRegions;
void export_SegExp()
{
py::class_<SegExp, py::bases<Expansion, StdRegions::StdSegExp>,
boost::shared_ptr<SegExp> >(
std::shared_ptr<SegExp> >(
"SegExp", py::init<const LibUtilities::BasisKey&,
const SpatialDomains::Geometry1DSharedPtr &>());
}
......@@ -7,7 +7,7 @@ using namespace Nektar::LocalRegions;
void export_TriExp()
{
py::class_<TriExp, py::bases<Expansion, StdRegions::StdTriExp>,
boost::shared_ptr<TriExp> >(
std::shared_ptr<TriExp> >(
"TriExp", py::init<const LibUtilities::BasisKey&,
const LibUtilities::BasisKey&,
const SpatialDomains::TriGeomSharedPtr &>());
......
......@@ -107,7 +107,7 @@ py::tuple ExpList_GetCoords(ExpListSharedPtr exp)
void export_ExpList()
{
py::class_<ExpList,
boost::shared_ptr<ExpList>,
std::shared_ptr<ExpList>,
boost::noncopyable>(
"ExpList", py::no_init)
......
......@@ -7,7 +7,7 @@ using namespace Nektar::MultiRegions;
void export_ExpList2D()
{
py::class_<ExpList2D, py::bases<ExpList>,
boost::shared_ptr<ExpList2D> >(
std::shared_ptr<ExpList2D> >(
"ExpList2D", py::init<
const LibUtilities::SessionReaderSharedPtr &,
const SpatialDomains::MeshGraphSharedPtr &>());
......
......@@ -19,7 +19,7 @@ namespace np = boost::numpy;
#define SIZENAME(s) SIZE_##s
#define NEKPY_WRAP_ENUM(ENUMNAME,MAPNAME) \
{ \
boost::python::enum_<ENUMNAME> tmp(#ENUMNAME); \
py::enum_<ENUMNAME> tmp(#ENUMNAME); \
for (int a = 0; a < (int)SIZENAME(ENUMNAME); ++a) \
{ \
tmp.value(MAPNAME[a], (ENUMNAME)a); \
......@@ -28,7 +28,7 @@ namespace np = boost::numpy;
}
#define NEKPY_WRAP_ENUM_STRING(ENUMNAME,MAPNAME) \
{ \
boost::python::enum_<ENUMNAME> tmp(#ENUMNAME); \
py::enum_<ENUMNAME> tmp(#ENUMNAME); \
for (int a = 0; a < (int)SIZENAME(ENUMNAME); ++a) \
{ \
tmp.value(MAPNAME[a].c_str(), (ENUMNAME)a); \
......
......@@ -19,7 +19,7 @@ void Geometry_GenGeomFactors(GeometrySharedPtr geom)
void export_Geometry()
{
py::class_<Geometry,
boost::shared_ptr<Geometry>,
std::shared_ptr<Geometry>,
boost::noncopyable>(
"Geometry", py::no_init)
......
......@@ -6,7 +6,7 @@ using namespace Nektar::SpatialDomains;
void export_Geometry1D()
{
py::class_<Geometry1D, py::bases<Geometry>, boost::shared_ptr<Geometry1D>,
py::class_<Geometry1D, py::bases<Geometry>, std::shared_ptr<Geometry1D>,
boost::noncopyable>(
"Geometry1D", py::no_init);
}
......@@ -6,7 +6,7 @@ using namespace Nektar::SpatialDomains;
void export_Geometry2D()
{
py::class_<Geometry2D, py::bases<Geometry>, boost::shared_ptr<Geometry2D>,
py::class_<Geometry2D, py::bases<Geometry>, std::shared_ptr<Geometry2D>,
boost::noncopyable>(
"Geometry2D", py::no_init);
}
......@@ -16,7 +16,7 @@ MeshGraphSharedPtr MeshGraph_Read(
}
/// MeshGraph::Read overloaded method selector
static boost::shared_ptr<MeshGraph> (*MeshGraph_Read_2)(
static std::shared_ptr<MeshGraph> (*MeshGraph_Read_2)(
const std::string&, bool) = &MeshGraph::Read;
/**
......@@ -31,7 +31,7 @@ void export_MeshGraph()
py::class_<TriGeomMap>("TriGeomMap")
.def(py::map_indexing_suite<TriGeomMap, true>());
py::class_<MeshGraph,
boost::shared_ptr<MeshGraph> >(
std::shared_ptr<MeshGraph> >(
"MeshGraph", py::init<>())
.def(py::init<int, int>())
......
......@@ -6,6 +6,6 @@ using namespace Nektar::SpatialDomains;
void export_QuadGeom()
{
py::class_<QuadGeom, py::bases<Geometry2D>, boost::shared_ptr<QuadGeom> >(
py::class_<QuadGeom, py::bases<Geometry2D>, std::shared_ptr<QuadGeom> >(
"QuadGeom", py::init<>());
}
......@@ -6,6 +6,6 @@ using namespace Nektar::SpatialDomains;
void export_SegGeom()
{
py::class_<SegGeom, py::bases<Geometry1D>, boost::shared_ptr<SegGeom> >(
py::class_<SegGeom, py::bases<Geometry1D>, std::shared_ptr<SegGeom> >(
"SegGeom", py::init<>());
}
......@@ -6,6 +6,6 @@ using namespace Nektar::SpatialDomains;
void export_TriGeom()
{
py::class_<TriGeom, py::bases<Geometry2D>, boost::shared_ptr<TriGeom> >(
py::class_<TriGeom, py::bases<Geometry2D>, std::shared_ptr<TriGeom> >(
"TriGeom", py::init<>());
}
......@@ -87,7 +87,7 @@ py::tuple StdExpansion_GetCoords(StdExpansionSharedPtr exp)
void export_StdExpansion()
{
py::class_<StdExpansion,
boost::shared_ptr<StdExpansion>,
std::shared_ptr<StdExpansion>,
boost::noncopyable>(
"StdExpansion", py::no_init)
......
......@@ -7,7 +7,7 @@ using namespace Nektar::StdRegions;
void export_StdQuadExp()
{
py::class_<StdQuadExp, py::bases<StdExpansion>,
boost::shared_ptr<StdQuadExp> >(
std::shared_ptr<StdQuadExp> >(
"StdQuadExp", py::init<const LibUtilities::BasisKey&,
const LibUtilities::BasisKey&>());
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment