Вы находитесь на странице: 1из 5

Sun Solaris

Sun Solaris ................................................................................................................................................... 1 Sun Solaris............................................................................................................................................ 1 Mount ISO .................................................................................................................................... 1 Companion CD ............................................................................................................................. 1 Installing GCC .............................................................................................................................. 2 Package Install (libgcc and 7za) ........................................................................................... 2 Patch ..................................................................................................................................... 3 math.h problem ..................................................................................................................... 3 Sun Studio 12 ............................................................................................................................... 4

Sun Solaris
http://www.sunfreeware.com/indexsparc10.html: Sun Freeware http://community.activestate.com/faq/whats-the-difference-betw: SunOS 2.X, 5.X and Solaris X are all the same When you download SunSolaris you must run "Companion Software" it holds necessary GNU C compilers and libraries. http://kevininscoe.com/geek/sun/compilesun/ Mount ISO Given an ISO image in /export/temp/software.iso, a loopback file device (/dev/lofi/1) is created with the following command:
lofiadm -a /export/temp/software.iso /dev/lofi/1

(Note: You have to give the absolute path of the iso.) The lofi device creates a block device version of a file. This block device can be mounted to /mnt with the following command:
mount -F hsfs -o ro /dev/lofi/1 /mnt

These commands can be combined into a single command:


mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt

Companion CD Download the companion CD and mount it. Goto following directory and call pkgadd.
$ cd /mnt/Solaris_Software_Companion/Solaris_sparc/Packages $ pkgadd -d `pwd`

Choose your package by the number You will need to install the package SFWgcc21. The pkgadd will list the dependent packages, you will just have to follow it. If the required package is SUN*, you need to mount the main DVD, too. http://www.ibiblio.org/pub/packages/solaris/sparc/html/00README.packages.html

Do like this to install packages from the DVD


$ cd /cdrom/solaris_2_5/s0/Solaris.2.5 $pkgadd -d`pwd` SUNWhea SUNWarc SUNWbtool SUNWlibC SUNWlibCf SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWdfbh SUNWcg6h

Installing GCC http://www.sunfreeware.com/gcc.html: Instruction for installing GCC into Solaris10 You cannot (I've tried every possible solutions) have GCC without developer mode on installation of Solaris. If your Solaris does not have GCC, then the answer is reinstallation. Simply doing pkgadd to gcc-3.4.6-sol10-sparc-local.gz wouldn't work because it needs way more other packages. First you will have to get companion CD and main install DVD mounted. Try to install SFWgcc21 by
$ cd /mnt/Solaris_Software_Companion/Solaris_sparc/Packages $ pkgadd -d `pwd`

Then it will say what is required, go back to install DVD and pkgadd those necessary packages. You will have to do
$ cd /mnt2/Solaris_10/Product $ pkgadd -d `pwd`

Package Install (libgcc and 7za) https://train.transitive.com/knowledge/solution/134: Problem of 7za http://forums.sun.com/thread.jspa?messageID=9289627: Viewing the cluster. In a recent change to Solaris Express Community addition, customers adding Solaris Express packages may see a failure about /usr/bin/7za being missing. You can (have to) download /usr/bin/7za from Sunfreeware The package is listed as: p7zip-4.57-sol10-sparc-local.gz (If libgcc-3.4.6-sol10-sparclocal.gz is not already installed on your system, download and install that as well) To install this package into your Virtual Solaris Environment, unzip the file and use pkgadd to install it:
# # # # gunzip libgcc-3.4.6-sol10-sparc-local.gz gunzip p7zip-4.57-sol10-sparc-local.gz /usr/sbin/pkgadd -d ./libgcc-3.4.6-sol10-sparc-local /usr/sbin/pkgadd -d ./p7zip-4.57-sol10-sparc-local

(But for most of the times you will want to do 'pkgadd -d `pwd` <package_dir>') To check the install has worked, run the following command:
# which 7za /usr/local/bin/7za

(Note: Most of them will say there is a conflict, but most of them are just changing directory attributes. We can ignore them and just go.)

Patch http://sunsolve.sun.com/show.do?target=patchpage: SunOS's patch page http://sunsolve.sun.com/search/document.do?assetkey=1-21-111722: It seems that some SunOS's are missing math header files. http://sunsolve.sun.com/show.do?target=patch-access: Patch cluster Probably patch cluster will ask you for upgrading your account, forget it you can just get it through "Companion Software" disk when you are initially downloading Solaris 10. Don't upgrade the account. It could be your SunOS is missing some very crucial header files such as math.h. The only way is to go to SunOS's patch webpage and search for needed patch. The way to apply patch is simple. The patch will be unzipped with a directory named of its patch id.
example# patchadd /var/spool/patch/106326-01

The following example removes a patch from a standalone system:


example# patchrm 104945-02

If you want to see the list of packages installed to your system, type
$ pkginfo

math.h problem http://wiki.openpkg.org/?HintReleaseOpenPKG23: Without SUNWlibmr package from CD4, you will have math.h problem. You might want to manually copy the necessary files, but it will not work well, because there are really many files you have to copy. This is a mail I sent to my colleague. =========================================================== I got math.h patch for SunOS 5.X which will not fit into our SunOS 2.X. I tried to patch it with "patchadd 111722-05", but it wouldn't patch because of version difference. But I figured that a header like math.h wouldn't change much, and I saw that our machine already had libm in it. So I manually copied math.h and iso/math_iso.h files to /usr/include/math.h /usr/include/iso/math_iso.h And you have to change "floatingpoint.h" in math.h to "float.h." And now the math.h program works perfectly. =========================================================== I think this is a bad way to solve the problem and I think the companion CD would be the solution. Install SUNWtoo, SUNWlibmr, and SUNWlibm
3

Then you have to do this. http://www.sawmill.net/dcforum/DCForumID2/2236.html You needed to update your header files by going to: /usr/local/lib/gcc-lib/sparc-sun-solaris2.10/3.3.2/install-tools/ Putting in the following line at the top of mkheaders.conf:
SHELL=/bin/sh

and then running


./mkheaders

This will rebuild the headers for your particular build of Solaris 10. NOTE: the gcc-lib library path could be different than above depending on the version of gcc that you are using. After doing this, set up the library path like following. Setting LD_LIBRARY_PATH on .zshrc like following.
export LD_LIBRARY_PATH=/usr/local/lib

Sun Studio 12 http://docs.sun.com/source/820-4155/prepare_system.html This is almost same as Visual Studio. About download you should use tarfile SS12 package is fine with comparing to total packaged one. About System Preparation The prepare_system command lets you check the system on which you are going to run the Sun Studio software for the prerequisite software, and install any missing software. You can check the system without having root privileges on the system, but you must have root privileges to install missing software. There is a chance that the system might already have Sun Studio C++ compiler. Check this out > cc -V Most of the times, it will be netbeans, java, patches. Those are needed on running IDE program, if you don't need IDE, just ignore prepare_system. About using the tarfile SS12 Download the tarfile SS12, set your path to PATH=$PATH:$SS12/bin MANPATH=$MANPATH:$SS12/man
4

You can just run it with "sunstudio &" or "cc <your target c/c++ file>" This might create a problem on loading "math.h". Do not use math.h on SS12. Use "sunmath.h"

Вам также может понравиться