diff --git a/CMakeLists.txt b/CMakeLists.txt index da81269f..70b0b4bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,10 @@ set(OpenFOAM_VERSION $ENV{WM_PROJECT_VERSION}) set(OpenFOAM_DIR $ENV{WM_PROJECT_DIR}) set(OpenFOAM_LIB_DIR $ENV{FOAM_LIBBIN}) set(OpenFOAM_SRC $ENV{FOAM_SRC}) + set(OpenFOAM_APP $ENV{FOAM_APP}) + set(SRC_ORIG ${CMAKE_CURRENT_SOURCE_DIR}/src_orig) @@ -34,12 +36,29 @@ ENDFUNCTION(R_SEARCH) set(DF_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) set(DF_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src) -# set the link options -set(LINK_FLAGS "-Xlinker --add-needed -Xlinker --no-as-needed") + +set(CMAKE_INSTALL_PREFIX ${DF_ROOT}) + +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -Xlinker --add-needed -Xlinker --no-as-needed") + set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread -fPIC") + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + + R_SEARCH(${DF_SRC}/dfCombustionModels dfcombustion_inc) R_SEARCH(${DF_SRC}/dfCanteraMixture dfcantera_inc) R_SEARCH(${DF_SRC}/lagrangian/intermediate dflagrangianinter_inc) @@ -47,6 +66,7 @@ R_SEARCH(${DF_SRC}/lagrangian/spray dflagrangianspray_inc) R_SEARCH(${DF_SRC}/lagrangian/turbulence dflagrangianturb_inc) R_SEARCH(${DF_SRC}/dfChemistryModel dfchemistry_inc) R_SEARCH(${DF_SRC}/thermophysicalModels/thermophysicalProperties dfthermophysicalprop_inc) + R_SEARCH(${DF_SRC}/thermophysicalModels/basic dfthermophysicalbasic_inc) R_SEARCH(${DF_SRC}/thermophysicalModels/SLGThermo dfthermophysicalslg_inc) R_SEARCH(${DF_SRC}/TurbulenceModels dfturbulence_inc) @@ -64,14 +84,16 @@ endif(DEFINED ENV{CANTERA_ROOT}) -set(CMAKE_C_COMPILER g++) -set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version -set(DEFINITIONS_COMPILE "-std=c++11 -DWM_ARCH_OPTION=64 -DWM_DP --DWM_LABEL_SIZE=32 -Wall -Wextra -Wno-unused-parameter --Wno-old-style-cas -Wno-overloaded-virtual -Wno-unused-variable --Wno-unused-local-typedef -Wno-invalid-offsetof -Wno-deprecated-register --Wno-undefined-var-template -O0 -g -DFULLDEBUG -DNoRepository --ftemplate-depth-100 -fPIC") + +include_directories( + ${OpenFOAM_SRC}/finiteVolume/lnInclude + + ${OpenFOAM_SRC}/OSspecific/POSIX/lnInclude + ${OpenFOAM_SRC}/OpenFOAM/lnInclude + ) + +link_directories(${OpenFOAM_LIB_DIR} ${OpenFOAM_LIB_DIR}/dummy ) + # Compiling configure @@ -84,6 +106,7 @@ include_directories( ) + set(CMAKE_INSTALL_PREFIX ${DF_ROOT}) add_subdirectory(${DF_SRC}/thermophysicalModels/thermophysicalProperties) @@ -102,8 +125,9 @@ add_subdirectory(${DF_SRC}/dfCombustionModels) add_subdirectory(${DF_SRC}/dynamicMesh) add_subdirectory(${DF_SRC}/dynamicFvMesh) +# add_subdirectory(${DF_ROOT}/applications/solvers/df0DFoam) +#add_subdirectory(${DF_ROOT}/applications/solvers/dfLowMachFoam) +# add_subdirectory(${DF_ROOT}/applications/solvers/dfHighSpeedFoam) +# add_subdirectory(${DF_ROOT}/applications/solvers/dfSprayFoam) + -add_subdirectory(${DF_ROOT}/applications/solvers/df0DFoam) -add_subdirectory(${DF_ROOT}/applications/solvers/dfLowMachFoam) -add_subdirectory(${DF_ROOT}/applications/solvers/dfHighSpeedFoam) -add_subdirectory(${DF_ROOT}/applications/solvers/dfSprayFoam) diff --git a/applications/solvers/dfLowMachFoam/CMakeLists.txt b/applications/solvers/dfLowMachFoam/CMakeLists.txt index b67477c3..59c731af 100644 --- a/applications/solvers/dfLowMachFoam/CMakeLists.txt +++ b/applications/solvers/dfLowMachFoam/CMakeLists.txt @@ -1,4 +1,109 @@ +cmake_minimum_required(VERSION 3.5) project(dfLowMachFoam LANGUAGES CXX) +FIND_PACKAGE(MPI REQUIRED) + +message(STATUS "MPI include path is " ${MPI_INCLUDE_PATH}) +message(STATUS "MPI libraries " ${MPI_LIBRARIES}) + + +# Check valid OpenFOAM +if(DEFINED ENV{WM_PROJECT_DIR}) + MESSAGE(STATUS "OpenFOAM: " $ENV{WM_PROJECT_DIR}) +else() + message(FATAL_ERROR "OpenFOAM is not sourced") +endif(DEFINED ENV{WM_PROJECT_DIR}) +set(OpenFOAM_VERSION $ENV{WM_PROJECT_VERSION}) +set(OpenFOAM_DIR $ENV{WM_PROJECT_DIR}) +set(OpenFOAM_LIB_DIR $ENV{FOAM_LIBBIN}) +set(OpenFOAM_SRC $ENV{FOAM_SRC}) + +set(DF_ROOT $ENV{DF_ROOT}) +set(DF_SRC ${DF_ROOT}/src) +set(SRC_ORIG ${DF_ROOT}/src_orig) + + +FUNCTION(R_SEARCH search_path return_list) + FILE(GLOB_RECURSE new_list ${search_path}/*.H) + SET(dir_list "") + FOREACH(file_path ${new_list}) + GET_FILENAME_COMPONENT(dir_path ${file_path} PATH) + SET(dir_list ${dir_list} ${dir_path}) + ENDFOREACH() + LIST(REMOVE_DUPLICATES dir_list) + SET(${return_list} ${dir_list} PARENT_SCOPE) +ENDFUNCTION(R_SEARCH) + + + + +R_SEARCH(${DF_SRC}/dfCombustionModels dfcombustion_inc) +R_SEARCH(${DF_SRC}/dfCanteraMixture dfcantera_inc) +R_SEARCH(${DF_SRC}/lagrangian/intermediate dflagrangianinter_inc) +R_SEARCH(${DF_SRC}/lagrangian/spray dflagrangianspray_inc) +R_SEARCH(${DF_SRC}/lagrangian/turbulence dflagrangianturb_inc) +R_SEARCH(${DF_SRC}/dfChemistryModel dfchemistry_inc) +R_SEARCH(${DF_SRC}/thermophysicalModels/thermophysicalProperties dfthermophysicalprop_inc) +R_SEARCH(${DF_SRC}/thermophysicalModels/thermophysicalProperties dfthermophysicalprop_inc) +R_SEARCH(${DF_SRC}/thermophysicalModels/basic dfthermophysicalbasic_inc) +R_SEARCH(${DF_SRC}/thermophysicalModels/SLGThermo dfthermophysicalslg_inc) +R_SEARCH(${DF_SRC}/TurbulenceModels dfturbulence_inc) +R_SEARCH(${DF_SRC}/dynamicMesh dfnewdynamic_inc) +R_SEARCH(${DF_SRC}/dynamicFvMesh dffvdynamic_inc) + + +# Check valid libcantera +if(DEFINED ENV{CANTERA_ROOT}) + MESSAGE(STATUS "libcantera: " $ENV{CANTERA_ROOT}) + set(CANTERA_ROOT $ENV{CANTERA_ROOT}) +else() + message(FATAL_ERROR "libcantera directory is not specified") +endif(DEFINED ENV{CANTERA_ROOT}) + + +# Check valid Torch +#if(DEFINED $ENV{PYTHON_INC_DIR)}) +# MESSAGE(STATUS "Torch: " $ENV{CANTERA_ROOT}) +#else() +# message(FATAL_ERROR "no torch used") +#endif(DEFINED ENV{PYTHON_INC_DIR}) + + + +include_directories( + ${OpenFOAM_SRC}/finiteVolume/lnInclude + + ${OpenFOAM_SRC}/OSspecific/POSIX/lnInclude + ${OpenFOAM_SRC}/OpenFOAM/lnInclude + ) + +message(STATUS "dummydir:" ${OpenFOAM_LIB_DIR}/dummy) +link_directories(${OpenFOAM_LIB_DIR} ${OpenFOAM_LIB_DIR}/dummy ) + +set(CMAKE_INSTALL_PREFIX ${DF_ROOT}) + +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread -fPIC") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + +FIND_PACKAGE(MPI REQUIRED) + include_directories( ${OpenFOAM_SRC}/transportModels/compressible/lnInclude @@ -35,6 +140,12 @@ target_link_libraries(${PROJECT_NAME} $ENV{FOAM_LIBBIN}/libfiniteVolume.so libme target_link_libraries(${PROJECT_NAME} ${CANTERA_ROOT}/lib/libcantera_shared.so.2) + +#set_target_properties(${PROJECT_NAME} +# PROPERTIES +# LINK_OPTIONS "-Xlinker --add-needed -Xlinker --no-as-needed" +# ) + target_link_libraries(${PROJECT_NAME} dfCompressibleTurbulenceModels dfChemistryModel dfCanteraMixture @@ -45,4 +156,5 @@ $ENV{FOAM_LIBBIN}/openmpi-system/libPstream.so ) + install(TARGETS ${PROJECT_NAME} DESTINATION bin) \ No newline at end of file diff --git a/src/TurbulenceModels/compressible/CMakeLists.txt b/src/TurbulenceModels/compressible/CMakeLists.txt index fe38b197..32ff3f4c 100644 --- a/src/TurbulenceModels/compressible/CMakeLists.txt +++ b/src/TurbulenceModels/compressible/CMakeLists.txt @@ -1,6 +1,28 @@ project(dfCompressibleTurbulenceModels LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + set(WORKINGDIR ${SRC_ORIG}/TurbulenceModels/compressible/) include_directories( ${OpenFOAM_SRC}/TurbulenceModels/compressible/lnInclude diff --git a/src/TurbulenceModels/turbulenceModels/CMakeLists.txt b/src/TurbulenceModels/turbulenceModels/CMakeLists.txt index b5ffe189..db74a714 100644 --- a/src/TurbulenceModels/turbulenceModels/CMakeLists.txt +++ b/src/TurbulenceModels/turbulenceModels/CMakeLists.txt @@ -1,5 +1,26 @@ project(dfTurbulenceModels LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") include_directories( ${dfturbulence_inc} diff --git a/src/dfCanteraMixture/CMakeLists.txt b/src/dfCanteraMixture/CMakeLists.txt index 1e8efbd3..1e6ce105 100644 --- a/src/dfCanteraMixture/CMakeLists.txt +++ b/src/dfCanteraMixture/CMakeLists.txt @@ -18,6 +18,28 @@ add_library(dfCanteraMixture SHARED ) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + # dynamic link target_link_libraries(${PROJECT_NAME} $ENV{FOAM_LIBBIN}/libfiniteVolume.so libmeshTools.so) diff --git a/src/dfChemistryModel/CMakeLists.txt b/src/dfChemistryModel/CMakeLists.txt index d28ac3b2..692fdb45 100644 --- a/src/dfChemistryModel/CMakeLists.txt +++ b/src/dfChemistryModel/CMakeLists.txt @@ -1,6 +1,8 @@ project(dfChemistryModel LANGUAGES CXX) + find_package(MPI REQUIRED) + include_directories( ${dfchemistry_inc} ${OpenFOAM_SRC}/meshTools/lnInclude @@ -10,11 +12,34 @@ include_directories( ${OpenFOAM_SRC}/TurbulenceModels/compressible/lnInclude ${dfcantera_inc} ${CANTERA_ROOT}/include - ${OpenFOAM_SRC}/Pstream/mpi - ${MPI_INCLUDE_PATH} + ) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + + ${OpenFOAM_SRC}/Pstream/mpi + ${MPI_INCLUDE_PATH} + ) add_library(dfChemistryModel SHARED @@ -54,6 +79,7 @@ target_link_libraries(${PROJECT_NAME} dfFluidThermophysicalModels dfCompressibleTurbulenceModels dfCanteraMixture ${MPI_LIBRARIES} + ) diff --git a/src/dfCombustionModels/CMakeLists.txt b/src/dfCombustionModels/CMakeLists.txt index 3a395d52..7dfa0282 100644 --- a/src/dfCombustionModels/CMakeLists.txt +++ b/src/dfCombustionModels/CMakeLists.txt @@ -4,6 +4,28 @@ project(dfCombustionModels LANGUAGES CXX) message(STATUS "header" ${header_dir}) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + include_directories( ${OpenFOAM_SRC}/transportModels/compressible/lnInclude @@ -16,11 +38,13 @@ include_directories( ${PROJECT_SOURCE_DIR} ${dfcombustion_inc} ${dfchemistry_inc} + ${OpenFOAM_SRC}/Pstream/mpi ${OpenFOAM_SRC}/ODE/lnInclude ${MPI_INCLUDE_PATH} + $ENV{CANTERA_ROOT}/include /usr/include/python3.8 /home/runze/.local/lib/python3.8/site-packages/pybind11/include @@ -70,6 +94,7 @@ dfCanteraMixture dfChemistryModel ${MPI_LIBRARIES} $ENV{FOAM_LIBBIN}/openmpi-system/libPstream.so + ) target_link_libraries(${PROJECT_NAME} ${CANTERA_ROOT}/lib/libcantera_shared.so.2) diff --git a/src/dynamicFvMesh/CMakeLists.txt b/src/dynamicFvMesh/CMakeLists.txt index e8efd26b..a921d100 100644 --- a/src/dynamicFvMesh/CMakeLists.txt +++ b/src/dynamicFvMesh/CMakeLists.txt @@ -1,5 +1,27 @@ project(dfDynamicFvMesh LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + # add library add_library(dfDynamicFvMesh SHARED diff --git a/src/dynamicMesh/CMakeLists.txt b/src/dynamicMesh/CMakeLists.txt index 8866f4f3..a4a45f8d 100644 --- a/src/dynamicMesh/CMakeLists.txt +++ b/src/dynamicMesh/CMakeLists.txt @@ -1,5 +1,27 @@ project(newdynamicMesh LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + # add library add_library(newdynamicMesh SHARED @@ -45,4 +67,5 @@ include_directories( # install install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib + ) \ No newline at end of file diff --git a/src/functionObjects/field/CMakeLists.txt b/src/functionObjects/field/CMakeLists.txt index e19cbcaf..05d9c58d 100644 --- a/src/functionObjects/field/CMakeLists.txt +++ b/src/functionObjects/field/CMakeLists.txt @@ -1,5 +1,26 @@ project(dfFieldFunctionObjects LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") set(workDir ${SRC_ORIG}/functionObjects/field) diff --git a/src/lagrangian/intermediate/CMakeLists.txt b/src/lagrangian/intermediate/CMakeLists.txt index ee7a81bd..f19d5df8 100644 --- a/src/lagrangian/intermediate/CMakeLists.txt +++ b/src/lagrangian/intermediate/CMakeLists.txt @@ -1,5 +1,27 @@ project(dfLagrangianIntermediate LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + include_directories( ${OpenFOAM_SRC}/lagrangian/basic/lnInclude ${OpenFOAM_SRC}/lagrangian/distributionModels/lnInclude diff --git a/src/lagrangian/spray/CMakeLists.txt b/src/lagrangian/spray/CMakeLists.txt index db6cf172..fe405041 100644 --- a/src/lagrangian/spray/CMakeLists.txt +++ b/src/lagrangian/spray/CMakeLists.txt @@ -1,5 +1,26 @@ project(dfLagrangianSpray LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") include_directories( ${OpenFOAM_SRC}/lagrangian/basic/lnInclude diff --git a/src/lagrangian/turbulence/CMakeLists.txt b/src/lagrangian/turbulence/CMakeLists.txt index f9fcb16a..ca6d37fa 100644 --- a/src/lagrangian/turbulence/CMakeLists.txt +++ b/src/lagrangian/turbulence/CMakeLists.txt @@ -1,6 +1,28 @@ project(dfLagrangianTurbulence LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + include_directories( ${OpenFOAM_SRC}/lagrangian/basic/lnInclude ${dflagrangianinter_inc} diff --git a/src/regionModels/surfaceFilmModels/CMakeLists.txt b/src/regionModels/surfaceFilmModels/CMakeLists.txt index bd6d3a65..a628438d 100644 --- a/src/regionModels/surfaceFilmModels/CMakeLists.txt +++ b/src/regionModels/surfaceFilmModels/CMakeLists.txt @@ -1,5 +1,26 @@ project(dfSurfaceFilmModels LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") set(workDir ${SRC_ORIG}/regionModels/surfaceFilmModels) set(KINEMATICMODELS ${workDir}/submodels/kinematic) diff --git a/src/thermophysicalModels/SLGThermo/CMakeLists.txt b/src/thermophysicalModels/SLGThermo/CMakeLists.txt index b50b59d0..72a28602 100644 --- a/src/thermophysicalModels/SLGThermo/CMakeLists.txt +++ b/src/thermophysicalModels/SLGThermo/CMakeLists.txt @@ -1,5 +1,27 @@ project(dfSLGThermo LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + # add library add_library(${PROJECT_NAME} SHARED diff --git a/src/thermophysicalModels/basic/CMakeLists.txt b/src/thermophysicalModels/basic/CMakeLists.txt index 169b5e27..ccf0ad45 100644 --- a/src/thermophysicalModels/basic/CMakeLists.txt +++ b/src/thermophysicalModels/basic/CMakeLists.txt @@ -1,5 +1,27 @@ project(dfFluidThermophysicalModels LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + # add library set(workDir $ENV{SRC_ORIG}/thermophysicalModels/basic/) diff --git a/src/thermophysicalModels/thermophysicalProperties/CMakeLists.txt b/src/thermophysicalModels/thermophysicalProperties/CMakeLists.txt index bb211c93..a09025a8 100644 --- a/src/thermophysicalModels/thermophysicalProperties/CMakeLists.txt +++ b/src/thermophysicalModels/thermophysicalProperties/CMakeLists.txt @@ -1,5 +1,27 @@ project(dfThermophysicalProperties LANGUAGES CXX) +#set the options for the shared library +set(LINK_FLAGS "-fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed") + +#set the link options +set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}") +set(CMAKE_EXE_LINKER_FLAGS "${LINK_FLAGS}") + + +SET(CMAKE_C_COMPILER g++) +set(PATH_LIB_OPENMPI "openmpi-system") # Foundation version +set(DEFINITIONS_COMPILE "-std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 +-DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor +-Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 +-DNoRepository -ftemplate-depth-100 -std=c++14 +-Wno-unused-variable -Wno-unused-but-set-variable -Wno-old-style-cast -DOMPI_SKIP_MPICXX +-pthread +-fPIC -c") + + +# Compiling configure +add_definitions("${DEFINITIONS_COMPILE}") + # add library set(workDir ${SRC_ORIG}/thermophysicalModels/thermophysicalProperties/)