Installing gcc-4.8 and gfortran-4.8, after having rm'ed gcc-8.3 and gfortran-8.3 from /usr/local/bin/

0

I recently installed gcc-8.3 and gfortran-8.3 from http://hpc.sourceforge.net, using the instructions on that site. I installed both locally on my Mac. Installation was successful and my FORTRAN code compiled. However, I could not run my desired program. I have previous compiled and run my program on my institute server, and I went back to check the FORTRAN version on that machine, which turned out to be 4.8.5. I figured the version difference could had been the reason my code didn't run.

I thought to myself that I needed to change the version of gcc and gfortran to 4.8 locally on my Mac, using the links for that version also available on http://hpc.sourceforge.net. To avoid having conflicting versions on my Mac, I thought I would remove the binaries associated with gcc and gfortran from my /usr/local/bin, so I removed them all using

sudo rm -f ...files...

Now, after downloading the files for version 4.8, I try to

tar -xvf gcc-4.8-bin.tar

But I receive what looks like tar-errors:

x usr/local/include/c++/4.8.1/backward/hash_map: Failed to create dir 'usr/local/include/c++/4.8.1'Can't create 'usr/local/include/c++/4.8.1/backward/hash_map'

x usr/local/bin/cpp: Can't unlink already-existing object

x usr/local/bin/g++: Can't create 'usr/local/bin/g++'

tar: copyfile unpack (usr/local/include/mpc.h) failed: No such file or directory

I assume I have made a mistake somewhere, and I am regretting the sudo rm -f on the first binaries.

Has anyone had this problem before, or does anyone know how I might get back to square one, where I can resume the fortran installation from scratch?

Thank you!

user1047122

Posted 2019-06-08T03:21:01.020

Reputation: 1

What directory are you in when you run the tar command?  Are you running as root (i.e., under sudo)? … … … … … … … … Please do not respond in comments; [edit] your question to make it clearer and more complete. – Scott – 2019-06-08T03:48:44.547

No answers