title: Does Ubuntu 18.04 boost include lzma support?
body: <p>I have a piece of C++ software that uses a bzip2 decompressor on a boost::iostreams::filtering_istreambuf. This works well.</p>
  
  <p>I now tried to change it to also support lzma decompression. The corresponding include file seems to be there in my ubuntu 18.04 installation:</p>
  
  <pre><code>$ ls -al /usr/include/boost/iostreams/filter/
  -rw-r--r-- 1 root root 13199 Mar  6  2018 bzip2.hpp
  -rw-r--r-- 1 root root 24804 Mar  6  2018 gzip.hpp
  -rw-r--r-- 1 root root 12157 Mar  6  2018 lzma.hpp
  -rw-r--r-- 1 root root 14650 Mar  6  2018 zlib.hpp
  (shortened)
  </code></pre>
  
  <p>However, the code does not link, I get error messages as follows:</p>
  
  <pre><code>In function `boost::iostreams::detail::lzma_decompressor_impl&lt;std::allocator&lt;char&gt; &gt;::lzma_decompressor_impl()':
  test2.cpp:(.text._ZN5boost9iostreams6detail22lzma_decompressor_implISaIcEEC2Ev[_ZN5boost9iostreams6detail22lzma_decompressor_implISaIcEEC5Ev]+0x24): undefined reference to `boost::iostreams::detail::lzma_base::lzma_base()'
  (etc)
  </code></pre>
  
  <p>I now wonder whether the shipped boost library was built without lzma support (but then why is there an lzma include file?). More generally, I wonder whether (and how) I can check the build options that were used for the boost library that was shipped.</p>
  
  <p>I understand I can built my boost library from scratch, but would only do this if I really need to.</p>
  
  <p>Update: My code is more complex, but below is a minimum example essentially <a href="https://stackoverflow.com/questions/50071513/c-boost-and-lzma-decompression/50071843#50071843">taken from here</a> that demonstrates the problem:</p>
  
  <p>This works:</p>
  
  <pre><code>#include &lt;boost/iostreams/copy.hpp&gt;
  #include &lt;boost/iostreams/filter/bzip2.hpp&gt;
  #include &lt;boost/iostreams/filtering_stream.hpp&gt;
  #include &lt;fstream&gt;
  #include &lt;iostream&gt;
  
  namespace io = boost::iostreams;
  
  void foo(std::string input_file_path, std::string output_file_path) {
      namespace io = boost::iostreams;
  
      std::ifstream file(input_file_path, std::ios::binary);
      std::ofstream out(output_file_path, std::ios::binary);
  
      boost::iostreams::filtering_istreambuf in;
      in.push(io::bzip2_decompressor());
      in.push(file);
  
      io::copy(in, out);
  }
  
  int main() {
      foo("test.cpp.bz2", "output.txt");
  }
  </code></pre>
  
  <p>This does not compile (with <code>g++ test.cpp -lboost_iostreams</code>):</p>
  
  <pre><code>#include &lt;boost/iostreams/copy.hpp&gt;
  #include &lt;boost/iostreams/filter/lzma.hpp&gt;
  #include &lt;boost/iostreams/filtering_stream.hpp&gt;
  #include &lt;fstream&gt;
  #include &lt;iostream&gt;
  
  namespace io = boost::iostreams;
  
  void foo(std::string input_file_path, std::string output_file_path) {
      namespace io = boost::iostreams;
  
      std::ifstream file(input_file_path, std::ios::binary);
      std::ofstream out(output_file_path, std::ios::binary);
  
      boost::iostreams::filtering_istreambuf in;
      in.push(io::lzma_decompressor());
      in.push(file);
  
      io::copy(in, out);
  }
  
  int main() {
      foo("test.cpp.lzma", "output.txt");
  }
  </code></pre>