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

question
package

#1

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 (https://travis-ci.org/bicycle1885/XML2Builder/jobs/331711593#L8985, around line 8985):

...
[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):

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.


#2

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) and noticed LDSHAREDLIBC='' is important.


#3

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.


#4

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.


#5

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.


#6

Can @staticfloat chime in here?


#7

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.


#8

Did you find a solution?


#9

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.