<div>Hello all!<br /> <div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">At present time I need to compile solver called Defmod (<a href="https://bitbucket.org/stali/defmod/wiki/Home">https://bitbucket.org/stali/defmod/wiki/Home</a>), which is written in Fortran 95.<br />Defmod uses PETSc for solving linear algebra system.</div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Solver compilation with 32-bit version of PETSc does not cause any problem. <br />But solver compilation with 64-bit version of PETSc produces an error with size of <em>ierr </em>PETSc variable. </div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>1. For example, consider the following statements written in Fortran:</div><div> </div><div> </div><div><em>PetscErrorCode :: ierr_m</em></div><div><em>PetscInt :: ierr</em></div><div>...<br />...</div><div><em>call VecDuplicate(Vec_U,Vec_Um,ierr) </em></div><div><em>call VecCopy(Vec_U,Vec_Um,ierr)</em></div><div><em>call VecGetLocalSize(Vec_U,j,ierr)</em></div><div><em>call VecGetOwnershipRange(Vec_U,j1,j2,ierr_m)</em></div><div> </div><div> </div><div>As can be seen first three subroutunes require <em>ierr </em>to be size of INTEGER(8), while the last subroutine (VecGetOwnershipRange) requires <em>ierr </em>to be size of INTEGER(4).<br />Using the same integer format gives an error:</div><div> </div><div><div><em>There is no specific subroutine for the generic ‘vecgetownershiprange’ at (1)</em></div><div> </div></div><div>2. Another example is:</div><div> </div><div> </div><div><div><em>call MatAssemblyBegin(Mat_K,Mat_Final_Assembly,ierr)</em></div><div><em>CHKERRA(ierr)</em></div><div><em>call MatAssemblyEnd(Mat_K,Mat_Final_Assembly,ierr)</em></div></div></div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">I am not able to define an appropriate size if <em>ierr </em>in CHKERRA(ierr). If I choose INTEGER(8), the error "<em>Type mismatch in argument ‘ierr’ at (1); passed INTEGER(8) to INTEGER(4)"</em> occurs.<br />If I define <em>ierr </em> as INTEGER(4), the error "<em>Type mismatch in argument ‘ierr’ at (1); passed INTEGER(4) to INTEGER(8)"</em> appears.</div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> <div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div> </div><div>3. If I change the sizes of <em>ierr </em>vaiables as error messages require, the compilation completed successfully, but an error occurs when calculating the RHS vector with following message:<div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br /><em>[0]PETSC ERROR: Out of range index value -4 cannot be negative </em></div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> </div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br />Command to configure 32-bit version of PETSc under Windows 10 using Cygwin:</div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><em>./configure --with-cc=x86_64-w64-mingw32-gcc --with-cxx=x86_64-w64-mingw32-g++ --with-fc=x86_64-w64-mingw32-gfortran --download-fblaslapack --with-mpi-include=/cygdrive/c/MPISDK/Include --with-mpi-lib=/cygdrive/c/MPISDK/Lib/libmsmpi.a --with-mpi-mpiexec=/cygdrive/c/MPI/Bin/mpiexec.exe --with-debugging=yes -CFLAGS='-O2' -CXXFLAGS='-O2' -FFLAGS='-O2 -static-libgfortran -static -lpthread -fno-range-check' --with-shared-libraries=no</em><br /> <div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Command to configure 64-bit version of PETSc under Windows 10 using Cygwin:<div><em>./configure --with-cc=x86_64-w64-mingw32-gcc --with-cxx=x86_64-w64-mingw32-g++ --with-fc=x86_64-w64-mingw32-gfortran --download-fblaslapack --with-mpi-include=/cygdrive/c/MPISDK/Include --with-mpi-lib=/cygdrive/c/MPISDK/Lib/libmsmpi.a --with-mpi-mpiexec=/cygdrive/c/MPI/Bin/mpiexec.exe --with-debugging=yes -CFLAGS='-O2' -CXXFLAGS='-O2' -FFLAGS='-O2 -static-libgfortran -static -lpthread -fno-range-check -fdefault-integer-8' --with-shared-libraries=no --with-64-bit-indices --known-64-bit-blas-indices</em></div></div></div></div></div></div></div></div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br /> </div><div style="background-color:rgb( 255 , 255 , 255 );color:rgb( 0 , 0 , 0 );font-family:'arial' , sans-serif;font-size:15px;font-style:normal;font-weight:400;text-decoration-style:initial;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Kind regards,<br />Dmitry Melnichuk</div></div>