diff --git a/appveyor.yml b/appveyor.yml index fc7dabb..259a185 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -50,10 +50,26 @@ build_script: # download and unpack the OpenBLAS library, integer*4 (or i32lp64) version - ps: wget http://skylink.dl.sourceforge.net/project/openblas/v0.2.14/OpenBLAS-v0.2.14-Win64-int32.zip -OutFile OpenBLAS-v0.2.14-Win64-int32.zip - 7z x OpenBLAS-v0.2.14-Win64-int32.zip > NUL - +# # add both OpenBLAS dynamic (libopenblas.dll) and static (libopenblas.a) library files dir to path - set path=%path%;C:\software\OpenBLAS-v0.2.14-Win64-int32\bin;C:\software\OpenBLAS-v0.2.14-Win64-int32\lib;C:\software\OpenBLAS-v0.2.14-Win64-int32\include +# download and unpack MSMPI library (Windows version of OpenMPI) +# follow http://www.symscape.com/configure-msmpi-for-mingw-w64#comment-1824 +- mkdir C:\software\msmpi && cd C:\software\msmpi +- ps: wget http://download.microsoft.com/download/A/1/3/A1397A8C-4751-433C-8330-F738C3BE2187/mpi_x64.Msi -OutFile mpi_x64.Msi +- 7z x mpi_x64.Msi +- gendef msmpi64.dll +- dlltool -d msmpi64.def -l libmsmpi64.a -D msmpi64.dll +- del mpi.f90 +- ps: wget http://web-docs.gsi.de/~milias/msmpi/mpi.F90 -OutFile mpi.F90 +- gfortran -c -D_WIN64 -D INT_PTR_KIND()=8 -fno-range-check mpi.F90 +- del mpif.h +- ps: wget http://web-docs.gsi.de/~milias/msmpi/mpif.h -OutFile mpif.h +- dir + +# add msmpi to path +- set path=%path%;C:\software\msmpi # download and upgrade pip - ps: wget https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.py diff --git a/test/fc_mpi/cmake/autocmake.cfg b/test/fc_mpi/cmake/autocmake.cfg index 7c3e118..97d8bc6 100644 --- a/test/fc_mpi/cmake/autocmake.cfg +++ b/test/fc_mpi/cmake/autocmake.cfg @@ -8,11 +8,11 @@ source: ../../../modules/fc.cmake [mpi] source: ../../../modules/mpi.cmake -[int64] -source: ../../../modules/int64.cmake - [default_build_paths] source: ../../../modules/default_build_paths.cmake [src] source: ../../../modules/src.cmake + +[definitions] +source: ../../../modules/definitions.cmake diff --git a/test/fc_mpi/src/CMakeLists.txt b/test/fc_mpi/src/CMakeLists.txt index 693f675..0829498 100644 --- a/test/fc_mpi/src/CMakeLists.txt +++ b/test/fc_mpi/src/CMakeLists.txt @@ -1,5 +1,9 @@ if (MPI_FOUND) add_executable(example example.F90) + if (CMAKE_SYSTEM_NAME MATCHES "Windows") + # respect paths in appveyor.yml + target_link_libraries(example "C:/software/msmpi/libmsmpi64.a") + endif() else() message(FATAL "MPI not found!") endif() diff --git a/test/test.py b/test/test.py index 3d0548d..d0975ae 100644 --- a/test/test.py +++ b/test/test.py @@ -157,14 +157,18 @@ def test_fc_int64(): # ------------------------------------------------------------------------------ -@skip_on_windows -def test_fc_mpi_module(): - configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=mpif90 --extra-fc-flags="-D USE_MPI_MODULE"', 'mpirun -np 2') +def test_fc_mpi(): + if sys.platform == 'win32': + configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=gfortran --extra-fc-flags="-D_WIN64 -D INT_PTR_KIND()=8 -fno-range-check" --add-definitions="-D USE_MPI_MODULE"', 'mpiexec -n 2') + else: + configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=mpif90 --add-definitions="-D USE_MPI_MODULE"', 'mpirun -np 2') -@skip_on_windows def test_fc_mpi_include(): - configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=mpif90', 'mpirun -np 2') + if sys.platform == 'win32': + configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=gfortran --extra-fc-flags="-D_WIN64 -D INT_PTR_KIND()=8 -fno-range-check"', 'mpiexec -np 2') + else: + configure_build_and_exe('fc_mpi', 'python setup.py --mpi --fc=mpif90', 'mpirun -np 2') # ------------------------------------------------------------------------------