#2110 How to properly install older gcc version.

INSTALLER
assigned
Earnie Boyd
None
Support
none
Unknown
False
2014-08-17
2013-10-15
jetgum77
No

How would I go about installing a previous gcc version from the command line?

Tried this but it is not only ugly but it also does not work.
mingw-get.exe --reinstall install "gcc<4.7"
mingw-get.exe --reinstall install "gcc-g++<4.7"

Without these it does not work at all (libs are there but wrong version):
mingw-get.exe --reinstall install "mpc<3"
mingw-get.exe --reinstall install "mpfr<3"
mingw-get.exe --reinstall install "libiconv<3"

Any suggestion is welcome.

Discussion

  • Keith Marshall
    Keith Marshall
    2013-10-16

    For a clean install:

    mingw-get install "gcc<4.7.*" "gcc-g++<4.7.*"
    

    To roll back an existing install, to an earlier release:

    mingw-get upgrade --recursive "gcc<4.7.*" "gcc-g++<4.7.*"
    

    You cannot use:

    mingw-get install --reinstall "gcc<4.7.*" "gcc-g++<4.7.*"
    

    because --reinstall states that you want to reinstall the currently installed version, which contradicts (and overrides) your hint that you would prefer an earlier release. Furthermore, without --recursive, --reinstall will not reschedule dependencies, because they are assumed to already match the current version you are reinstalling.

     
  • jetgum77
    jetgum77
    2013-10-17

    It works. As my script does not know about the previous state I do this:

    mingw-get.exe update
    mingw-get.exe install "gcc<4.7." "gcc-g++<4.7."
    mingw-get.exe upgrade --recursive "gcc<4.7." "gcc-g++<4.7."

    Thank you very much.

    And for the future I will try to upgrade to 4.8. :)

     
  • jetgum77
    jetgum77
    2013-10-23

    Unfortunately it is still not working:

    mingw-get update
    mingw-get install "gcc<4.7.*" "gcc-g++<4.7.*"
    mingw-get upgrade --recursive "gcc<4.7.*" "gcc-g++<4.7.*"
    /c/mingw/libexec/gcc/mingw32/4.6.2/cc1.exe
    ---> popup saying libmpc-2.dll is missing
    

    I can not manage to install a working GCC 4.6 environment which I am stuck on due to library requirements. Until the new installer/catalouge is fixed it would be very nice to be able to fall back to the nicely working mingw-get-inst-20120426.exe

    I have wasted a ridiculous amount of time trying to work around you removing the old installer...

     
    • Keith Marshall
      Keith Marshall
      2013-10-23

      $ mingw-get update
      $ mingw-get upgrade gcc-bin="4.6.*"
      

      installed gcc-4.6.2, accompanied by libmpc-2.dll, just fine for me, (leaving the libmpc-3.dll from the original gcc-4.8.1 installation in place). However, due to another careless catalogue error, it did not install libmpfr-1.dll, (as it should have), but reported a conflict when attempting to install libmpfr-4.dll, (which should not have been in the package it was trying to install; libmpfr-1.dll should have been, but wasn't). I've now corrected that catalogue error, (even though it wasn't mine to begin with); give it an hour or so, to propagate to the mirrors, before you try again.

      I appreciate that you are frustrated, but this is precisely why I will not bring back mingw-get-inst.exe; I want it to be difficult for users to continue to use it, (and especially to misuse it), because we need these bug reports to identify problems in current mingw-get itself, and in the catalogue it uses, (the two are distinct entities, and are maintained separately, by different developers). As I've said before, the problems you are experiencing are not attributable to mingw-get; they are catalogue errors. Even if your starting point was mingw-get-inst.exe, rather than mingw-get-setup.exe, if you were managing your installation properly, and keeping your local copy of the catalogue up to date, you would be experiencing identically the same issues.

      If you must continue to live in the Dark Ages, you'd better engage in some archaeology; you might start digging here. We will not continue to distribute mingw-get-inst.exe.

       
  • jetgum77
    jetgum77
    2013-10-23

    If you put it that way I can understand some way. Still in my case with prepackaged catalogs... Anyway, I appreciate that you see my troubles not as only bothering you but also as a way for improvement.

    I could not find mingw-get-inst on the mirror server. If I can get the new version to do what I want all the better.

    Why does 'mingw-get install "gcc=4.6." "gcc-g++=4.6."' not include gcc-bin? Or am I misunderstanding?

    Here goes another issue that struck me odd:
    (new mingw-get installation with update & msys-base, then in msys:)
    mingw-get update
    many times: mingw-get install "gcc=4.6." "gcc-g++=4.6." "gcc-bin=4.6."
    mingw-get.exe: ERROR ...
    probable package conflict; existing file not overwritten
    --> only libmpc-3.dll
    mingw-get upgrade --recursive "gcc=4.6.
    " "gcc-g++=4.6." "gcc-bin=4.6."
    several times: mingw-get.exe: WARNING upgrade gcc-dev: request ignored...
    mingw-get.exe: WARNING gcc-dev: package was not previously installed
    --> only libmpc-3.dll
    mingw-get upgrade --recursive "gcc-bin=4.6.*"
    --> libmpc-3.dll and libmpc-2.dll are available.

    I had expected mingw-get to do the same whether there are several packages in one call (as per your previous suggestion) or each one on a single line.

    To be continued... :)

     
  • jetgum77
    jetgum77
    2013-10-23

    Also missing:
    make: libiconv-2.dll
    cc1plus: libwinpthread-1.dll

    I can get the proper libiconv installed but pthreads does not want to be installed...

     
    Last edit: jetgum77 2013-10-23
    • Keith Marshall
      Keith Marshall
      2013-10-23

      Also missing:
      make: libiconv-2.dll

      Another careless catalogue omission; again, not mine, but I've added the missing dependency nonetheless.

      cc1plus: libwinpthread-1.dll

      This one, I do not understand. AFAICT, we have never published libwinpthread-1.dll, so no cc1plus from our stable should depend on it. Are you sure you haven't polluted your installation with someone else's build?

       
    • Earnie Boyd
      Earnie Boyd
      2013-10-24

      libwinpthread is a concoction of the sister project. We have never distributed it.

       
  • jetgum77
    jetgum77
    2013-10-23

    I'm quite sure I did not pollute the installation.

    I guess it actually wants this:
    pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev.tar.lzma (libpthread.a and some others).

    As with libmpc I can not install it:
    $ mingw-get install --reinstall --recursive pthreads-w32="2.9.0"
    or
    $ mingw-get install --reinstall --recursive pthreads="2.9.0"

    mingw-get.exe: ERROR there is no release matching pthreads-w32=2.9.0
    mingw-get.exe: ERROR available candidate releases are...
    mingw-get.exe: ERROR pthreads-w32-2.9.1-1-mingw32-dev.tar.lzma
    mingw-get.exe: ERROR pthreads-w32-2.8.0-3-mingw32-dev.tar.lzma
    mingw-get.exe: ERROR pthreads-w32-2.9.0-mingw32-pre-20110507-2-dev.tar.
    lzma
    mingw-get.exe: ERROR there is no release matching pthreads-w32=2.9.0
    mingw-get.exe: ERROR available candidate releases are...
    mingw-get.exe: ERROR pthreads-w32-2.9.1-1-mingw32-doc.tar.lzma
    mingw-get.exe: ERROR pthreads-w32-2.8.0-3-mingw32-doc.tar.lzma
    mingw-get.exe: ERROR pthreads-w32-2.9.0-mingw32-pre-20110507-2-doc.tar.
    lzma
    mingw-get.exe: ERROR there is no release matching pthreads-w32=2.9.0
    mingw-get.exe: ERROR available candidate releases are...
    mingw-get.exe: ERROR pthreads-w32-2.9.1-1-mingw32-lic.tar.lzma
    mingw-get.exe: ERROR pthreads-w32-2.9.0-mingw32-pre-20110507-2-lic.tar.
    lzma
    mingw-get.exe: ERROR pthreads-w32-2.8.0-3-mingw32-lic.tar.lzma

     
  • jetgum77
    jetgum77
    2013-10-24

    Retried with a fresh install and the problem stays the same. With the old time-honored installer everything works just fine.
    edit: with the old installer there is no file of that exact filename either. But for example: MinGW\lib\libpthread.dll.a

     
    Last edit: jetgum77 2013-10-24
  • jetgum77
    jetgum77
    2013-10-24

    Tried once more with a fresh install - same problem. From what I can find I don't even have libwinpthread-1.dll on my system.
    When g++ is called there shows up a popup with cc1plus.exe in the top complaining about this file missing.
    I tried to provoke the error with the old install by deleting all .dll .a files with "thread" or "thrd" in them to no avail - old install always works :)
    Maybe something else is missing so it thinks it would need that dll.

     
  • jetgum77
    jetgum77
    2013-10-24

    The problem lies in \bin\libgmp-10.dll

    The one from the new installer is twice the size as the one from the old installer. If I replace the new one with the old one it magically works.

    I have a feeling without the old installer and it's prepackaged catalogue it is close to impossible to get a working gcc 4.6.x

     
  • Keith Marshall
    Keith Marshall
    2013-10-27

    • status: unread --> assigned
    • assigned_to: Earnie Boyd
     
  • Keith Marshall
    Keith Marshall
    2013-10-27

    (Assigning to Earnie, for comment).

    I simply cannot reproduce this issue. In a clean sandbox, I installed the latest mingw-get, (as delivered by mingw-get-setup.exe); then I did:

    $ mingw-get update
    $ mingw-get install gcc-bin="4.6.*" gcc-g++="4.6.*"
    

    This did not immediately yield a working installation; however, with the exception of a non-fatal issue surrounding libgmp-10.dll, the residual issues I noted bear absolutely no resemblance to what you are reporting:--

    1. The libgmp-10.dll installed is a later version (5.1.2) than GCC-4.6.2 was originally built with (5.0.1); this results in a warning, when running 'gcc -v', about the version mismatch, but since both provide interface version 10, gcc should run just fine with the later release, and indeed, it does for me, to compile mingw-get itself. (The warning from "gcc -v" can easily be eliminated, by running 'mingw-get upgrade libgmp-dll="5.0.1-*"').
    2. As installed, the versions of mingwrt and w32api are mutually incompatible, and without attention, this does break compilation. (Perhaps Earnie could comment on why he chose to restrict mingwrt to an earlier version than 3.20-2, for GCC-4.6.x and earlier, since upgrading mingwrt to 4.0 works for me, with GCC-4.6.2). In any case, either "mingw-get upgrade mingwrt-dev", or "mingw-get upgrade w32api-dev='3.*', restores these to a state of compatibility, which suffices to get me a working GCC-4.6.2. (To fix this properly, the catalogue entries for GCC-4.6.x and earlier need to be amended, either to remove the mingwrt version restriction, or to impose a similar restriction for w32api).
    3. Latest mingw-get does complain about numerous package conflicts between gcc-core and gcc-g++. This is a packaging bug, which was not caught by the earlier version delivered by mingw-get-inst.exe; however, the bug has been present since our release of GCC-4.6.2, and use of the older mingw-get, (on which you seem so keen), will have recorded inconsistent (i.e. broken) file to package associations, within the installation database.
     
    • Earnie Boyd
      Earnie Boyd
      2013-10-28

      I don't remember why at the moment. I will take a look at the catalogue to see if it triggers some memory. But at the very least both mingwrt and w32api should have been controlled if one of them is.

       
  • jetgum77
    jetgum77
    2013-10-27

    Thank you for you suggestions.

    On further testing I noticed that now I also get the problem of the libwinpthread-1.dll with the latest gcc version installed. Even with deleting the MinGW directory and a new installation so something may be messed up with my system.
    With all the experimenting I had in fact the sister project installed at some point but I removed it long ago and can not find any traces left from it. I will try it on another system to make sure. There certainly is no other g++.exe or cc1plus.exe on my system.

    Let me note that the error shows up when g++ is being started via a batch file with various options. I can start cc1plus.exe from the command line without problem.

    Will report back once I figure out more.

    edit: As always the installation using mingw-get-inst-20120426.exe with prepackaged catalogs works like a charm.

     
    Last edit: jetgum77 2013-10-27
  • jetgum77
    jetgum77
    2013-10-27

    @Keith: Your step 2. from above got me a step further. Now as.exe is complaining about libwinpthread-1.dll missing...

     
  • Keith Marshall
    Keith Marshall
    2013-10-27

    AFAIK, libwinpthread-1.dll is written by and distributed by the developers of mingw-w64. This is a distinct project, which is not affiliated with MinGW.org. We have never distributed libwinpthread-1.dll, and NONE of our tools depend on it; (those which do exhibit a pthreads dependency use libpthreadGC2.dll, which we do distribute).

    If you are seeing dependencies on libwinpthread-1.dll, then you MUST have cross contaminated your installation with mingw-w64 components; this is your bug, not ours.

     
    • Earnie Boyd
      Earnie Boyd
      2013-10-28

      The libwinpthread library is a fork of pthread-w32 which was later adapted and maintenance taken over by the sister project.