Skip to content

Commit 39b83b4

Browse files
committed
fmk - fixing Mac and Linux github actions builds for conan2, Windows to come
1 parent 04f4204 commit 39b83b4

2 files changed

Lines changed: 40 additions & 122 deletions

File tree

.github/workflows/build_cmake.yml

Lines changed: 39 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -10,73 +10,51 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
build-win:
14-
name: Build Windows VS2022
15-
runs-on: windows-2022
13+
build-ubuntu:
14+
name: Build Ubuntu
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 30
1617
steps:
1718
- name: 2.1. Obtaining OpenSees Source Code
1819
uses: actions/checkout@v4
1920
with:
2021
fetch-depth: 0
21-
- name: Microsoft Visual Studio
22-
uses: ilammy/msvc-dev-cmd@v1
23-
with:
24-
vsversion: 2022
25-
- name: Intel oneAPI Basic & HPC Toolkits
26-
shell: pwsh
27-
env:
28-
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
29-
WINDOWS_BASEKIT_COMPONENTS: intel.oneapi.win.mkl.devel
30-
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
31-
WINDOWS_HPCKIT_COMPONENTS: "intel.oneapi.win.mpi.devel:intel.oneapi.win.ifort-compiler"
32-
working-directory: D:\a\OpenSees\OpenSees\.github\workflows
33-
run: |
34-
./install_fortran.bat $env:WINDOWS_BASEKIT_URL $env:WINDOWS_BASEKIT_COMPONENTS
35-
./install_fortran.bat $env:WINDOWS_HPCKIT_URL $env:WINDOWS_HPCKIT_COMPONENTS
3622
- name: Python 3.11
3723
uses: actions/setup-python@v5
3824
with:
3925
python-version: "3.11"
40-
- name: Conan 1.x
41-
run: pip install conan<2.0
42-
- name: MUMPS
43-
shell: cmd
26+
- name: Install conan
4427
run: |
45-
git clone https://github.com/OpenSees/mumps.git
46-
cd mumps
47-
mkdir build
48-
cd build
49-
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 mod
50-
cmake .. -Darith=d -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" -G Ninja
51-
cmake --build . --config Release --parallel 4
52-
- name: 2.2.2. Building the OpenSees Applications and Python module
53-
shell: cmd
28+
pip install conan
29+
conan profile detect --force
30+
- name: build OpenSees & OpenSeesPy
5431
run: |
55-
mkdir build
56-
cd build
57-
conan install .. --build missing --settings compiler="Visual Studio" --settings compiler.runtime="MT" --settings compiler.version=16
58-
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 mod
59-
cmake .. -DBLA_STATIC=ON -DMKL_LINK=static -DMKL_INTERFACE_FULL=intel_lp64 -DMUMPS_DIR="..\..\mumps\build"
60-
cmake --build . --config Release --target OpenSees -j8
61-
cmake --build . --config Release --target OpenSeesPy -j8
62-
- name: Verification OpenSeesPySP
63-
shell: pwsh
32+
conan install . --build=missing
33+
cmake -S . -B build/Release -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/bin
34+
cd build/Release
35+
cmake --build . --target OpenSees -j8
36+
cmake --build . --target OpenSeesPy -j8
37+
mv OpenSeesPy.so opensees.so
38+
- name: Verification OpenSeesPy # Simple Sanity Test
39+
run: |
40+
export PYTHONPATH="./build/Release"
41+
python3 -c "import sys; print(sys.path)"
42+
python3 ./EXAMPLES/ExamplePython/example_variable_analysis.py
43+
- name: Run pytest in tests/ folder
6444
run: |
65-
mv ./build/bin/OpenSeesPy.dll ./build/bin/opensees.pyd
66-
cp "C:\Program Files (x86)\Intel\oneAPI\compiler\2024.1\bin\libiomp5md.dll" ./build/bin/
67-
$env:PYTHONPATH = "./build/bin/"
68-
python -c "import sys; print(sys.path)"
69-
python ./EXAMPLES/ExamplePython/example_variable_analysis.py
45+
python3 -m pip install pytest
46+
cp build/Release/opensees.so tests/
47+
cd tests
48+
pytest -v
7049
- name: Upload Artifacts
7150
uses: actions/upload-artifact@v4
7251
with:
73-
name: OpenSees_Windows
52+
name: OpenSees_Ubuntu
7453
path: |
75-
./build/bin/OpenSees.exe
76-
./build/bin/opensees.pyd
77-
./build/bin/libiomp5md.dll
54+
./build/Release/OpenSees
55+
./build/Release/opensees.so
7856
79-
build-mac:
57+
build-mac-conan:
8058
name: Build Mac OS
8159
runs-on: macos-latest
8260
timeout-minutes: 30
@@ -89,89 +67,29 @@ jobs:
8967
uses: actions/setup-python@v5
9068
with:
9169
python-version: "3.11"
92-
# - name: XCode Command Line Tools is already installed.
93-
- name: Install other dependencies via Homebrew
94-
run: |
95-
ln -s /opt/homebrew/bin/gcc-13 /usr/local/bin/gcc
96-
ln -s /opt/homebrew/bin/gfortran-13 /usr/local/bin/gfortran
97-
brew install eigen
98-
brew install hdf5
99-
brew install open-mpi
100-
brew install scalapack
101-
sudo ln -sf /opt/homebrew/include/eigen3/Eigen /opt/homebrew/include/Eigen
102-
- name: MUMPS
70+
- name: conan install
10371
run: |
104-
git clone https://github.com/OpenSees/mumps.git
105-
cd mumps
106-
mkdir build
107-
cd build
108-
cmake .. -Darith=d
109-
cmake --build . --config Release --parallel 4
72+
pip install conan
73+
conan profile detect --force
11074
- name: 2.3.2. Building the OpenSees Applications and Python module
11175
run: |
112-
mkdir build
113-
cd build
114-
cmake .. -DMUMPS_DIR=$PWD/../../mumps/build -DCMAKE_PREFIX_PATH=/usr/local/Cellar/libaec/1.1.3/cmake
76+
export FC=/opt/homebrew/bin/gfortran-13
77+
export LDFLAGS="-L/opt/homebrew/lib/gcc/current -lgfortran"
78+
conan install . --build=missing
79+
cmake -S . -B build/Release -DCMAKE_TOOLCHAIN_FILE=build/Release/generators/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/bin
80+
cd build/Release
11581
cmake --build . --target OpenSees -j8
11682
cmake --build . --target OpenSeesPy -j8
11783
mv ./OpenSeesPy.dylib ./opensees.so
11884
- name: Verification OpenSeesPySP
11985
run: |
120-
export PYTHONPATH="./build/"
86+
export PYTHONPATH="./build/Release"
12187
python3 -c "import sys; print(sys.path)"
12288
python3 ./EXAMPLES/ExamplePython/example_variable_analysis.py
12389
- name: Upload Artifacts
12490
uses: actions/upload-artifact@v4
12591
with:
12692
name: OpenSees_Mac
12793
path: |
128-
./build/OpenSees
129-
./build/opensees.so
130-
131-
build-ubuntu:
132-
name: Build Ubuntu
133-
runs-on: ubuntu-latest
134-
timeout-minutes: 30
135-
steps:
136-
- name: 2.1. Obtaining OpenSees Source Code
137-
uses: actions/checkout@v4
138-
with:
139-
fetch-depth: 0
140-
- name: Python 3.11
141-
uses: actions/setup-python@v5
142-
with:
143-
python-version: "3.11"
144-
# - name: Needed Applications and Libraries are already satisfied.
145-
- name: Conan 1.x
146-
run: pip install "conan<2.0"
147-
- name: 2.4.2. Building the OpenSees Applications and Python module
148-
run: |
149-
mkdir build
150-
cd build
151-
conan install .. --build missing # conan executables location is different.
152-
cmake ..
153-
cmake --build . --target OpenSees -j8
154-
cmake --build . --target OpenSeesPy -j8
155-
mv lib/OpenSeesPy.so lib/opensees.so
156-
- name: Verification OpenSeesPySP # Simple Sanity Test
157-
run: |
158-
export PYTHONPATH="./build/lib/"
159-
python3 -c "import sys; print(sys.path)"
160-
python3 ./EXAMPLES/ExamplePython/example_variable_analysis.py
161-
- name: Run pytest in tests/ folder
162-
run: |
163-
python3 -m pip install pytest
164-
cp build/lib/opensees.so tests/
165-
cd tests
166-
pytest -v
167-
- name: Upload Artifacts
168-
uses: actions/upload-artifact@v4
169-
with:
170-
name: OpenSees_Ubuntu
171-
path: |
172-
./build/bin/OpenSees
173-
./build/lib/opensees.so
174-
# # Simple MP sanity test
175-
# - name: Verification OpenSeesPyMP
176-
# run: |
177-
# mpiexec -np 2 python ../EXAMPLES/ExamplePython/example_mpi_paralleltruss_explicit.py
94+
./build/Release/OpenSees
95+
./build/Release/opensees.so

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
7777

7878
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
7979

80-
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
80+
# set(CMAKE_FIND_LIBRARY_SUFFIXES ".so")
8181
set(BUILD_SHARED_LIBS OFF)
8282
# set(CMAKE_EXE_LINKER_FLAGS "-static")
8383
add_compile_options(-fPIC)

0 commit comments

Comments
 (0)