[petsc-users] Petsc and cmake

Michele Rosso mrosso at uci.edu
Sat Jun 20 21:29:56 CDT 2015


Hi Jed,

thank you for your reply.
So basically I should use PETSC_COMPILER to check against the system
compiler and proceed only if they match, correct?

Also, I attached the output of cmake and FindPETSc.cmake: it complains
that PETSc requires extra include paths and explicit linking to all
dependencies.
Despite that, I can compile and run my correctly. Should I worry about
it?

Finally, is there a way to retrieve the compiler flags I use to build
PETSc?

Thanks,
Michele


On Sat, 2015-06-20 at 14:11 -0600, Jed Brown wrote:

> Michele Rosso <mrosso at uci.edu> writes:
> 
> > Hi,
> >
> > I am trying to move to cmake to build my code. How would you suggest to
> > handle the dependency on PETSc?
> > Currently my makefile relies on the PETSc variables for building the all
> > code, namely FLINKER, CLINKER and so on. I found the FindPETSc.cmake
> > module and I successfully used it
> > but it does not import the aforementioned variables.
> 
> CMake insists on setting the compiler before discovering dependent
> packages.  FindPETSc.cmake sets PETSC_COMPILER, but you can't set the
> compiler based on this information; you can only check and decide
> whether to error.  That's life with CMake.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150620/c697161a/attachment-0001.html>
-------------- next part --------------
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The Fortran compiler identification is GNU
-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
-- petsc_lib_dir /opt/petsc/petsc-3.5.3/gnu-dbg-32idx/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 - Failed
-- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes
-- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes - Failed
-- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries
-- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries - Failed
-- Performing Test MULTIPASS_TEST_4_petsc_works_all
-- Performing Test MULTIPASS_TEST_4_petsc_works_all - Success
-- PETSc requires extra include paths and explicit linking to all dependencies.  This probably means you have static libraries and something unexpected in PETSc headers.
-- Found PETSc: /opt/petsc/petsc-3.5.3/include;/opt/petsc/petsc-3.5.3/gnu-dbg-32idx/include;/usr/include/mpich  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mic/Documents/Dev/cmake_tests/build


More information about the petsc-users mailing list