Maafkan ketidaktahuan saya ... Saya hanya menggunakan Solaris untuk menguji perpustakaan C / C ++ yang saya minati. Saya bukan admin Solaris atau pengguna Solaris.
Saya menginstal GCC-5 pada Solaris 11.3, x86 karena saya memerlukan kompiler C ++ yang mendukung -std=c++11
(lihat di bawah untuk output paket). GCC asli Sun adalah 4.8, dan itu tidak mendukung C ++ 11 dengan baik (atau sama sekali).
Sayangnya, saya tidak dapat menemukannya setelah menginstal:
$ g++-5 --version
-bash: g++-5: command not found
$ sudo find /usr -name gcc-5
$ sudo find /bin -name gcc-5
$
Dan untuk kelengkapan:
$ /bin/gcc --version
gcc (GCC) 4.8.2
...
$ ls -l /usr/bin/gcc
lrwxrwxrwx 1 root root 18 Jun 7 2016 /usr/bin/gcc -> ../gcc/4.8/bin/gcc
$ which gcc-5
no gcc-5 in /usr/local/bin /usr/local/sbin /bin /sbin /usr/bin /usr/sbin /usr/sfw/bin
Di mana kompiler berada?
Menurut Menginstal GCC pada Oracle Solaris 11 pada Stack Overflow, itu seharusnya /usr/bin/gcc
sebagai symlink. Namun jawabannya agak tidak aktif:
$ /usr/bin/gcc --version
gcc (GCC) 4.8.2
...
Menurut GCC yang hilang dari Solaris 11, dan server sudah dikerahkan di Server Fault:
/usr/sfw/bin
adalah jalur gcc yang dibundel dengan Solaris 10. Pada Solaris 11.1, gcc, ketika diinstal, langsung tersedia/usr/bin
sebagai symlink yang menunjuk ke/usr/gcc/<version>/bin/gcc
Jawabannya tampaknya tidak aktif juga.
$ sudo pkg install --accept gcc-5
------------------------------------------------------------
Package: pkg://solaris/release/evaluation@1.0,5.12-5.12.0.0.0.115.0:20170111T175931Z
License: evaluation
This software has been made available for evaluation purposes only.
See http://www.oracle.com/technetwork/server-storage/solaris11/technologies/foss-evaluation-program-2586275.html for further information.
Packages to install: 2
Create boot environment: No
Create backup boot environment: No
DOWNLOAD PKGS FILES XFER (MB) SPEED
Completed 2/2 8/8 0.0/0.0 17.4k/s
PHASE ITEMS
Installing new actions 37/37
Updating package state database Done
Updating package cache 0/0
Updating image state Done
Creating fast lookup database Done
Updating package cache 2/2
Setelah menginstal gcc-5
:
$ find / -name 'gcc*' 2>/dev/null
/usr/share/vim/vim73/compiler/gcc.vim
/usr/share/gcc-4.8.2
/usr/share/man/man1/gcc.1
/usr/gcc
/usr/gcc/4.8/bin/gcc-nm
/usr/gcc/4.8/bin/gcc-ranlib
/usr/gcc/4.8/bin/gcc
/usr/gcc/4.8/bin/gcc-ar
/usr/gcc/4.8/lib/gcc
/usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/plugin/include/ada/gcc-interface
/usr/gcc/4.8/lib/gcc/i386-pc-solaris2.11/4.8.2/plugin/include/gcc-plugin.h
/usr/gcc/4.8/share/locale/de/LC_MESSAGES/gcc.mo
/usr/gcc/4.8/share/locale/ja/LC_MESSAGES/gcc.mo
/usr/gcc/4.8/share/locale/fr/LC_MESSAGES/gcc.mo
/usr/gcc/4.8/share/locale/zh_CN/LC_MESSAGES/gcc.mo
/usr/gcc/4.8/share/locale/zh_TW/LC_MESSAGES/gcc.mo
/usr/gcc/4.8/share/locale/es/LC_MESSAGES/gcc.mo
/usr/gcc/4.8/share/gcc-4.8.2
/usr/gcc/4.8/share/info/gccinstall.info
/usr/gcc/4.8/share/info/gccint.info
/usr/gcc/4.8/share/info/gcc.info
/usr/gcc/4.8/share/man/man1/gcc.1
/usr/bin/gcc
/usr/local/share/emacs/24.5/lisp/cedet/semantic/bovine/gcc.el
/usr/local/share/emacs/24.5/lisp/cedet/semantic/bovine/gcc.elc
/usr/include/gc/atomic_ops/sysdeps/gcc
/usr/include/avahi-common/gccmacro.h
/usr/include/pulse/gccmacro.h
/export/home/jwalton/botan/src/scripts/ci/circle/gcc-sanitizer.sh
/export/home/jwalton/botan/src/scripts/ci/circle/gcc-static-debug.sh
/export/home/jwalton/botan/src/scripts/ci/circle/gcc-shared-debug.sh
/export/home/jwalton/botan/src/build-data/cc/gcc.txt
/export/home/jwalton/zlib-1.2.8/contrib/gcc_gvmat64
/opt/developerstudio12.5/lib/compilers/CC-gcc/lib/gcc
/opt/developerstudio12.5/lib/compilers/CC-gcc/gcc_version.map
/opt/solarisstudio12.4/lib/compilers/CC-gcc/gcc_version.map
/opt/solarisstudio12.4/lib/compilers/CC-gcc/lib/gcc
Dan:
~$ pkg search -l gcc | grep ^basename
basename dir opt/developerstudio12.5/lib/compilers/CC-gcc/lib/gcc pkg:/developer/developerstudio-125/library/studio-gccrt@12.5-1.0.0.0
basename dir opt/solarisstudio12.4/lib/compilers/CC-gcc/lib/gcc pkg:/developer/solarisstudio-124/library/studio-gccrt@12.4-1.0.0.0
basename dir usr/include/gc/atomic_ops/sysdeps/gcc pkg:/library/gc@7.2-0.175.2.0.0.39.0
basename link usr/bin/gcc pkg:/developer/gcc-4/gcc-c-48@4.8.2-0.175.3.0.0.30.0
basename file usr/gcc/4.8/bin/gcc pkg:/developer/gcc-4/gcc-c-48@4.8.2-0.175.3.0.0.30.0
pkg: Search performance is degraded.
/bin/gcc
dan /usr/bin/gcc
GCC 4.8. Saya memperbarui pertanyaan dengan output dari perintah.
which gcc-5