[petsc-dev] Configure won't find python
Jed Brown
jed at jedbrown.org
Sat Apr 18 14:19:35 CDT 2020
I guess this is close to what you started the thread with (and had already left my head).
Jed Brown <jed at jedbrown.org> writes:
> Jacob Faibussowitsch <jacob.fai at gmail.com> writes:
>
>>> command -v $pyimpls > /dev/null && echo Using: $pyimpl && exec $pyimpl "$@"
>>
>> As Lisandro noted below, command -v would have to be swapped out since it also picks up aliases and doesn’t error out.
>
> Right, which is better.
>
> diff --git i/configure w/configure
> index 4538314871..78e72da1a2 100755
> --- i/configure
> +++ w/configure
> @@ -1,4 +1,11 @@
> -#!/usr/bin/env python
> +#!/bin/sh
> +
> +"true" '''\'
> +for pyimpl in python3 python python2; do
> + which $pyimpl > /dev/null && echo "Using $pyimpl for Python" && exec $pyimpl "$0" "$@"
> +done
> +exit 127
> +'''
>
> import sys, os
>
More information about the petsc-dev
mailing list