Skip to content

Commit 7d07b7d

Browse files
authored
Merge pull request #85 from svalinn/windows_action
2 parents ad8cd3a + dbd5f6f commit 7d07b7d

6 files changed

Lines changed: 224 additions & 3 deletions

File tree

.github/workflows/unix_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323

2424
release:
2525
types: # This configuration does not affect the page_build event above
26-
- created
26+
- published
2727
env:
2828
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929

.github/workflows/unix_mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
release:
2727
types: # This configuration does not affect the page_build event above
28-
- created
28+
- published
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3131

.github/workflows/windows.yml

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
name: Windows
2+
3+
on:
4+
# allows us to run workflows manually
5+
workflow_dispatch:
6+
pull_request:
7+
branches:
8+
- develop
9+
paths-ignore:
10+
- '.github/workflows/unix_linux.yml'
11+
- '.github/workflows/unix_mac.yml'
12+
- 'scripts/**'
13+
- '*.md'
14+
- 'LICENSE'
15+
16+
push:
17+
branches:
18+
- develop
19+
paths-ignore:
20+
- '.github/workflows/unix_linux.yml'
21+
- '.github/workflows/unix_mac.yml'
22+
- 'scripts/**'
23+
- '*.md'
24+
- 'LICENSE'
25+
26+
release:
27+
types: # This configuration does not affect the page_build event above
28+
- published
29+
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
33+
jobs:
34+
main:
35+
runs-on: windows-2019
36+
strategy:
37+
matrix:
38+
cubit: [17.1.0, 2021.3, 2021.4, 2021.5]
39+
40+
name: 'Cubit Svalinn Plugin ${{ matrix.cubit }} Build for Windows'
41+
steps:
42+
43+
- uses: conda-incubator/setup-miniconda@v2
44+
with:
45+
auto-activate-base: true
46+
activate-environment: ""
47+
48+
- name: Environment Variables
49+
shell: bash -l {0}
50+
run: |
51+
COREFORM_BASE_URL=https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases
52+
53+
CUBIT_BASE_NAME=Coreform-Cubit-${{ matrix.cubit }}
54+
if [ "${{ matrix.cubit }}" == "17.1.0" ]; then
55+
BASE=Trelis-17.1.0
56+
BASESDK=Trelis-SDK-17.1.0
57+
CUBIT_BASE_NAME=Trelis-17.1
58+
elif [ "${{ matrix.cubit }}" == "2021.3" ]; then
59+
BASE=Coreform-Cubit-2021.3.0
60+
CUBIT_BASE_NAME=Coreform-Cubit-2021.3
61+
elif [ "${{ matrix.cubit }}" == "2021.4" ]; then
62+
BASE=Coreform-Cubit-2021.4%2B15017_05893177
63+
elif [ "${{ matrix.cubit }}" == "2021.5" ]; then
64+
BASE=Coreform-Cubit-2021.5%2B15962_5043ef39
65+
fi
66+
echo "COREFORM_BASE_URL=${COREFORM_BASE_URL}/Windows/" >> $GITHUB_ENV
67+
echo "CUBIT_PKG=${BASE}-Win64.exe" >> $GITHUB_ENV
68+
echo "CUBIT_SDK_PKG=${BASESDK}-Win64.zip" >> $GITHUB_ENV
69+
echo "CUBIT_BASE_NAME=${CUBIT_BASE_NAME}" >> $GITHUB_ENV
70+
71+
echo "CURRENT=$(pwd)" >> $GITHUB_ENV
72+
echo "SCRIPTPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
73+
echo "PLUGIN_ABS_PATH=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV
74+
75+
- name: Conda dependencies
76+
shell: bash -l {0}
77+
run: |
78+
conda install curl eigen hdf5
79+
80+
- name: Build MOAB
81+
shell: bash -l {0}
82+
run: |
83+
cd ${PLUGIN_ABS_PATH}
84+
git clone https://bitbucket.org/fathomteam/moab -b 5.3.0 --depth 1 --shallow-submodules
85+
mkdir moab_build moab_install
86+
cd moab_build
87+
cmake ../moab \
88+
-DENABLE_BLASLAPACK=OFF \
89+
-DENABLE_FORTRAN=OFF \
90+
-DENABLE_IMESH=OFF \
91+
-DENABLE_TESTING=OFF \
92+
-DENABLE_HDF5=ON \
93+
-DBUILD_SHARED_LIBS=ON \
94+
-G"Visual Studio 16 2019" \
95+
-DCMAKE_INSTALL_PREFIX=../moab_install/ \
96+
-DHDF5_ROOT="C:/Miniconda/Library/" \
97+
-DHDF5_hdf5_LIBRARY_RELEASE="C:/Miniconda/Library/lib/libhdf5_hl.lib;C:/Miniconda/Library/lib/libhdf5.lib;C:/Miniconda/Library/lib/zlib.lib;C:/Miniconda/Library/lib/libhdf5_cpp.lib" \
98+
-DCMAKE_EXE_LINKER_FLAGS="" \
99+
-DCMAKE_MODULE_LINKER_FLAGS="" \
100+
-DCMAKE_SHARED_LINKER_FLAGS="" \
101+
-DCMAKE_STATIC_LINKER_FLAGS="" \
102+
-DCMAKE_BUILD_TYPE=Release \
103+
-DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe" \
104+
-DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe"
105+
cmake --build . --config Release
106+
cmake --install . --config Release
107+
108+
109+
- name: build DAGMC
110+
shell: bash -l {0}
111+
run: |
112+
cd ${PLUGIN_ABS_PATH}
113+
git clone https://github.com/svalinn/DAGMC -b develop --depth 1 --shallow-submodules
114+
115+
mkdir dagmc_build dagmc_install
116+
cd dagmc_build
117+
118+
cmake ../dagmc \
119+
-G"Visual Studio 16 2019" \
120+
-DBUILD_EXE=OFF \
121+
-DBUILD_SHARED_LIBS=ON \
122+
-DBUILD_STATIC_LIBS=OFF \
123+
-DBUILD_TALLY=OFF \
124+
-DBUILD_BUILD_OBB=OFF \
125+
-DBUILD_UWUW=ON \
126+
-DBUILD_MAKE_WATERTIGHT=ON \
127+
-DBUILD_TESTS=OFF \
128+
-DMOAB_DIR=../moab_install \
129+
-DHDF5_ROOT="C:/Miniconda/Library/" \
130+
-DHDF5_hdf5_LIBRARY_RELEASE="C:/Miniconda/Library/lib/libhdf5_hl.lib;C:/Miniconda/Library/lib/libhdf5.lib;C:/Miniconda/Library/lib/zlib.lib;C:/Miniconda/Library/lib/libhdf5_cpp.lib" \
131+
-DCMAKE_INSTALL_PREFIX=../dagmc_install/ \
132+
-DCMAKE_EXE_LINKER_FLAGS="" \
133+
-DCMAKE_MODULE_LINKER_FLAGS="" \
134+
-DCMAKE_SHARED_LINKER_FLAGS="" \
135+
-DCMAKE_STATIC_LINKER_FLAGS="" \
136+
-DCMAKE_BUILD_TYPE=Release
137+
cmake --build . --config Release
138+
cmake --install . --config Release
139+
140+
141+
- name: Cubit download
142+
shell: bash -l {0}
143+
env:
144+
CUBIT_DEB_URL: ${{ secrets[matrix.URL] }}
145+
CUBIT_SDK_URL: ${{ secrets[matrix.URL_SDK] }}
146+
run: |
147+
cd ${PLUGIN_ABS_PATH}
148+
mkdir Cubit
149+
cd Cubit
150+
curl -L ${COREFORM_BASE_URL}${CUBIT_PKG} --output ${CUBIT_PKG}
151+
7z x ${CUBIT_PKG}
152+
153+
if [ "${{ matrix.cubit }}" = "17.1.0" ]; then
154+
curl -L ${COREFORM_BASE_URL}${CUBIT_SDK_PKG} --output ${CUBIT_SDK_PKG}
155+
7z x ${CUBIT_SDK_PKG}
156+
cp -r Trelis*/* ./
157+
fi
158+
159+
- uses: actions/checkout@v2
160+
161+
- name: build plugin
162+
shell: bash -l {0}
163+
run: |
164+
cd ${PLUGIN_ABS_PATH}
165+
mkdir plugin_build plugin_install
166+
cd plugin_build
167+
cmake ../Cubit-plugin/ \
168+
-G"Visual Studio 16 2019" \
169+
-DCubit_DIR="../Cubit/bin" \
170+
-DCUBIT_ROOT="../Cubit/bin" \
171+
-DUPDATE_SUBMODULES=ON \
172+
-DDAGMC_DIR="../dagmc_install" \
173+
-DCMAKE_BUILD_TYPE=Release \
174+
-DCMAKE_INSTALL_PREFIX=../plugin_install \
175+
-DHDF5_ROOT="C:/Miniconda/Library/" \
176+
-DHDF5_hdf5_LIBRARY_RELEASE="C:/Miniconda/Library/lib/libhdf5_hl.lib;C:/Miniconda/Library/lib/libhdf5.lib;C:/Miniconda/Library/lib/zlib.lib;C:/Miniconda/Library/lib/libhdf5_cpp.lib" \
177+
-DCMAKE_EXE_LINKER_FLAGS="" \
178+
-DCMAKE_MODULE_LINKER_FLAGS="" \
179+
-DCMAKE_SHARED_LINKER_FLAGS="" \
180+
-DCMAKE_STATIC_LINKER_FLAGS=""
181+
cmake --build . --config Release
182+
cmake --install . --config Release
183+
184+
- name: prepare pkg
185+
shell: bash
186+
run: |
187+
cd ${PLUGIN_ABS_PATH}
188+
mkdir -p bin/plugins
189+
cd bin/plugins
190+
cp ../../moab_install/bin/MOAB.dll ./
191+
cp ../../dagmc_install/lib/*.lib ./
192+
cp ../../plugin_install/bin/* ./
193+
cp ../../plugin_install/lib/* ./
194+
cd ${PLUGIN_ABS_PATH}
195+
7z -tzip a C:/Users/runneradmin/svalinn_plugin_windows_${{ matrix.cubit }}.zip bin\
196+
197+
- if: github.event_name != 'release'
198+
name: Upload artifact for CI
199+
uses: actions/upload-artifact@v2
200+
with:
201+
name: svalinn-plugin_windows_${{ matrix.cubit }}.zip
202+
path: C:/Users/runneradmin/svalinn_plugin_windows_${{ matrix.cubit }}.zip
203+
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
204+
205+
- if: github.event_name == 'release'
206+
name: Upload binaries into the release
207+
uses: svenstaro/upload-release-action@v2
208+
with:
209+
repo_token: ${{ secrets.GITHUB_TOKEN }}
210+
file: C:/Users/runneradmin/svalinn_plugin_windows_${{ matrix.cubit }}.zip
211+
asset_name: svalinn_plugin_windows_${{ matrix.cubit }}.zip
212+
tag: ${{ github.ref }}
213+

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ if (NOT CMAKE_BUILD_TYPE)
2020
set(CMAKE_BUILD_TYPE Release)
2121
endif ()
2222

23+
#enable windows export flags
24+
if(MSVC)
25+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
26+
set(BUILD_SHARED_LIBS TRUE)
27+
endif()
28+
2329
# Use C++11
2430
set(CMAKE_CXX_STANDARD 11)
2531

import_mcnp_cmd/MCNPImp.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
//Stores all of the options selected
1010
struct program_option_struct Gopt;
11+
std::ofstream record;
12+
1113

1214
MCNPImp::MCNPImp()
1315
{

mcnp2cad

0 commit comments

Comments
 (0)