forked from OpenSees/OpenSees
-
Notifications
You must be signed in to change notification settings - Fork 2
173 lines (167 loc) · 6.32 KB
/
build_cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
name: CMake Build
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build-win:
name: Build Windows10
runs-on: windows-2019
steps:
- name: 2.1. Obtaining OpenSees Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
# - name: CMake is already installed
# - name: Git is already installed
- name: Microsoft Visual Studio
uses: ilammy/msvc-dev-cmd@v1
with:
vsversion: 2019
- 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: Conan 1.x
run: pip install conan<2.0
- name: MUMPS
shell: cmd
run: |
git clone https://github.com/OpenSees/mumps.git
cd mumps
mkdir build
cd build
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 mod
cmake .. -Darith=d -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -G Ninja
cmake --build . --config Release --parallel 4
- name: 2.2.2. Building the OpenSees Applications and Python module
shell: cmd
run: |
mkdir build
cd build
conan install .. --build missing --settings compiler="Visual Studio" --settings compiler.runtime="MT" --settings compiler.version=16
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 mod
cmake .. -DBLA_STATIC=ON -DMKL_LINK=static -DMKL_INTERFACE_FULL=intel_lp64 -DMUMPS_DIR="..\..\mumps\build"
cmake --build . --config Release --target OpenSees -j8
cmake --build . --config Release --target OpenSeesPy -j8
- name: Verification OpenSeesPySP
shell: pwsh
run: |
mv ./build/bin/OpenSeesPy.dll ./build/bin/opensees.pyd
cp "C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\bin\libiomp5md.dll" ./build/bin/
$env:PYTHONPATH = "./build/bin/"
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/bin/OpenSees.exe
./build/bin/opensees.pyd
./build/bin/libiomp5md.dll
build-mac:
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: XCode Command Line Tools is already installed.
- name: Install other dependencies via Homebrew
run: |
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: MUMPS
run: |
git clone https://github.com/OpenSees/mumps.git
cd mumps
mkdir build
cd build
cmake .. -Darith=d
cmake --build . --config Release --parallel 4
- name: 2.3.2. Building the OpenSees Applications and Python module
run: |
mkdir build
cd build
cmake .. -DMUMPS_DIR=$PWD/../../mumps/build
cmake --build . --target OpenSees -j8
cmake --build . --target OpenSeesPy -j8
mv ./OpenSeesPy.dylib ./opensees.so
- name: Verification OpenSeesPySP
run: |
export PYTHONPATH="./build/"
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/OpenSees
./build/opensees.so
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: Needed Applications and Libraries are already satisfied.
- name: Conan 1.x
run: pip install "conan<2.0"
- name: 2.4.2. Building the OpenSees Applications and Python module
run: |
mkdir build
cd build
conan install .. --build missing # conan executables location is different.
cmake ..
cmake --build . --target OpenSees -j8
cmake --build . --target OpenSeesPy -j8
mv lib/OpenSeesPy.so lib/opensees.so
- name: Verification OpenSeesPySP # Simple Sanity Test
run: |
export PYTHONPATH="./build/lib/"
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_Ubuntu
path: |
./build/bin/OpenSees
./build/lib/opensees.so
# # Simple MP sanity test
# - name: Verification OpenSeesPyMP
# run: |
# mpiexec -np 2 python ../EXAMPLES/ExamplePython/example_mpi_paralleltruss_explicit.py