Skip to content

Commit

Permalink
Updated C++ standard from C++11 to C++14.
Browse files Browse the repository at this point in the history
  • Loading branch information
GPMueller committed Dec 22, 2020
1 parent 053ce9d commit 63261d9
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ endif()
set( CMAKE_DISABLE_IN_SOURCE_BUILD ON )
### Position independent code
set( CMAKE_POSITION_INDEPENDENT_CODE ON )
### We need at least C++11
set( CMAKE_CXX_STANDARD 11 )
### We need at least C++14
set( CMAKE_CXX_STANDARD 14 )
### Set the cmake subdirectory
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" )
####################################################################
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Introduction <a name="Introduction"></a>

#### A modern framework for magnetism science on clusters, desktops & laptops and even your Phone

**Spirit** is a **platform-independent** framework for spin dynamics, written in C++11.
**Spirit** is a **platform-independent** framework for spin dynamics, written in C++14.
It combines the traditional cluster work, using using the command-line, with modern
visualisation capabilites in order to maximize scientists' productivity.

Expand Down
8 changes: 4 additions & 4 deletions core/CMake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message(FATAL_ERROR "GCC version must be at least 5.1!")
endif()
### Compiler Flags
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
### Linker Flags
if (APPLE)
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_compact_unwind" )
Expand All @@ -30,12 +30,12 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
### Message
MESSAGE( STATUS ">> Chose compiler: Clang emcc" )
### Compiler Flags
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
else ()
### Message
MESSAGE( STATUS ">> Chose compiler: Clang" )
### Compiler Flags
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
endif ()
######################################################################

Expand All @@ -52,7 +52,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel")
### Message
MESSAGE( STATUS ">> Chose compiler: Intel" )
### Compiler Flags
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
# set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
### Linker Flags
if (APPLE)
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no_compact_unwind" )
Expand Down
8 changes: 4 additions & 4 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ if( SPIRIT_USE_CUDA )
find_package( CUDA 8 REQUIRED )

# set( CUDA_PROPAGATE_HOST_FLAGS ON )
# --std=c++11 flag may be necessary, but it is propagated from global flags...
# --std=c++14 flag may be necessary, but it is propagated from global flags...
# if it appears twice, for some reason the compilation breaks

set( CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -lineinfo -arch=${SPIRIT_CUDA_ARCH} --expt-relaxed-constexpr --expt-extended-lambda" )
Expand All @@ -155,7 +155,7 @@ if( SPIRIT_USE_CUDA )
set( META_COMPILER_FULL "${META_COMPILER_FULL} and nvcc (${CUDA_VERSION}) for cuda arch \\\"${SPIRIT_CUDA_ARCH}\\\"" )

if( NOT DEFINED CMAKE_CUDA_STANDARD )
set( CMAKE_CUDA_STANDARD 11 )
set( CMAKE_CUDA_STANDARD 14 )
set( CMAKE_CUDA_STANDARD_REQUIRED ON )
endif()

Expand Down Expand Up @@ -317,7 +317,7 @@ add_library( ${META_PROJECT_NAME} OBJECT
${SOURCE_SPIRIT_UTILITY} )

set_target_properties( ${META_PROJECT_NAME} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF )

Expand Down Expand Up @@ -461,7 +461,7 @@ if( SPIRIT_BUILD_FOR_CXX OR SPIRIT_BUILD_FOR_JS )
target_link_libraries( ${testName} ${META_PROJECT_NAME}_static )
# Properties
set_target_properties( ${testName} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
RUNTIME_OUTPUT_DIRECTORY ${TEST_RUNTIME_OUTPUT_DIRECTORY} )
Expand Down
2 changes: 1 addition & 1 deletion docs/Build_Unix_OSX.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Core library
**Requirements**

- cmake >= 3.10
- compiler with C++11 support, e.g. gcc >= 5.1
- compiler with C++14 support, e.g. gcc >= 5.1

**Build**

Expand Down
2 changes: 1 addition & 1 deletion docs/Build_Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Core library
**Requirements**

- cmake >= 3.10
- compiler with C++11 support, e.g. msvc 14 2015
- compiler with C++14 support, e.g. msvc 19.10 (VS 2017, version 15.1)

**Build**

Expand Down
2 changes: 1 addition & 1 deletion ui-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ add_executable( ${PROJECT_NAME} ${OS_BUNDLE_NAME} ${SOURCE_SPIRIT_UI_CXX} )
set_target_properties( ${PROJECT_NAME} PROPERTIES
OUTPUT_NAME ${SPIRIT_EXE_NAME}
RUNTIME_OUTPUT_DIRECTORY ${SPIRIT_OUTPUT_DIRECTORY}
CXX_STANDARD 11
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF )

Expand Down
6 changes: 3 additions & 3 deletions ui-cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Pressing `Ctrl+C` twice within 2 seconds will cause immediate termination.
### Command Line
This is a very simplistic command line user interface implementing the **core** library.
It has no non-standard library dependencies and should thus run almost anywhere,
where a compiler with C++11 support is available.
where a compiler with C++14 support is available.

#### Controlling the code
The actions need to be hard-coded into `main.cpp`, there is currently no way to
Expand All @@ -33,8 +33,8 @@ menu, one can import and export e.g. spin configurations.
The `Spin Widget` wraps the **VFRendering** library's visualisation capabilities
and provides user interaction.
The remaining widgets are used to control parameters and view output. They are packed
into a `QDockWidget`, meaning they are repositionable and can be toggled.
into a `QDockWidget`, meaning they are repositionable and can be toggled.

#### ui files
The *ui* folder contains QT-specific xml files, which can be edited using
*QT Creator* or *QT Designer*.
*QT Creator* or *QT Designer*.
4 changes: 2 additions & 2 deletions ui-web/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MESSAGE( STATUS ">> --------------------- UI - Web -----------------------------


######### CMake Version #####################
cmake_minimum_required(VERSION 2.8.11)
cmake_minimum_required(VERSION 3.1)
#############################################


Expand Down Expand Up @@ -356,7 +356,7 @@ set_target_properties( webui PROPERTIES OUTPUT_NAME "libSpirit" )
### We want it to be placed under ui-web/js/ s.t. it is directly part of the python core module/package
set_target_properties( webui PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/ui-web/js/ )

set_property( TARGET webui PROPERTY CXX_STANDARD 11 )
set_property( TARGET webui PROPERTY CXX_STANDARD 14 )
set_property( TARGET webui PROPERTY CXX_STANDARD_REQUIRED ON )
set_property( TARGET webui PROPERTY CXX_EXTENSIONS OFF )

Expand Down
2 changes: 1 addition & 1 deletion ui-web/web.html
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ <h4 class="panel-title">
<h5>Spin Simulation Framework</h5>
<p id="spirit-version">Spirit version x</p>
<br>
<p>Spirit is <strong>platform-independent, open-source</strong> code with optional visualization, written in C++11.
<p>Spirit is <strong>platform-independent, open-source</strong> code with optional visualization, written in C++14.
The source code is available on <a href="https://github.com/spirit-code/spirit" title="spirit-code/spirit">GitHub</a> under the terms of the <a href="https://github.com/spirit-code/spirit/blob/master/LICENSE.txt" title="Spirit License">MIT license</a>.</p>
<p>While this web-based demo version is limited to Spin Dynamics simulations, the Spirit code has been developed as a flexible solution to various use-cases, including:</p>
<ul>
Expand Down

0 comments on commit 63261d9

Please sign in to comment.