Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OpenSees/OpenSees into path-time-…
Browse files Browse the repository at this point in the history
…series
  • Loading branch information
mhscott committed Jun 18, 2024
2 parents bd3637d + d5a3b3f commit 2217479
Show file tree
Hide file tree
Showing 165 changed files with 16,660 additions and 9,691 deletions.
34 changes: 8 additions & 26 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand Down Expand Up @@ -71,18 +71,21 @@ jobs:
runs-on: macos-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Library
run: |
ln -s /usr/local/bin/gfortran-11 /usr/local/bin/gfortran
ln -s /opt/homebrew/bin/gcc-13 /usr/local/bin/gcc
ln -s /opt/homebrew/bin/gfortran-13 /usr/local/bin/gfortran
brew install eigen
brew install hdf5
brew install open-mpi
brew install scalapack
sudo ln -sf /opt/homebrew/include/eigen3/Eigen /opt/homebrew/include/Eigen
- name: Build
run: |
mkdir build
Expand All @@ -97,24 +100,3 @@ jobs:
export PYTHONPATH="../../build/"
python3 -c "import sys; print(sys.path)"
python3 example_variable_analysis.py
# 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


41 changes: 31 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_EXE_LINKER_FLAGS "-static")
# add_compile_options(-fPIC)
add_compile_options(-fPIC)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
MESSAGE("COMPILER: GNU")
Expand Down Expand Up @@ -94,12 +94,15 @@ if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
MESSAGE("USING CONAN")
include("${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
conan_basic_setup()
set (Eigen3_FOUND TRUE)
set (HDF5_FOUND TRUE)
set (HDF5_LIBRARIES ${CONAN_LIBS_HDF5} ${CONAN_LIBS_ZLIB})
set (HDF5_VERSION "1.12.0")
set(USING_CONAN TRUE)
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${CMAKE_PREFIX_PATH})
set(TCL_LIBRARIES ${TCL_LIBRARY})
include_directories(${TCL_INCLUDE_PATH})

else()

Expand All @@ -109,6 +112,9 @@ else()
set (CONAN_LIBS )
find_package(HDF5 REQUIRED)
find_package(TCL REQUIRED)
find_package(Eigen3 REQUIRED)
include_directories(${TCL_INCLUDE_DIR})
set(TCL_LIBRARY ${TCL_LIBRARIES})

endif()

Expand Down Expand Up @@ -292,7 +298,11 @@ else()
set (LAPACK_FOUND TRUE CACHE BOOL "providing own lapack lib")
endif()

find_package (Python COMPONENTS Interpreter Development)
if (NOT DEFINED Python_LIBRARIES)
find_package(Python COMPONENTS Interpreter Development)
else()
set (PYTHON_FOUND TRUE CACHE BOOL "providing own python lib")
endif()


find_package(MPI)
Expand All @@ -313,8 +323,8 @@ endif()

if(PYTHON_FOUND)
message("Python_FOUND:${Python_FOUND}")
message("Python_VERSION:${Python_VERSION}")
message("Python_Development_FOUND:${Python_Development_FOUND}")
#message("Python_VERSION:${Python_VERSION}")
#message("Python_Development_FOUND:${Python_Development_FOUND}")
message("Python_LIBRARIES:${Python_LIBRARIES}")
message("Python_INCLUDES:${Python_INCLUDE_DIRS}")
else()
Expand Down Expand Up @@ -381,6 +391,8 @@ message(STATUS "SCALAPACK_LIBRARIES=${SCALAPACK_LIBRARIES}")
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()



add_library(OPS_Numerics INTERFACE)

target_link_libraries(OPS_Numerics INTERFACE
Expand All @@ -398,6 +410,7 @@ target_link_libraries(OPS_Numerics INTERFACE

set(TCL_LIBRARIES ${TCL_LIBRARY})


#
# OpenSees OBJECT LIBRARIES
#
Expand Down Expand Up @@ -427,7 +440,6 @@ add_library(OPS_Database OBJECT)
add_library(OPS_INTERPRETER OBJECT)


include_directories(${TCL_INCLUDE_PATH})

#
# Optional Extensions
Expand Down Expand Up @@ -551,11 +563,11 @@ if(NOT EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
else ()
FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/tcl8.6)
add_custom_command(
TARGET OpenSees POST_BUILD
COMMENT("Copying init.tcl to ${CMAKE_CURRENT_BINARY_DIR}")
COMMAND ${CMAKE_COMMAND} -E copy
${CONAN_LIB_DIRS_TCL}/tcl8.6/init.tcl
${CMAKE_CURRENT_BINARY_DIR}/lib/tcl8.6
TARGET OpenSees POST_BUILD
COMMENT("Copying init.tcl to ${CMAKE_CURRENT_BINARY_DIR}")
COMMAND ${CMAKE_COMMAND} -E copy
${CONAN_LIB_DIRS_TCL}/tcl8.6/init.tcl
${CMAKE_CURRENT_BINARY_DIR}/lib/tcl8.6
)
endif()

Expand Down Expand Up @@ -833,6 +845,15 @@ else()
message(STATUS "OPS >>> Could not find HDF5")
endif()

#----------------------------
# Eigen3
#----------------------------
if(Eigen3_FOUND)
include_directories(${Eigen3_INCLUDE_DIR})
add_compile_definitions(_EIGEN3)
else()
message(STATUS "OPS >>> Could not find Eigen3")
endif()

if (OPS_Use_Dev_Directories)
add_subdirectory("${PROJECT_SOURCE_DIR}/DEVELOPER/")
Expand Down
Loading

0 comments on commit 2217479

Please sign in to comment.