scivision / mumps

MUMPS via CMake
http://mumps-solver.org
MIT License
115 stars 46 forks source link

OneAPI & Visual Studio #25

Closed hbadi closed 2 years ago

hbadi commented 2 years ago

Hi, I'd like to compile mumps using oneAPI compiler under Visual Studio. To do so, i configure cmake -G "Visual Studio 17 2022" -A x64 -Dopenmp=true -Dparallel=false -B build using the oneAPI command line (in order to dect the fortran compiler). When it comes to the mumps visual studio solution, the project mumps_common failed to compile with the oneAPI compiler (a lot of fortran files are ignored also). Does anybody already succed ?

Another related question : is there a way to set the oneAPI toolchain compilation in cmake ?

Best regards.

PS : I also tried to configure using Ninja mode but i get the same error when compiling.

scivision commented 2 years ago

with Intel oneAPI on Windows and Visual Studio 17.1, using

cmake -B build -Dopenmp=true -Dparallel=off -G Ninja
cmake --build build

I get configure text including

-- Building for: Ninja
-- The C compiler identification is IntelLLVM 2022.0.0 with MSVC-like command-line
-- The Fortran compiler identification is IntelLLVM 2022.0.0 with MSVC-like command-line

the "build" directory contains:

dmumps.lib
mpiseq.lib
mumps_common.lib
pord.lib
smumps.lib
scivision commented 2 years ago

I don't use a toolchain file for CMake with oneAPI, I just use the oneAPI command prompt for Intel 64 for Visual Studio {2019,2022}

hbadi commented 2 years ago

Hi @scivision

I followed your steps but the compilation failed, here the log file

Thanks for helping.

PS : I used the Intel oneAPI command promp

F:\Work\mumps>cmake -B build -Dopenmp=true -Dparallel=off -G Ninja
-- The C compiler identification is IntelLLVM 2022.0.0 with MSVC-like command-line
-- The Fortran compiler identification is IntelLLVM 2022.0.0 with MSVC-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/icx.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: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/bin/ifx.exe - skipped
-- checking that C and Fortran compilers can link
-- checking that C and Fortran compilers can link - OK
-- Populating mumps
-- Configuring done
-- Generating done
-- Build files have been written to: F:/Work/mumps/build/_deps/mumps-subbuild
[1/8] Creating directories for 'mumps-populate'
[1/8] Performing download step (download, verify and extract) for 'mumps-populate'
-- Downloading...
   dst='F:/Work/mumps/build/_deps/mumps-subbuild/mumps-populate-prefix/src/MUMPS_5.4.1.tar.gz'
   timeout='none'
   inactivity timeout='15 seconds'
-- Using src='http://mumps.enseeiht.fr/MUMPS_5.4.1.tar.gz'
-- [download 0% complete]
-- ...
-- [download 100% complete]
-- verifying file...
       file='F:/Work/mumps/build/_deps/mumps-subbuild/mumps-populate-prefix/src/MUMPS_5.4.1.tar.gz'
-- Downloading... done
-- extracting...
     src='F:/Work/mumps/build/_deps/mumps-subbuild/mumps-populate-prefix/src/MUMPS_5.4.1.tar.gz'
     dst='F:/Work/mumps/build/_deps/mumps-src'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
[3/8] No patch step for 'mumps-populate'
[4/8] No configure step for 'mumps-populate'
[5/8] No build step for 'mumps-populate'
[6/8] No install step for 'mumps-populate'
[7/8] No test step for 'mumps-populate'
[8/8] Completed 'mumps-populate'
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Performing Test LAPACK_s_links
-- Performing Test LAPACK_s_links - Success
-- Performing Test LAPACK_d_links
-- Performing Test LAPACK_d_links - Success
-- Found LAPACK: C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_lp64.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_sequential.lib;C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core.lib  found components: MKL
-- The following features have been enabled:

 * Openmp, OpenMP API https://www.openmp.org/

-- The following features have been disabled:

 * Parallel, parallel MUMPS (using MPI and Scalapack)
 * 64-bit-integer, use 64-bit integers in C and Fortran
 * Scotch, Scotch graph partitioning https://www.labri.fr/perso/pelegrin/scotch/
 * BuildScalapack, auto-build Scalapack
 * BuildLapack, auto-build Lapack

-- Configuring done
-- Generating done
-- Build files have been written to: F:/Work/mumps/build

F:\Work\mumps>cmake --build build
[22/504] Generating ../mumps_io.c
FAILED: _deps/mumps-build/mumps_io.c F:/Work/mumps/build/_deps/mumps-build/mumps_io.c
cmd.exe /C "cd /D F:\Work\mumps\build\_deps\mumps-build\src && "C:\Program Files\CMake\bin\cmake.exe" -Din_file:FILEPATH=F:/Work/mumps/build/_deps/mumps-src/src/mumps_io.c -Dpatch_file:FILEPATH=F:/Work/mumps/cmake/mumps_io.c.patch -Dout_file:FILEPATH=F:/Work/mumps/build/_deps/mumps-build/mumps_io.c -P F:/Work/mumps/cmake/PatchFile.cmake"
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.33.0.windows.2")
'C:/Program Files/Git/usr/bin/patch.exe' 'F:/Work/mumps/build/_deps/mumps-src/src/mumps_io.c' '--input=F:/Work/mumps/cmake/mumps_io.c.patch' '--output=F:/Work/mumps/build/_deps/mumps-build/mumps_io.c' '--ignore-whitespace'
patching file F:/Work/mumps/build/_deps/mumps-build/mumps_io.c (read from F:/Work/mumps/build/_deps/mumps-src/src/mumps_io.c)
Hunk #1 FAILED at 13 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file F:/Work/mumps/build/_deps/mumps-build/mumps_io.c.rej
CMake Error at F:/Work/mumps/cmake/PatchFile.cmake:30 (message):
  Failed to apply patch F:/Work/mumps/cmake/mumps_io.c.patch to
  F:/Work/mumps/build/_deps/mumps-src/src/mumps_io.c with C:/Program
  Files/Git/usr/bin/patch.exe

[23/504] Generating ../include/mumps_io_patched.h
FAILED: _deps/mumps-build/include/mumps_io_patched.h F:/Work/mumps/build/_deps/mumps-build/include/mumps_io_patched.h
cmd.exe /C "cd /D F:\Work\mumps\build\_deps\mumps-build\src && "C:\Program Files\CMake\bin\cmake.exe" -Din_file:FILEPATH=F:/Work/mumps/build/_deps/mumps-src/src/mumps_io.h -Dpatch_file:FILEPATH=F:/Work/mumps/cmake/mumps_io.h.patch -Dout_file:FILEPATH=F:/Work/mumps/build/_deps/mumps-build/include/mumps_io_patched.h -P F:/Work/mumps/cmake/PatchFile.cmake"
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.33.0.windows.2")
'C:/Program Files/Git/usr/bin/patch.exe' 'F:/Work/mumps/build/_deps/mumps-src/src/mumps_io.h' '--input=F:/Work/mumps/cmake/mumps_io.h.patch' '--output=F:/Work/mumps/build/_deps/mumps-build/include/mumps_io_patched.h' '--ignore-whitespace'
patching file F:/Work/mumps/build/_deps/mumps-build/include/mumps_io_patched.h (read from F:/Work/mumps/build/_deps/mumps-src/src/mumps_io.h)
Hunk #1 FAILED at 33 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file F:/Work/mumps/build/_deps/mumps-build/include/mumps_io_patched.h.rej
CMake Error at F:/Work/mumps/cmake/PatchFile.cmake:30 (message):
  Failed to apply patch F:/Work/mumps/cmake/mumps_io.h.patch to
  F:/Work/mumps/build/_deps/mumps-src/src/mumps_io.h with C:/Program
  Files/Git/usr/bin/patch.exe

ninja: build stopped: subcommand failed.
scivision commented 2 years ago

try

cmake -B build -Dopenmp=true -Dparallel=off -G Ninja -DMUMPS_UPSTREAM_VERSION=5.3.5

cmake --build build

I have just emailed the MUMPS developers again asking them when they'll release MUMPS 5.4.2 that has a fix for MUMPS 5.4.0, 5.4.1. For now, using MUMPS 5.3.5 should work in the case where patching 5.4.x fails as you have experienced.