Skip to content

Commit

Permalink
Experiment with MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
oerc0122 committed Nov 8, 2024
1 parent a3c30a4 commit c75e3fe
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ jobs:
if: startsWith(matrix.os, 'macos')
run: |
brew install llvm
echo CC="/opt/homebrew/opt/llvm/bin/clang" >> $GITHUB_ENV
echo LDFLAGS="-L/opt/homebrew/opt/llvm/lib $LDFLAGS" >> $GITHUB_ENV
echo CPPFLAGS="-I/opt/homebrew/opt/llvm/include $CPPFLAGS" >> $GITHUB_ENV
- name: Setup MSVC env on Windows
if: startsWith(matrix.os, 'windows')
shell: bash
run: |
echo "CC=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\cl.exe" >> $GITHUB_ENV
echo "CC_LD=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\bin\HostX64\x64\link.exe" >> $GITHUB_ENV
- name: Update pip and install dependencies
shell: bash -l {0}
run: |
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ version = configure_file(input: 'build_utils/version.py.in',
output: 'version.py',
configuration: {'VERSION': meson.project_version()})

py.install_sources(version, 'CITATION.cff', 'LICENSE', subdir : 'euphonic')
py.install_sources(version, 'CITATION.cff', 'LICENSE', subdir: 'euphonic')

src = ['c/_euphonic.c', 'c/dyn_mat.c', 'c/util.c', 'c/py_util.c', 'c/load_libs.c']

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ requires = ["meson-python",
"packaging",
"numpy>=1.24.0"]

[tool.meson-python.args]
setup = ['--vsenv']

[project]
name = "Euphonic"
description = "Euphonic calculates phonon bandstructures and inelastic neutron scattering intensities from modelling code output (e.g. CASTEP)"
Expand Down
15 changes: 8 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ skipsdist = True
[testenv]
changedir = tests_and_analysis/test
test_command = python run_tests.py --report
passenv = PATH CC CC_LD LDFLAGS CPPFLAGS

[testenv:{py310,py311,py312}]
install_command =
Expand All @@ -21,7 +22,7 @@ deps =
numpy
-r{toxinidir}/tests_and_analysis/tox_requirements.txt
commands_pre =
python -m pip install -vvv \
python -m pip install \
--upgrade \
--upgrade-strategy eager \
'{toxinidir}[matplotlib,phonopy_reader,brille]'
Expand All @@ -33,7 +34,7 @@ commands =
install_command = {[testenv:py310]install_command}
deps = {[testenv:py310]deps}
commands_pre =
python -m pip install -vvv \
python -m pip install \
--upgrade \
--upgrade-strategy eager \
'{toxinidir}'
Expand All @@ -44,7 +45,7 @@ commands = {[testenv]test_command} --cov -m "not (phonopy_reader or matplotlib o
install_command = {[testenv:py310]install_command}
deps = {[testenv:py310]deps}
commands_pre =
python -m pip install -vvv \
python -m pip install \
--upgrade \
--upgrade-strategy eager \
'{toxinidir}[matplotlib]'
Expand All @@ -55,7 +56,7 @@ commands = {[testenv]test_command} --cov -m "matplotlib and not multiple_extras"
install_command = {[testenv:py310]install_command}
deps = {[testenv:py310]deps}
commands_pre =
python -m pip install -vvv \
python -m pip install \
--upgrade \
--upgrade-strategy eager \
'{toxinidir}[phonopy_reader]'
Expand All @@ -66,7 +67,7 @@ commands = {[testenv]test_command} --cov -m "phonopy_reader and not multiple_ext
install_command = {[testenv:py310]install_command}
deps = {[testenv:py310]deps}
commands_pre =
python -m pip install -vvv \
python -m pip install \
--upgrade \
--upgrade-strategy eager \
'{toxinidir}[brille]'
Expand All @@ -77,7 +78,7 @@ commands = {[testenv]test_command} --cov -m "brille and not multiple_extras"
install_command = {[testenv:py310]install_command}
deps = {[testenv:py310]deps}
commands_pre =
python -m pip install -vvv \
python -m pip install \
--upgrade \
--upgrade-strategy eager \
'{toxinidir}[phonopy_reader,matplotlib,brille]'
Expand All @@ -100,5 +101,5 @@ commands_pre =
-r{toxinidir}/tests_and_analysis/tox_requirements.txt
# Force rebuild of euphonic extension to avoid Numpy clash
rm -rf {toxinidir}/build
python -m pip install -vvv '{toxinidir}[matplotlib,phonopy_reader,brille]'
python -m pip install '{toxinidir}[matplotlib,phonopy_reader,brille]'
commands = {[testenv]test_command}

0 comments on commit c75e3fe

Please sign in to comment.