dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #19175
Re: [Branch ~dolfin-core/dolfin/main] Rev 5013: Improve search for PETSC_PATH by examining LD_LIBRARY_PATH.
On Wed, 2010-08-18 at 15:23 +0000, noreply@xxxxxxxxxxxxx wrote:
> ------------------------------------------------------------
> revno: 5013
> committer: Anders Logg <logg@xxxxxxxxx>
> branch nick: dolfin-dev
> timestamp: Wed 2010-08-18 13:57:25 +0200
> message:
> Improve search for PETSC_PATH by examining LD_LIBRARY_PATH.
> No need to set PETSC_PATH or PETSC_ARCH if LD_LIBRARY PATH is set.
Sounds platform dependent to me? Probably better to search the CMake
list of library locations.
Garth
> modified:
> cmake/FindPETSc.dolfin.cmake
>
>
> --
> lp:dolfin
> https://code.launchpad.net/~dolfin-core/dolfin/main
>
> Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
> To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
> differences between files attachment (revision-diff.txt)
> === modified file 'cmake/FindPETSc.dolfin.cmake'
> --- cmake/FindPETSc.dolfin.cmake 2010-08-18 00:42:17 +0000
> +++ cmake/FindPETSc.dolfin.cmake 2010-08-18 11:57:25 +0000
> @@ -31,12 +31,24 @@
> endif ()
> endforeach ()
>
> +# List of possible locations for PETSC_DIR
> +set(petsc_dir_locations "")
> +list(APPEND petsc_dir_locations "/usr/lib/petscdir/3.1")
> +list(APPEND petsc_dir_locations "/usr/lib/petscdir/3.0.0")
> +list(APPEND petsc_dir_locations "$ENV{HOME}/petsc")
> +
> +# Add prefixes in LD_LIBRARY_PATH to possible locations
> +string(REGEX REPLACE ":" ";" libdirs $ENV{LD_LIBRARY_PATH})
> +foreach (libdir ${libdirs})
> + get_filename_component(petsc_dir_location "${libdir}/" PATH)
> + list(APPEND petsc_dir_locations ${petsc_dir_location})
> +endforeach()
> +
> # Try to figure out PETSC_DIR
> find_path (PETSC_DIR include/petsc.h
> HINTS ENV PETSC_DIR
> PATHS
> - /usr/lib/petscdir/3.1 /usr/lib/petscdir/3.0.0 /usr/lib/petscdir/2.3.3 /usr/lib/petscdir/2.3.2 # Debian
> - $ENV{HOME}/petsc
> + ${petsc_dir_locations}
> DOC "PETSc Directory")
>
> # Report result of search for PETSC_DIR
>
Follow ups