Commit fd40c64d authored by snuverink_j's avatar snuverink_j
Browse files

remove NOCPLUSPLUS11 compiler options; fixes issue #87

parent 58031721
......@@ -104,9 +104,6 @@ OPTION (DBG_SCALARFIELD "Enable dump of scalar field rho_m" OFF)
OPTION (DBG_STENCIL "Dump stencil of iterative solver in matlab format" OFF)
OPTION (BUILD_LIBOPAL "Enable building the OPAL library" OFF)
OPTION (NOCPLUSPLUS11_FOREACH "Disable C++11 foreach support" OFF)
OPTION (NOCPLUSPLUS11_NULLPTR "Disable C++11 nullptr support" OFF)
OPTION (NO_FIELD_ASSIGN_OPTIMIZATION "Disable compiler optimization of IPPL field assignment" OFF)
IF (BUILD_OPAL_UNIT_TESTS)
......@@ -208,20 +205,6 @@ IF (BUILD_LIBOPAL)
MESSAGE (STATUS "\nBuilding OPAL library")
ENDIF (BUILD_LIBOPAL)
IF (NOCPLUSPLUS11_FOREACH)
MESSAGE (STATUS "\nBuilding OPAL without c++11 foreach support")
SET (CMAKE_CXX_FLAGS
"-DOPAL_NOCPLUSPLUS11_FOREACH ${CMAKE_CXX_FLAGS}"
)
ENDIF (NOCPLUSPLUS11_FOREACH)
IF (NOCPLUSPLUS11_NULLPTR)
MESSAGE (STATUS "\nBuilding OPAL without c++11 nullptr support")
SET (CMAKE_CXX_FLAGS
"-DOPAL_NOCPLUSPLUS11_NULLPTR ${CMAKE_CXX_FLAGS}"
)
ENDIF (NOCPLUSPLUS11_NULLPTR)
IF (NO_FIELD_ASSIGN_OPTIMIZATION)
MESSAGE (STATUS "\nCompiler will not try to optimize field assignment")
SET (CMAKE_CXX_FLAGS
......@@ -253,7 +236,7 @@ IF (BUILD_OPAL_UNIT_TESTS)
ADD_SUBDIRECTORY(tests)
ENDIF (BUILD_OPAL_UNIT_TESTS)
# make variables visible in other CMakeKists files
# make variables visible in other CMakeLists files
set(OPAL_CXX_FLAGS ${OPAL_CXX_FLAGS}
CACHE INTERNAL "" FORCE
)
......
......@@ -91,9 +91,6 @@ OPTION (DBG_SCALARFIELD "Enable dump of scalar field rho_m" OFF)
OPTION (DBG_STENCIL "Dump stencil of iterative solver in matlab format" OFF)
OPTION (BUILD_LIBOPAL "Enable building the OPAL library" OFF)
OPTION (NOCPLUSPLUS11_FOREACH "Disable C++11 foreach support" OFF)
OPTION (NOCPLUSPLUS11_NULLPTR "Disable C++11 nullptr support" OFF)
OPTION (NO_FIELD_ASSIGN_OPTIMIZATION "Disable compiler optimization of IPPL field assignment" OFF)
IF (ENABLE_AMR_SOLVER)
......@@ -180,20 +177,6 @@ IF (BUILD_LIBOPAL)
MESSAGE (STATUS "\nBuilding OPAL library")
ENDIF (BUILD_LIBOPAL)
IF (NOCPLUSPLUS11_FOREACH)
MESSAGE (STATUS "\nBuilding OPAL without c++11 foreach support")
SET (CMAKE_CXX_FLAGS
"-DOPAL_NOCPLUSPLUS11_FOREACH ${CMAKE_CXX_FLAGS}"
)
ENDIF (NOCPLUSPLUS11_FOREACH)
IF (NOCPLUSPLUS11_NULLPTR)
MESSAGE (STATUS "\nBuilding OPAL without c++11 nullptr support")
SET (CMAKE_CXX_FLAGS
"-DOPAL_NOCPLUSPLUS11_NULLPTR ${CMAKE_CXX_FLAGS}"
)
ENDIF (NOCPLUSPLUS11_NULLPTR)
IF (NO_FIELD_ASSIGN_OPTIMIZATION)
MESSAGE (STATUS "\nCompiler will not try to optimize field assignment")
SET (CMAKE_CXX_FLAGS
......
......@@ -539,19 +539,10 @@ void EnvelopeBunch::createBunch() {
dfi_x = 0.0;
dfi_y = 0.0; // no rotation of coordinate system
//for(unsigned int i = 0; i < nSlices; i++)
//s.push_back(std::shared_ptr<EnvelopeSlice>(new EnvelopeSlice()));
s.resize(nSlices);
#ifdef OPAL_NOCPLUSPLUS11_FOREACH
for( auto slice = s.begin(); slice != s.end(); ++ slice ) {
(*slice) = std::shared_ptr<EnvelopeSlice>(new EnvelopeSlice());
}
#else
for( auto & slice : s ) {
slice = std::shared_ptr<EnvelopeSlice>(new EnvelopeSlice());
}
#endif
//XXX: not supported by clang at the moment
//std::generate(s.begin(), s.end(),
//[]()
......
......@@ -524,15 +524,8 @@ private:
/// backup slice values
void backup() {
#ifdef OPAL_NOCPLUSPLUS11_FOREACH
std::vector< std::shared_ptr<EnvelopeSlice> >::iterator slice;
for (slice = s.begin(); slice != s.end(); ++ slice) {
(*slice)->backup();
}
#else
for (auto & slice : s)
slice->backup();
#endif
}
......
#include "Algorithms/bet/EnvelopeSlice.h"
#include <Physics/Physics.h>
#ifdef OPAL_NOCPLUSPLUS11_FOREACH
#include <algorithm>
#endif
EnvelopeSlice::EnvelopeSlice() {
#ifdef OPAL_NOCPLUSPLUS11_FOREACH
std::fill(p, p + SLNPAR, 0.0);
std::fill(p_old, p_old + SLNPAR, 0.0);
#else
for(auto &slice_param : p) slice_param = 0.0;
for(auto &slice_param : p_old) slice_param = 0.0;
#endif
double initial_gamma = 1.0 + (1.0e6 * Physics::q_e /
(Physics::EMASS * Physics::c * Physics::c));
p[SLI_beta] = sqrt(1.0 / (1.0 - (1.0 / (initial_gamma * initial_gamma))));
......
......@@ -30,9 +30,6 @@
#include "gsl/gsl_spline.h"
#include <iostream>
#include <fstream>
#ifdef OPAL_NOCPLUSPLUS11_NULLPTR
#define nullptr NULL
#endif
extern Inform *gmsg;
......
......@@ -46,10 +46,6 @@
#include <gsl/gsl_sf_erf.h>
#include <gsl/gsl_qrng.h>
#ifdef OPAL_NOCPLUSPLUS11_NULLPTR
#define nullptr NULL
#endif
//#define DBG_SCALARFIELD
//#define FIELDSTDOUT
......
......@@ -27,10 +27,6 @@
// template parameter is the full type of the Field to compute, and the second
// is the dimension of the data, which should be specialized.
#ifdef OPAL_NOCPLUSPLUS11_NULLPTR
#define nullptr NULL
#endif
template<unsigned int Dim>
struct SpecializedGreensFunction { };
......
......@@ -31,10 +31,6 @@
// template parameter is the full type of the Field to compute, and the second
// is the dimension of the data, which should be specialized.
#ifdef OPAL_NOCPLUSPLUS11_NULLPTR
#define nullptr NULL
#endif
//const double ke=1./(4.*M_PI*8.8e-14);
const double ke=2.532638e8;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment