Skip to content

Merge pull request #1708 from gaaraujo/bug/brick #81

Merge pull request #1708 from gaaraujo/bug/brick

Merge pull request #1708 from gaaraujo/bug/brick #81

Workflow file for this run

name: CMake Build
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build-ubuntu:
name: Build Ubuntu
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: 2.1. Obtaining OpenSees Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install conan
run: |
pip install conan
conan profile detect --force
- name: build OpenSees & OpenSeesPy
run: |
conan install . --build=missing
cmake -S . -B build/Release -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/bin
cd build/Release
cmake --build . --target OpenSees -j8
cmake --build . --target OpenSeesPy -j8
mv OpenSeesPy.so opensees.so
- name: Verification OpenSeesPy # Simple Sanity Test
run: |
export PYTHONPATH="./build/Release"
python3 -c "import sys; print(sys.path)"
python3 ./EXAMPLES/ExamplePython/example_variable_analysis.py
- name: Run pytest in tests/ folder
run: |
python3 -m pip install pytest
cp build/Release/opensees.so tests/
cd tests
pytest -v
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: OpenSees_Ubuntu
path: |
./build/Release/OpenSees
./build/Release/opensees.so
build-mac-conan:
name: Build Mac OS
runs-on: macos-latest
timeout-minutes: 30
steps:
- name: 2.1. Obtaining OpenSees Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: conan install
run: |
pip install conan
conan profile detect --force
- name: 2.3.2. Building the OpenSees Applications and Python module
run: |
export FC=/opt/homebrew/bin/gfortran-13
export LDFLAGS="-L/opt/homebrew/lib/gcc/current -lgfortran"
conan install . --build=missing
cmake -S . -B build/Release -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/bin
cd build/Release
cmake --build . --target OpenSees -j8
cmake --build . --target OpenSeesPy -j8
mv ./OpenSeesPy.dylib ./opensees.so
- name: Verification OpenSeesPySP
run: |
export PYTHONPATH="./build/Release"
python3 -c "import sys; print(sys.path)"
python3 ./EXAMPLES/ExamplePython/example_variable_analysis.py
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: OpenSees_Mac
path: |
./build/Release/OpenSees
./build/Release/opensees.so
build-win:
name: Build Windows VS2022
runs-on: windows-2022
steps:
- name: 2.1. Obtaining OpenSees Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Microsoft Visual Studio
uses: ilammy/msvc-dev-cmd@v1
with:
vsversion: 2022
- name: Intel oneAPI Basic & HPC Toolkits
shell: pwsh
env:
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7dff44ba-e3af-4448-841c-0d616c8da6e7/w_BaseKit_p_2024.1.0.595_offline.exe
WINDOWS_BASEKIT_COMPONENTS: intel.oneapi.win.mkl.devel
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/c95a3b26-fc45-496c-833b-df08b10297b9/w_HPCKit_p_2024.1.0.561_offline.exe
WINDOWS_HPCKIT_COMPONENTS: "intel.oneapi.win.mpi.devel:intel.oneapi.win.ifort-compiler"
working-directory: D:\a\OpenSees\OpenSees\.github\workflows
run: |
./install_fortran.bat $env:WINDOWS_BASEKIT_URL $env:WINDOWS_BASEKIT_COMPONENTS
./install_fortran.bat $env:WINDOWS_HPCKIT_URL $env:WINDOWS_HPCKIT_COMPONENTS
- name: Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install conan
run: |
pip install conan
conan profile detect --force
- name: MUMPS
shell: cmd
run: |
git clone https://github.com/OpenSees/mumps.git
cd mumps
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 mod
cmake -S . -B build -G Ninja -Darith=d -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -DCMAKE_EXE_LINKER_FLAGS="/link /FORCE:MULTIPLE" -DCMAKE_SHARED_LINKER_FLAGS="/link /FORCE:MULTIPLE"
cd build
cmake --build . --config Release
- name: 2.2.2. Building the OpenSees Applications and Python module
shell: cmd
run: |
conan install . -s arch=x86_64 -s compiler.runtime=static --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 mod
cmake.exe -S . -B build/Release -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -DCMAKE_Fortran_COMPILER="ifx" -DBLA_STATIC=ON -DMKL_LINK=static -DMKL_INTERFACE_FULL=intel_lp64 -DMUMPS_DIR="..\..\mumps\build" -DCMAKE_EXE_LINKER_FLAGS="/FORCE:MULTIPLE" -DCMAKE_SHARED_LINKER_FLAGS="/FORCE:MULTIPLE" -DCMAKE_NINJA_FORCE_RESPONSE_FILE=ON
cd build/Release
cmake --build . --config Release --target OpenSees -j8
cmake --build . --config Release --target OpenSeesPy -j8
- name: Verification OpenSeesPySP
shell: pwsh
run: |
mv ./build/Release/OpenSeesPy.dll ./build/Release/opensees.pyd
cp "C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\bin\libiomp5md.dll" ./build/Release/
$env:PYTHONPATH = "./build/Release/"
python -c "import sys; print(sys.path)"
python ./EXAMPLES/ExamplePython/example_variable_analysis.py
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: OpenSees_Windows
path: |
./build/Release/OpenSees.exe
./build/Release/opensees.pyd
./build/Release/libiomp5md.dll