请原谅我的无知...我仅将Solaris用于测试感兴趣的C / C ++库。我不是Solaris管理员或Solaris用户。
我在Solaris 11.3 x86上安装了GCC-5,因为我需要一个支持的C ++编译器-std=c++11
(有关软件包输出,请参见下文)。Sun的本机GCC是4.8,它不能很好地(或根本不)支持C ++ 11。
不幸的是,安装后我找不到它:
$ g++-5 --version
-bash: g++-5: command not found
$ sudo find /usr -name gcc-5
$ sudo find /bin -name gcc-5
$
为了完整性:
$ /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
编译器在哪里?
根据在Stack Overflow 上的Oracle Solaris 11上安装GCC的说法,它应该/usr/bin/gcc
作为符号链接进入。但是答案似乎有点偏离:
$ /usr/bin/gcc --version
gcc (GCC) 4.8.2
...
根据Solaris 11中缺少的GCC,并且服务器已在Server Fault上进行了部署:
/usr/sfw/bin
是与Solaris 10捆绑在一起的gcc路径。在Solaris 11.1上,安装后,gcc可直接/usr/bin
作为指向以下链接的符号链接使用:/usr/gcc/<version>/bin/gcc
答案似乎也有些偏离。
$ 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
安装后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
和:
~$ 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.
which gcc-5