khazali / Starfish

Starfish: An open source pore network modeling software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling at Win 10 environment

parsegov opened this issue · comments

Dear Ali,

Could you please advise a proper compiler environment for Windows 10? Visual Studio 2015 (Community Edition) has issues with missed libraries:

petscksp.h and mpi.h:

Severity Code Description Project File Line Suppression State
Error (active) cannot open source file "petscksp.h" Starfish c:\Users\User\Downloads\Starfish-master\Starfish\Globals.h 10

Severity Code Description Project File Line Suppression State
Error (active) cannot open source file "mpi.h" Starfish c:\Users\User\Downloads\Starfish-master\Starfish\Globals.h 11

How can I install proper SKD?

Thank you in advance,
Sergei

Dear Sergei,

Starfish needs PETSc package to solve systems of linear equations. You can download it from here:

https://www.mcs.anl.gov/petsc/

First, you need to compile PETSc. PETSc requires some version of MPI. I used intel MPI, but you can employ any other version, like Microsoft MPI or MPICH2. After compiling PETSc, you have to add the compiled library to the LIB path, and its include files to the INC path, in addition to MPI includes and libraries. The Starfish can be compiled then.
I can guide you during these procedures step by step. Please let me know if you have any problems.

Thank you, I'm trying to follow https://www.mcs.anl.gov/petsc/documentation/installation.html#windows for Windows environment. I've installed MS MPI and Cygwin. I'm confused about how to install PETSc through Cygwin terminal and configure win32fe.

I use VS 2019 Community and MS MPI for Win10.

PETSc itself has an excellent mailing list:
https://www.mcs.anl.gov/petsc/miscellaneous/mailing-lists.html
If you could not find the solution to your problems within the existing mails, you can ask PETSc developers. They will answer new questions quickly and thoroughly.

Dear Sergei,
Have you solved the problems of install PETSc on Win10? It‘s really appreciated for sharing the install steps.
best regards
Yong Luo

Dear Ali,
Could you please provide the compiled PETsc and MPI library,which we can compile the Starfish using VS 2019 on Win 10 conveniently.

best regards
Yong Luo

Dear Ali,
Could you please provide the compiled PETsc and MPI library,which we can compile the Starfish using VS 2019 on Win 10 conveniently.

best regards
Yong Luo

I do not think that it is going to work since I have compiled PETSc with Intel libraries on win 7. Unless you have the exact same versions, Starfish will fail to execute.
Compiling PETSc is easy. you have to install Cygwin and some version of MPI. I can walk you through it.

Dear Ali,
is it ok to stall Intel MPI on win10? other than install it using Cygwin.
regards
Yong Luo

Yes, I am using the same.

Dear Ali,
I almost compile Petsc,but with following config problems. Could you please give me any guidance?

$ ./configure --with-cc='win32fe cl' --with-fc='win32fe ifort' --with-cxx='win32fe cl' --with-shared-libraries=0 --with-mpiexec=/cygdrive/c/PROGRA2/INTELS1/COMPIL~1/windows/mpi/intel64/bin/mpiexec --ignore-cygwin-link

         Configuring PETSc to compile on your system

===============================================================================
TESTING: checkCCompiler from config.setCompilers(config/BuildSystem/config/setCo*******************************************************************************
UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for details):

C compiler you provided with -with-cc=win32fe cl does not work.
Cannot compile C with /cygdrive/d/Limin-PNM/LuoyongPNM/petsc-3.12.4/petsc-3.12.4/lib/petsc/bin/win32fe/win32fe cl.


here is the script that I have used to config PETSc on Cygwin:

./configure --prefix=/home/alireza/PetscInstall --with-shared-libraries=0 --with-mkl_pardiso-include=/cygdrive/E/Program_Files_x86/IntelSWTools/compilers_and_libraries/windows/mkl/include --with-mkl_pardiso-lib="-L/cygdrive/E/Program_Files_x86/IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64_win/ mkl_blas95_lp64.lib mkl_core.lib mkl_intel_lp64.lib mkl_intel_thread.lib mkl_lapack95_lp64.lib mkl_sequential.lib mkl_tbb_thread.lib" –with-openmp --with-cc="win32fe icl" --with-fc="win32fe ifort" --with-mpi-include=/cygdrive/E/Program_Files_x86/IntelSWTools/compilers_and_libraries/windows/mpi/intel64/include --with-mpi-lib=/cygdrive/E/Program_Files_x86/IntelSWTools/compilers_and_libraries/windows/mpi/intel64/lib/impi.lib --with-mpi-mpiexec=/cygdrive/E/Program_Files_x86/IntelSWTools/compilers_and_libraries/windows/mpi/intel64/bin/mpiexec.exe --with-debugging=0 --with-blas-lib="-L/cygdrive/E/Program_Files_x86/IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64_win/ mkl_blas95_lp64.lib mkl_core.lib mkl_intel_lp64.lib mkl_intel_thread.lib mkl_lapack95_lp64.lib mkl_sequential.lib mkl_tbb_thread.lib" --with-lapack-lib="-L/cygdrive/E/Program_Files_x86/IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64_win/ mkl_blas95_lp64.lib mkl_core.lib mkl_intel_lp64.lib mkl_intel_thread.lib mkl_lapack95_lp64.lib mkl_sequential.lib mkl_tbb_thread.lib" -CFLAGS='-O3 -MT -wd4996 -Qopenmp' -CXXFLAGS='-O3 -MT -wd4996 -Qopenmp' -FFLAGS='-MT -O3 -Qopenmp'

Please note that "Program_Files_x86" (on drive E:) is a junction (shortcut) for Program Files x86, since it is better not to use paths with space in them. You can build it with "mklink -j" command.
I use Intel compilers, and therefore, I have created the following batch file to construct the intel developer command line:

call "E:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\compilervars.bat" -arch intel64
call "E:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\bin\mklvars.bat" intel64 mod
call "E:\Program_Files_x86\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\mpivars.bat"
E:\cygwin64\bin\mintty.exe

the first three batch files are the intel batch files for setting the environment up. For MS compilers, I think the following commands can be cut and pasted into a similar batch file:

call "E:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\bin\mklvars.bat" intel64 mod
call "E:\Program_Files_x86\IntelSWTools\compilers_and_libraries\windows\mpi\intel64\mpivars.bat"
call "E:\Program_Files_x86\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call "E:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\ifortvars.bat" -arch intel64
E:\cygwin64\bin\mintty.exe

run the batch file, and then, run the Cygwin config script.