Skip to content

Commit

Permalink
Merge commit 'ee24c7546e3278cefbc4b12eae0a5d84678df9bd'
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuminjie committed Dec 14, 2021
2 parents 597951a + ee24c75 commit 717da8a
Show file tree
Hide file tree
Showing 415 changed files with 27,865 additions and 3,400 deletions.
59 changes: 59 additions & 0 deletions opensees/.github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

name: CMake Build

env:
CMAKE_VERSION: 3.20.1
BUILD_TYPE: Debug

on:
push:
branches: [cmake-build]

pull_request:
branches: [master]

jobs:
build-ubuntu:
name: Ubuntu bundled build
runs-on: ubuntu-latest
steps:
#- uses: claudioperez/OpenSees@cmake-build
- uses: actions/checkout@v2
#with: {ref: cmake-build}

- name: Install Tcl
run:
sudo apt-get install tcl-dev

- name: Build
run: |
mkdir build
cd build
cmake ..
cmake --build . --target OpenSeesTcl -j5
- name: Verification
run: |
cd ./EXAMPLES/verification/ && ../../build/OpenSeesTcl runVerificationSuite.tcl
# 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


93 changes: 93 additions & 0 deletions opensees/BuildTools/cmake/FindAMD.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# - Find the AMD includes and library
#
# This module defines
# AMD_INCLUDE_DIR, where to find umfpack.h, etc.
# AMD_LIBRARIES, the libraries to link against to use AMD.
# AMD_FOUND, If false, do not try to use AMD.
# also defined, but not for general use are
# AMD_LIBRARY, where to find the AMD library.
# None of the above will be defined unless UFconfig can be found.
# AMD depends on UFConfig

#=============================================================================
# Copyright 2010, Martin Koehler
# http://www-user.tu-chemnitz.de/~komart/
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# Changelog:
# - Apr. 1, 2011 Martin Koehler
# - June 25, 2013 Martin Koehler, add _libdir and _incdir

if (WIN32)
set(_libdir ENV LIB)
set(_liblist $ENV{LIB})
set(_incdir)
foreach ( dir ${_liblist})
set(_incdir ${_incdir} "${dir}/../include")
endforeach()
set(_incdir "${_incdir}" ENV INC ENV INCLUDE ENV CPATH)
elseif (APPLE)
set(_libdir ENV DYLD_LIBRARY_PATH)
string(REPLACE ":" ";" _liblist $ENV{DYLD_LIBRARY_PATH} "")
set(_incdir)
foreach ( dir ${_liblist})
set(_incdir ${_incdir} "${dir}/../include")
endforeach()
set(_incdir "${_incdir}" ENV INC ENV INCLUDE ENV CPATH)
else ()
set(_libdir ENV LD_LIBRARY_PATH)
string(REPLACE ":" ";" _liblist $ENV{LD_LIBRARY_PATH} "")
set(_incdir)
foreach ( dir ${_liblist})
set(_incdir ${_incdir} "${dir}/../include")
endforeach()
set(_incdir "${_incdir}" ENV INC ENV INCLUDE ENV CPATH)
endif ()


find_path(AMD_AMD_INCLUDE_DIR amd.h
HINTS ${SUITESPARSE}/AMD/Include #Local Setup
${SUITESPARSE}/include
${_incdir}
/usr/local/include/suitesparse #FreeBSD
/usr/include/suitesparse #Debian
/opt/local/include/ufsparse #Macports
NO_DEFAULT_PATH
)
find_path(AMD_AMD_INCLUDE_DIR amd.h)


set(AMD_NAMES ${AMD_NAMES} libamd amd)
set(AMD_PATH
${SUITESPARSE}/AMD/Lib
${SUITESPARSE}/lib
/opt/local/lib # Macports
${_libdir}
)
find_library(AMD_LIBRARY NAMES ${AMD_NAMES} PATHS ${AMD_PATH} NO_DEFAULT_PATH )
#MESSAGE(STATUS "AMD_LIB: ${AMD_LIBRARY}")
find_library(AMD_LIBRARY NAMES ${AMD_NAMES} )

#MESSAGE(STATUS "AMD_INC: ${AMD_AMD_INCLUDE_DIR}" )
#MESSAGE(STATUS "AMD_LIB: ${AMD_LIBRARY}")

if (AMD_LIBRARY AND AMD_AMD_INCLUDE_DIR)
SET(AMD_INCLUDE_DIR ${AMD_AMD_INCLUDE_DIR} )
SET(AMD_LIBRARIES ${AMD_LIBRARY} )
endif (AMD_LIBRARY AND AMD_AMD_INCLUDE_DIR)


# handle the QUIETLY and REQUIRED arguments and set AMD_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AMD DEFAULT_MSG AMD_LIBRARY AMD_AMD_INCLUDE_DIR)

mark_as_advanced(AMD_AMD_INCLUDE_DIR AMD_LIBRARY )


61 changes: 61 additions & 0 deletions opensees/BuildTools/cmake/FindARPACK.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Searches for an installation of the ARPACK library. On success, it sets the following variables:
#
# ARPACK_FOUND Set to true to indicate the library was found
# ARPACK_LIBRARIES All libraries needed to use ARPACK (with full path)
#
# To specify an additional directory to search, set ARPACK_ROOT.
#
# TODO: Do we need to explicitly search for BLAS and LAPACK as well? The source distribution statically links these to
# libarpack. Are there any installations that don't do this or the equivalent?
#
# Author: Siddhartha Chaudhuri, 2009
#

SET(ARPACK_FOUND FALSE)

# First look in user-provided root directory, then look in system locations
FIND_LIBRARY(ARPACK_LIBRARIES NAMES arpack libarpack ARPACK libARPACK PATHS "${ARPACK_ROOT}" "${ARPACK_ROOT}/lib"
NO_DEFAULT_PATH)
IF(NOT ARPACK_LIBRARIES)
FIND_LIBRARY(ARPACK_LIBRARIES NAMES arpack libarpack ARPACK libARPACK)
ENDIF(NOT ARPACK_LIBRARIES)

IF(NOT ARPACK_LIBRARIES)
message(".......................")
FIND_LIBRARY(ARPACK_LIBRARIES NAMES arpack libarpack ARPACK libARPACK PATHS ${OPS_BUNDLED_DIR}/ARPACK)
ENDIF(NOT ARPACK_LIBRARIES)


IF(ARPACK_LIBRARIES)
# On OS X we probably also need gfortran and BLAS and LAPACK libraries
IF(APPLE)
FIND_LIBRARY(ARPACK_LAPACK_LIBRARY NAMES lapack LAPACK PATHS "${ARPACK_ROOT}" "${ARPACK_ROOT}/lib")
FIND_LIBRARY(ARPACK_BLAS_LIBRARY NAMES blas BLAS PATHS "${ARPACK_ROOT}" "${ARPACK_ROOT}/lib")
FIND_LIBRARY(ARPACK_GFORTRAN_LIBRARY NAMES gfortran PATHS "${ARPACK_ROOT}" "${ARPACK_ROOT}/lib"
PATH_SUFFIXES "" "gfortran/lib" "../gfortran/lib")

IF(ARPACK_BLAS_LIBRARY)
SET(ARPACK_LIBRARIES ${ARPACK_LIBRARIES} ${ARPACK_BLAS_LIBRARY})
ENDIF(ARPACK_BLAS_LIBRARY)

IF(ARPACK_LAPACK_LIBRARY)
SET(ARPACK_LIBRARIES ${ARPACK_LIBRARIES} ${ARPACK_LAPACK_LIBRARY})
ENDIF(ARPACK_LAPACK_LIBRARY)

IF(ARPACK_GFORTRAN_LIBRARY)
SET(ARPACK_LIBRARIES ${ARPACK_LIBRARIES} ${ARPACK_GFORTRAN_LIBRARY})
ENDIF(ARPACK_GFORTRAN_LIBRARY)
ENDIF(APPLE)

SET(ARPACK_FOUND TRUE)
ENDIF(ARPACK_LIBRARIES)

IF(ARPACK_FOUND)
IF(NOT ARPACK_FIND_QUIETLY)
MESSAGE(STATUS "Found ARPACK: libraries at ${ARPACK_LIBRARIES}")
ENDIF(NOT ARPACK_FIND_QUIETLY)
ELSE(ARPACK_FOUND)
IF(ARPACK_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "ARPACK not found")
ENDIF(ARPACK_FIND_REQUIRED)
ENDIF(ARPACK_FOUND)
69 changes: 69 additions & 0 deletions opensees/BuildTools/cmake/FindMETIS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#----------------------------------------------------------
# OpenSees
#----------------------------------------------------------
# This file was copied from the Eigen project at
# https://github.com/libigl/eigen/blob/master/cmake/FindMetis.cmake
# Redistribution and modification are subject to the terms
# and conditions of the Eigen project.
#----------------------------------------------------------

# Pastix requires METIS or METIS (partitioning and reordering tools)

if (METIS_INCLUDES AND METIS_LIBRARIES)
set(METIS_FIND_QUIETLY TRUE)
endif (METIS_INCLUDES AND METIS_LIBRARIES)

find_path(METIS_INCLUDES
NAMES
metis.h
PATHS
$ENV{METISDIR}
${INCLUDE_INSTALL_DIR}
PATH_SUFFIXES
.
metis
include
)

macro(_metis_check_version)
file(READ "${METIS_INCLUDES}/metis.h" _metis_version_header)

string(REGEX MATCH "define[ \t]+METIS_VER_MAJOR[ \t]+([0-9]+)" _metis_major_version_match "${_metis_version_header}")
set(METIS_MAJOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+METIS_VER_MINOR[ \t]+([0-9]+)" _metis_minor_version_match "${_metis_version_header}")
set(METIS_MINOR_VERSION "${CMAKE_MATCH_1}")
string(REGEX MATCH "define[ \t]+METIS_VER_SUBMINOR[ \t]+([0-9]+)" _metis_subminor_version_match "${_metis_version_header}")
set(METIS_SUBMINOR_VERSION "${CMAKE_MATCH_1}")
if(NOT METIS_MAJOR_VERSION)
message(STATUS "Could not determine Metis version. Assuming version 4.0.0")
set(METIS_VERSION 4.0.0)
else()
set(METIS_VERSION ${METIS_MAJOR_VERSION}.${METIS_MINOR_VERSION}.${METIS_SUBMINOR_VERSION})
endif()
if(${METIS_VERSION} VERSION_LESS ${Metis_FIND_VERSION})
set(METIS_VERSION_OK FALSE)
else()
set(METIS_VERSION_OK TRUE)
endif()

if(NOT METIS_VERSION_OK)
message(STATUS "Metis version ${METIS_VERSION} found in ${METIS_INCLUDES}, "
"but at least version ${Metis_FIND_VERSION} is required")
endif(NOT METIS_VERSION_OK)
endmacro(_metis_check_version)

if(METIS_INCLUDES AND Metis_FIND_VERSION)
_metis_check_version()
else()
set(METIS_VERSION_OK TRUE)
endif()


find_library(METIS_LIBRARIES metis PATHS $ENV{METISDIR} ${LIB_INSTALL_DIR} PATH_SUFFIXES lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(METIS DEFAULT_MSG
METIS_INCLUDES METIS_LIBRARIES METIS_VERSION_OK)

mark_as_advanced(METIS_INCLUDES METIS_LIBRARIES)

Loading

0 comments on commit 717da8a

Please sign in to comment.