<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/2036/1/7/_/styles/combined.css?spaceKey=TOP&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Solaris">Building - Solaris</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~dsessions@digium.com">Darren Sessions</a>
</h4>
<br/>
<h4>Changes (3)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{info}These instructions explain how to build Asterisk SCF on a *fresh* Solaris 10 9/10 installation (Entire Distribution).{info} <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;">{info}These instructions explain how to build Asterisk SCF on a *fresh* Solaris 10 9/10 installation (Entire Distribution). It is *highly* recommended that you have a swap file => 8GB.{info} <br></td></tr>
<tr><td class="diff-unchanged" >{note}The instructions currently only cover installing Asterisk SCF on SPARC platforms.{note} <br>h2.Software Requirements <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >cmake --build ./build <br>{noformat} <br></td></tr>
<tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>{note} <br>h2. Notes <br>If you receive the error message below while compiling, your system hasn't got enough swap space. It is *highly* recommended that you have a swap file => 8GB. On ZFS based systems, changing your swap file configuration is fairly easy to do. UFS formatted systems generally can not be grown without using DiskSuite - which is beyond the scope of this documentation. <br>{noformat} <br>ld: fatal: file /dev/zero: mmap anon failed: Not enough space <br>collect2: ld returned 1 exit status <br>gmake[3]: *** [serveramd] Error 1 <br>gmake[2]: *** [all] Error 1 <br>gmake[1]: *** [all] Error 1 <br>gmake: *** [all] Error 1 <br>{noformat} <br>h6. ZFS swap file resize <br>In the output below, blocks == free, so the swap device is not actually being used at the moment. If swap is not in use, you can safely remove the swap area. <br>{noformat} <br># swap -l <br>swapfile dev swaplo blocks free <br>/dev/zvol/dsk/rpool/swap 256,1 16 1048560 1048560 <br>{noformat} <br>To remove your swap file and create another: <br>{noformat} <br># swap -d /dev/zvol/dsk/rpool/swap <br># zfs set volsize=8G rpool/swap <br># swap -a /dev/zvol/dsk/rpool/swap <br>{noformat} <br>and finally, you'll want to make sure your changes have taken properly <br>{noformat} <br># swap -l <br>swapfile dev swaplo blocks free <br>/dev/zvol/dsk/rpool/swap 256,1 16 16777200 16777200 <br>{noformat} <br>{note} <br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>These instructions explain how to build Asterisk SCF on a <b>fresh</b> Solaris 10 9/10 installation (Entire Distribution). It is <b>highly</b> recommended that you have a swap file => 8GB.</td></tr></table></div>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>The instructions currently only cover installing Asterisk SCF on SPARC platforms.</td></tr></table></div>
<h2><a name="Building-Solaris-SoftwareRequirements"></a>Software Requirements</h2>
<ul>
        <li><b>SPARC specific</b>
        <ul>
                <li>Oracle GCC for Sun Systems 4.3.2</li>
        </ul>
        </li>
        <li><b>Common</b>
        <ul>
                <li>GNU coreutils</li>
                <li>git</li>
                <li>cmake</li>
                <li>LUA</li>
                <li>Boost libraries</li>
                <li>ZeroC Ice Third-Party-Sources</li>
        </ul>
        </li>
</ul>
<h2><a name="Building-Solaris-Installation"></a>Installation</h2>
<ul>
        <li><h6><a name="Building-Solaris-SPARCGCCforSunSystems4.3.2"></a>SPARC - GCC for Sun Systems 4.3.2</h6>
<p>The GCC components can be downloaded <a href="https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=GCC-4.3.2-G-F@CDS-CDS_SMI" class="external-link" rel="nofollow">here</a> (login / registration required). You'll need to download both GCC and the 'Sun Code Generator' components into your user directory.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
su root -c "mkdir /opt/gcc; chown -R <USERNAME DIR>:other /opt/gcc"
gunzip -c SUNWgccfss432.tar.gz | tar -xf /opt -
mkdir -p SUNW0scgfss/4.3.2
ln -s /opt/gcc/ SUNW0scgfss/4.3.2/prod
gunzip -c SUNW0scgfss432.tar.gz | tar -xf -
</pre>
</div></div>
<p>Double check that '/opt/gcc/lib/libgcc_s.so.1' and '/opt/gcc/lib/libstdc++.so.6.0.10' files have a byte count greater than zero. If they are zero bytes, you can copy news ones over like this:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
tar -xvf SUNWgccfss432.tar
mv gcc/lib/libgcc_s.so.1 /opt/gcc/lib/
mv gcc/lib/libstdc++.so.6.0.10 /opt/gcc/lib/
rm -rf gcc
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-Paths"></a>Paths</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>su root -c "vi /etc/default/su"
su root -c "vi /etc/default/login"
</pre>
</div></div>
<p>We'll need to edit the PATH and SUPATH environment variables in these two files to look like the ones in the example below. Once you've done this, you'll need to log out and log back in unless you update your path environment manually.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre># PATH sets the initial shell PATH variable
#
PATH=/opt/gcc/bin:/usr/local/bin:/usr/sfw/bin:/usr/bin:/opt/csw/bin:/usr/ccs/bin
# SUPATH sets the initial shell PATH variable for root
#
SUPATH=/opt/gcc/bin:/usr/local/bin:/usr/sfw/bin:/usr/bin:/usr/sbin:/opt/csw/bin:/usr/ccs/bin
</pre>
</div></div>
<p>Now, we need to update our ld library paths.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>su root -c "crle -c /var/ld/ld.config -l /lib:/usr/lib:/opt/gcc/lib:/usr/local/lib:/opt/csw/lib:/usr/sfw/lib:/opt/gcc/lib/sys:/opt/Ice-3.4.1/lib"
su root -c "crle -64 -c /var/ld/64/ld.config -l /lib/64:/usr/lib/64:/opt/gcc/lib/sparcv9:/opt/csw/lib/sparcv9:/usr/sfw/lib/sparcv9:/opt/gcc/lib/sys:/usr/sfw/lib/64:/opt/Ice-3.4.1/lib64"
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-git"></a>git</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
wget http://www.kernel.org/pub/software/scm/git/git-1.7.4.tar.gz
gunzip -c git-1.7.4.tar.gz | tar -xf -
cd git-1.7.4
./configure
gmake NO_TCLTK=1
su root -c "gmake NO_TCLTK=1 install"
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-cmake"></a>cmake</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
wget http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz
gunzip -c cmake-2.8.3.tar.gz | /bin/tar xf -
cd cmake-2.8.3
./bootstrap
gmake
su root -c "gmake install"
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-LUA"></a>LUA</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
gunzip -c lua-5.1.4.tar.gz | tar xf -
cd lua-5.1.4
</pre>
</div></div>
<p>We need to edit the makefile as the default 'install' in Solaris does not support the '-p' option, we'll comment that section out and un-comment the 'cp' section (starting at line 23). Your makefile should look like this:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre># How to install. If your install program does not support "-p", then you
# may have to run ranlib on the installed liblua.a (do "make ranlib").
#INSTALL= install -p
#INSTALL_EXEC= $(INSTALL) -m 0755
#INSTALL_DATA= $(INSTALL) -m 0644
#
# If you don't have install you can use cp instead.
INSTALL= cp -p
INSTALL_EXEC= $(INSTALL)
INSTALL_DATA= $(INSTALL)
</pre>
</div></div>
<p>Next, we'll build and install LUA.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>gmake solaris install
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-Boost"></a>Boost</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
wget http://cdnetworks-us-2.dl.sourceforge.net/project/boost/boost/1.44.0/boost_1_44_0.tar.gz
gunzip -c boost_1_44_0.tar.gz | tar xf -
cd boost_1_44_0
./bootstrap.sh
./bjam --with-thread
su root -c "./bjam install"
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-ZeroCIceThirdPartySources"></a>ZeroC Ice - Third Party Sources</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
wget http://www.zeroc.com/download/Ice/3.4/ThirdParty-Sources-3.4.1.tar.gz
gunzip -c ThirdParty-Sources-3.4.1.tar.gz | /bin/tar xf -
cd ThirdParty-Sources-3.4.1
for x in *.tar.gz; do gzcat $x | tar -xvf -; done
cd db-4.8.30.NC/build_unix
../dist/configure --enable-cxx
gmake
su root -c "gmake install"
cd ../../mcpp-2.7.2
gpatch -p0 < ../mcpp/patch.mcpp.2.7.2
./configure CFLAGS=-fPIC --enable-mcpplib --disable-shared
gmake
su root -c "gmake install"
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-Digium%27sIceDistribution"></a>Digium's Ice Distribution</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
git clone git://git.asterisk.org/asterisk-scf/release/ice
cd ~/ice/cpp
gmake MCPP_HOME=/usr/local EXPAT_HOME=/usr/sfw OPENSSL_HOME=/usr/sfw DB_HOME=/usr/local/BerkeleyDB.4.8
su root -c "gmake install"
cd ../py
gmake
su root -c "gmake install"
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-SliceTranslatorPlugins"></a>Slice Translator Plugins</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>git clone git://git.asterisk.org/asterisk-scf/release/slice-plugins
cd slice-plugins
cmake .
gmake
su root -c "gmake install"
cd ..
</pre>
</div></div></li>
        <li><h6><a name="Building-Solaris-AsteriskSCF"></a>Asterisk SCF</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd
git clone git://git.asterisk.org/asterisk-scf/integration/gitall
cd gitall
./gitall-asterisk-scf.sh
./cmake/init-cmake.sh
cmake --build ./build
</pre>
</div></div></li>
</ul>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><h2><a name="Building-Solaris-Notes"></a>Notes</h2>
<p>If you receive the error message below while compiling, your system hasn't got enough swap space. It is <b>highly</b> recommended that you have a swap file => 8GB. On ZFS based systems, changing your swap file configuration is fairly easy to do. UFS formatted systems generally can not be grown without using DiskSuite - which is beyond the scope of this documentation. </p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>ld: fatal: file /dev/zero: mmap anon failed: Not enough space
collect2: ld returned 1 exit status
gmake[3]: *** [serveramd] Error 1
gmake[2]: *** [all] Error 1
gmake[1]: *** [all] Error 1
gmake: *** [all] Error 1
</pre>
</div></div>
<h6><a name="Building-Solaris-ZFSswapfileresize"></a>ZFS swap file resize</h6>
<p>In the output below, blocks == free, so the swap device is not actually being used at the moment. If swap is not in use, you can safely remove the swap area.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre># swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 256,1 16 1048560 1048560
</pre>
</div></div>
<p>To remove your swap file and create another:</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre># swap -d /dev/zvol/dsk/rpool/swap
# zfs set volsize=8G rpool/swap
# swap -a /dev/zvol/dsk/rpool/swap
</pre>
</div></div>
<p>and finally, you'll want to make sure your changes have taken properly</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre># swap -l
swapfile dev swaplo blocks free
/dev/zvol/dsk/rpool/swap 256,1 16 16777200 16777200
</pre>
</div></div></td></tr></table></div>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;">
<a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Solaris">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=6980010&revisedVersion=35&originalVersion=34">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Solaris?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>