Menu

#28 Replace all instances of python by python2

Development v3.x
closed-fixed
nobody
None
5
2014-11-05
2014-10-23
SuperFluffy
No

There are a lot of calls to python < 3.0 both in the sources of pFunit as well as in the installation of it, for which “python” is used as the name of the executable.

At least one Linux distribution I know of (Arch Linux) has python point to python3 by default, which makes both compiling and running pFunit fail.

According to PEP 394, while python should in principle default to python2 this is not a reality on all Linux distributions. I therefore suggest replacing all instances of python by python2 (sed -i 's/python/python2) to make sure that the proper binary is called.

For me, applying the following to the pFunit's installation directory let all Examples pass:

grep -rlZ python * | while IFS= read -r -d '' filename; do sed -i '1 s/python/python2/' "$filename"; done

Related

Bugs: #28

Discussion

  • Michael L. Rilee

    This is quite useful. I'd rather introduce a top-level environment & makefile variable that could be set as needed. "python2" is not available on the system of at least one of our key users.

    Have you tried CMAKE? I'm wondering how it might be working in your environment.

     
    • Tom Clune

      Tom Clune - 2014-10-23

      Just to clarify: python2 is available, but it is not called ‘python2’ on some systems. E.g. on OS X.

      On Oct 23, 2014, at 2:04 PM, Michael L. Rilee mlrilee@users.sf.net wrote:

      This is quite useful. I'd rather introduce a top-level environment & makefile variable that could be set as needed. "python2" is not available on the system of at least one of our key users.

      Have you tried CMAKE? I'm wondering how it might be working in your environment.

      [bugs:#28] Replace all instances of python by python2

      Status: open
      Group: Development v3.x
      Created: Thu Oct 23, 2014 12:33 PM UTC by SuperFluffy
      Last Updated: Thu Oct 23, 2014 12:33 PM UTC
      Owner: nobody

      There are a lot of calls to python < 3.0 both in the sources of pFunit as well as in the installation of it, for which “python” is used as the name of the executable.

      At least one Linux distribution I know of (Arch Linux) has python point to python3 by default, which makes both compiling and running pFunit fail.

      According to PEP 394, while python should in principle default to python2 this is not a reality on all Linux distributions. I therefore suggest replacing all instances of python by python2 (sed -i 's/python/python2) to make sure that the proper binary is called.

      For me, applying the following to the pFunit's installation directory let all Examples pass:

      grep -rlZ python * | while IFS= read -r -d '' filename; do sed -i '1 s/python/python2/' "$filename"; done

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/pfunit/bugs/28/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

      Thomas Clune, Ph. D. Thomas.L.Clune@nasa.gov
      Head ASTG,Code 606
      NASA GSFC
      MS 610.8 B33-C128
      Greenbelt, MD 20771
      301-286-4635

       

      Related

      Bugs: #28

  • Michael L. Rilee

    The scripts all use '/usr/bin/env python' to select the version. The makefiles now use '$(PYTHON)', which is set in the top level GNUmakefile. CMAKE also uses 'python'. Because the executable python2 is not available across our systems (yet), I hesitate to make that the default. Since all of the build tools search PATH for 'python', I'd recommend setting a symbolic link early in the PATH from python to python2. Something like: ln -s ~/bin/python /usr/bin/python2; ln -s ~/bin/python-config /usr/bin/python2-config; export PATH=~/bin:${PATH}.

     
  • Michael L. Rilee

    One item: the scripts in regression are hardwired to to /usr/bin/python. Because this code is used in production on the HPC system Discover, I don't want to change this until after consulting with our team.

     
  • Michael L. Rilee

    Thanks for opening the ticket. Need anything else here, or can we close? Cheers.

     
  • Michael L. Rilee

    • status: open --> closed-fixed
     

Log in to post a comment.