Skip to content

Commit d95a962

Browse files
committed
Automated coda build on win works for cpu, nvcc compilation is not working yet
1 parent f06c840 commit d95a962

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

.conda-recipe/bld.bat

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
@echo off
22

3-
:: Preparation of terminal to find ifort
3+
:: Preparation of terminal to find ifort and icl
44
:: Assuming there is a setvars.bat for Intel OneAPI on Windows
55
call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
66

77
:: Navigate to wrapper file for python module
88
cd %RECIPE_DIR%\..\python\src\magtense\lib
9+
del /Q /F %RECIPE_DIR%\..\python\src\magtense.egg-info
10+
del /Q /F %RECIPE_DIR%\..\python\build
11+
make clean
912
make
1013

1114
:: Navigate to distribution script
1215
cd %RECIPE_DIR%\..\python
1316
%PYTHON% -m pip install . -vvv --use-deprecated=legacy-resolver --no-deps --ignore-installed --no-cache-dir
14-
15-
:: Clean up
16-
cd %RECIPE_DIR%\..\python\src\magtense\lib
17-
make clean
18-
del /Q /F %RECIPE_DIR%\..\python\src\magtense.egg-info
19-
del /Q /F %RECIPE_DIR%\..\python\build

.conda-recipe/meta.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{% set cuda_version = "cuda12" %}
44
{% set cuda_pkg_version = "12.*" %}
55
{% set mkl_version = "2023.*" %}
6+
{% set numpy_version_build = "1.25.2" %}
67

78
package:
89
name: magtense
@@ -15,11 +16,12 @@ build:
1516
requirements:
1617
build:
1718
- python {{ py_version }}
18-
- numpy
19+
- numpy =={{ numpy_version_build }}
1920
- mkl =={{ mkl_version }}
2021
- mkl-static
2122
- intel-fortran-rt # [unix]
2223
{% if cuda_version != 'cpu' %}
24+
- cuda-nvcc =={{ cuda_pkg_version }}
2325
- libcusparse-dev =={{ cuda_pkg_version }}
2426
- libcublas-dev =={{ cuda_pkg_version }}
2527
- cuda-cudart-dev =={{ cuda_pkg_version }}

python/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ When the soft tiles differ in their M-H-curves, multiple state function can be c
9696

9797
## Distribution on [Anaconda](https://anaconda.org/cmt-dtu-energy/magtense)
9898

99+
### Required compilers have to be pre-installed
100+
101+
- [Intel® C++ Compiler](https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#inpage-nav-6-undefined)
102+
- [Intel® Fortran Compiler](https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#fortran)
103+
99104
```bash
100105
conda install -y anaconda-client conda-build
101106
@@ -106,7 +111,7 @@ conda config --env --append channels intel
106111
# On Windows
107112
# conda config --env --append channels conda-forge
108113
109-
# Version numbers have to be set in advance
114+
# Version numbers have to be set in advance in pyproject.toml
110115
cd MagTense/python/
111116
python scripts/dist_conda.py
112117
```

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ where = ["src"]
1414

1515
[project]
1616
name = "magtense"
17-
version = "2.2.0"
17+
version = "2.2.1"
1818
authors = [
1919
{ name="Stefan Pollok", email="[email protected]" },
2020
]

python/src/magtense/lib/Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,17 @@ PYTHON_MODN = magtensesource
2929
VPATH = ../../../../source/NumericalIntegration/NumericalIntegration:\
3030
../../../../source/TileDemagTensor/TileDemagTensor:\
3131
../../../../source/DemagField/DemagField:\
32-
../../../../source/MagTenseMicroMag
32+
../../../../source/MagTenseMicroMag:\
33+
../../../../source/MagTenseFortranCuda/cuda
3334

34-
CU_PATH = ../../../../source/MagTenseFortranCuda/cuda
3535
CUDA_SOURCE = MagTenseCudaBlas
3636
CUDA_WRAP_SOURCE = MagTenseCudaBlasICLWrapper
3737

38+
# file names
3839
CUDA_FILE = $(addsuffix .cu, ${CUDA_SOURCE})
3940
CUDA_WRAP_FILE = $(addsuffix .cxx, ${CUDA_WRAP_SOURCE})
41+
42+
# object files
4043
CUDA_OBJECT = $(addsuffix .o, ${CUDA_SOURCE})
4144
CUDA_WRAP = $(addsuffix .o, ${CUDA_WRAP_SOURCE})
4245

@@ -150,7 +153,7 @@ LIBSRC_WRAP_FILES = $(addsuffix .f90, ${LIBSRC_WRAP_SOURCES})
150153
#=======================================================================
151154
# Relevant suffixes
152155
#=======================================================================
153-
.SUFFIXES: .f90
156+
.SUFFIXES: .f90 .cu .cxx
154157

155158
#=======================================================================
156159
#
@@ -170,11 +173,11 @@ clean:
170173
.c.o:
171174
${CC} ${CFLAGS} -c $< -o $@
172175

173-
${CUDA_OBJECT}:
174-
${CU} ${CUFLAGS} -c ${CU_PATH}/${CUDA_FILE} -o $@
176+
.cu.o:
177+
${CU} ${CUFLAGS} -c $< -o $@
175178

176-
${CUDA_WRAP}:
177-
${CPP} ${CPPFLAGS} -c ${CU_PATH}/${CUDA_WRAP_FILE}
179+
.cxx.o:
180+
${CPP} ${CPPFLAGS} -c $< -o $@
178181

179182
${STATIC_LIB}: ${LIBSRC_OBJECTS} ${CUDA_OBJECT} ${CUDA_WRAP}
180183
${LIBTOOL}

0 commit comments

Comments
 (0)