diff --git a/CMakeLists.txt b/CMakeLists.txt index a628e8608e034cf7bbde313da690e3b5c27b6bfc..fb103f17aa1122ec9b83922625c3baa6edeefb59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,30 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.24) project(Redesign CXX) +#SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) +#INCLUDE (NektarCommon) + +option(NEKTAR_USE_DEBUG " Enable Graphless execution" OFF) +option(NEKTAR_USE_SERIAL "Enable Serial execution" ON) +option(NEKTAR_USE_THREADS "Enable Multithreading execution" ON) +option(NEKTAR_USE_CUDA "Enable CUDA execution" ON) +OPTION(NEKTAR_MPI "Use MPI for parallelisation." ON) +option(NEKTAR_USE_SIMD "Enable SIMD support, if available" TRUE) + +if (NEKTAR_USE_CUDA AND NEKTAR_USE_SIMD) + MESSAGE(FATAL_ERROR "Cannot use both SIMD and CUDA") +endif() -enable_testing() +OPTION(NEKTAR_BUILD_DEMOS "Build demonstration codes." OFF) +OPTION(NEKTAR_BUILD_TESTS "Build tests." OFF) -option(NEKTAR_USE_CUDA "Enable CUDA support" FALSE) -option(NEKTAR_USE_SIMD "Enable SIMD support, if available" TRUE) +OPTION(NEKTAR_FULL_DEBUG "Enable Full Debugging." ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(CMAKE_BUILD_TYPE Debug) - -if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) - set(CMAKE_CUDA_ARCHITECTURES 75 80 86) - # CMake 3.24 - # set(CMAKE_CUDA_ARCHITECTURES native) -endif() +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) -# Default install location: build/dist +INCLUDE(CMakeDependentOption) IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist CACHE PATH "" FORCE) ENDIF() @@ -26,56 +33,43 @@ find_package(Nektar++ REQUIRED) include_directories(SYSTEM ${NEKTAR++_INCLUDE_DIRS} ${NEKTAR++_TP_INCLUDE_DIRS}) link_directories(${NEKTAR++_LIBRARY_DIRS} ${NEKTAR++_TP_LIBRARY_DIRS}) message(STATUS "Found Nektar++: version ${NEKTAR++_VERSION}") - set(CMAKE_INSTALL_RPATH "${NEKTAR++_LIBRARY_DIRS}") -set(SRC Field.cpp Operators/Operator.cpp - Operators/OperatorBwdTrans.cpp Operators/BwdTrans/BwdTransImpl.cpp - Operators/OperatorIProductWRTBase.cpp Operators/IProductWRTBase/IProductWRTBaseImpl.cpp - Operators/OperatorIProductWRTDerivBase.cpp Operators/IProductWRTDerivBase/IProductWRTDerivBaseImpl.cpp - Operators/OperatorPhysDeriv.cpp Operators/PhysDeriv/PhysDerivImpl.cpp - Operators/OperatorIdentity.cpp Operators/Identity/IdentityImpl.cpp - Operators/OperatorMass.cpp Operators/Mass/MassImpl.cpp - Operators/OperatorHelmholtz.cpp Operators/Helmholtz/HelmholtzImpl.cpp - Operators/OperatorAssmbScatr.cpp Operators/AssmbScatr/AssmbScatrImpl.cpp - Operators/OperatorNullPrecon.cpp Operators/NullPrecon/NullPreconImpl.cpp - Operators/OperatorDiagPrecon.cpp Operators/DiagPrecon/DiagPreconImpl.cpp - Operators/OperatorDirBndCond.cpp Operators/DirBndCond/DirBndCondImpl.cpp - Operators/OperatorNeuBndCond.cpp Operators/NeuBndCond/NeuBndCondImpl.cpp - Operators/OperatorRobBndCond.cpp Operators/RobBndCond/RobBndCondImpl.cpp - Operators/OperatorConjGrad.cpp Operators/ConjGrad/ConjGradImpl.cpp - Operators/OperatorFwdTrans.cpp Operators/FwdTrans/FwdTransImpl.cpp - Operators/OperatorHelmSolve.cpp Operators/HelmSolve/HelmSolveImpl.cpp - Operators/OperatorMatrix.cpp Operators/Matrix/MatrixImpl.cpp - Operators/OperatorAddTraceIntegral.cpp Operators/AddTraceIntegral/AddTraceIntegralImpl.cpp - ) +set(CMAKE_INCLUDE_CURRENT_DIR ON) -if (NEKTAR_USE_CUDA AND NEKTAR_USE_SIMD) - MESSAGE(FATAL_ERROR "Cannot use both SIMD and CUDA") -endif() +SET(NEKTAR_LIBRARY_TYPE "SHARED") if (NEKTAR_USE_CUDA) enable_language(CUDA) + find_package(CUDAToolkit REQUIRED) add_definitions(-DNEKTAR_USE_CUDA) - set(SRC ${SRC} MemoryRegionCUDA.cu - Operators/BwdTrans/BwdTransCUDA.cu - Operators/IProductWRTBase/IProductWRTBaseCUDA.cu - Operators/IProductWRTDerivBase/IProductWRTDerivBaseCUDA.cu - Operators/PhysDeriv/PhysDerivCUDA.cu - Operators/Identity/IdentityCUDA.cu - Operators/Mass/MassCUDA.cu - Operators/Helmholtz/HelmholtzCUDA.cu - Operators/AssmbScatr/AssmbScatrCUDA.cu - Operators/NullPrecon/NullPreconCUDA.cu - Operators/DiagPrecon/DiagPreconCUDA.cu - Operators/DirBndCond/DirBndCondCUDA.cu - Operators/NeuBndCond/NeuBndCondCUDA.cu - #Operators/RobBndCond/RobBndCondCUDA.cu - Operators/ConjGrad/ConjGradCUDA.cu - Operators/FwdTrans/FwdTransCUDA.cu - Operators/HelmSolve/HelmSolveCUDA.cu - Operators/Matrix/MatrixCUDA.cu - ) + + if(NEKTAR_FULL_DEBUG) + add_definitions(-DNEKTAR_CUDA_DEBUG) + endif() + + SET(CUDA_SEPARABLE_COMPILATION ON) + SET(CUDA_RUNTIME_LIBRARY "SHARED") + IF(NOT DEFINED CMAKE_CUDA_STANDARD) + SET(CMAKE_CUDA_STANDARD 20) + SET(CMAKE_CUDA_STANDARD_REQUIRED ON) + ENDIF() + IF(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) + SET(CMAKE_CUDA_ARCHITECTURES native) + ENDIF() + +endif() + +if (NEKTAR_USE_THREADS) + add_definitions(-DNEKTAR_USE_THREADS) +endif() + +if (NEKTAR_USE_SERIAL) + add_definitions(-DNEKTAR_USE_SERIAL) +endif() + +if (NEKTAR_USE_DEBUG) + add_definitions(-DNEKTAR_USE_DEBUG) endif() if (NEKTAR_USE_SIMD) @@ -83,90 +77,42 @@ if (NEKTAR_USE_SIMD) add_compile_options("-march=native") endif() -SET(OPERATORS_HEADERS - Operators/Operators.hpp -) +if (NEKTAR_MPI) + FIND_PACKAGE(MPI REQUIRED) + INCLUDE_DIRECTORIES(SYSTEM ${MPI_CXX_INCLUDE_PATH} ) + MESSAGE(STATUS "Found MPI: ${MPI_CXX_LIBRARIES}") + add_definitions(-DNEKTAR_USE_MPI) +endif() -# # Boilerplate cpp implementation files for registering an operator -# # with the factory. There are individual files for each operator shape -# # so to reduce compile time timeout failures due to the large number -# # of template impementations. - -# SET(OPERATORS BwdTrans) -# SET(SHAPES Seg Tri Quad Hex Tet Prism Pyr ) -# SET(DIMENSIONS 1 2 2 3 3 3 3 ) - -# # Note the commented out code is future simpler code for when cmake 3.17 can -# # be used on the tester. - -# foreach(OPERATOR IN LISTS OPERATORS) -# # if(${CMAKE_VERSION} VERSION_LESS "3.17.0") -# # Remove the code in this part of the conditional once CMake 3.17 -# # can be used on the CI tester. -# foreach(SHAPE IN LISTS SHAPES) -# IF( "${SHAPE}" STREQUAL "Seg" ) -# SET(DIMENSION 1) -# ELSEIF( "${SHAPE}" STREQUAL "Tri" OR "${SHAPE}" STREQUAL "Quad" ) -# SET(DIMENSION 2) -# ELSE() -# SET(DIMENSION 3) -# ENDIF() -# # else() -# # Use this code once CMake 3.17 can be used on the CI tester. -# # foreach(SHAPE DIMENSION IN ZIP_LISTS SHAPES DIMENSIONS) -# # endif() - -# # Uppercase is used for the #defines in the header files. -# string(TOUPPER ${SHAPE} TYPE) - -# # INST sets the macro used in NektarExpMacros.h -# # The BwdTrans only has regular elements. -# IF( "${OPERATOR}" STREQUAL "BwdTrans" ) -# SET(INST 1) -# # All other operators have regular and deformed elements. -# ELSE() -# SET(INST 2) -# ENDIF() - -# # Create the cpp file from the implementation file. -# configure_file(Operators/OperatorImp.cpp.in ${OPERATOR}${SHAPE}.cpp) - -# # Add the respective headers and cpp file. -# SET(OPERATORS_HEADERS ${OPERATORS_HEADERS} -# ${OPERATOR}/${OPERATOR}MatFree.hpp) -# SET(OPERATORS_HEADERS ${OPERATORS_HEADERS} -# ${OPERATOR}/${OPERATOR}MatFreeKernels.hpp) -# SET(SRC ${SRC} ${OPERATORS_SOURCES} -# ${CMAKE_CURRENT_BINARY_DIR}/${OPERATOR}${SHAPE}.cpp) - -# endforeach() -# endforeach() - -# add_compile_options("-fsanitize=address,undefined") -# add_link_options("-fsanitize=address,undefined") +#INCLUDE (ThirdPartyBoost) +SET(Boost_USE_STATIC_LIBS OFF) +IF( WIN32 ) + # The auto-linking feature has problems with USE_STATIC_LIBS off, so we use + # BOOST_ALL_NO_LIB to turn it off. + # Several boost libraries headers aren't configured correctly if + # USE_STATIC_LIBS is off, so we explicitly say they are dynamic with the + # remaining definitions. + ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_THREAD_DYN_LINK) +ENDIF( ) add_compile_definitions(NEKTAR_FULLDEBUG) # Test ASSERT/WARNING macros -add_library(Operators SHARED ${SRC}) -target_link_libraries(Operators PUBLIC ${NEKTAR++_LIBRARIES} ${NEKTAR++_TP_LIBRARIES}) -target_include_directories(Operators PRIVATE "${CMAKE_SOURCE_DIR}") -target_compile_definitions(Operators PUBLIC ${NEKTAR++_DEFINITIONS}) - -add_subdirectory(tests) +INCLUDE_DIRECTORIES(Operators) +ADD_SUBDIRECTORY(Operators) find_package(Doxygen) add_custom_target(doc COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/Doxyfile) +IF (NEKTAR_BUILD_TESTS) + enable_testing() + add_subdirectory(tests) + add_definitions(-DNEKTAR_TEST_ALL) +ENDIF (NEKTAR_BUILD_TESTS) + # Turn-on warnings -TARGET_COMPILE_OPTIONS(Operators PRIVATE -Wall -Wextra) -IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # For GNU compilers add pedantic warnings - IF (NOT NEKTAR_USE_CUDA) - TARGET_COMPILE_OPTIONS(Operators PRIVATE -Wpedantic) - ENDIF() - TARGET_COMPILE_OPTIONS(Operators PRIVATE -Wnon-virtual-dtor) -ENDIF() -# Temporarily disable warnings about comparing signed and unsigned -TARGET_COMPILE_OPTIONS(Operators PRIVATE -Wno-sign-compare) -# Temporarily disable warnings about narrowing of data types -TARGET_COMPILE_OPTIONS(Operators PRIVATE -Wno-narrowing -Wno-conversion) +add_compile_options( + $<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:MSVC>:/W4>> + $<$<COMPILE_LANGUAGE:CXX>:$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Werror -Wnon-virtual-dtor -Wno-sign-compare -Wno-narrowing -Wno-conversion>> +) + +add_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<$<CXX_COMPILER_ID:MSVC>:/MP>>) diff --git a/Operators/CMakeLists.txt b/Operators/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..2d701c5e7dc4f1bdf8560769866cf59531b7d53c --- /dev/null +++ b/Operators/CMakeLists.txt @@ -0,0 +1,117 @@ +MACRO(ADD_OPERATOR name) + SET(NAME_HEADERS ${name}_HEADERS) + SET(NAME_SOURCES ${name}_SOURCES) + + FILE(GLOB ${NAME_HEADERS} + ./*${name}.hpp + ./${name}/*.hpp + ) + FILE(GLOB ${NAME_SOURCES} + ./*${name}.cpp + ./${name}/*.cpp + ) + + IF(NEKTAR_USE_CUDA) + SET(NAME_CUDA_HEADERS ${name}_CUDA_HEADERS) + SET(NAME_CUDA_SOURCES ${name}_CUDA_SOURCES) + + FILE(GLOB ${NAME_CUDA_HEADERS} + ./${name}/*.cuh + ) + FILE(GLOB ${NAME_CUDA_SOURCES} + ./${name}/*.cu + ) + + SET(${NAME_HEADERS} + ${${NAME_HEADERS}} + ${${NAME_CUDA_HEADERS}} + ) + SET(${NAME_SOURCES} + ${${NAME_SOURCES}} + ${${NAME_CUDA_SOURCES}} + ) + ENDIF() + SET(OPERATORS_HEADERS + ${OPERATORS_HEADERS} + ${${NAME_HEADERS}} + ) + SET(OPERATORS_SOURCES + ${OPERATORS_SOURCES} + ${${NAME_SOURCES}} + ) +ENDMACRO() + + +SET(OPERATORS_HEADERS +./Operator.hpp +./Field.hpp +./MemoryRegionCPU.hpp +) + +SET(OPERATORS_SOURCES +./Operator.cpp +./Field.cpp +) + +ADD_OPERATOR(Identity) +ADD_OPERATOR(BwdTrans) +ADD_OPERATOR(IProductWRTBase) +ADD_OPERATOR(IProductWRTDerivBase) +ADD_OPERATOR(PhysDeriv) +ADD_OPERATOR(Mass) +ADD_OPERATOR(Helmholtz) +ADD_OPERATOR(ConjGrad) +ADD_OPERATOR(AssmbScatr) +ADD_OPERATOR(NullPrecon) +ADD_OPERATOR(DiagPrecon) +ADD_OPERATOR(FwdTrans) +ADD_OPERATOR(HelmSolve) +ADD_OPERATOR(Matrix) +ADD_OPERATOR(DirBndCond) +ADD_OPERATOR(NeuBndCond) +ADD_OPERATOR(RobBndCond) +ADD_OPERATOR(AddTraceIntegral) +#ADD_OPERATOR(Reduce) + + +if(NEKTAR_USE_CUDA) + SET(OPERATORS_SOURCES + ${OPERATORS_SOURCES} + ./MemoryRegionCuda.cu + ) + SET(OPERATORS_HEADERS + ${OPERATORS_HEADERS} + ./MemoryRegionCuda.hpp + ) + SET(ADDITIONAL_OPERATOR_DEPS + CUDA::cublas + ) +endif() + +SOURCE_GROUP(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${OPERATORS_HEADERS} ${OPERATORS_SOURCES}) + +ADD_DEFINITIONS(-DOPERATORS_EXPORTS) + +#ADD_NEKTAR_LIBRARY(Operators +# SOURCES ${OPERATORS_SOURCES} +# HEADERS ${OPERATORS_HEADERS} ${OPERATORS_KERNELS} +# DEPENDS Execution ${ADDITIONAL_OPERATOR_DEPS} +# SUMMARY "Nektar++ Operators library" +# DESCRIPTION "This library provides classes related to operators for Nektar++.") + + +add_library(Operators SHARED ${OPERATORS_SOURCES} ${OPERATORS_HEADERS}) +target_link_libraries(Operators PUBLIC ${NEKTAR++_LIBRARIES} ${NEKTAR++_TP_LIBRARIES}) +#target_link_libraries(Operators PUBLIC Execution ${ADDITIONAL_OPERATOR_DEPS}) +target_include_directories(Operators PRIVATE "${CMAKE_SOURCE_DIR}") +target_compile_definitions(Operators PUBLIC ${NEKTAR++_DEFINITIONS}) + +#INSTALL(TARGETS Operators +# LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX} +# RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}) +# +#INSTALL(DIRECTORY ./ DESTINATION ${CMAKE_INSTALL_PREFIX} +# COMPONENT dev FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "*.cuh") + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}) +TARGET_INCLUDE_DIRECTORIES(Operators PUBLIC ${CMAKE_SOURCE_DIR}/Operators) diff --git a/Field.cpp b/Operators/Field.cpp similarity index 100% rename from Field.cpp rename to Operators/Field.cpp diff --git a/Field.hpp b/Operators/Field.hpp similarity index 100% rename from Field.hpp rename to Operators/Field.hpp diff --git a/MemoryRegionCPU.hpp b/Operators/MemoryRegionCPU.hpp similarity index 95% rename from MemoryRegionCPU.hpp rename to Operators/MemoryRegionCPU.hpp index 7dcd1c2b44d609ef617557a8065a67d2e375d846..0ad017fb43956c6508af76683ef7b07513854ec8 100644 --- a/MemoryRegionCPU.hpp +++ b/Operators/MemoryRegionCPU.hpp @@ -29,7 +29,7 @@ public: size_t alignment = __STDCPP_DEFAULT_NEW_ALIGNMENT__) { // C++17 aligned new - m_host = new (std::align_val_t(alignment)) TData[n](); + m_host = static_cast<TData*>(::operator new[](n * sizeof(TData), std::align_val_t(alignment))); m_alignment = alignment; m_size = n; } diff --git a/MemoryRegionCUDA.cu b/Operators/MemoryRegionCUDA.cu similarity index 100% rename from MemoryRegionCUDA.cu rename to Operators/MemoryRegionCUDA.cu diff --git a/MemoryRegionCUDA.hpp b/Operators/MemoryRegionCUDA.hpp similarity index 100% rename from MemoryRegionCUDA.hpp rename to Operators/MemoryRegionCUDA.hpp diff --git a/Operators/Operator.hpp b/Operators/Operator.hpp index d03e3ca153f5ec9fe4e2147335562f2070afac0d..7029d8df64729e7d58fb7507497c08bd8004558c 100644 --- a/Operators/Operator.hpp +++ b/Operators/Operator.hpp @@ -6,6 +6,7 @@ #include <string> #include "Field.hpp" +#include <OperatorsDeclspec.hpp> namespace Nektar::Operators { diff --git a/Operators/OperatorAddTraceIntegral.hpp b/Operators/OperatorAddTraceIntegral.hpp index 37130a722869c14f35c5f55989ccc4738c027125..288cd0d33391461f219b4026349a944cc1df0c89 100644 --- a/Operators/OperatorAddTraceIntegral.hpp +++ b/Operators/OperatorAddTraceIntegral.hpp @@ -35,8 +35,8 @@ template <typename TData = default_fp_type> struct AddTraceIntegral using class_name = OperatorAddTraceIntegral<TData>; using FieldIn = Field<TData, FieldState::Phys>; using FieldOut = Field<TData, FieldState::Coeff>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; static std::shared_ptr<class_name> create( const MultiRegions::ExpListSharedPtr &expansionList, diff --git a/Operators/OperatorAssmbScatr.hpp b/Operators/OperatorAssmbScatr.hpp index 13ee34c50cb3a0bfb2514186868d26a1c7e24550..375ee0d1f569304e0b3e59cfeb1b2a2bd72acc43 100644 --- a/Operators/OperatorAssmbScatr.hpp +++ b/Operators/OperatorAssmbScatr.hpp @@ -35,8 +35,8 @@ public: template <typename TData = default_fp_type> struct AssmbScatr { using class_name = OperatorAssmbScatr<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; AssmbScatr() = delete; diff --git a/Operators/OperatorBwdTrans.hpp b/Operators/OperatorBwdTrans.hpp index 954571707cc4c0c11ac7397ca3902f151528f997..2fd37dffc307aba671b25520589f7da264c5c438 100644 --- a/Operators/OperatorBwdTrans.hpp +++ b/Operators/OperatorBwdTrans.hpp @@ -40,8 +40,8 @@ template <typename TData = default_fp_type> struct BwdTrans using class_name = OperatorBwdTrans<TData>; using FieldIn = Field<TData, FieldState::Coeff>; using FieldOut = Field<TData, FieldState::Phys>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; BwdTrans() = delete; diff --git a/Operators/OperatorConjGrad.hpp b/Operators/OperatorConjGrad.hpp index ad1bf8eeeef9cd9a13cefbb11f1fd7925cb9e94e..8f0db9ff6d07f1060eef99a15060f09a1a7eebc9 100644 --- a/Operators/OperatorConjGrad.hpp +++ b/Operators/OperatorConjGrad.hpp @@ -51,8 +51,8 @@ protected: template <typename TData = default_fp_type> struct ConjGrad { using class_name = OperatorConjGrad<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; ConjGrad() = delete; diff --git a/Operators/OperatorDiagPrecon.hpp b/Operators/OperatorDiagPrecon.hpp index fcfbb31104ba957019d053211533df5de6eea33d..f5d028a82ff34fe8b16583e9f0383c1e7baca281 100644 --- a/Operators/OperatorDiagPrecon.hpp +++ b/Operators/OperatorDiagPrecon.hpp @@ -25,8 +25,8 @@ public: template <typename TData = default_fp_type> struct DiagPrecon { using class_name = OperatorDiagPrecon<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; DiagPrecon() = delete; diff --git a/Operators/OperatorDirBndCond.hpp b/Operators/OperatorDirBndCond.hpp index 8f26d4a08654cda750ca2fa21a7846f9ed245bec..bf04ed8689dacd1d3a29110e6715061c830084f2 100644 --- a/Operators/OperatorDirBndCond.hpp +++ b/Operators/OperatorDirBndCond.hpp @@ -32,8 +32,8 @@ public: template <typename TData = default_fp_type> struct DirBndCond { using class_name = OperatorDirBndCond<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; DirBndCond() = delete; diff --git a/Operators/OperatorFwdTrans.hpp b/Operators/OperatorFwdTrans.hpp index be66cdfa6bcd919ba30bb60a597785c444b8ecc6..e84062dc7203a717399afd2e49fed24de48da882 100644 --- a/Operators/OperatorFwdTrans.hpp +++ b/Operators/OperatorFwdTrans.hpp @@ -37,8 +37,8 @@ public: template <typename TData = default_fp_type> struct FwdTrans { using class_name = OperatorFwdTrans<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; FwdTrans() = delete; diff --git a/Operators/OperatorHelmSolve.hpp b/Operators/OperatorHelmSolve.hpp index 9d110d6e338a265364ea4f36142c10f290ea871b..d204b2e55b4a9b210c78304f7d702bcd14859b27 100644 --- a/Operators/OperatorHelmSolve.hpp +++ b/Operators/OperatorHelmSolve.hpp @@ -33,8 +33,8 @@ public: template <typename TData = default_fp_type> struct HelmSolve { using class_name = OperatorHelmSolve<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; HelmSolve() = delete; diff --git a/Operators/OperatorHelmholtz.hpp b/Operators/OperatorHelmholtz.hpp index 80401814474604be111c40b01cbe21e283bed920..bf2e24456058a030639fd83ae5c15b0f01a8a28c 100644 --- a/Operators/OperatorHelmholtz.hpp +++ b/Operators/OperatorHelmholtz.hpp @@ -47,8 +47,8 @@ template <typename TData = default_fp_type> struct Helmholtz using class_name = OperatorHelmholtz<TData>; using FieldIn = Field<TData, FieldState::Coeff>; using FieldOut = Field<TData, FieldState::Coeff>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; Helmholtz() = delete; diff --git a/Operators/OperatorIProductWRTBase.hpp b/Operators/OperatorIProductWRTBase.hpp index 92fe6eb867237936c227cdf4677e6cea99dd2273..62d5da14310e6245013bb9feac0330e6495e16f0 100644 --- a/Operators/OperatorIProductWRTBase.hpp +++ b/Operators/OperatorIProductWRTBase.hpp @@ -35,8 +35,8 @@ template <typename TData = default_fp_type> struct IProductWRTBase using class_name = OperatorIProductWRTBase<TData>; using FieldIn = Field<TData, FieldState::Phys>; using FieldOut = Field<TData, FieldState::Coeff>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; IProductWRTBase() = delete; diff --git a/Operators/OperatorIProductWRTDerivBase.hpp b/Operators/OperatorIProductWRTDerivBase.hpp index 7a9e81956e1cc1e912cdf38c4bcc016505fd94c1..cfc2c5fbba4fbcd47c82489236381674fa94af40 100644 --- a/Operators/OperatorIProductWRTDerivBase.hpp +++ b/Operators/OperatorIProductWRTDerivBase.hpp @@ -38,8 +38,8 @@ template <typename TData = default_fp_type> struct IProductWRTDerivBase using class_name = OperatorIProductWRTDerivBase<TData>; using FieldIn = Field<TData, FieldState::Phys>; using FieldOut = Field<TData, FieldState::Coeff>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; IProductWRTDerivBase() = delete; diff --git a/Operators/OperatorIdentity.hpp b/Operators/OperatorIdentity.hpp index 2063d4cbb2e9cef961b12b212ed300decf4056f6..53699d4a5d9fd892315be6724b074d53d680f72a 100644 --- a/Operators/OperatorIdentity.hpp +++ b/Operators/OperatorIdentity.hpp @@ -38,8 +38,8 @@ struct Identity using class_name = OperatorIdentity<TData, TFieldState>; using FieldIn = Field<TData, TFieldState>; using FieldOut = Field<TData, TFieldState>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; Identity() = delete; diff --git a/Operators/OperatorMass.hpp b/Operators/OperatorMass.hpp index 5a2b5429bccf520a2c8b72747c21a82d311f413a..b984211751dcc9be4a27a06216e0ebeca44be689 100644 --- a/Operators/OperatorMass.hpp +++ b/Operators/OperatorMass.hpp @@ -40,8 +40,8 @@ template <typename TData = default_fp_type> struct Mass using class_name = OperatorMass<TData>; using FieldIn = Field<TData, FieldState::Coeff>; using FieldOut = Field<TData, FieldState::Coeff>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; Mass() = delete; diff --git a/Operators/OperatorMatrix.hpp b/Operators/OperatorMatrix.hpp index fab07ca8f24a67d8812e6c8e0cc5a840dd07c781..ac7f4499ea0ccd8b018271babf6192803768516b 100644 --- a/Operators/OperatorMatrix.hpp +++ b/Operators/OperatorMatrix.hpp @@ -28,8 +28,8 @@ public: template <FieldState TFieldState, typename TData> struct Matrix { using class_name = OperatorMatrix<TData, TFieldState>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; Matrix() = delete; diff --git a/Operators/OperatorNeuBndCond.hpp b/Operators/OperatorNeuBndCond.hpp index 7d081d13984094f68527c133de50b40ae2be1870..59ea82f89930cbbb1d2721f5747b72b814c945e0 100644 --- a/Operators/OperatorNeuBndCond.hpp +++ b/Operators/OperatorNeuBndCond.hpp @@ -31,8 +31,8 @@ public: template <typename TData = default_fp_type> struct NeuBndCond { using class_name = OperatorNeuBndCond<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; NeuBndCond() = delete; diff --git a/Operators/OperatorNullPrecon.hpp b/Operators/OperatorNullPrecon.hpp index 4ee30bb1305517a9148caa15083cb80130234195..d9685bf3a455fdefbcc7eb729a31fd31ed3f523e 100644 --- a/Operators/OperatorNullPrecon.hpp +++ b/Operators/OperatorNullPrecon.hpp @@ -25,8 +25,8 @@ public: template <typename TData = default_fp_type> struct NullPrecon { using class_name = OperatorNullPrecon<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; NullPrecon() = delete; diff --git a/Operators/OperatorPhysDeriv.hpp b/Operators/OperatorPhysDeriv.hpp index 38b2f0accd4da70b315aca212a2d54c23627739c..56dd3a0ea723e934733705f78294398889c6d2ce 100644 --- a/Operators/OperatorPhysDeriv.hpp +++ b/Operators/OperatorPhysDeriv.hpp @@ -40,8 +40,8 @@ template <typename TData = default_fp_type> struct PhysDeriv using class_name = OperatorPhysDeriv<TData>; using FieldIn = Field<TData, FieldState::Phys>; using FieldOut = Field<TData, FieldState::Phys>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; PhysDeriv() = delete; diff --git a/Operators/OperatorRobBndCond.hpp b/Operators/OperatorRobBndCond.hpp index 0b38b4799a2d49555a00afeeda60e23c4ddcba4f..5c86b1427dc90067bfd208cc4290ba570fccb525 100644 --- a/Operators/OperatorRobBndCond.hpp +++ b/Operators/OperatorRobBndCond.hpp @@ -29,8 +29,8 @@ public: template <typename TData = default_fp_type> struct RobBndCond { using class_name = OperatorRobBndCond<TData>; - static const std::string key; - static const std::string default_impl; + OPERATORS_EXPORT static const std::string key; + OPERATORS_EXPORT static const std::string default_impl; RobBndCond() = delete; diff --git a/Operators/OperatorsDeclspec.hpp b/Operators/OperatorsDeclspec.hpp new file mode 100644 index 0000000000000000000000000000000000000000..d76e5aa1d3318a7e98252aad96169ed36e576c7c --- /dev/null +++ b/Operators/OperatorsDeclspec.hpp @@ -0,0 +1,14 @@ +#ifndef NEKTAR__OPERATORS_OPERATORS_DECLSPEC_H +#define NEKTAR__OPERATORS_OPERATORS_DECLSPEC_H + +#if defined(_MSC_VER) +#ifdef OPERATORS_EXPORTS +#define OPERATORS_EXPORT _declspec(dllexport) +#else +#define OPERATORS_EXPORT _declspec(dllimport) +#endif +#else +#define OPERATORS_EXPORT +#endif + +#endif // NEKTAR__OPERATORS_OPERATORS_DECLSPEC_H