Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9a23d52
First stab at adding basic windows MSVC test
tkittel Mar 20, 2025
7aca5bc
Adapt CMake for multicfg generators
tkittel Mar 20, 2025
1569b74
CMake cleanup for executable installs
tkittel Mar 20, 2025
faeadc2
Change default values of deprecated ENSURE_MCPL and ENSURE_NCRYSTAL t…
tkittel Mar 20, 2025
21ffdfe
Attempt setting MCSTAS env var via cmd syntax
willend Mar 20, 2025
cd0ee5f
Call mcrun with relative path, cat the config file
willend Mar 24, 2025
c914f21
Add wget dependency
willend Mar 24, 2025
cfc11ec
Use ilammy/msvc-dev-cmd@v1
willend Mar 21, 2025
67a7cdd
Implement @MCPLFLAGS@ and use CMD(ncrystal-config --show buildflags) …
willend Mar 21, 2025
c187c63
Add MCPLFLAGS in parsing DEPENDENCIES
willend Mar 21, 2025
109404a
Add msmpi
willend Mar 21, 2025
55ad1ee
Tar up run_ folders and provide for download
willend Mar 22, 2025
d5cca82
REVISIT Remove extra USE_MPI bracing of MPI_MASTER that handles this …
willend Mar 22, 2025
8cbcab7
Re-enable MCPL_output and MPI
willend Mar 22, 2025
434a8fa
Put MCPL instrs in own test category
willend Mar 22, 2025
379e81c
Add McXtrace test, but don't run MPI for MCPL yet
willend Mar 22, 2025
ea8e1be
Use ${{ matrix.os }} for output
willend Mar 22, 2025
1236984
Path correction and test look at %MCXTRACE%
willend Mar 22, 2025
6683cd9
MPI_MASTER without USE_MPI for MCPL_input McXtrace
willend Mar 22, 2025
319d3e2
Try enabling MPI on MCPL_input McXtrace
willend Mar 22, 2025
1770c72
MPI_MASTER fixes for McXtrace MCPL_output
willend Mar 22, 2025
6f735be
Enable MCPL_output MPI McXtrace
willend Mar 22, 2025
900801b
mingw / gcc based workflow for mcstas windows
willend Mar 23, 2025
af09c1e
Add workflow for mingw McXtrace
willend Mar 23, 2025
9c2da59
Windows has its own basictest track
willend Mar 24, 2025
00decf0
Add MCPLFLAGS in these config snips
willend Mar 24, 2025
3ee3e86
Configure these builds for -DMCCODE_CONFIG_MCPL2=ON since they
willend Mar 24, 2025
78839aa
Add use of MCPLFLAGS in tool layer
willend Mar 24, 2025
33c78ad
Consequence-edit: McXtrace MCPL examples moved.
willend Mar 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mcstas-basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- { os: macos-13, CC: clang, CXX: clang++, python: "3.11", mpi: 'openmpi' }
- { os: macos-14, CC: clang, CXX: clang++, python: "3.12", mpi: 'openmpi' }
- { os: macos-15, CC: clang, CXX: clang++, python: "3.13", mpi: 'openmpi' }
- { os: windows-latest, CC: gcc, CXX: g++, python: "3.12", mpi: 'msmpi' }
#- { os: windows-latest, CC: gcc, CXX: g++, python: "3.12", mpi: 'msmpi' }

name: ${{ matrix.os }}.${{ matrix.CC }}.${{ matrix.mpi }}.python-${{ matrix.python }}
runs-on: ${{ matrix.os }}
Expand Down
185 changes: 185 additions & 0 deletions .github/workflows/mcstas-winbasictest-mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: mcstas-mingw-winbasictest

on:
push:
pull_request:

jobs:
build:
# More platform information available on:
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md

runs-on: ${{ matrix.os }}
defaults:
run:
shell: cmd

strategy:
matrix:
os: [windows-2022]

steps:

- name: Checkout
uses: actions/checkout@v4
with:
path: src

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: 'msmpi'

- name: Setup MPI cygpath bash...
shell: bash
run: |
cygpath -sm "$MSMPI_INC" > includepath.txt
cygpath -sm "$MSMPI_LIB64" > libpath.txt

- name: Setup MPI cygpath...
run: |
set /p MPIINCVAR=<includepath.txt
set /p MPILIBVAR=<libpath.txt
echo MPIINCVAR=%MPIINCVAR% >> %GITHUB_ENV%
echo MPILIBVAR=%MPILIBVAR% >> %GITHUB_ENV%

- name: choco install wget
run: choco install wget

- name: pip install deps
run: pip install PyYAML ply McStasscript ncrystal mslex

- name: pip install mcpl-core preview
run: pip install -v "git+https://github.com/mctools/mcpl@path_to_mcpl2#subdirectory=mcpl_core"

- name: choco install deps2
run: choco install mingw make winflexbison3

- name: CMake cfg
run: >
cmake -B build -S src
-G "Unix Makefiles"
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc.exe
"-DCMAKE_INSTALL_PREFIX=./install"
-DMCVERSION="3.99.99"
-DMCCODE_BUILD_CONDA_PKG=OFF
-DMCCODE_BUILD_WINDOWS_MINGW=ON
-DMCCODE_CONFIG_MCPL2=ON
-DCMAKE_INSTALL_LIBDIR=lib
-DBUILD_MCSTAS=ON
-DMCCODE_USE_LEGACY_DESTINATIONS=OFF
-DBUILD_TOOLS=ON
-DENABLE_COMPONENTS=ON
-DENABLE_CIF2HKL=OFF
-DENABLE_NEUTRONICS=OFF
-DMPIINCLUDEDIR=%MPIINCVAR%
-DMPILIBDIR=%MPILIBVAR%

- name: CMake build
shell: cmd
run: cmake --build build --config Release -j 2

- name: CMake install
run: cmake --install build --config Release

- name: set MCSTAS env var
run: echo MCSTAS=%CD%\install\share\mcstas\resources >> %GITHUB_ENV%

- name: check MCSTAS env var
run: echo %MCSTAS%

- run: type .\install\share\mcstas\tools\Python\mccodelib\mccode_config.json
- run: .\install\bin\mcrun -h
- run: .\install\bin\mcstas -v
- run: mcpl-config -s
- run: ncrystal-config -s

- name: Prepare rundirs
run: mkdir run_std run_mcpl_output run_mcpl_input run_mcpl_input_once run_union run_ncrystal

- name: Prepare std instrument
working-directory: run_std
run: copy ..\install\share\mcstas\resources\examples\BNL\BNL_H8\BNL_H8.instr test.instr

- name: Prepare NCrystal instrument
working-directory: run_ncrystal
run: copy ..\install\share\mcstas\resources\examples\NCrystal\NCrystal_example\NCrystal_example.instr test.instr

- name: Prepare MCPL_input instrument
working-directory: run_mcpl_input
run: |
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input\Test_MCPL_input.instr test.instr
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input\voutput.mcpl .

- name: Prepare MCPL_input_once instrument
working-directory: run_mcpl_input_once
run: |
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input_once\Test_MCPL_input_once.instr test.instr
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input_once\voutput.mcpl .

- name: Prepare MCPL_output instrument
working-directory: run_mcpl_output
run: copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_output\Test_MCPL_output.instr test.instr

- name: Run std instrument
working-directory: run_std
run: ..\install\bin\mcrun --verbose test.instr -d Single_core lambda=2.36

- name: Run MCPL_output instrument
working-directory: run_mcpl_output
run: ..\install\bin\mcrun --verbose test.instr -d Single_core Ncount=1e3

- name: Run MCPL_input instrument
working-directory: run_mcpl_input
run: ..\install\bin\mcrun --verbose test.instr -d Single_core repeat=1

- name: Run MCPL_input_once instrument
working-directory: run_mcpl_input_once
run: ..\install\bin\mcrun --verbose test.instr -d Single_core v_smear=0.1

- name: Run NCrystal instrument
working-directory: run_ncrystal
run: ..\install\bin\mcrun --verbose test.instr -d Single_core sample_cfg="Y2O3_sg206_Yttrium_Oxide.ncmat;density=0.6x"

- name: Run std instrument MPI
working-directory: run_std
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto lambda=2.36

- name: Run MCPL_output instrument MPI
working-directory: run_mcpl_output
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto Ncount=1e3

- name: Run MCPL_input instrument MPI
working-directory: run_mcpl_input
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto repeat=1

- name: Run MCPL_input_once instrument MPI
working-directory: run_mcpl_input_once
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto v_smear=0.1

- name: Run NCrystal instrument MPI
working-directory: run_ncrystal
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto sample_cfg="Y2O3_sg206_Yttrium_Oxide.ncmat;density=0.6x"

- name: 'Tar output files'
id: tar-package
if: always()
shell: bash
run: |
set -e
set -u
set -x
tar cvfz mcstas-mingw-${{ matrix.os }}_output.tgz run_*

- name: 'Upload Artifact'
id: tar-upload
uses: actions/upload-artifact@v4
if: always()
with:
name: mcstas-mingw-${{ matrix.os }}_output.tgz
path: "mcstas-mingw-${{ matrix.os }}_output.tgz"
193 changes: 193 additions & 0 deletions .github/workflows/mcstas-winbasictest-msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
name: mcstas-msvc-winbasictest

on:
push:
pull_request:

jobs:
build:
# More platform information available on:
# https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md

runs-on: ${{ matrix.os }}
defaults:
run:
shell: cmd

strategy:
matrix:
os: [windows-2019, windows-2022, windows-2025]

steps:

- name: Checkout
uses: actions/checkout@v4
with:
path: src

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.11

#Two ways of enabling cl.exe and other tools. One is via an external action...:
- name: Setup VS in shell
uses: ilammy/msvc-dev-cmd@v1
#...but a simpler one might be to simply invoke the correct vcvars64.bat
#file first, like...:
#
# - name: whatever
# shell: cmd
# run: |
# call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
# cl /help
#
#...but since we also want to support VS 2019, we use the above action for now

- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: 'msmpi'

- name: Setup MPI cygpath bash...
shell: bash
run: |
cygpath -sm "$MSMPI_INC" > includepath.txt
cygpath -sm "$MSMPI_LIB64" > libpath.txt

- name: Setup MPI cygpath...
run: |
set /p MPIINCVAR=<includepath.txt
set /p MPILIBVAR=<libpath.txt
echo MPIINCVAR=%MPIINCVAR% >> %GITHUB_ENV%
echo MPILIBVAR=%MPILIBVAR% >> %GITHUB_ENV%

- name: choco install deps
run: choco install winflexbison3 wget

- name: CMake cfg
run: >
cmake -B build -S src
"-DCMAKE_INSTALL_PREFIX=./install"
-DMCVERSION="3.99.99"
-DMCCODE_BUILD_CONDA_PKG=OFF
-DMCCODE_CONFIG_MCPL2=ON
-DCMAKE_INSTALL_LIBDIR=lib
-DBUILD_MCSTAS=ON
-DMCCODE_USE_LEGACY_DESTINATIONS=OFF
-DBUILD_TOOLS=ON
-DENABLE_COMPONENTS=ON
-DENABLE_CIF2HKL=OFF
-DENABLE_NEUTRONICS=OFF
-DMPIINCLUDEDIR=%MPIINCVAR%
-DMPILIBDIR=%MPILIBVAR%

- name: CMake build
shell: cmd
run: cmake --build build --config Release -j 2

- name: CMake install
run: cmake --install build --config Release

- name: pip install deps
run: pip install PyYAML ply McStasscript ncrystal mslex

- name: pip install mcpl-core preview
run: pip install -v "git+https://github.com/mctools/mcpl@path_to_mcpl2#subdirectory=mcpl_core"

- name: set MCSTAS env var
run: echo MCSTAS=%CD%\install\share\mcstas\resources >> %GITHUB_ENV%

- name: check MCSTAS env var
run: echo %MCSTAS%

- run: type .\install\share\mcstas\tools\Python\mccodelib\mccode_config.json
- run: .\install\bin\mcrun -h
- run: .\install\bin\mcstas -v
- run: mcpl-config -s
- run: ncrystal-config -s

- name: Prepare rundirs
run: mkdir run_std run_mcpl_output run_mcpl_input run_mcpl_input_once run_union run_ncrystal

- name: Prepare std instrument
working-directory: run_std
run: copy ..\install\share\mcstas\resources\examples\BNL\BNL_H8\BNL_H8.instr test.instr

- name: Prepare NCrystal instrument
working-directory: run_ncrystal
run: copy ..\install\share\mcstas\resources\examples\NCrystal\NCrystal_example\NCrystal_example.instr test.instr

- name: Prepare MCPL_input instrument
working-directory: run_mcpl_input
run: |
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input\Test_MCPL_input.instr test.instr
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input\voutput.mcpl .

- name: Prepare MCPL_input_once instrument
working-directory: run_mcpl_input_once
run: |
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input_once\Test_MCPL_input_once.instr test.instr
copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_input_once\voutput.mcpl .

- name: Prepare MCPL_output instrument
working-directory: run_mcpl_output
run: copy ..\install\share\mcstas\resources\examples\Tests_MCPL_etc\Test_MCPL_output\Test_MCPL_output.instr test.instr

- name: Run std instrument
working-directory: run_std
run: ..\install\bin\mcrun --verbose test.instr -d Single_core lambda=2.36

- name: Run MCPL_output instrument
working-directory: run_mcpl_output
run: ..\install\bin\mcrun --verbose test.instr -d Single_core Ncount=1e3

- name: Run MCPL_input instrument
working-directory: run_mcpl_input
run: ..\install\bin\mcrun --verbose test.instr -d Single_core repeat=1

- name: Run MCPL_input_once instrument
working-directory: run_mcpl_input_once
run: ..\install\bin\mcrun --verbose test.instr -d Single_core v_smear=0.1

- name: Run NCrystal instrument
working-directory: run_ncrystal
run: ..\install\bin\mcrun --verbose test.instr -d Single_core sample_cfg="Y2O3_sg206_Yttrium_Oxide.ncmat;density=0.6x"

- name: Run std instrument MPI
working-directory: run_std
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto lambda=2.36

- name: Run MCPL_output instrument MPI
working-directory: run_mcpl_output
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto Ncount=1e3

- name: Run MCPL_input instrument MPI
working-directory: run_mcpl_input
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto repeat=1

- name: Run MCPL_input_once instrument MPI
working-directory: run_mcpl_input_once
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto v_smear=0.1

- name: Run NCrystal instrument MPI
working-directory: run_ncrystal
run: ..\install\bin\mcrun --verbose test.instr -d MPI_multicore -c --mpi=auto sample_cfg="Y2O3_sg206_Yttrium_Oxide.ncmat;density=0.6x"

- name: 'Tar output files'
id: tar-package
if: always()
shell: bash
run: |
set -e
set -u
set -x
tar cvfz mcstas-msvc-${{ matrix.os }}_output.tgz run_*

- name: 'Upload Artifact'
id: tar-upload
uses: actions/upload-artifact@v4
if: always()
with:
name: mcstas-msvc-${{ matrix.os }}_output.tgz
path: "mcstas-msvc-${{ matrix.os }}_output.tgz"
Loading