conda-forge / msmpi-feedstock

A conda-smithy repository for msmpi.
BSD 3-Clause "New" or "Revised" License
1 stars 7 forks source link

Add wrappers #20

Closed nicogodet closed 3 months ago

nicogodet commented 10 months ago

Checklist

msmpi is now built against https://github.com/nicogodet/Microsoft-MPI. This is a fork of https://github.com/microsoft/Microsoft-MPI, as GH repo is still on MIT licence, including pending PRs and necessary files to build wrappers (mpicc, mpicxx, mpic++, mpifort, mpif77, mpif90). Fixes #19

file mpi.c is adapted from msys2 mpi.c file.

A built package is available here: https://anaconda.org/nicogodet/m2w64-msmpi/10.1.1/download/win-64/m2w64-msmpi-10.1.1-h82bb817_5.tar.bz2

These wrappers are mandatory to build several other (like scalapack, mumps with MPI support). Example for scalapack:

cmake -B build -G "MinGW Makefiles" -DBUILD_SINGLE=yes -DBUILD_DOUBLE=yes -DBUILD_COMPLEX=yes -DBUILD_COMPLEX16=yes -DBUILD_SHARED_LIBS:BOOL=true -DLAPACK_ROOT=%B
UILD_PREFIX%\Library -DCMAKE_INSTALL_PREFIX=%BUILD_PREFIX%\Library
-- The C compiler identification is GNU 5.3.0
-- The Fortran compiler identification is GNU 5.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/miniforge3/envs/build/conda-bld/m2w64-scalapack_1697999268173/_h_env/Library/mingw-w64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: D:/miniforge3/envs/build/conda-bld/m2w64-scalapack_1697999268173/_h_env/Library/mingw-w64/bin/gfortran.exe - skipped
-- SCALAPACK 2.2.1.5  CMake 3.26.4  Toolchain
-- checking that C and Fortran compilers can link
-- checking that C and Fortran compilers can link - OK
-- Performing Test HAS_IMPLICIT_FUNC_FLAG
-- Performing Test HAS_IMPLICIT_FUNC_FLAG - Success
-- Found MPI_C: D:/miniforge3/envs/build/conda-bld/m2w64-scalapack_1697999268173/_h_env/Library/lib/libmsmpi.dll.a (found version "2.0")
-- Found MPI_Fortran: D:/miniforge3/envs/build/conda-bld/m2w64-scalapack_1697999268173/_h_env/Library/lib/libmsmpi.dll.a (found version "2.0")
-- Found MPI: TRUE (found version "2.0") found components: C Fortran
-- Populating scalapack
-- Configuring done (0.1s)
-- Generating done (0.1s)

https://anaconda.org/nicogodet/m2w64-scalapack/2.2.1.6/download/win-64/m2w64-scalapack-2.2.1.6-0.tar.bz2

conda-forge-webservices[bot] commented 10 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

nicogodet commented 10 months ago

Not very elegant to downgrade to VS2019 but CBT is deprecated in VS2022 and current msmpi project requires CBT. Not in my scope to update it.

isuruf commented 10 months ago

I don't think we should be calling this microsoft-msmpi if the sources are different.

nicogodet commented 10 months ago

Sources are stil 99% Microsoft ones with a little from msys2. For my own purposes, I used m2w64-msmpi but changing name in conda-forge will have a lot of consequences on packages that depends on msmpi.

I'm not a licence expert but from my understanding of MIT, packaging this slightly modified sources under original name is not forbidden.

nicogodet commented 10 months ago

If we rename, what should it be ? m2w64-msmpi ?

nicogodet commented 10 months ago

Need to double check some things

nicogodet commented 10 months ago

If I want everything to work properly, msmpi needs to be installed in %LIBRARY_PREFIX%/mingw-w64 or f2py fails to link properly

gcc -g -shared tmp_f2py\Release\tmp_f2py\src.win-amd64-3.10\lib\_hermesmodule.o tmp_f2py\Release\tmp_f2py\src.win-amd64-3.10\tmp_f2py\src.win-amd64-3.10\lib\fortranobject.o -LD:\DEV\LOCAL\t
est\telemac-mascaret-v8p4r0\builds\gnu.dynamic\wrap_api\lib -LD:\miniforge3\envs\build-telemac\libs -LD:\miniforge3\envs\build-telemac -LD:\miniforge3\envs\build-telemac\PCbuild\amd64 -lher
mes4api -lspecial4api -lgfortran -lmetis -lmsmpi -lpthread -lpython310 -o .\_hermes.cp310-win_amd64.pyd
D:/miniforge3/envs/build-telemac/Library/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsmpi
collect2.exe: error: ld returned 1 exit status
error: Command "gcc -g -shared tmp_f2py\Release\tmp_f2py\src.win-amd64-3.10\lib\_hermesmodule.o tmp_f2py\Release\tmp_f2py\src.win-amd64-3.10\tmp_f2py\src.win-amd64-3.10\lib\fortranobject.o
-LD:\DEV\LOCAL\test\telemac-mascaret-v8p4r0\builds\gnu.dynamic\wrap_api\lib -LD:\miniforge3\envs\build-telemac\libs -LD:\miniforge3\envs\build-telemac -LD:\miniforge3\envs\build-telemac\PCb
uild\amd64 -lhermes4api -lspecial4api -lgfortran -lmetis -lmsmpi -lpthread -lpython310 -o .\_hermes.cp310-win_amd64.pyd" failed with exit status 1

If I copy bin/msmpi.dll to mingw-w64/bin/ and lib/libmsmpi.dll.a to mingw-w64/lib/, it runs successfully.