[petsc-dev] PETSc 3.5.3 and CMake

Barry Smith bsmith at mcs.anl.gov
Thu Feb 5 07:17:08 CST 2015


> On Feb 5, 2015, at 6:18 AM, gouarin <loic.gouarin at math.u-psud.fr> wrote:
> 
> Hello,
> 
> I had the same problem. The rules and variables files are not in the same directory with the petsc-3.5.3.

  I certainly hope you do not mean petsc-3.5.3  it is suppose to have the same layout as petsc-3.5.2 and previous tarballs.

  It is only the development version of PETSc (which is still evolving) that has a different layout, is that what you mean?

   Barry


> You just have to replace the lines in FindPETSc.cmake
> 
> # Determine whether the PETSc layout is old-style (through 2.3.3) or
> # new-style (>= 3.0.0)
> if (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h")   # > 2.3.3
>  set (petsc_conf_rules "${PETSC_DIR}/conf/rules")
>  set (petsc_conf_variables "${PETSC_DIR}/conf/variables")
> elseif (EXISTS "${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h") # <= 2.3.3
>  set (petsc_conf_rules "${PETSC_DIR}/bmake/common/rules")
>  set (petsc_conf_variables "${PETSC_DIR}/bmake/common/variables")
> elseif (PETSC_DIR)
>  message (SEND_ERROR "The pair PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} do not specify a valid PETSc installation")
> endif ()
> 
> by
> 
> # Determine whether the PETSc layout is old-style (through 2.3.3) or
> # new-style (>= 3.0.0)
> if (EXISTS "${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h")   # > 2.3.3
>  if (EXISTS "${PETSC_DIR}/conf/rules")
>    set (petsc_conf_rules "${PETSC_DIR}/conf/rules")
>    set (petsc_conf_variables "${PETSC_DIR}/conf/variables")
>  else()
>     set (petsc_conf_rules "${PETSC_DIR}/lib/petsc-conf/rules")
>     set (petsc_conf_variables "${PETSC_DIR}/lib/petsc-conf/variables")
>  endif()
> elseif (EXISTS "${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h") # <= 2.3.3
>  set (petsc_conf_rules "${PETSC_DIR}/bmake/common/rules")
>  set (petsc_conf_variables "${PETSC_DIR}/bmake/common/variables")
> elseif (PETSC_DIR)
>  message (SEND_ERROR "The pair PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} do not specify a valid PETSc installation")
> endif ()
> 
> It works for me.
> 
> Jed will probably have a better solution.
> 
> Loic
> 
> Le 05/02/2015 12:59, Pierre Jolivet a écrit :
>> Hello,
>> I don’t know if Jed is the sole maintainer of the FindPETSc.cmake file available here [1], so sorry in advance for disturbing the rest of you if this is the case.
>> 
>> It appears that with version 3.5.3, FindPETSc.cmake can’t detect PETSc correctly anymore and just returns:
>> "PETSc could not be found.  Be sure to set PETSC_DIR and PETSC_ARCH."
>> even though these variables are set. That would be great if you could fix this.
>> 
>> Thank you in advance,
>> Pierre
>> 
>> [1] https://github.com/jedbrown/cmake-modules/
> 
> -- 
> Loic Gouarin
> Laboratoire de Mathématiques
> Université Paris-Sud
> Bâtiment 425
> 91405 Orsay Cedex
> France
> Tel: (+33) 1 69 15 60 14
> Fax: (+33) 1 69 15 67 18
> 




More information about the petsc-dev mailing list