Installing GCC on Oracle Solaris 11

后端 未结 9 2080
北荒
北荒 2020-12-05 11:26

i recently got Oracle Solaris on my VM to test some code on it, i was unable to install gcc since i dont really know how, i googled alot but all info is about oracle compile

相关标签:
9条回答
  • 2020-12-05 11:48

    My Solaris 2.11 does NOT have internet access :/

    What work for me:

    (1) I use this link as guideline
    (2) From my windows machine, download gcc at one of their mirror sites, i used here, normally the closer the better
    (3) Upload gcc-9.2.0.tar.gz to target /tmp directory using WinSCP
    (4) tar -xvf gcc-9.2.0.tar.gz
    (5) cd gcc-9.2.0
    (6) mkdir /usr/local/gcc
    (7) cd /usr/local/gcc
    (8) /tmp/gcc-9.2.0/configure -v --program-suffix=9.2

    At this point, you might get this error:
    Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.

    (9) Manually download the required files here.
    Note: To know what files are required, check contrib/download_prerequisites
    (10)Copy over the files in (9) to /tmp/gcc-9.2.0
    (11)Extract, then create shortcuts: ln -s gmp-6.1.0 gmp, ln -s mpc-1.0.3 mpc, ln -s mpfr-3.1.4 mpfr, ln -s isl-0.18 isl
    (12)/tmp/gcc-9.2.0/configure -v --program-suffix=9.2 --enable-languages=c,c++ -v
    (13) nohup gmake & (At this point it's going to take some time...mine took ~6 hours. Use -j option if you can, to gmake it faster )
    (14) gmake install
    (15) /usr/local/bin# ./gcc9.2 --version
    gcc9.2 (GCC) 9.2.0 Copyright (C) 2019 Free Software Foundation, Inc.

    Voila! :-)

    0 讨论(0)
  • 2020-12-05 11:53

    You can install gcc 4.3 from OpenCSW:

    pkg-get -i gcc4code gcc4g++
    

    I also had to run mkheaders manually after the install.

    0 讨论(0)
  • 2020-12-05 11:54

    Just download gcc from its homepage, follow one of the mirror links to fetch the latest binary package (in .tar.gz or tar.bz2 format), and use traditional steps to build:

    1. ./configure --<> // give your options
    2. make
    3. make install

    The good news is you can customize what you need and always stay with the latest, while bad part is you may lose the power to debug with mdb/adb - we are facing such problems with latest GCC 4.6.x

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