# Cannot find zlib when building libxml2 on Windows using BinaryBuilder.jl

**URL:** <https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [January 22, 2018, 10:37am UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519 "2018-01-22T10:37:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [January 22, 2018, 10:37am UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/1 "2018-01-22T10:37:29Z")

</div>

Hi,

I’m trying to build libxml2 for various platforms using BinaryBuilder.jl. This works very well on Ubuntu 16.04, which is on VirtualBox or on TravisCI. However, when building libxml2, I found Windows failed to find libz, which is required to read gzipped XML files. This happens only on Windows, not on either Linux or macOS.

This is the log ([Travis CI - Test and Deploy Your Code with Confidence](https://travis-ci.org/bicycle1885/XML2Builder/jobs/331711593#L8985), around line 8985):

```julia
...
[09:20:10] Checking zlib
[09:20:10] checking for Z... no
[09:20:10] checking zlib.h usability... no
[09:20:10] checking zlib.h presence... no
[09:20:10] checking for zlib.h... no
...

```

I think this is because configuration options passed to `configure` is wrong ([https://github.com/bicycle1885/XML2Builder/blob/0e19e58cfcdfb27e3f3eb67e7b6e2f40f67c0529/build\_tarballs.jl#L33-L41](https://github.com/bicycle1885/XML2Builder/blob/0e19e58cfcdfb27e3f3eb67e7b6e2f40f67c0529/build_tarballs.jl#L33-L41)):

```julia
cd $WORKSPACE/srcdir
cd zlib-1.2.11/
./configure --prefix=/
make
make install
cd ../libxml2-2.9.7/
./configure --prefix=/ --host=$target --without-python --with-zlib=$(pwd)/../../destdir
make
make install

```

These options are the same on all platforms but I guess special consideration is needed on Windows. I have no clue to fix that since I don’t have access to Windows machines.

Any suggestions are welcome. I can try on my virtual machine if you could give me some hint.

---

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [January 22, 2018, 1:08pm UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/2 "2018-01-22T13:08:10Z")

</div>

I may have found the reason. Actually, zlib building has failed due to some missing options. I found this script ([https://github.com/staticfloat/ZlibBuilder/blob/a7d713f2897fcca95fe958194b19452da79dcb2e/build\_tarballs.jl#L40](https://github.com/staticfloat/ZlibBuilder/blob/a7d713f2897fcca95fe958194b19452da79dcb2e/build_tarballs.jl#L40)) and noticed `LDSHAREDLIBC=''` is important.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [January 22, 2018, 4:28pm UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/3 "2018-01-22T16:28:29Z")

</div>

I think the idea in a case like this is that you have one Builder repo for zlib, and then another one for libxml2 that imports the results from the zlib Builder. In theory that is supposed to work, if you need help, I would ask on the bindeps2 channel on slack.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 22, 2018, 4:40pm UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/4 "2018-01-22T16:40:08Z")

</div>

> [@davidanthoff](#):
>
> I think the idea in a case like this is that you have one Builder repo for zlib, and then another one for libxml2 that imports the results from the zlib Builder. In theory that is supposed to work, if you need help, I would ask on the bindeps2 channel on slack.

Is there an example showing how to do this yet though? We want to do this with OpenBLAS for Sundials, and this has been mentioned as possible, but I still haven’t seen it done anywhere.

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [January 22, 2018, 4:42pm UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/5 "2018-01-22T16:42:00Z")

</div>

> [@ChrisRackauckas](#):
>
> Is there an example showing how to do this yet though?

I looked for one as well but didn’t find it… I think one is supposed to somehow paste the URL of a `build.jl` file at some point in the wizard, but it is all a bit unclear to me.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 22, 2018, 4:47pm UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/6 "2018-01-22T16:47:50Z")

</div>

Can @staticfloat chime in here?

---

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [January 22, 2018, 5:02pm UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/7 "2018-01-22T17:02:39Z")

</div>

I considered that but I didn’t because I’m not sure about a way to do that. If we find the way, I will do . I didn’t know that Slack channel, thank you for your information.

---

<div class="post-metadata">

**Author:** ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)\
**Post date:** [January 27, 2018, 11:25am UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/8 "2018-01-27T11:25:40Z")

</div>

Did you find a solution?

---

<div class="post-metadata">

**Author:** ![bicycle1885](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bicycle1885/32/107_2.png) [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Post date:** [January 27, 2018, 3:53pm UTC](https://discourse.julialang.org/t/cannot-find-zlib-when-building-libxml2-on-windows-using-binarybuilder-jl/8519/9 "2018-01-27T15:53:47Z")

</div>

Solution to the original question? If so, I’ve answered it by myself (see the second post). If you mean dependencies between binary builds (e.g. zlib and libxml2), it is still an open question.
