# boost-iostreams from ports with zlib support



## NuLL3rr0r (Jul 20, 2013)

According to the Boost documentation, zlib should be found automatically when you are building Boost if it's available on *NIX systems.



> The zlib Filters depend on the third-party zlib library, which is not included in the Boost distribution. Prebuilt zlib binaries are available on most UNIX and UNIX-like systems, and will be found automatically by the Boost build system. Windows users can obtain prebuilt binaries at the zlib homepage. Users can also configure the Boost Iostream library to build zlib from the source code, which is available at the zlib homepage. For details on configuring the build system to find your zlib installation, please see Installation.



I found zlib binaries and headers in the base system. So, I expect Boost to find the zlib and build zlib filters for being used with boost::iostreams. But, after building boost from ports there is no /usr/local/lib/libboost_zlib.*.

And this CMake command which works on other platforms, fails to find the library and its header.

```
FIND_PACKAGE (Boost 1.52.0
    COMPONENTS
        date_time filesystem iostreams system thread zlib
    )
```


```
CMake Error at /usr/local/share/cmake/Modules/FindBoost.cmake:1192 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.52.0

  Boost include path: /usr/local/include

  The following Boost libraries could not be found:

          boost_zlib

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  dependencies.cmake:21 (FIND_PACKAGE)
  CMakeLists.txt:178 (INCLUDE)
```

So, my question is how to build Boost from ports with zlib support?


----------

