Installing gfortran in Linux as a user

后端 未结 1 1160
孤独总比滥情好
孤独总比滥情好 2020-12-20 09:57

I am a non-administrator user of a Linux (CentOS 6.6) server at work. I log in through a terminal program on a windows computer. My problem is that the IT does not feel co

相关标签:
1条回答
  • 2020-12-20 10:38

    After much effort I have answered my own question! To install GCC to my own personal Linux account as a non-administrator, I ended up having to compile GCC and not use the binaries I originally downloaded. My friend was make install which knows where everything needs to go, which I did not have with the binaries.

    The key was to install to my user root directory /GCC with the following command provided with the build-it-yourself method (-prefix):

    ../gcc-5.3.0/configure --prefix$HOME/gcc-5.3.0 --enable-languages=c,c++,fortran --disable-multilib
    

    For me I had to disable multilib because I guess my system only has 64 bit libraries (I think this was causing my original problem).

    Before I got to that point, I had to also download the prerequisites manually since my workplace I suppose blocks the automatic prerequisite downloader as referenced in these instructions.

    https://gcc.gnu.org/wiki/InstallingGCC
    

    Prerequisites need to be taken from here, placed into the root of the directory that gets created when you unzip GCC. Then unzip them and link them as is done in the batch file you have already unzipped ./contrib/download_prerequisites.

    ftp://gcc.gnu.org/pub/gcc/infrastructure/
    

    Finally I need to run the following command, after it is all up so it looks at the new libraries. I will add this to my .profile when I am ready to fully switch to the local newer version.

    LD_LIBRARY_PATH=/users/home/myself/gcc-5.3.0/lib64
    export LD_LIBRARY_PATH
    

    For now I am running gfortran with the following command but also I will add this to my .profile later.

    /users/home/myself/gcc-5.3.0/bin/gfortran Test.f90
    

    It works! Latest version of GCC running from my local Linux user non-administrator account!

    Edited to add how we resolved this for the network group: IT did not want to overwrite the original installation so we installed to some network folder /gcc-5.3.0 . Then we modified the group's .profile to add the library and binary paths to that, before the standard path.

    0 讨论(0)
提交回复
热议问题