[petsc-dev] petsc compatibility issues with slepc

David Jiawei LUO LIANG 12431140 at mail.sustech.edu.cn
Thu Nov 14 23:11:55 CST 2024


My MacBook is M2
gcc, g++, c++, cpp version is : 

Apple clang version 16.0.0 (clang-1600.0.26.4)
 
Target: arm64-apple-darwin24.1.0
 
Thread model: posix
 
InstalledDir: /Library/Developer/CommandLineTools/usr/bin



# install mpich by source
./configure --prefix=/Users/lawkawai/lib/mpich-4.2.3-opt

config.status: executing gen_binding_f90 commands
 
  [ ./maint/gen_binding_f90.py -f-logical-size=4 -ignore-tkr=gcc ]
 
  --> [src/binding/fortran/use_mpi/mpi_base.f90]
 
  --> [src/binding/fortran/use_mpi/pmpi_base.f90]
 
  --> [src/binding/fortran/use_mpi/mpi_constants.f90]
 
  --> [src/binding/fortran/use_mpi/mpi_sizeofs.f90]
 
*****************************************************
 
***
 
*** device      : ch4:ofi (embedded libfabric)
 
*** shm feature : auto 
 
*** gpu support : disabled
 
***
 
  MPICH is configured with device ch4:ofi, which should work
 
  for TCP networks and any high-bandwidth interconnect
 
  supported by libfabric. MPICH can also be configured with
 
  "--with-device=ch4:ucx", which should work for TCP networks
 
  and any high-bandwidth interconnect supported by the UCX
 
  library. In addition, the legacy device ch3 (--with-device=ch3)
 
  is also available.
 
*****************************************************
 
Configuration completed.


make -j6 2>&1 | tee m.txt

  MOD      src/binding/fortran/use_mpi/mpi.mod-stamp
 
copying selected object files to avoid basename conflicts...
 
  GEN      lib/libmpi.la
 
  CXXLD    lib/libmpicxx.la
 
  GEN      lib/libmpifort.la
 
  CCLD     src/env/mpichversion
 
  CCLD     src/env/mpivars
 
ld: warning: -dylib_file is deprecated. Use -F or -L to control where indirect dylibs are found
 
ld: warning: -dylib_file is deprecated. Use -F or -L to control where indirect dylibs are found
 
Making all in examples
 
  CC       cpi.o
 
  CCLD     cpi



make install 2>&1 | tee mi.txt

/usr/bin/install -c -m 644 index.htm /Users/lawkawai/lib/mpich-4.2.3-opt/share/doc/mpich/www3/index.htm
 
/usr/bin/install -c -m 644 mpi.cit /Users/lawkawai/lib/mpich-4.2.3-opt/share/doc/mpich/www3/mpi.cit
 
if [ ! -e /Users/lawkawai/lib/mpich-4.2.3-opt/share/doc/mpich ] ; then mkdir -p /Users/lawkawai/lib/mpich-4.2.3-opt/share/doc/mpich ; fi
 
if [ -s ./doc/userguide/user.pdf ] ; then /usr/bin/install -c -m 644 ./doc/userguide/user.pdf /Users/lawkawai/lib/mpich-4.2.3-opt/share/doc/mpich/user.pdf ; fi
 
if [ -s ./doc/installguide/install.pdf ] ; then /usr/bin/install -c -m 644 ./doc/installguide/install.pdf /Users/lawkawai/lib/mpich-4.2.3-opt/share/doc/mpich/install.pdf ; fi
 
if [ -s ./doc/logging/logging.pdf ] ; then /usr/bin/install -c -m 644 ./doc/logging/logging.pdf /Users/lawkawai/lib/mpich-4.2.3-opt/share/doc/mpich/logging.pdf ; fi
 
 mkdir -p '/Users/lawkawai/lib/mpich-4.2.3-opt/include'
 
 /usr/bin/install -c -m 644 src/include/mpi_proto.h '/Users/lawkawai/lib/mpich-4.2.3-opt/include'
 
 mkdir -p '/Users/lawkawai/lib/mpich-4.2.3-opt/include'
 
 /usr/bin/install -c -m 644 src/binding/fortran/use_mpi/mpi.mod src/binding/fortran/use_mpi/mpi_sizeofs.mod src/binding/fortran/use_mpi/mpi_constants.mod src/binding/fortran/use_mpi/mpi_base.mod src/binding/fortran/use_mpi/pmpi_base.mod '/Users/lawkawai/lib/mpich-4.2.3-opt/include'
 
 mkdir -p '/Users/lawkawai/lib/mpich-4.2.3-opt/include'
 
 /usr/bin/install -c -m 644 src/binding/cxx/mpicxx.h src/binding/fortran/mpif_h/mpif.h src/include/mpi.h '/Users/lawkawai/lib/mpich-4.2.3-opt/include'
 
 mkdir -p '/Users/lawkawai/lib/mpich-4.2.3-opt/lib/pkgconfig'
 
 /usr/bin/install -c -m 644 src/packaging/pkgconfig/mpich.pc '/Users/lawkawai/lib/mpich-4.2.3-opt/lib/pkgconfig'
 
Making install in examples
 
make[3]: Nothing to be done for `install-exec-am'.
 
make[3]: Nothing to be done for `install-data-am'.



export PATH=/Users/jiaweiluo/lib/mpich-4.2.3-opt/bin:$PATH
source ~/.zshrc
which mpicc

/Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicc



# install vtk by source 
cmake ../VTK-9.3.1-src/ -DCMAKE_INSTALL_PREFIX=/Users/lawkawai/lib/VTK-9.3.1-shared -DBUILD_SHARED_LIBS=ON  -DCMAKE_BUILD_TYPE=Release



 
-- Configuring done (44.3s)
 
-- Generating done (1.8s)
 
-- Build files have been written to: /Users/lawkawai/lib/build_vtk



make -j4

[100%] Building CXX object Views/Infovis/CMakeFiles/ViewsInfovis.dir/vtkViewUpdater.cxx.o
 
[100%] Linking CXX shared library ../../lib/libvtkViewsInfovis-9.3.dylib
 
[100%] Built target ViewsInfovis



make install

-- Installing: /Users/lawkawai/lib/VTK-9.3.1-shared/lib/cmake/vtk-9.3/VTK-vtk-module-find-packages.cmake
 
-- Installing: /Users/lawkawai/lib/VTK-9.3.1-shared/share/licenses/VTK/Copyright.txt



export LD_LIBRARY_PATH=/Users/lawkawai/lib/VTK-9.3.1-shared/lib:$LD_LIBRARY_PATH
source ~/.zshrc


# install petsc by source
./configure --with-x=0 -with-pic --with-make-np=4 --with-mpi-compilers=1 --with-mpi-dir=/Users/lawkawai/lib/mpich-4.2.3-opt/ --with-scalar-type=real --with-precision=double --with-mumps=1 --download-mumps --with-scalapack=1 --download-scalapack --with-blacs=1 --download-blacs --download-fblaslapack --download-metis --download-hdf5 --with-debugging=no --download-slepc --prefix=/Users/lawkawai/lib/petsc-3.22.1-opt

================================================================================
 
                         Configuring PETSc to compile on your system
 
================================================================================
 
================================================================================
 
                                     ***** WARNING *****
 
  Found environment variable: FFLAGS=-w -fallow-argument-mismatch -O2. Ignoring it! Use
 
  "./configure FFLAGS=$FFLAGS" if you really want to use this value
 
================================================================================
 
================================================================================
 
                                     ***** WARNING *****
 
  Using default C optimization flags "-g -O3". You might consider manually setting optimal
 
  optimization flags for your system with COPTFLAGS="optimization flags" see
 
  config/examples/arch-*-opt.py for examples
 
================================================================================
 
================================================================================
 
                                     ***** WARNING *****
 
  Using default Cxx optimization flags "-g -O3". You might consider manually setting
 
  optimal optimization flags for your system with CXXOPTFLAGS="optimization flags" see
 
  config/examples/arch-*-opt.py for examples
 
================================================================================
 
================================================================================
 
                                     ***** WARNING *****
 
  Using default FC optimization flags "-g -O". You might consider manually setting optimal
 
  optimization flags for your system with FOPTFLAGS="optimization flags" see
 
  config/examples/arch-*-opt.py for examples
 
================================================================================
 
================================================================================
 
  Trying to download
 
  https://urldefense.us/v3/__https://web.cels.anl.gov/projects/petsc/download/externalpackages/hdf5-1.14.3-p1.tar.bz2__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBtxBTTaJT$ 
 
  for HDF5
 
================================================================================
 
================================================================================
 
                   Running configure on HDF5; this may take several minutes
 
================================================================================
 
================================================================================
 
                     Running make on HDF5; this may take several minutes
 
================================================================================
 
================================================================================
 
                 Running make install on HDF5; this may take several minutes
 
================================================================================
 
================================================================================
 
        Trying to download https://urldefense.us/v3/__https://bitbucket.org/petsc/pkg-fblaslapack__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBt-2urujb$  for FBLASLAPACK
 
================================================================================
 
================================================================================
 
                     Compiling FBLASLAPACK; this may take several minutes
 
================================================================================
 
================================================================================
 
            Trying to download https://urldefense.us/v3/__https://bitbucket.org/petsc/pkg-metis.git__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBtxZ2iHZz$  for METIS
 
================================================================================
 
================================================================================
 
                 Configuring METIS with CMake; this may take several minutes
 
================================================================================
 
================================================================================
 
                Compiling and installing METIS; this may take several minutes
 
================================================================================
 
================================================================================
 
      Trying to download https://urldefense.us/v3/__https://github.com/Reference-ScaLAPACK/scalapack__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBt53loATD$  for SCALAPACK
 
================================================================================
 
================================================================================
 
               Configuring SCALAPACK with CMake; this may take several minutes
 
================================================================================
 
================================================================================
 
              Compiling and installing SCALAPACK; this may take several minutes
 
================================================================================
 
================================================================================
 
           Trying to download https://urldefense.us/v3/__https://mumps-solver.org/MUMPS_5.7.3.tar.gz__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBt_GzU-IB$  for MUMPS
 
================================================================================
 
================================================================================
 
                        Compiling MUMPS; this may take several minutes
 
================================================================================
 
================================================================================
 
                       Installing MUMPS; this may take several minutes
 
================================================================================
 
================================================================================
 
               Trying to download https://urldefense.us/v3/__https://gitlab.com/slepc/slepc.git__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBt2vAYsuE$  for SLEPC
 
================================================================================
 
================================================================================
 
  SLEPc examples are available at arch-darwin-c-opt/externalpackages/git.slepc
 
  export SLEPC_DIR=/Users/lawkawai/lib/petsc-3.22.1-opt
 
================================================================================
 
Compilers:
 
  C Compiler:         /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicc  -fPIC -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -fstack-protector -fno-stack-check -Qunused-arguments -fvisibility=hidden -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -fstack-protector -fno-stack-check -Qunused-arguments -fvisibility=hidden -g -O3 
 
    Version: Apple clang version 16.0.0 (clang-1600.0.26.4)
 
  C++ Compiler:         /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicxx  -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fno-stack-check -fvisibility=hidden -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fno-stack-check -fvisibility=hidden -g -O3  -std=gnu++20 -fPIC 
 
    Version: Apple clang version 16.0.0 (clang-1600.0.26.4)
 
  Fortran Compiler:         /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpif90  -fPIC -Wall -ffree-line-length-none -ffree-line-length-0 -Wno-lto-type-mismatch -Wno-unused-dummy-argument -Wall -ffree-line-length-none -ffree-line-length-0 -Wno-lto-type-mismatch -Wno-unused-dummy-argument -g -O  
 
    Version: GNU Fortran (Homebrew GCC 14.2.0_1) 14.2.0
 
Linkers:
 
  Shared linker:   /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicc  -dynamiclib -undefined dynamic_lookup  -fPIC -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -fstack-protector -fno-stack-check -Qunused-arguments -fvisibility=hidden -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -fstack-protector -fno-stack-check -Qunused-arguments -fvisibility=hidden -g -O3
 
  Dynamic linker:   /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicc  -dynamiclib -undefined dynamic_lookup  -fPIC -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -fstack-protector -fno-stack-check -Qunused-arguments -fvisibility=hidden -Wall -Wwrite-strings -Wno-unknown-pragmas -Wconversion -Wno-sign-conversion -Wno-float-conversion -Wno-implicit-float-conversion -fstack-protector -fno-stack-check -Qunused-arguments -fvisibility=hidden -g -O3
 
  Libraries linked against:   
 
BlasLapack:
 
  Libraries:  -Wl,-rpath,/Users/lawkawai/lib/petsc-3.22.1-opt/lib -L/Users/lawkawai/lib/petsc-3.22.1-opt/lib -lflapack -lfblas
 
  uses 4 byte integers
 
MPI:
 
  Version:    4
 
  Includes:   -I/Users/lawkawai/lib/mpich-4.2.3-opt/include
 
  mpiexec: /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpiexec
 
  Implementation: mpich4
 
  MPICH_NUMVERSION: 40203300
 
python:
 
  Executable: /opt/homebrew/opt/python at 3.13/bin/python3.13
 
pthread:
 
cmake:
 
  Version:    3.31.0
 
  Executable: /opt/homebrew/bin/cmake
 
fblaslapack:
 
hdf5:
 
  Version:    1.14.3
 
  Includes:   -I/Users/lawkawai/lib/petsc-3.22.1-opt/include
 
  Libraries:  -Wl,-rpath,/Users/lawkawai/lib/petsc-3.22.1-opt/lib -L/Users/lawkawai/lib/petsc-3.22.1-opt/lib -lhdf5_hl -lhdf5
 
metis:
 
  Version:    5.1.0
 
  Includes:   -I/Users/lawkawai/lib/petsc-3.22.1-opt/include
 
  Libraries:  -Wl,-rpath,/Users/lawkawai/lib/petsc-3.22.1-opt/lib -L/Users/lawkawai/lib/petsc-3.22.1-opt/lib -lmetis
 
slepc:
 
  Version:    3.22.0
 
  Includes:   -I/Users/lawkawai/lib/petsc-3.22.1-opt/include
 
  Libraries:  -Wl,-rpath,/Users/lawkawai/lib/petsc-3.22.1-opt/lib -L/Users/lawkawai/lib/petsc-3.22.1-opt/lib -lslepc
 
regex:
 
bison:
 
  Version:    2.3
 
  Executable: /usr/bin/bison
 
MUMPS:
 
  Version:    5.7.3
 
  Includes:   -I/Users/lawkawai/lib/petsc-3.22.1-opt/include
 
  Libraries:  -Wl,-rpath,/Users/lawkawai/lib/petsc-3.22.1-opt/lib -L/Users/lawkawai/lib/petsc-3.22.1-opt/lib -ldmumps -lmumps_common -lpord -lpthread
 
scalapack:
 
  Libraries:  -Wl,-rpath,/Users/lawkawai/lib/petsc-3.22.1-opt/lib -L/Users/lawkawai/lib/petsc-3.22.1-opt/lib -lscalapack
 
PETSc:
 
  Language used to compile PETSc: C
 
  PETSC_ARCH: arch-darwin-c-opt
 
  PETSC_DIR: /Users/lawkawai/lib/petsc-3.22.1-src
 
  Prefix: /Users/lawkawai/lib/petsc-3.22.1-opt
 
  Scalar type: real
 
  Precision: double
 
  Support for __fp16
 
  Integer size: 4 bytes
 
  Single library: yes
 
  Shared libraries: yes
 
  Memory alignment from malloc(): 16 bytes
 
  Using GNU make: /opt/homebrew/bin/gmake
 
xxx=======================================================================================xxx
 
 Configure stage complete. Now build PETSc libraries with:
 
   make PETSC_DIR=/Users/lawkawai/lib/petsc-3.22.1-src PETSC_ARCH=arch-darwin-c-opt all
 
xxx=======================================================================================xxx



make PETSC_DIR=/Users/lawkawai/lib/petsc-3.22.1-src PETSC_ARCH=arch-darwin-c-opt all

    CLINKER arch-darwin-c-opt/lib/libpetsc.3.22.1.dylib
 
   DSYMUTIL arch-darwin-c-opt/lib/libpetsc.3.22.1.dylib
 
gmake[3]: Leaving directory '/Users/lawkawai/lib/petsc-3.22.1-src'
 
gmake[2]: Leaving directory '/Users/lawkawai/lib/petsc-3.22.1-src'
 
=========================================
 
Now to install the libraries do:
 
make PETSC_DIR=/Users/lawkawai/lib/petsc-3.22.1-src PETSC_ARCH=arch-darwin-c-opt install



make PETSC_DIR=/Users/lawkawai/lib/petsc-3.22.1-src PETSC_ARCH=arch-darwin-c-opt install


*** Installing SLEPc ***
 
*** Installing SLEPc at prefix location: /Users/lawkawai/lib/petsc-3.22.1-opt  ***
 
====================================
 
Install complete.
 
Now to check if the libraries are working do (in current directory):
 
make SLEPC_DIR=/Users/lawkawai/lib/petsc-3.22.1-opt PETSC_DIR=/Users/lawkawai/lib/petsc-3.22.1-opt PETSC_ARCH="" check
 
====================================
 
/opt/homebrew/bin/gmake --no-print-directory -f makefile PETSC_ARCH=installed-arch-darwin-c-opt PETSC_DIR=/Users/lawkawai/lib/petsc-3.22.1-opt SLEPC_DIR=/Users/lawkawai/lib/petsc-3.22.1-src/arch-darwin-c-opt/externalpackages/git.slepc install-builtafterslepc
 
/opt/homebrew/bin/gmake --no-print-directory -f makefile PETSC_ARCH=installed-arch-darwin-c-opt PETSC_DIR=/Users/lawkawai/lib/petsc-3.22.1-opt SLEPC_DIR=/Users/lawkawai/lib/petsc-3.22.1-src/arch-darwin-c-opt/externalpackages/git.slepc slepc4py-install
 
gmake[7]: Nothing to be done for 'slepc4py-install'.
 
gmake[3]: Nothing to be done for 'hpddm-install'.
 
gmake[3]: Nothing to be done for 'amrex-install'.
 
gmake[3]: Nothing to be done for 'bamg-install'.



when I run my software
# my cmake
# This is a sample code that provide a linkage between the
# PERIGEE code and external libraries. Users will have to
# provide correct values for the libraries, according to their
# installation.
# This one is a sample one, assuming the libraries are installed
# following the guide documented in
# https://urldefense.us/v3/__https://github.com/ju-liu/PERIGEE-NS/blob/master/install-external-libs.md__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBt4vBuw6U$ 
# The value of $HOME is /Users/lawkawai

# ========================================================
# Specify the library locations
# ========================================================
# VTK_DIR should be the vtk directory/lib/cmake/vtk-version,
# which contains VTKConfig.cmake file.
# In the guide, vtk directory is $HOME/lib/VTK-7.1.1-shared
set(VTK_DIR /Users/lawkawai/lib/VTK-9.3.1-shared/lib/cmake/vtk-9.3)

# Modify the PETSC_DIR variable to point to the location of PETSc.
set(PETSC_DIR /Users/lawkawai/lib/petsc-3.22.1-opt)

# Modify the SLEPC_DIR
set(SLEPC_DIR ${PETSC_DIR})

# Modify the PETSC_ARCH variable. You can find it in your configuration
# output. If you forget it, go to your PETSc home director and open
# configure.log. Go the end of the file, and you shall find the value 
# of PETSC_ARCH
set(PETSC_ARCH .)

# Modify the METIS_DIR.
# Note: If your PETSc has METIS installed, the conf
# file will directly load that METIS; otherwise this METIS will
# be used for PERIGEE. This means, if you are sure that you have
# METIS in PETSc, you do not have to specify the METIS_DIR variable.
set(METIS_DIR ${PETSC_DIR})

# Modify the HDF5_ROOT, pointing to your hdf5 library location
set(HDF5_ROOT ${PETSC_DIR})

set(YAML_DIR /Users/lawkawai/lib/yaml-shared)

# set(OpenMP_ROOT /opt/homebrew/Cellar/libomp/19.1.3)

# set(Matlab_ROOT /Applications/MATLAB_R2023b.app)
# ========================================================
# Setup the libraries
# You do NOT have to modify anything in this part
# ========================================================
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")

find_package(VTK REQUIRED)
find_package(PETSc REQUIRED)
find_package(HDF5 REQUIRED)
find_package(SLEPc)
find_package(YAML REQUIRED)
# find_package(OpenMP
# find_package(Matlab REQUIRED)

include_directories(${VTK_INCLUDE_DIRS})
include_directories(${HDF5_INCLUDE_DIRS})
include_directories(${PETSC_INC})
include_directories(${SLEPC_INC})
include_directories(${YAML_INC})
# include_directories(${Matlab_INCLUDE_DIRS})

set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${VTK_LIBRARIES})
set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${HDF5_LIBRARIES})
set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${PETSC_LIB})
set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${PETSC_METIS_LIB})
set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${SLEPC_LIB})
set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${YAML_LIB})
# set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${Matlab_ENG_LIBRARY})


if(PETSC_METIS)
  set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${PETSC_METIS_LIB})
  message(STATUS "Use METIS in PETSc: " ${PETSC_METIS_LIB})
else(PETSC_METIS)
  find_package(METIS)
  INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS})
  set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${METIS_LIBRARIES})
endif(PETSC_METIS)

include_directories(${HDF5_INCLUDE_DIRS})
set(EXTRA_LINK_LIBS ${EXTRA_LINK_LIBS} ${HDF5_LIBRARIES})

message(STATUS "External Libraries: " ${EXTRA_LINK_LIBS})

# ========================================================
# Compiler options 
# ========================================================
# Specify the MPI compilers. There should be compilers in
# $PETSC_DIR/$PETSC_ARCH/bin, or the mpich you specified for 
# PETSc install.
set(CMAKE_C_COMPILER  /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicc)
set(CMAKE_CXX_COMPILER /Users/lawkawai/lib/mpich-4.2.3-opt/bin/mpicxx)
set(CMAKE_CXX_STANDARD 11)

if( ${CMAKE_BUILD_TYPE} MATCHES "Release" )
  set(CMAKE_CXX_FLAGS " -O3 -Wall ")
else( ${CMAKE_BUILD_TYPE} MATCHES "Release" )
  set(CMAKE_CXX_FLAGS " -O0 -Wall ")
endif( ${CMAKE_BUILD_TYPE} MATCHES "Release" )

set(CMAKE_VERBOSE_MAKEFILE OFF)

# EOF





# cmake my project
cmake ../../codes/MixPERIGEE/examples/elasticity_NURBS_TaylorHood -DCMKAE_BUILD_TYPE=Release

-- The C compiler identification is AppleClang 16.0.0.16000026
 
-- The CXX compiler identification is AppleClang 16.0.0.16000026
 
-- Detecting C compiler ABI info
 
-- Detecting C compiler ABI info - done
 
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
 
-- Detecting C compile features
 
-- Detecting C compile features - done
 
-- Detecting CXX compiler ABI info
 
-- Detecting CXX compiler ABI info - done
 
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
 
-- Detecting CXX compile features
 
-- Detecting CXX compile features - done
 
-- =================== System setup ==========================
 
-- THE SYSTEM is Darwin
 
--               Darwin-24.1.0
 
-- CMAKE_BINARY_DIR:         /Users/lawkawai/build/build_MixPERIGEE
 
-- CMAKE_CURRENT_BINARY_DIR: /Users/lawkawai/build/build_MixPERIGEE
 
-- CMAKE_SOURCE_DIR:         /Users/lawkawai/codes/MixPERIGEE/examples/elasticity_NURBS_TaylorHood
 
-- CMAKE_CURRENT_SOURCE_DIR: /Users/lawkawai/codes/MixPERIGEE/examples/elasticity_NURBS_TaylorHood
 
-- PROJECT_BINARY_DIR: /Users/lawkawai/build/build_MixPERIGEE
 
-- PROJECT_SOURCE_DIR: /Users/lawkawai/codes/MixPERIGEE/examples/elasticity_NURBS_TaylorHood
 
-- EXECUTABLE_OUTPUT_PATH: /Users/lawkawai/build/build_MixPERIGEE
 
-- LIBRARY_OUTPUT_PATH:     /Users/lawkawai/build/build_MixPERIGEE/lib
 
-- CMAKE_COMMAND: /opt/homebrew/bin/cmake
 
-- CMAKE_SYSTEM_PROCESSOR: arm64
 
-- CMAKE_AR: /Library/Developer/CommandLineTools/usr/bin/ar
 
-- CMAKE_RANLIB: /Library/Developer/CommandLineTools/usr/bin/ranlib
 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
 
-- Found Threads: TRUE
 
-- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/System/Library/Frameworks/OpenGL.framework  found components: OpenGL
 
-- Found PETSc: /Users/lawkawai/lib/petsc-3.22.1-opt/./lib/libpetsc.dylib
 
-- Found HDF5: /Users/lawkawai/lib/petsc-3.22.1-opt/lib/libhdf5.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/lib/libdl.tbd;/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/lib/libm.tbd (found version "1.14.3")
 
-- Found SLEPc: /Users/lawkawai/lib/petsc-3.22.1-opt/./lib/libslepc.dylib
 
-- Found YAML: /Users/lawkawai/lib/yaml-shared/lib/libyaml-cpp.dylib
 
-- Use METIS in PETSc: /Users/lawkawai/lib/petsc-3.22.1-opt/./lib/libmetis.dylib
 
-- External Libraries: VTK::WrappingToolsVTK::ViewsContext2DVTK::loguruVTK::TestingRenderingVTK::TestingCoreVTK::vtksysVTK::ViewsInfovisVTK::CommonColorVTK::RenderingVolumeOpenGL2VTK::glewVTK::openglVTK::RenderingLabelVTK::octreeVTK::RenderingLODVTK::RenderingLICOpenGL2VTK::RenderingImageVTK::RenderingContextOpenGL2VTK::RenderingCellGridVTK::IOVeraOutVTK::hdf5VTK::IOTecplotTableVTK::utf8VTK::IOSegYVTK::IOParallelXMLVTK::IOPLYVTK::IOOggTheoraVTK::theoraVTK::oggVTK::IONetCDFVTK::netcdfVTK::libprojVTK::IOMotionFXVTK::pegtlVTK::IOParallelVTK::jsoncppVTK::IOMINCVTK::IOLSDynaVTK::IOInfovisVTK::libxml2VTK::zlibVTK::IOImportVTK::IOIOSSVTK::fmtVTK::iossVTK::cgnsVTK::exodusIIVTK::IOFLUENTCFFVTK::IOVideoVTK::IOMovieVTK::IOExportPDFVTK::libharuVTK::IOExportGL2PSVTK::RenderingGL2PSOpenGL2VTK::gl2psVTK::pngVTK::IOExportVTK::RenderingVtkJSVTK::nlohmannjsonVTK::RenderingSceneGraphVTK::IOExodusVTK::IOEnSightVTK::IOCityGMLVTK::pugixmlVTK::IOChemistryVTK::IOCesium3DTilesVTK::IOGeometryVTK::IOCellGridVTK::IOCONVERGECFDVTK::IOHDFVTK::IOCGNSReaderVTK::IOAsynchronousVTK::IOAMRVTK::InteractionImageVTK::ImagingStencilVTK::ImagingStatisticsVTK::ImagingMorphologicalVTK::ImagingMathVTK::ImagingFourierVTK::IOSQLVTK::sqliteVTK::GeovisCoreVTK::InfovisLayoutVTK::ViewsCoreVTK::InteractionWidgetsVTK::RenderingVolumeVTK::RenderingAnnotationVTK::ImagingHybridVTK::ImagingColorVTK::InteractionStyleVTK::FiltersTopologyVTK::FiltersTensorVTK::FiltersSelectionVTK::FiltersSMPVTK::FiltersReductionVTK::FiltersProgrammableVTK::FiltersPointsVTK::FiltersParallelImagingVTK::FiltersImagingVTK::ImagingGeneralVTK::FiltersGeometryPreviewVTK::FiltersGenericVTK::FiltersFlowPathsVTK::eigenVTK::FiltersCellGridVTK::FiltersAMRVTK::FiltersParallelVTK::FiltersTextureVTK::FiltersModelingVTK::DomainsChemistryOpenGL2VTK::RenderingOpenGL2VTK::RenderingHyperTreeGridVTK::RenderingUIVTK::FiltersHybridVTK::DomainsChemistryVTK::ChartsCoreVTK::InfovisCoreVTK::FiltersExtractionVTK::ParallelDIYVTK::diy2VTK::IOXMLVTK::IOXMLParserVTK::expatVTK::ParallelCoreVTK::IOLegacyVTK::IOCoreVTK::doubleconversionVTK::lz4VTK::lzmaVTK::fast_floatVTK::FiltersStatisticsVTK::FiltersHyperTreeVTK::ImagingSourcesVTK::IOImageVTK::DICOMParserVTK::jpegVTK::metaioVTK::tiffVTK::RenderingContext2DVTK::RenderingFreeTypeVTK::freetypeVTK::kwimlVTK::RenderingCoreVTK::FiltersSourcesVTK::ImagingCoreVTK::FiltersGeneralVTK::FiltersVerdictVTK::verdictVTK::FiltersGeometryVTK::CommonComputationalGeometryVTK::FiltersCoreVTK::CommonExecutionModelVTK::CommonDataModelVTK::CommonSystemVTK::CommonMiscVTK::exprtkVTK::CommonTransformsVTK::CommonMathVTK::kissfftVTK::CommonCore/Users/lawkawai/lib/petsc-3.22.1-opt/lib/libhdf5.dylib/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/lib/libdl.tbd/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/lib/libm.tbd/Users/lawkawai/lib/petsc-3.22.1-opt/./lib/libpetsc.dylib/Users/lawkawai/lib/petsc-3.22.1-opt/./lib/libmetis.dylib/Users/lawkawai/lib/petsc-3.22.1-opt/./lib/libslepc.dylib/Users/lawkawai/lib/yaml-shared/lib/libyaml-cpp.dylib/Users/lawkawai/lib/petsc-3.22.1-opt/./lib/libmetis.dylib/Users/lawkawai/lib/petsc-3.22.1-opt/lib/libhdf5.dylib/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/lib/libdl.tbd/Library/Developer/CommandLineTools/SDKs/MacOSX15.1.sdk/usr/lib/libm.tbd
 
-- Configuring done (0.9s)
 
-- Generating done (0.1s)
 
-- Build files have been written to: /Users/lawkawai/build/build_MixPERIGEE



./preprocess3d

========= Partition quality information ========= 
 
The largest ghost / local node ratio is: 0.1126126126126126
 
The smallest ghost / local node ratio is: 0.1126126126126126
 
The summation of the number of ghost nodes is: 47
 
The maximum badnode number is: 0
 
The maximum and minimum local node numbers are 222	222
 
The maximum / minimum of local node is: 1
 


 
================== Clean memory ================= 
 
-- Mesh_NURBS_MultiPatch_3D deleted. 
 
-- Mesh_NURBS_MultiPatch_3D deleted. 





mpirun -np 2 ./mixed_ga_drive

Time is 13:09:19 2024/11/15 
 
===> Assembly mass matrix and residual vector.
 
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
 
[0]PETSC ERROR: Unknown type. Check for miss-spelling or missing package: https://urldefense.us/v3/__https://petsc.org/release/install/install/*external-packages__;Iw!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBtxYPavSd$ 
 
[0]PETSC ERROR: Unable to find requested PC type hypre
 
[0]PETSC ERROR: WARNING! There are unused option(s) set! Could be the program crashed before usage or a spelling mistake, etc!
 
[0]PETSC ERROR:   Option left: name:-ksp_type value: gmres source: file
 
[0]PETSC ERROR:   Option left: name:-pc_factor_mat_solver_type value: mumps source: file
 
[0]PETSC ERROR:   Option left: name:-pc_type value: lu source: file
 
[0]PETSC ERROR: See https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBt0fnhsA8$  for trouble shooting.
 
[0]PETSC ERROR: Petsc Release Version 3.22.1, Oct 28, 2024 
 
[0]PETSC ERROR: ./mixed_ga_driver with 2 MPI process(es) and PETSC_ARCH  on lawkawais-MacBook-Pro.local by lawkawai Fri Nov 15 13:09:19 2024
 
[0]PETSC ERROR: Configure options: --with-x=0 -with-pic --with-make-np=4 --with-mpi-compilers=1 --with-mpi-dir=/Users/lawkawai/lib/mpich-4.2.3-opt/ --with-scalar-type=real --with-precision=double --with-mumps=1 --download-mumps --with-scalapack=1 --download-scalapack --with-blacs=1 --download-blacs --download-fblaslapack --download-metis --download-hdf5 --with-debugging=no --download-slepc --prefix=/Users/lawkawai/lib/petsc-3.22.1-opt
 
[0]PETSC ERROR: #1 PCSetType() at /Users/lawkawai/lib/petsc-3.22.1-src/src/ksp/pc/interface/pcset.c:59
 
  Residual norms for ls_mass_ solve.
 
  0 KSP Residual norm 1.337529422525e+02
 
  1 KSP Residual norm 5.908055492162e+01



Time = 2.000000e-02, dt = 1.000000e-02, index = 2 
 
  --- M updated  Init res 2-norm: 2.599563e+05 
 
[0]PETSC ERROR: ------------------------------------------------------------------------
 
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
 
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
 
[0]PETSC ERROR: or see https://urldefense.us/v3/__https://petsc.org/release/faq/*valgrind__;Iw!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBtyTiruP6$  and https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!e1g3rIXd-IQj4zeoUi3Tcux14UB6T98q0QiXTRb5KVraA5FdjUMRAGXnthnVjrZ9_wWD3GII3OuRrzaylR3YAXeBt0fnhsA8$ 
 
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run 
 
[0]PETSC ERROR: to get more information on the crash.
 
[0]PETSC ERROR: Run with -malloc_debug to check if memory corruption is causing the crash.
 
Abort(59) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0




when driver using cpu number >= 2, Petsc cannot work. But for cpu of 1, it's working. 
What is the problem ?






David Jiawei LUO LIANG



南方科技大学/学生/研究生/2024



广东省深圳市南山区学苑大道1088号




 
 
 
------------------ Original ------------------
From:  "Satish Balay"<balay.anl at fastmail.org>;
Date:  Mon, Nov 11, 2024 11:40 PM
To:  "David Jiawei LUO LIANG"<12431140 at mail.sustech.edu.cn>; 
Cc:  "Satish Balay"<balay.anl at fastmail.org>; "petsc-dev"<petsc-dev at mcs.anl.gov>; 
Subject:  Re: ????????????[petsc-dev] petsc compatibility issues with slepc

 

 On Mon, 11 Nov 2024, David Jiawei LUO LIANG wrote:

> But there still be some linking issues because my MacBook is arm64 architecture which is incompatible with x86

with source install - everything should be built for arm64 - and there should be no "mixing" with x86 libraries.

Satish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20241115/8da613b9/attachment-0001.html>


More information about the petsc-dev mailing list