1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
<!DOCTYPE html>
<html>
<head>
<link rel=stylesheet href=style.css />
<link rel=icon href=CZI-new-logo.png />
</head>
<body>
<main>
<div class="goto-index"><a href="index.html">Table of contents</a></div>
<h1>Building the code from source</h1>
<h2>When is it necessary to build from source?</h2>
<p>
In most cases, you can directly run a Shasta static executable
from a release build
downloaded from one of the release pages,
<a href='https://github.com/chanzuckerberg/shasta/releases'>chanzuckerberg/shasta/releases</a>
for releases up to 0.10.0
or
<a href='https://github.com/paoloshasta/shasta/releases'>paoloshasta/shasta/releases</a>
for newer relesases.
These static executables are portable to almost any version of Linux currently in use.
See the <a href="QuickStart.html">quick start</a> page for more information.
You need to build from source in one of the
following circumstances:
<ul>
<li>
To build a version of Shasta for which no release exists.
For example, if you want to get a recently added feature
not available in the most recent release build.
For this specific use case, it might be easiest to instead download a
Shasta test build from GitHub, as described
<a href="#DownloadTestBuild">below</a>.
<li>
To test, develop, or debug Shasta code.
<li>
To port the Shasta build to a different platform.
</ul>
<h2>How to build from source</h2>
<h3>Build platforms</h3>
<p>
We currently support building from source on the following platforms:
<ul>
<li>Ubuntu 22.04 for Intel/AMD processors.
The Shasta static executable created by this build has no dependencies
(and therefore requires no installation) and runs on most current
64-bit Linux platforms that use kernel version 3.2.0 or newer.
<li>Ubuntu 22.04 for ARM processors
(for example, AWS Graviton/Graviton2/Graviton3 processors running Ubuntu,
Raspberry Pi).
</ul>
<p>
Shasta no longer builds on Ubuntu 20.04 or on any version of macOS.
<h3>Build commands</h3>
<ol>
<li>Check out the Shasta repository (you need to have <code>git</code> installed on your machine)
<pre>
git clone https://github.com/paoloshasta/shasta.git
</pre>
<li>Install <a href="Prerequisites.html">prerequisite packages</a>
<pre>
sudo shasta/scripts/InstallPrerequisites-Ubuntu.sh
</pre>
<li>Build
<pre>
mkdir shasta-build
cd shasta-build
cmake ../shasta
make all -j
make install
</pre>
<h3>Build contents</h3>
<p>
The build process described above creates in the <code>shasta-build</code> directory
a <code>shasta-install</code> directory that
contains the following:
<ul>
<li>A <code>bin</code> directory containing the Shasta static executable,
named <code>shasta</code>, Shasta shared library
<code>shasta.so</code>, and several scripts.
The static executable is highly portable to other Linux versions.
<li>A <code>conf</code> directory containing sample config files.
<li>A <code>docs</code> directory containing this and other documentation.
</ul>
<h3>Building smaller binaries</h3>
<p>
If you don't plan to use your build for debugging, you
can use command <code>make install/strip</code>
instead of <code>make install</code> as the last
step of the build process.
This will strip debug symbols from the Shasta executable and shared library, which significantly reduces
the size of the
build directory.
<h2 id="DownloadTestBuild">An alternative to building from source: downloading a test build</h2>
<p>
Shasta uses
<a href='https://help.github.com/en/articles/about-github-actions'>GitHub Actions</a>
to perform a test build every time a push to the repository occurs.
The main goal of these builds is to test that new code continues to build
on all supported platforms,
but the builds are accessible to all users for download
for 90 days after their creation.
The test builds are generally not as reliable as
release builds and can sometimes be non-functional.
With this in mind, you can use the following steps to download one of these test builds:
<ul>
<li>Make sure to be logged in to GitHub. Any user will work, but GitHub
will not allow downloading a test build anonymously.
<li>Go to the
<a href='https://github.com/paoloshasta/shasta/actions'>GitHub Actions</a>
page of the Shasta repository.
<li>Choose a build that has green checkmark and click on it.
The checkmark indicates that a push occurred at that commit,
followed by a successful test build.
<li>Scroll down to the <i>Artifacts</i> section
and select what you want to download.
Your browser will then download the file you selected as zipped.
You can use the <code>unzip</code>
command, or equivalent, to unzip it.
After unzipping it, if it is an executable. Before running it, you will have to set its execute permission bit
via <code>chmod ugo+x filename</code>.
</ul>
<div class="goto-index"><a href="index.html">Table of contents</a></div>
</main>
</body>
</html>
|