<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Anna, and Hernán (and @grass-users),</p>
    <p>Many thanks for your helpful suggestions. In fact you both helped
      me in finding the solution to the issue I've had getting Grass
      compiled against a newer Python than the one in the OpenSuse 15.5
      base system. Your replies gave me the confidence to pursue
      building the Grass application with Python v3.11, and to use a
      Python virtual environment in doing so.</p>
    <p>I'm very happy to report, that today [Sat] I managed to build the
      latest development release Grass from source, and the
      python-related errors are now gone : <br>
    </p>
    <p>System Info :
                                                                        
      <br>
          GRASS version:
      8.4.0dev                                                         <br>
          Code revision:
      exported                                                         <br>
          Build date:
      2024-03-23                                                        
       <br>
          Build platform:
      x86_64-pc-linux-gnu                                             <br>
          GDAL:
      3.8.4                                                                   
       <br>
          PROJ:
      9.3.1                                                                   
       <br>
          GEOS:
      3.12.1                                                                  
       <br>
          SQLite:
      3.44.0                                                                
       <br>
          Python:
      3.11.8                                                                
       <br>
          wxPython:
      4.2.1                                                               
       <br>
          Platform:
      Linux-5.14.21-150500.55.52-default-x86_64-with-glibc2.31            
       <br>
    </p>
    <p>The steps :</p>
    <p>1. Build wxPython in a temporary Python v3.11 virtual environment
      (using this as a go by:
<a class="moz-txt-link-freetext" href="https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html">https://wxpython.org/blog/2017-08-17-builds-for-linux-with-pip/index.html</a>
      ).</p>
    <p>     - Note: this was made more difficult because there is a
      wxPython bug relating to setup on OpenSuse (see this link for
      details : <br>
    </p>
    <p>       <a class="moz-txt-link-freetext" href="https://github.com/wxWidgets/Phoenix/issues/1067">https://github.com/wxWidgets/Phoenix/issues/1067</a>,</p>
    <p>       and specifically this comment by Frank78 : 
      <a class="moz-txt-link-freetext" href="https://github.com/wxWidgets/Phoenix/issues/1067#issuecomment-685175041">https://github.com/wxWidgets/Phoenix/issues/1067#issuecomment-685175041</a>)<br>
    </p>
    <p>2. Create a wheel file, from the wxPython build using pip (still
      in the same venv).</p>
    <p>3. Exit that venv, and then activate my usual Python v3.11 venv,
      navigate to the the directory containing the new wxPython wheel
      and install it with pip.</p>
    <p>4. Then, still in my usual Python v3.11 venv, change directory to
      a clean instance of the Grass 8.4 development snapshot I'd
      downloaded previously.</p>
    <p>5. In the bash console, set the following :  export
      LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local:/usr/local/lib64</p>
    <p>6. Run the configure command with all the required options, then
      when that finishes successfully ...</p>
    <p>7a. set this : export GRASS_RANDOM_SEED=1234</p>
    <p>7b. initiate the build with this : make prefix=/usr/local
      PREFIX=/usr/local -j4</p>
    <p>8. The build finished :</p>
    <p>GRASS GIS 8.4.0dev exported compilation log<br>
      --------------------------------------------------<br>
      Started compilation: Sat 23 Mar 15:01:20 GMT 2024<br>
      --<br>
      Errors in:<br>
      No errors detected.<br>
      --<br>
      Finished compilation: Sat 23 Mar 15:05:17 GMT 2024<br>
    </p>
    <p>9. Finally, install to the desired directory location (in this
      case /usr/local/bin and /usr/local/grass84) with this : sudo make
      install<br>
    </p>
    <p>10. create a desktop launcher that activates the Python3.11 and
      runs the /usr/local/bin/grass executable, all in one go with this
      setting :</p>
    <p>      Exec=/bin/bash -c 'source ~/.venv/py311env/bin/activate
      && /usr/local/bin/grass'<br>
    </p>
    <p>Hopefully the above workflow will be of help to others just
      beginning to attempt compiling Grass on their Linux system.</p>
    <p>Once again, thanks Anna, and Hernán.</p>
    <p>Regards,</p>
    <p>Barry.<br>
    </p>
    <div class="moz-cite-prefix">On 22/03/2024 14:00, Anna Petrášová
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAE0EDErmvpUeHtWHjx5KrmLsN3CW6Dqfm_HBerudL26C3qiXrA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">There is GRASS_PYTHON variable you can try. Running
        GRASS in virtual environment should work too.</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, Mar 21, 2024 at
          2:39 AM Hernán De Angelis via grass-user <<a
            href="mailto:grass-user@lists.osgeo.org"
            moz-do-not-send="true" class="moz-txt-link-freetext">grass-user@lists.osgeo.org</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="auto">I understand you are using openSUSE Leap. At
            the moment I cannot check which Python version is offered
            there as base. Are you sure you cant install a newer
            version? If that is not possible you could perhaps install a
            newer version using your own separate local environment,
            using miniforge, for example.
            <div dir="auto">
              <div dir="auto"><br>
              </div>
              <div dir="auto">I use openSUSE Tumbleweed and always build
                from source. Python 3.11 is the base version now, with
                3.12 starting to be rolled in. Perhaps it is not too
                crazy to try TW?</div>
              <div dir="auto"><br>
              </div>
              <div dir="auto">Good luck!</div>
              <div dir="auto"><br>
              </div>
              <div dir="auto">Hernán </div>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">Den tors 21 mars 2024
              01:23Barry Keeling via grass-user <<a
                href="mailto:grass-user@lists.osgeo.org" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">grass-user@lists.osgeo.org</a>>
              skrev:<br>
            </div>
            <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi
              @grass-users,<br>
              <br>
              I posted the following on libera.chat#grass but it seemed
              like there <br>
              isn't much activity on there (pls. excuse if I'm wrong on
              that).<br>
              <br>
              I spent the day learning how to compile the grass8.4dev
              source, and <br>
              managed to get the app to compile, and fire up<br>
              but there's a glitch, it compiled against the system
              python which is <br>
              only v3.6 (not compatible based on REQUIREMENTS file)<br>
              and I don't know how to point it at python v3.11.<br>
              <br>
              This is on OpenSuse 15.5 Linux, btw, and though the Grass
              application <br>
              windows work well, I get errors in the console related
              mostly to python,<br>
              when trying to use the various modules, for example using
              r.in.png.<br>
              <br>
              I've tried per-user setting python3 aliased to v3.11 in my
              .bashrc, but <br>
              no luck Grass still shows v3.6 in Help/about/system ..<br>
              <br>
              I'm wondering whether I should use update-alternatives
              approach, and <br>
              also wondering whether the problem might be related to
              wxpython3 being <br>
              linked to the system python and not v3.11.<br>
              <br>
              I haven't compiled wxpython separately.<br>
              <br>
              I'm just hoping someone might be able to point me in the
              right direction :-)<br>
              <br>
              Barry<br>
              <br>
              <br>
              _______________________________________________<br>
              grass-user mailing list<br>
              <a href="mailto:grass-user@lists.osgeo.org"
                rel="noreferrer" target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">grass-user@lists.osgeo.org</a><br>
              <a
href="https://lists.osgeo.org/mailman/listinfo/grass-user"
                rel="noreferrer noreferrer" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
            </blockquote>
          </div>
          _______________________________________________<br>
          grass-user mailing list<br>
          <a href="mailto:grass-user@lists.osgeo.org" target="_blank"
            moz-do-not-send="true" class="moz-txt-link-freetext">grass-user@lists.osgeo.org</a><br>
          <a href="https://lists.osgeo.org/mailman/listinfo/grass-user"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>