Skip to content

Commit

Permalink
Merge branch 'master' into hssSection
Browse files Browse the repository at this point in the history
  • Loading branch information
mhscott committed Oct 2, 2021
2 parents e19aa70 + ec812d9 commit b15c940
Show file tree
Hide file tree
Showing 24 changed files with 1,061 additions and 120 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,24 @@ jobs:
cmake ..
cmake --build . --target OpenSeesTcl -j5
build-win32:
name: Build on Windows
- name: Build
run: |
mkdir build
cd build
cmake ..
cmake --build . --target OpenSeesTcl -j5
# Not building on Windows until we can figure out how to use Fortran
# with Github Actions
# build-win32:
# name: Build on Windows
# runs-on: [windows-latest]
# steps:
# - name: Checkout sources
# uses: actions/checkout@v2
# with: {ref: cmake-build}
#
# - name: Install Conan
# uses: turtlebrowser/get-conan@main
#
# - name: Build
# run: |
# mkdir build
# cd build
# cmake ..
# cmake --build . --target OpenSeesTcl -j5


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,73 @@
# OpenSees -- Open System For Earthquake Engineering Simulation
# Pacific Earthquake Engineering Research Center
#
# (c) Copyright 1999-2021 The Regents of the University of California
# All Rights Reserved
# (Copyright and Disclaimer @ http://www.berkeley.edu/OpenSees/copyright.html)
#
#==============================================================================
# External Libraries
# External Libraries
#
#==============================================================================
# Synopsis
# - opensees_load(<PACKAGE> OPTIONS [<PATHS>])
# - opensees_load(<PACKAGE> [FLAGS] [<PATHS>])
#
# Options:
# - FIND: Use CMake to find library, fail if not found
# - SEARCH: Try finding library with CMake, build OpenSees
# Version if not found.
# Flags:
# - FIND: Use CMake to find library on system, fail if not found
#
# Keyword arguments
# Keyword arguments:
# Provide specific paths for library.
#
# - BUNDLED <path/to/OTHER/LIB/>
# Provide path to OpenSees bundled library
# Provide path to OpenSees bundled library directory containing a
# CMakeLists.txt file.
#
# - LIBRARY <path/to/lib.a> INCLUDE <path/to/include/>
#
# - CONAN <conan-package/version>
# Point to a conan package.
#
#----------------------------------------------------------------
opensees_load(TCL FIND
)

#opensees_load(TCL CONAN tcl/8.6.10)
opensees_load(TCL FIND)
set(TCL_LIBRARIES ${TCL_LIBRARY})

opensees_load(BLAS FIND
#LIBRARY /home/user/lib/libBlas.a
)
opensees_load(BLAS FIND)

opensees_load(LAPACK FIND
#LIBRARY /home/user/lib/libLapack.a
)
opensees_load(LAPACK FIND)

opensees_load(SUPERLU #FIND
opensees_load(SUPERLU
BUNDLED "${OPS_BUNDLED_DIR}/SuperLU_5.1.1/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/SuperLU_5.1.1/libSUPERLU.a"
)

opensees_load(ARPACK #FIND
opensees_load(ARPACK
BUNDLED "${OPS_BUNDLED_DIR}/ARPACK/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/ARPACK/libARPACK.a"
)

opensees_load(UMFPACK #FIND
opensees_load(UMFPACK
BUNDLED "${OPS_BUNDLED_DIR}/UMFPACK/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/UMFPACK/libUMFPACK.a"
)

opensees_load(CSPARSE #FIND
opensees_load(CSPARSE
BUNDLED "${OPS_BUNDLED_DIR}/CSPARSE/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/CSPARSE/libCSPARSE.a"
)

opensees_load(AMD #FIND
opensees_load(AMD
BUNDLED "${OPS_BUNDLED_DIR}/AMD/"
#LIBRARY "${OPS_BUNDLED_DIR}/bin/AMD/libAMD.a"
)

find_package(Python COMPONENTS Development)

opensees_load(METIS FIND)

opensees_load(HDF5 FIND)

opensees_load(MySQL FIND)

find_package(Python COMPONENTS Development)

# Integrated exteral libraries
opensees_load(FEDEAS_Uniaxial
LIBRARY FALSE
)


Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ set(CONDA_DIR "C:/Users/claud/miniconda3")
set(CONDA_ENV "C:/Users/claud/miniconda3/envs/sim")
set(BUNDLE_LIBS "${PROJECT_SOURCE_DIR}/Win64/lib/debug/")

opensees_load(TCL
LIBRARY ${CONDA_DIR}/Library/lib/tcl86t.lib
#LIBRARY "${BUNDLE_LIBS}/tcl.lib"
INCLUDE ${CONDA_DIR}/Library/include
)
opensees_load(TCL CONAN tcl/8.6.10)

set(TCL_INCLUDE_PATH ${TCL_INCLUDE_DIRS})
set(TCL_LIBRARY ${TCL_LIBRARIES})
Expand Down Expand Up @@ -76,9 +72,9 @@ opensees_load(METIS SEARCH)

opensees_load(HDF5 FIND)

opensees_load(MySQL #FIND
LIBRARY ${CONDA_ENV}/Library/lib/libmysql.lib
INCLUDE ${CONDA_ENV}/Library/include/mysql
opensees_load(MySQL CONAN mysql-connector-c/6.1.11
#LIBRARY ${CONDA_ENV}/Library/lib/libmysql.lib
#INCLUDE ${CONDA_ENV}/Library/include/mysql
)

set(MYSQL_INCLUDE_DIR "${CONDA_ENV}/Library/include/mysql/")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Claudio Perez
#include(conan.cmake)

function (opensees_library elemlib)
# opensees_library(<lib_name> [REQUIRES <requirement>] <sources>...)
cmake_parse_arguments(PARSE_ARGV 1 OPS_LIB_ARG "" "" "LINK;SOURCES")
add_library(${elemlib} EXCLUDE_FROM_ALL)
cmake_parse_arguments(PARSE_ARGV 1 OPS_LIB_ARG "EXTERNAL" "" "LINK;SOURCES")
if (OPS_LIB_ARG_EXTERNAL)
set(OPS_LIB_NEW_TYP "SHARED")
endif()
add_library(${elemlib} EXCLUDE_FROM_ALL ${OPS_LIB_NEW_TYP})
set(private_sources ${OPS_LIB_ARG_SOURCES})
set(public_sources ${OPS_LIB_ARG_SOURCES})
list(FILTER private_sources INCLUDE REGEX ".*\.cpp")
list(FILTER public_sources INCLUDE REGEX ".*\.h")
target_sources(${elemlib} PRIVATE ${private_sources} PUBLIC ${public_sources})

if (OPS_LIB_ARG_LINK)
target_link_libraries(${elemlib} INTERFACE ${OPS_LIB_ARG_LINK})
endif()
Expand Down Expand Up @@ -62,54 +67,63 @@ function (opensees_load lib_name)
cmake_parse_arguments(
PARSE_ARGV 1
OPS_LOAD_ARG # prefix of output variables
"BUILD;FIND" # list of names of the boolean arguments (only defined ones will be true)
"BUNDLED;LIBRARY;INCLUDE" # list of names of mono-valued arguments
"PATHS;AS" # list of names of multi-valued arguments (output variables are lists)
"BUILD;FIND" # boolean arguments (only defined ones will be true)
"BUNDLED;LIBRARY;CONAN;INCLUDE" # mono-valued arguments
"PATHS;AS" # multi-valued arguments (output variables are lists)
)
set(OPS_PKG_FOUND_VAR "${lib_name}_FOUND")# PARENT_SCOPE)
set(${OPS_PKG_FOUND_VAR} FALSE)# PARENT_SCOPE)
set(OPS_PKG_FOUND_VAR "${lib_name}_FOUND")
set(${OPS_PKG_FOUND_VAR} FALSE)

if(OPS_LOAD_ARG_CONAN)
if(NOT ${${OPS_PKG_FOUND_VAR}})
#message(">>> >>> ${OPS_LOAD_ARG_CONAN}")
conan_cmake_configure(REQUIRES ${OPS_LOAD_ARG_CONAN}
#BASIC_SETUP CMAKE_TARGETS
#BUILD missing
)
conan_cmake_install(PATH_OR_REFERENCE . BUILD missing )#REMOTE conan-center)
endif()
endif()

if(OPS_LOAD_ARG_LIBRARY)
if(NOT ${${OPS_PKG_FOUND_VAR}})
message("OPS >>> ${lib_name}")
set("${lib_name}_LIBRARIES" ${OPS_LOAD_ARG_LIBRARY})# PARENT_SCOPE)
set("${lib_name}_INCLUDE_DIRS" ${OPS_LOAD_ARG_INCLUDE})# PARENT_SCOPE)
endif()
if(NOT ${${OPS_PKG_FOUND_VAR}})
message("OPS >>> ${lib_name}")
set("${lib_name}_LIBRARIES" ${OPS_LOAD_ARG_LIBRARY})
set("${lib_name}_INCLUDE_DIRS" ${OPS_LOAD_ARG_INCLUDE})
endif()
endif()

if(OPS_LOAD_ARG_PATHS)
message("Provided ${lib_name} paths are:")
foreach(src ${OPS_LOAD_ARG_PATHS})
message("- ${src}")
endforeach(src)
find_package(${lib_name} PATHS ${OPS_LOAD_ARG_PATHS})
message("Provided ${lib_name} paths are:")
foreach(src ${OPS_LOAD_ARG_PATHS})
message("- ${src}")
endforeach(src)
find_package(${lib_name} PATHS ${OPS_LOAD_ARG_PATHS})
endif()

if(OPS_LOAD_ARG_FIND)
if(NOT ${${OPS_PKG_FOUND_VAR}})
message("OPS >>> find_package(${lib_name})")
find_package(${lib_name})
message("OPS >>> status: ${OPS_PKG_FOUND_VAR}=${${OPS_PKG_FOUND_VAR}}")
endif()
endif()
endif()

if(OPS_LOAD_ARG_BUNDLED)
if(NOT ${${OPS_PKG_FOUND_VAR}})
message("OPS >>> Building OpenSees bundled ${lib_name}")
set(${OPS_PKG_FOUND_VAR} TRUE PARENT_SCOPE)
#opensees_build(${lib_name})
add_subdirectory("${OPS_LOAD_ARG_BUNDLED}")
include_directories("${OPS_LOAD_ARG_BUNDLED}")
#set("${lib_name}_INCLUDE_DIRS" ${OPS_LOAD_ARG_BUNDLED}/ PARENT_SCOPE)
set("${lib_name}_LIBRARIES" "${lib_name}")
endif()
if(NOT ${${OPS_PKG_FOUND_VAR}})
#message("OPS >>> Building OpenSees bundled ${lib_name}")
set(${OPS_PKG_FOUND_VAR} TRUE PARENT_SCOPE)
add_subdirectory("${OPS_LOAD_ARG_BUNDLED}")
include_directories("${OPS_LOAD_ARG_BUNDLED}")
set("${lib_name}_LIBRARIES" "${lib_name}")
endif()
endif()

set("${lib_name}_LIBRARIES" ${${lib_name}_LIBRARIES} PARENT_SCOPE)
set("${lib_name}_INCLUDE_DIRS" ${${lib_name}_INCLUDE_DIRS} PARENT_SCOPE)
target_compile_definitions(OPS_External_packages INTERFACE "OPSDEF_${lib_name}")
message(" status: ${lib_name}_LIBRARIES =${${lib_name}_LIBRARIES}")
message(" status: ${lib_name}_INCLUDE_DIRS =${${lib_name}_INCLUDE_DIRS}\n")
#message(" status: ${lib_name}_LIBRARIES =${${lib_name}_LIBRARIES}")
#message(" status: ${lib_name}_INCLUDE_DIRS =${${lib_name}_INCLUDE_DIRS}\n")
endfunction()

function (opensees_build lib_name)
Expand Down
Loading

0 comments on commit b15c940

Please sign in to comment.