diff --git a/.github/workflows/unix_linux.yml b/.github/workflows/unix_linux.yml index 3a0ecb748..bc5b3fdba 100644 --- a/.github/workflows/unix_linux.yml +++ b/.github/workflows/unix_linux.yml @@ -23,7 +23,7 @@ on: release: types: # This configuration does not affect the page_build event above - - created + - published env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/unix_mac.yml b/.github/workflows/unix_mac.yml index 207c90829..25565fa80 100644 --- a/.github/workflows/unix_mac.yml +++ b/.github/workflows/unix_mac.yml @@ -25,7 +25,7 @@ on: release: types: # This configuration does not affect the page_build event above - - created + - published env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..ee5092e0d --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,213 @@ +name: Windows + +on: + # allows us to run workflows manually + workflow_dispatch: + pull_request: + branches: + - develop + paths-ignore: + - '.github/workflows/unix_linux.yml' + - '.github/workflows/unix_mac.yml' + - 'scripts/**' + - '*.md' + - 'LICENSE' + + push: + branches: + - develop + paths-ignore: + - '.github/workflows/unix_linux.yml' + - '.github/workflows/unix_mac.yml' + - 'scripts/**' + - '*.md' + - 'LICENSE' + + release: + types: # This configuration does not affect the page_build event above + - published + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + main: + runs-on: windows-2019 + strategy: + matrix: + cubit: [17.1.0, 2021.3, 2021.4, 2021.5] + + name: 'Cubit Svalinn Plugin ${{ matrix.cubit }} Build for Windows' + steps: + + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-activate-base: true + activate-environment: "" + + - name: Environment Variables + shell: bash -l {0} + run: | + COREFORM_BASE_URL=https://f002.backblazeb2.com/file/cubit-downloads/Coreform-Cubit/Releases + + CUBIT_BASE_NAME=Coreform-Cubit-${{ matrix.cubit }} + if [ "${{ matrix.cubit }}" == "17.1.0" ]; then + BASE=Trelis-17.1.0 + BASESDK=Trelis-SDK-17.1.0 + CUBIT_BASE_NAME=Trelis-17.1 + elif [ "${{ matrix.cubit }}" == "2021.3" ]; then + BASE=Coreform-Cubit-2021.3.0 + CUBIT_BASE_NAME=Coreform-Cubit-2021.3 + elif [ "${{ matrix.cubit }}" == "2021.4" ]; then + BASE=Coreform-Cubit-2021.4%2B15017_05893177 + elif [ "${{ matrix.cubit }}" == "2021.5" ]; then + BASE=Coreform-Cubit-2021.5%2B15962_5043ef39 + fi + echo "COREFORM_BASE_URL=${COREFORM_BASE_URL}/Windows/" >> $GITHUB_ENV + echo "CUBIT_PKG=${BASE}-Win64.exe" >> $GITHUB_ENV + echo "CUBIT_SDK_PKG=${BASESDK}-Win64.zip" >> $GITHUB_ENV + echo "CUBIT_BASE_NAME=${CUBIT_BASE_NAME}" >> $GITHUB_ENV + + echo "CURRENT=$(pwd)" >> $GITHUB_ENV + echo "SCRIPTPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV + echo "PLUGIN_ABS_PATH=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV + + - name: Conda dependencies + shell: bash -l {0} + run: | + conda install curl eigen hdf5 + + - name: Build MOAB + shell: bash -l {0} + run: | + cd ${PLUGIN_ABS_PATH} + git clone https://bitbucket.org/fathomteam/moab -b 5.3.0 --depth 1 --shallow-submodules + mkdir moab_build moab_install + cd moab_build + cmake ../moab \ + -DENABLE_BLASLAPACK=OFF \ + -DENABLE_FORTRAN=OFF \ + -DENABLE_IMESH=OFF \ + -DENABLE_TESTING=OFF \ + -DENABLE_HDF5=ON \ + -DBUILD_SHARED_LIBS=ON \ + -G"Visual Studio 16 2019" \ + -DCMAKE_INSTALL_PREFIX=../moab_install/ \ + -DHDF5_ROOT="C:/Miniconda/Library/" \ + -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" \ + -DCMAKE_EXE_LINKER_FLAGS="" \ + -DCMAKE_MODULE_LINKER_FLAGS="" \ + -DCMAKE_SHARED_LINKER_FLAGS="" \ + -DCMAKE_STATIC_LINKER_FLAGS="" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe" \ + -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe" + cmake --build . --config Release + cmake --install . --config Release + + + - name: build DAGMC + shell: bash -l {0} + run: | + cd ${PLUGIN_ABS_PATH} + git clone https://github.com/svalinn/DAGMC -b develop --depth 1 --shallow-submodules + + mkdir dagmc_build dagmc_install + cd dagmc_build + + cmake ../dagmc \ + -G"Visual Studio 16 2019" \ + -DBUILD_EXE=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_STATIC_LIBS=OFF \ + -DBUILD_TALLY=OFF \ + -DBUILD_BUILD_OBB=OFF \ + -DBUILD_UWUW=ON \ + -DBUILD_MAKE_WATERTIGHT=ON \ + -DBUILD_TESTS=OFF \ + -DMOAB_DIR=../moab_install \ + -DHDF5_ROOT="C:/Miniconda/Library/" \ + -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" \ + -DCMAKE_INSTALL_PREFIX=../dagmc_install/ \ + -DCMAKE_EXE_LINKER_FLAGS="" \ + -DCMAKE_MODULE_LINKER_FLAGS="" \ + -DCMAKE_SHARED_LINKER_FLAGS="" \ + -DCMAKE_STATIC_LINKER_FLAGS="" \ + -DCMAKE_BUILD_TYPE=Release + cmake --build . --config Release + cmake --install . --config Release + + + - name: Cubit download + shell: bash -l {0} + env: + CUBIT_DEB_URL: ${{ secrets[matrix.URL] }} + CUBIT_SDK_URL: ${{ secrets[matrix.URL_SDK] }} + run: | + cd ${PLUGIN_ABS_PATH} + mkdir Cubit + cd Cubit + curl -L ${COREFORM_BASE_URL}${CUBIT_PKG} --output ${CUBIT_PKG} + 7z x ${CUBIT_PKG} + + if [ "${{ matrix.cubit }}" = "17.1.0" ]; then + curl -L ${COREFORM_BASE_URL}${CUBIT_SDK_PKG} --output ${CUBIT_SDK_PKG} + 7z x ${CUBIT_SDK_PKG} + cp -r Trelis*/* ./ + fi + + - uses: actions/checkout@v2 + + - name: build plugin + shell: bash -l {0} + run: | + cd ${PLUGIN_ABS_PATH} + mkdir plugin_build plugin_install + cd plugin_build + cmake ../Cubit-plugin/ \ + -G"Visual Studio 16 2019" \ + -DCubit_DIR="../Cubit/bin" \ + -DCUBIT_ROOT="../Cubit/bin" \ + -DUPDATE_SUBMODULES=ON \ + -DDAGMC_DIR="../dagmc_install" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=../plugin_install \ + -DHDF5_ROOT="C:/Miniconda/Library/" \ + -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" \ + -DCMAKE_EXE_LINKER_FLAGS="" \ + -DCMAKE_MODULE_LINKER_FLAGS="" \ + -DCMAKE_SHARED_LINKER_FLAGS="" \ + -DCMAKE_STATIC_LINKER_FLAGS="" + cmake --build . --config Release + cmake --install . --config Release + + - name: prepare pkg + shell: bash + run: | + cd ${PLUGIN_ABS_PATH} + mkdir -p bin/plugins + cd bin/plugins + cp ../../moab_install/bin/MOAB.dll ./ + cp ../../dagmc_install/lib/*.lib ./ + cp ../../plugin_install/bin/* ./ + cp ../../plugin_install/lib/* ./ + cd ${PLUGIN_ABS_PATH} + 7z -tzip a C:/Users/runneradmin/svalinn_plugin_windows_${{ matrix.cubit }}.zip bin\ + + - if: github.event_name != 'release' + name: Upload artifact for CI + uses: actions/upload-artifact@v2 + with: + name: svalinn-plugin_windows_${{ matrix.cubit }}.zip + path: C:/Users/runneradmin/svalinn_plugin_windows_${{ matrix.cubit }}.zip + if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` + + - if: github.event_name == 'release' + name: Upload binaries into the release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: C:/Users/runneradmin/svalinn_plugin_windows_${{ matrix.cubit }}.zip + asset_name: svalinn_plugin_windows_${{ matrix.cubit }}.zip + tag: ${{ github.ref }} + diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ff80ca37..c05558380 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,12 @@ if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif () +#enable windows export flags +if(MSVC) + set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + set(BUILD_SHARED_LIBS TRUE) +endif() + # Use C++11 set(CMAKE_CXX_STANDARD 11) diff --git a/import_mcnp_cmd/MCNPImp.cpp b/import_mcnp_cmd/MCNPImp.cpp index 41999bf7e..23247decd 100644 --- a/import_mcnp_cmd/MCNPImp.cpp +++ b/import_mcnp_cmd/MCNPImp.cpp @@ -8,6 +8,8 @@ //Stores all of the options selected struct program_option_struct Gopt; +std::ofstream record; + MCNPImp::MCNPImp() { diff --git a/mcnp2cad b/mcnp2cad index b6708144f..87525b180 160000 --- a/mcnp2cad +++ b/mcnp2cad @@ -1 +1 @@ -Subproject commit b6708144fa69fb40a6ff56ee5a37cc4b79888bc3 +Subproject commit 87525b180a7f127971216812166d4acf1fb01a9a