Another possibility is that the Matlab file wasn’t saved in HDF5. Try resaving it with the “-v7.3” option.
Samar On Jul 25, 2023, at 10:18 AM, Matthew Knepley <[email protected]> wrote: On Tue, Jul 25, 2023 at 3:12 AM maitri ksh <[email protected]<mailto:[email protected]>> wrote: Hi, I am new to Petsc, here are some details of the relevant softwares I am using: 1. petsc-3.19.3 (on wsl-ubuntu22.04 platform) 2. MATLAB-R2022a 3. hdf5-1.10.7 (checked using 'pkg-config --modversion hdf5') 4. configured using: './configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack --with-matlab --with-matlab-dir=/usr/local/MATLAB/R2022a --download-hdf5 --with-hdf5=1' I am trying to read a '.mat' file ('myfile.mat') using 'PetscViewerHDF5Open' (the source code 'read_Matrix.c' is attached herewith). I could compile the source code with no error, but I am getting an error ('ERROR.txt') indicating that there is an issue opening the HDF5 file. Could you please help me to resolve this issue HDF5 thinks that this is not an HDF5 file. Since PETSc built HDF5 for you, you can check this using $PETSC_DIR/$PETSC_ARCH/bin/h5dump myfile.mat It could be a version incompatibility between the HDF5 on your machine and the one you asked PETSc to download. Thanks, Matt Maitri -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/<http://www.cse.buffalo.edu/~knepley/>
