Skip to content

Commit

Permalink
cmp - Merge origin
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioperez committed Jul 16, 2021
2 parents 88a95d0 + 53a67d0 commit f372ce6
Show file tree
Hide file tree
Showing 22 changed files with 506 additions and 276 deletions.
191 changes: 128 additions & 63 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.16)
#==============================================================================
#
# OpenSees -- Open System For Earthquake Engineering Simulation
Expand All @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.18)
# Project wide includes, properties, libraries, etc
#
# - Target definitions
# Define component libraries
# Declarations/definitions of component libraries
#
# - Target Configuration
# Specify target-specific compiler options, linking, etc
Expand All @@ -26,13 +26,14 @@ project(
)

set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/ETC/cmake)
set(OPS_EXTERN_SOURCE_DIR ${PROJECT_SOURCE_DIR}/OTHER/)
set(OPS_EXTERNALS_DIR ${PROJECT_SOURCE_DIR}/OTHER/)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/ETC/cmake")
set(OPS_EXTERN_SOURCE_DIR "${PROJECT_SOURCE_DIR}/OTHER/")
set(OPS_EXTERNALS_DIR "${PROJECT_SOURCE_DIR}/OTHER/")

set(OPS_BUNDLED_DIR ${PROJECT_SOURCE_DIR}/OTHER/)
set(OPS_SRC_DIR ${PROJECT_SOURCE_DIR}/SRC/)
set(OPS_BUNDLED_DIR "${PROJECT_SOURCE_DIR}/OTHER/")
set(OPS_SRC_DIR "${PROJECT_SOURCE_DIR}/SRC/")
include(OpenSeesFunctions)

include(${PROJECT_SOURCE_DIR}/Conf.cmake)

set_property(CACHE OPS_FINAL_TARGET PROPERTY STRINGS
Expand All @@ -57,7 +58,7 @@ if (UNIX)
endif()

if(WIN32)
include(OpenSeesDependenciesBundled)
include(OpenSeesDependenciesWin)
message(STATUS ">>> WIN32")
endif()

Expand All @@ -80,23 +81,16 @@ message("OPS >>> AMD: ${AMD_LIBRARIES}")
# General Setup
#
#==============================================================================
# Properties

#define_property(TARGET
# PROPERTY OPS_INTERPRETER_GLOBAL #TODO
# BRIEF_DOCS "Include functionality for using global interpreter"
# FULL_DOCS "..."
#)

#----------------------------------------------------------------
# Compilers
#----------------------------------------------------------------

# Fortran
#--------------------------------------
enable_language(Fortran)


# C++
#--------------------------------------

set(CMAKE_CXX_STANDARD 11)

# Warnings
Expand All @@ -111,7 +105,6 @@ opensees_add_cxx_flag(
MSVC /fp:precise
)


#----------------------------------------------------------------
# Global Includes
#----------------------------------------------------------------
Expand Down Expand Up @@ -173,12 +166,10 @@ include_directories(
${OPS_SRC_DIR}/actor/objectBroker
${OPS_SRC_DIR}/actor/message
)
# Temporary fix
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/include/incl)
include_directories(${TCL_INCLUDE_PATH})
include_directories(${MYSQL_INCLUDE_DIR})

# Temporary fix: include all directories with .h files by glob
file(GLOB_RECURSE ops_include_files CONFIGURE_DEPENDS
${OPS_SRC_DIR}/*.h
${OPS_BUNDLED_DIR}/*.h
Expand All @@ -191,7 +182,6 @@ endforeach()
list(REMOVE_DUPLICATES OPS_INCLUDE_DIRS)

include_directories(${OPS_INCLUDE_DIRS})
#message(${OPS_INCLUDE_DIRS})


#==============================================================================
Expand All @@ -212,12 +202,12 @@ add_library(G3_Material OBJECT)
add_library(G3_ModelBuilder OBJECT)

add_library(G3_Numerics INTERFACE)
target_link_libraries(G3_Numerics INTERFACE
target_link_libraries(G3_Numerics INTERFACE
${ARPACK_LIBRARIES}
${SUPERLU_LIBRARIES}
${UMFPACK_LIBRARIES}
${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
${AMD_LIBRARIES}
${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}
)


Expand All @@ -233,8 +223,6 @@ add_library(OPS_Material OBJECT)
add_library(OPS_Damage OBJECT)
add_library(OPS_Database OBJECT)



# Optional Extensions
add_library(OPS_DRM OBJECT EXCLUDE_FROM_ALL)
add_library(OPS_PFEM OBJECT EXCLUDE_FROM_ALL)
Expand Down Expand Up @@ -297,17 +285,18 @@ target_link_libraries(G3
#----------------------------
target_sources(OpenSees
PRIVATE
${OPS_SRC_DIR}/interpreter/OpenSeesBeamIntegrationCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesCrdTransfCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesFrictionModelCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesMiscCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesNDMaterialCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesOutputCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesElementCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesSectionCommands.cpp
${OPS_SRC_DIR}/interpreter/OpenSeesUniaxialMaterialCommands.cpp
"${OPS_SRC_DIR}/interpreter/OpenSeesBeamIntegrationCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesCrdTransfCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesFrictionModelCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesMiscCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesNDMaterialCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesOutputCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesElementCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesSectionCommands.cpp"
"${OPS_SRC_DIR}/interpreter/OpenSeesUniaxialMaterialCommands.cpp"
)

target_link_libraries(OpenSees
#OPS_Paraview
OPS_Renderer
Expand All @@ -332,35 +321,100 @@ target_include_directories(OpenSees PUBLIC ${TCL_INCLUDE_PATH})
#----------------------------
# OPS_Tcl
#----------------------------
file(GLOB_RECURSE OPS_TCL_SOURCES CONFIGURE_DEPENDS
${OPS_SRC_DIR}/Tcl*.cpp
)
# TODO: Properly list out Tcl files
list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX "${OPS_SRC_DIR}/database/TclBerkeley.*")
list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*PFEM.*")
list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*/reliability/.*")
list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*/drm/.*")

list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*tclMain.*")
list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*tclAppInit.*")
list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*Interpreter.*")

list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*/petsc/.*")

#list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*TclFeViewer.*")
list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*TclVideoP.*")

list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*TclFeap.*")

list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*nonlinearBeamColumn.*")
list(FILTER OPS_TCL_SOURCES EXCLUDE REGEX ".*TclNewUniaxialMaterial.*")
# END

# Add sources to OPS_Tcl target
target_sources(OPS_Tcl PRIVATE
${OPS_TCL_SOURCES}
"${OPS_SRC_DIR}/coordTransformation/TclGeomTransfCommand.cpp"

"${OPS_SRC_DIR}/database/TclDatabaseCommands.cpp"
"${OPS_SRC_DIR}/database/TclMySQL.cpp"
#"${OPS_SRC_DIR}/database/TclBerkeleyDB.cpp"

"${OPS_SRC_DIR}/domain/component/TclParameterCommands.cpp"
"${OPS_SRC_DIR}/domain/component/TclUpdateMaterialCommand.cpp"
"${OPS_SRC_DIR}/domain/groundMotion/TclGroundMotionCommand.cpp"
"${OPS_SRC_DIR}/domain/pattern/TclPatternCommand.cpp"
"${OPS_SRC_DIR}/domain/pattern/TclSeriesCommand.cpp"
"${OPS_SRC_DIR}/domain/pattern/TclSeriesIntegratorCommand.cpp"
#"${OPS_SRC_DIR}/domain/pattern/drm/TclPatternCommand.cpp"
"${OPS_SRC_DIR}/domain/region/TclRegionCommands.cpp"

"${OPS_SRC_DIR}/element/TclElementCommands.cpp"
"${OPS_SRC_DIR}/element/UP-ucsd/TclFourNodeQuadUPCommand.cpp"
"${OPS_SRC_DIR}/element/UWelements/Tcl_generateInterfacePoints.cpp"
"${OPS_SRC_DIR}/element/adapter/TclActuatorCommand.cpp"
"${OPS_SRC_DIR}/element/adapter/TclActuatorCorotCommand.cpp"
"${OPS_SRC_DIR}/element/adapter/TclAdapterCommand.cpp"
"${OPS_SRC_DIR}/element/beamWithHinges/TclBeamWithHingesBuilder.cpp"
"${OPS_SRC_DIR}/element/brick/TclBrickCommand.cpp"
"${OPS_SRC_DIR}/element/brick/TclTwenty_Node_BrickCommand.cpp"
"${OPS_SRC_DIR}/element/dispBeamColumnInt/TclDispBeamColumnIntCommand.cpp"
"${OPS_SRC_DIR}/element/elasticBeamColumn/TclElasticBeamCommand.cpp"
"${OPS_SRC_DIR}/element/elastomericBearing/TclElastomericBearingBoucWenCommand.cpp"
"${OPS_SRC_DIR}/element/elastomericBearing/TclElastomericBearingPlasticityCommand.cpp"
"${OPS_SRC_DIR}/element/elastomericBearing/TclElastomericBearingUFRPCommand.cpp"
"${OPS_SRC_DIR}/element/forceBeamColumn/TclForceBeamColumnCommand.cpp"
"${OPS_SRC_DIR}/element/fourNodeQuad/TclFourNodeQuadCommand.cpp"
"${OPS_SRC_DIR}/element/frictionBearing/TclFlatSliderCommand.cpp"
"${OPS_SRC_DIR}/element/frictionBearing/TclRJWatsonEQSCommand.cpp"
"${OPS_SRC_DIR}/element/frictionBearing/TclSingleFPCommand.cpp"
"${OPS_SRC_DIR}/element/frictionBearing/frictionModel/TclModelBuilderFrictionModelCommand.cpp"
"${OPS_SRC_DIR}/element/generic/TclGenericClientCommand.cpp"
"${OPS_SRC_DIR}/element/generic/TclGenericCopyCommand.cpp"
"${OPS_SRC_DIR}/element/gradientInelasticBeamColumn/TclGradientInelasticBeamColumnCommand.cpp"
"${OPS_SRC_DIR}/element/joint/TclBeamColumnJointCommand.cpp"
"${OPS_SRC_DIR}/element/joint/TclJoint2dCommand.cpp"
"${OPS_SRC_DIR}/element/joint/TclJoint3dCommand.cpp"
"${OPS_SRC_DIR}/element/twoNodeLink/TclTwoNodeLinkCommand.cpp"
"${OPS_SRC_DIR}/element/updatedLagrangianBeamColumn/TclCyclicModelCommands.cpp"
"${OPS_SRC_DIR}/element/updatedLagrangianBeamColumn/TclElement2dGNL.cpp"
"${OPS_SRC_DIR}/element/updatedLagrangianBeamColumn/TclElement2dYS.cpp"
"${OPS_SRC_DIR}/element/zeroLength/TclZeroLength.cpp"
#"${OPS_SRC_DIR}/element/PFEMElement/TclModelBuilder_addPFEMElement.cpp"
#"${OPS_SRC_DIR}/element/PFEMElement/TclPFEMCommands.cpp"
#"${OPS_SRC_DIR}/element/feap/TclFeapElementCommand.cpp"
#"${OPS_SRC_DIR}/element/nonlinearBeamColumn/tcl/TclElmtBuilder.cpp"
# Materials
"${OPS_SRC_DIR}/material/nD/TclModelBuilderNDMaterialCommand.cpp"
"${OPS_SRC_DIR}/material/nD/feap/TclFeapMaterialCommand.cpp"
"${OPS_SRC_DIR}/material/nD/soil/TclUpdateMaterialStageCommand.cpp"
"${OPS_SRC_DIR}/material/section/TclModelBuilderSectionCommand.cpp"
"${OPS_SRC_DIR}/material/section/yieldSurface/TclModelBuilderYS_SectionCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/PY/TclPyTzQzMaterialCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/TclModelBuilderUniaxialMaterialCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/backbone/TclModelBuilderBackboneCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/drain/TclDrainMaterialCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/fedeas/TclFedeasMaterialCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/limitState/TclLimitState.cpp"
"${OPS_SRC_DIR}/material/uniaxial/snap/TclSnapMaterialCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/stiffness/TclModelBuilderStiffnessDegradationCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/strength/TclModelBuilderStrengthDegradationCommand.cpp"
"${OPS_SRC_DIR}/material/uniaxial/unloading/TclModelBuilderUnloadingRuleCommand.cpp"
"${OPS_SRC_DIR}/material/yieldSurface/evolution/TclModelBuilderYS_EvolutionCommand.cpp"
"${OPS_SRC_DIR}/material/yieldSurface/plasticHardeningMaterial/TclModelBuilderYSPlasticMaterialCommand.cpp"
"${OPS_SRC_DIR}/material/yieldSurface/yieldSurfaceBC/TclModelBuilderYieldSurfaceBCCommand.cpp"
#"${OPS_SRC_DIR}/material/uniaxial/TclNewUniaxialMaterial.cpp"
# Model Builders
"${OPS_SRC_DIR}/modelbuilder/tcl/TclModelBuilder.cpp"
"${OPS_SRC_DIR}/modelbuilder/tcl/TclPlaneStressMaterialTester.cpp"
"${OPS_SRC_DIR}/modelbuilder/tcl/TclSectionTester.cpp"
"${OPS_SRC_DIR}/modelbuilder/tcl/TclUniaxialMaterialTester.cpp"
"${OPS_SRC_DIR}/optimization/tcl/TclOptimizationBuilder.cpp"
"${OPS_SRC_DIR}/recorder/TclRecorderCommands.cpp"
"${OPS_SRC_DIR}/damage/TclModelBuilderDamageModelCommand.cpp"

"${OPS_SRC_DIR}/api/elementAPI_TCL.cpp"
"${OPS_SRC_DIR}/tcl/commands.cpp"
"${OPS_SRC_DIR}/tcl/TclFeViewer.cpp"

#"${OPS_SRC_DIR}/interpreter/TclInterpreter.cpp"
"${OPS_SRC_DIR}/interpreter/TclWrapper.cpp"

#"${OPS_SRC_DIR}/reliability/analysis/gFunction/TclGFunEvaluator.cpp"
#"${OPS_SRC_DIR}/reliability/analysis/gFunction/TclMatlabGFunEvaluator.cpp"
#"${OPS_SRC_DIR}/reliability/domain/functionEvaluator/TclEvaluator.cpp"
#"${OPS_SRC_DIR}/reliability/tcl/TclReliabilityBuilder.cpp"
#"${OPS_SRC_DIR}/system_of_eqn/linearSOE/petsc/TclPetsc.cpp"
#"${OPS_SRC_DIR}/tcl/TclVideoPlayer.cpp"
)

target_include_directories(OPS_Tcl PUBLIC ${TCL_INCLUDE_PATH})
Expand All @@ -375,7 +429,6 @@ opensees_add_cxx_flag(TARGETS OPS_Tcl
#----------------------------
# OpenSeesTcl
#----------------------------

target_link_libraries(OpenSeesTcl
OPS_Tcl ${OPS_Element_List} OPS_Thermal OpenSees ${CMAKE_DL_LIBS}
)
Expand All @@ -395,6 +448,7 @@ target_link_libraries(OpenSeesMP OpenSees)
target_compile_definitions(OpenSeesSP
PUBLIC _OPS_PARALLEL_INTERPRETERS
)

#----------------------------
# OpenSeesPy
#----------------------------
Expand All @@ -418,6 +472,17 @@ if(FMK)
)
endif()

#----------------------------
# Extensions
#----------------------------
message("OPS >>> Configuring OpenSees extensions")
foreach(extension IN LISTS OPS_Element_List OPS_Extension_List)
string(TOUPPER "${extension}" ext_flag)
set(ext_flag "_${ext_flag}")
message(" Adding definition '${ext_flag}'")
add_compile_definitions(${ext_flag})
endforeach()

#----------------------------
# Renderer
#----------------------------
Expand Down
35 changes: 26 additions & 9 deletions Conf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
# All Rights Reserved
# (Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)
#
#------------------------------------------------------------------------------

#==============================================================================
# Select Executable
#
Expand All @@ -23,12 +21,14 @@ set(OPS_FINAL_TARGET "OpenSeesTcl"
option(FMK
"Special FMK Code" OFF)

option(OPS_THREADSAFE
"Only build thread safe components" ON)
# G3 Options
#--------------------------------------
option(G3_Api_OPS_Global
"Compile G3 library with bindings \
to the global OpenSees API" ON)

# Component Libraries
#--------------------------------------

option(OPS_Use_Reliability
"Include reliability" OFF)

Expand Down Expand Up @@ -68,17 +68,34 @@ define_property(TARGET
FULL_DOCS "..."
)


#==============================================================================
# Select Element Libraries
# Select Auxiliary Libraries
#
# Each element in this list ows and associated macro definition
# Each element in this list owns an associated macro definition that is the
# name of the lib converted to uppercase, and prepended with an underscore
# (e.g. using OPS_Element_truss defines the macro _OPS_ELEMENT_TRUSS)
#==============================================================================
set(OPS_Extension_List

OPS_Reliability # TODO: replace existing tests on '_RELIABILITY'

OPS_NumLib_PETSC
OPS_NumLib_METIS
OPS_NumLib_UMFPACK

OPS_ExtLib_PFEM

OPS_Graphics
OPS_Renderer
OPS_Renderer_GLX # TODO: replace existing tests on '_GLX'
OPS_Renderer_X11
)

set(OPS_Element_List

OPS_Element_truss
OPS_Element_beam3d
#OPS_Element_beam2d
OPS_Element_beam3d
OPS_Element_dispBeamColumnInt
OPS_Element_forceBeamColumn
OPS_Element_mixedBeamColumn
Expand Down

0 comments on commit f372ce6

Please sign in to comment.