<p>Manually editing makefiles is just... ugh. Save yourself the effort and use conda:</p>
<pre><code>conda create -n shapeit
conda install -c bioconda shapeit4 -n shapeit
</code></pre>

CC BY-SA 4.0
2022-12-09T23:29:44.217Z
2022-12-09T23:29:44.217Z
user438383
<p>Actually, precompiled SHAPEIT 4.2.2 is available in <a href="https://launchpad.net/ubuntu/+source/shapeit4" rel="nofollow noreferrer">a Ubuntu repository</a>.</p>
<pre><code>sudo apt install shapeit4
</code></pre>

CC BY-SA 4.0
2023-02-17T02:16:03.533Z
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Community
CC BY-SA 4.0
2023-02-17T02:03:07.523Z
2023-02-17T12:19:41.890Z
2023-02-17T12:19:41.890Z
Yeoman
<p>The documentation appears to be missing an edit one has to do. Open the <code>makefile</code> in the shapeit4 dir, and you will see something like (for version 4.2.2):</p>
<pre><code>#COMPILER MODE C++11
CXX=g++ -std=c++11

#HTSLIB LIBRARY [SPECIFY YOUR OWN PATHS]
HTSLIB_INC=<span class="math-container">$(HOME)/Tools/htslib-1.11
HTSLIB_LIB=$</span>(HOME)/Tools/htslib-1.11/libhts.a

#BOOST IOSTREAM &amp; PROGRAM_OPTION LIBRARIES [SPECIFY YOUR OWN PATHS]
BOOST_INC=/usr/include
BOOST_LIB_IO=/usr/lib/x86_64-linux-gnu/libboost_iostreams.a
BOOST_LIB_PO=/usr/lib/x86_64-linux-gnu/libboost_program_options.a
</code></pre>
<p>So the paths appear to be hardcoded. Set these to the paths where you installed htslib (and compile it first).</p>
<p>For libboost, I found that its own installer doesn't place files in this expected location. So you can either change these paths to where you installed libboost, or you can use the apt manager version which will put the files in the right location by default. This is done with <code>sudo apt-get install libboost-all-dev</code> (<a href="https://stackoverflow.com/questions/24173330/cmake-is-not-able-to-find-boost-libraries">found here</a>).</p>
<p>After this, just run the <code>make</code> file again, and the output should looks like this:</p>
<pre><code>user@computer:/dir/shapeit4-4.2.2$ make
make: Nothing to be done for 'all'.
</code></pre>

CC BY-SA 4.0
2022-12-09T22:13:55.740Z
2022-12-09T22:13:55.740Z
CoderGuy123
<p>I'm having trouble install shapeit4 4.2.2 on my new Mint 21 installation (Ubuntu 22.04 LTS). <a href="https://odelaneau.github.io/shapeit4/#installation" rel="nofollow noreferrer">According to the official docs</a>, the requirements are:</p>
<ul>
<li>HTSlib: A great C library for reading/writing high-throughput sequencing data.</li>
<li>BOOST: A free peer-reviewed portable C++ source libraries. SHAPEIT4 uses two specific BOOST libraries: iostreams and program_options.</li>
</ul>
<p>I installed <a href="http://www.htslib.org/download/" rel="nofollow noreferrer">HTSlib</a> with <code>make</code> and <code>sudo make install</code>, and libboost using its calls <code>./bootstrap</code> and <code>./b2</code> but I still get errors when trying to run the <code>make</code> file for shapeit4:</p>
<pre><code>/usr/bin/ld: cannot find /home/user/Tools/htslib-1.11/libhts.a: No such file or directory
/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libboost_iostreams.a: No such file or directory
/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libboost_program_options.a: No such file or directory
</code></pre>

<software-installation><phasing>
How do I install shapeit4 on Ubuntu/Mint?
# How do I install shapeit4 on Ubuntu/Mint?

(Asked by: username_0 on 2022-12-09)

I'm having trouble install shapeit4 4.2.2 on my new Mint 21 installation (Ubuntu 22.04 LTS). According to the official docs, the requirements are:

HTSlib: A great C library for reading/writing high-throughput sequencing data.
BOOST: A free peer-reviewed portable C++ source libraries. SHAPEIT4 uses two specific BOOST libraries: iostreams and program_options.

I installed HTSlib with make and sudo make install, and libboost using its calls ./bootstrap and ./b2 but I still get errors when trying to run the make file for shapeit4:
/usr/bin/ld: cannot find /home/user/Tools/htslib-1.11/libhts.a: No such file or directory
/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libboost_iostreams.a: No such file or directory
/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libboost_program_options.a: No such file or directory

**Tags:** software-installation, phasing

---

## 3 answers

### Answer by username_1 on 2022-12-09. Score: 1

Manually editing makefiles is just... ugh. Save yourself the effort and use conda:
conda create -n shapeit
conda install -c bioconda shapeit4 -n shapeit


---

### Answer by username_2 on 2023-02-17. Score: 0

Actually, precompiled SHAPEIT 4.2.2 is available in a Ubuntu repository.
sudo apt install shapeit4

> **Comments:**
> **username_3**: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).  

---

### Answer by username_0 on 2022-12-09. Score: 0

The documentation appears to be missing an edit one has to do. Open the makefile in the shapeit4 dir, and you will see something like (for version 4.2.2):
#COMPILER MODE C++11
CXX=g++ -std=c++11

#HTSLIB LIBRARY [SPECIFY YOUR OWN PATHS]
HTSLIB_INC=$(HOME)/Tools/htslib-1.11
HTSLIB_LIB=$(HOME)/Tools/htslib-1.11/libhts.a

#BOOST IOSTREAM & PROGRAM_OPTION LIBRARIES [SPECIFY YOUR OWN PATHS]
BOOST_INC=/usr/include
BOOST_LIB_IO=/usr/lib/x86_64-linux-gnu/libboost_iostreams.a
BOOST_LIB_PO=/usr/lib/x86_64-linux-gnu/libboost_program_options.a

So the paths appear to be hardcoded. Set these to the paths where you installed htslib (and compile it first).
For libboost, I found that its own installer doesn't place files in this expected location. So you can either change these paths to where you installed libboost, or you can use the apt manager version which will put the files in the right location by default. This is done with sudo apt-get install libboost-all-dev (found here).
After this, just run the make file again, and the output should looks like this:
user@computer:/dir/shapeit4-4.2.2$ make
make: Nothing to be done for 'all'.


---

