pism / pism

Repository for the Parallel Ice Sheet Model (PISM)
https://pism.io/
GNU General Public License v3.0
98 stars 41 forks source link

Incorrect minimum required PETSc version #501

Closed nicholasmr closed 2 years ago

nicholasmr commented 2 years ago

Description

First of all: congratulations on the new v. 2.0!

When building I get the following error:

[ 58%] Building CXX object src/stressbalance/blatter/CMakeFiles/blatter.dir/Blatter.cc.o
/home/projects/ku_00013/apps/pism2_src/pism-2.0/src/stressbalance/blatter/Blatter.cc: In function ‘PetscErrorCode pism::stressbalance::blatter_coarsening_hook(DM, DM, void*)’:
/home/projects/ku_00013/apps/pism2_src/pism-2.0/src/stressbalance/blatter/Blatter.cc:364:47: error: ‘DMGetOptionsPrefix’ was not declared in this scope
     ierr = DMGetOptionsPrefix(dm_fine, &prefix); CHKERRQ(ierr);
                                               ^
make[2]: *** [src/stressbalance/blatter/CMakeFiles/blatter.dir/Blatter.cc.o] Error 1
make[1]: *** [src/stressbalance/blatter/CMakeFiles/blatter.dir/all] Error 2
make: *** [all] Error 2

Is this an error in the source code or my build config?

PISM version

New version 2.0 from https://github.com/pism/pism/releases/tag/v2.0

To Reproduce

This is my build script with dependencies installed (note that PISM 1.2 builds fine)

export PATH=/home/projects/ku_00013/apps/pism2/bin:$PATH
export PISM_BIN=/home/projects/ku_00013/apps/pism2/bin;

cd /home/projects/ku_00013/apps/pism2_src/pism-2.0
mkdir build
cd build/
PISM_INSTALL_PREFIX=/home/projects/ku_00013/apps/pism2 CC=mpicc CXX=mpicxx cmake ..
make clean
make install
ckhroulev commented 2 years ago

Hi @nicholasmr! Which PETSc version did you use?

I just realized that this PISM version should require PETSc 3.7 or newer (instead of 3.5 or newer). I'll update the manual.

(Note that PETSc 3.7 is over 5 years old.)

nicholasmr commented 2 years ago

Hi @ckhroulev, thanks for the quick response!

I have now updated to PETSc 3.7.1 (used 3.6.x before), but I encounter a new error slightly later during compilation:

[ 58%] Built target stressbalance
Scanning dependencies of target blatter
[ 58%] Building CXX object src/stressbalance/blatter/CMakeFiles/blatter.dir/Blatter.cc.o
[ 58%] Building CXX object src/stressbalance/blatter/CMakeFiles/blatter.dir/residual.cc.o
[ 59%] Building CXX object src/stressbalance/blatter/CMakeFiles/blatter.dir/jacobian.cc.o
[ 59%] Building CXX object src/stressbalance/blatter/CMakeFiles/blatter.dir/BlatterMod.cc.o
[ 59%] Building CXX object src/stressbalance/blatter/CMakeFiles/blatter.dir/util/grid_hierarchy.cc.o
/home/projects/ku_00013/apps/pism2_src/pism-2.0/src/stressbalance/blatter/util/grid_hierarchy.cc(104): error: identifier "DMDACreateCompatibleDMDA" is undefined
      ierr = DMDACreateCompatibleDMDA(dm, dof, &da); CHKERRQ(ierr);
             ^

compilation aborted for /home/projects/ku_00013/apps/pism2_src/pism-2.0/src/stressbalance/blatter/util/grid_hierarchy.cc (code 2)
make[2]: *** [src/stressbalance/blatter/CMakeFiles/blatter.dir/util/grid_hierarchy.cc.o] Error 2
make[1]: *** [src/stressbalance/blatter/CMakeFiles/blatter.dir/all] Error 2
make: *** [all] Error 2

As far as I can tell this is also related to PETSc?

FYI this is my configure output:

-- The C compiler identification is Intel 19.1.3.20200925
-- The CXX compiler identification is Intel 19.1.3.20200925
-- Check for working C compiler: /services/tools/intel/parallel_studio_xe/2020_update4/compilers_and_libraries/linux/mpi/intel64/bin/mpiicc
-- Check for working C compiler: /services/tools/intel/parallel_studio_xe/2020_update4/compilers_and_libraries/linux/mpi/intel64/bin/mpiicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /services/tools/intel/parallel_studio_xe/2020_update4/compilers_and_libraries/linux/mpi/intel64/bin/mpiicpc
-- Check for working CXX compiler: /services/tools/intel/parallel_studio_xe/2020_update4/compilers_and_libraries/linux/mpi/intel64/bin/mpiicpc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Adding -std=c++11 to C++ compiler flags for Intel compilers.
-- Configuring PISM version 'stable v2.0'
-- Setting PISM install prefix to /home/projects/ku_00013/apps/pism2.
-- petsc_lib_dir /services/tools/petsc/3.7.1-icc/lib
-- Recognized PETSc install with single library for all packages
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal - Success
-- Minimal PETSc includes and libraries work.  This probably means we are building with shared libs.
-- Found PETSc: /services/tools/petsc/3.7.1-icc/include;/services/tools/petsc/3.7.1-icc/include (found version "3.7.1") 
-- Found MPI_C: /services/tools/intel/parallel_studio_xe/2020_update4/compilers_and_libraries/linux/mpi/intel64/bin/mpiicc (found version "3.1") 
-- Found MPI: TRUE (found version "3.1") found components: C 
-- Performing Test UDUNITS2_WORKS_WITHOUT_EXPAT
-- Performing Test UDUNITS2_WORKS_WITHOUT_EXPAT - Failed
-- Found EXPAT: /usr/lib64/libexpat.so (found version "2.1.0") 
-- Performing Test UDUNITS2_WORKS_WITH_EXPAT
-- Performing Test UDUNITS2_WORKS_WITH_EXPAT - Failed
-- UDUNITS-2 requires EXPAT
-- Found UDUNITS2: /services/tools/udunits/2.2.26/lib/libudunits2.so;/usr/lib64/libexpat.so  
-- Found GSL: /services/tools/gsl/2.6/lib/libgsl.so;/services/tools/gsl/2.6/lib/libgslcblas.so  
-- Found NetCDF: /services/tools/netcdf-c/4.8.0/lib/libnetcdf.so  
-- Found FFTW: /services/tools/fftw/3.3.8/lib/libfftw3.so  
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /services/tools/hdf5/1.10.0p1/lib/libhdf5.so;/services/tools/hdf5/1.10.0p1/lib/libsz.so;/services/tools/hdf5/1.10.0p1/lib/libz.so;/usr/lib64/libdl.so;/usr/lib64/libm.so (found version "1.10.0.1") found components: C HL 
-- Found LATEX: /usr/bin/latex  found components: PDFLATEX 
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.5") found components: doxygen dot 
-- Found PythonInterp: /services/tools/anaconda3/4.4.0/bin/python (found version "3.6.10") 
-- nose was not found; some regression tests will be disabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/projects/ku_00013/apps/pism2_src/pism-2.0/build
ckhroulev commented 2 years ago

As far as I can tell this is also related to PETSc?

Yes. Please try again using the most recent commit in the main branch.

I have now updated to PETSc 3.7.1 (used 3.6.x before) [...]

PETSc 3.7.1 should work now, but I would recommend updating to a more recent (if not the latest) version.

Now that I've tried it with older PETSc versions I'm pretty sure the code tagged v2.0 should work with PETSc 3.10 and newer.

nicholasmr commented 2 years ago

Thanks Constantine, the patch worked for my petsc 3.7.1.
I'm using this version to avoid compiling petsc from scratch (our HPC already has this version installed).

Thank you very much!