Compile gcc 7.4 failed for ubuntu-22.04

I tried to compile gcc 7.4 for my ubuntu-22.04 so that I could use the glmnet for my R package. I tried everything from the internet and it did not work. The error I have is :

#Error1 sanitizer_platform_limits_posix.lo] Error 1

#Error2 all-target-libsanitizer

  1. In most of cases, internet ask me to sudo apt-get g++ 7. etc, but there is no resporitory to download this and no support.

  2. I tried linux guy that ask me to compile with options like below: sudo ./configure --prefix=/home/software/GlobalModulesInstall/compilers/gcc/$version --enable-languages=c,c++ --disable-multilib --disable-libsanitizer --disable-libcilkrts

it does not work and compile failed

  1. There is a link discuss this issue and claim that this bug was fixed in later version, but I need exactly gcc 7.4

  2. I tried to install lib package indpendently, no luck, not working.

  3. The gcc 9.4 compile successfully and can be used, and I used gcc 9.4 to compile 7.4, it did not work. now I am compliling 4.8 and hope it could compile 7.4

I basically run out of any ideas and then I start thinking, hei, since I installed environment module, and this module says things about "protable" and environment independent. So I tried this non-sense method. I have a separate machine runing red hat 7 with environment module installed, so I just compile and install this gcc 7.4 on this machine in a certain folder. Then I just copy this installed gcc 7.4 with its module files from my rehl 7 machine to the ubuntu machine, and then with environment module, it works somehow. And now I can use glmnet from R.

So I am asking does anyone can make the damn gcc 7.4 compile work in this ubuntu 22.04

my current non-sense work around satisfies my need, but could be issue in future.

So if anyone desparetely need to run gcc 7.4 on ubuntu 22.04, could refer to my illogic methods:

  1. in a separate machine with REHL7, compile and install 7.4 under enviroment module
  2. copy paste installed 7.4 and its moduliefile to ubuntu.
  3. load 7.4 with enviorment in ubuntu and things suddenly start working.

Update: can't complile gcc 4.8.2 as well, start suspect Ubuntu has poor support for lower version of gcc

Update: I tried to compile with this 7.4 it did not work, but R glmnet does accept this gcc 7.4, so the package mv is just a work around, the gcc 7.4 was not functioning in ubuntu. I tried compile other gcc say 9.4, it worked and succeed. can anyone give me a hand on compile 7.4 in environment module ?

1 Answer

I am just wonder why you are trying to compile gcc, when there is a perfectly good repository? Personally, I would start with :

sudo apt-get install gcc make cmake build-essential 
3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like