[libvirt] Works: libvirt client on OS X 10.5.6

Getting libvirt-0.6.3 (client) to compile on OS X - Use MacPorts to install gnutls (and its several dependencies) - Set environment variables: export LDFLAGS="-L/opt/local/lib" export CPPFLAGS="-I/opt/local/include" export MACOSX_DEPLOYMENT_TARGET=10.4 - Configure --prefix=/opt/libvirt/ --without-sasl --without-avahi --without-polkit --without-python --without-xen --without-qemu --without-lxc --without- openvz --without-libvirtd --without-uml - Apply patches src/pci.c #ifndef MODPROBE #define MODPROBE 0 #endif src/virsh.c:5665 if (command_ret != 0 /* WEXITSTATUS (0) */) { - Compile The MACOSX_DEPLOYMENT_TARGET variable is very important, otherwise you will get symbol errors when linking. -- -a "Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts." -- L. Stein

Getting libvirt-java 0.2.1 to compile on OS X - Set environment variables LIBVIRT_CFLAGS=-I/opt/libvirt-0.6.3/include LIBVIRT_LIBS=-L/opt/libvirt-0.6.3/lib - Configure ./configure --prefix=/opt/libvirt-java-0.2.1 --with-java-home=$JAVA_HOME - Compile -- -a "Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts." -- L. Stein On May 7, 2009, at 11:50 PM, Schley Andrew Kutz wrote:
Getting libvirt-0.6.3 (client) to compile on OS X
- Use MacPorts to install gnutls (and its several dependencies)
- Set environment variables:
export LDFLAGS="-L/opt/local/lib" export CPPFLAGS="-I/opt/local/include" export MACOSX_DEPLOYMENT_TARGET=10.4
- Configure
--prefix=/opt/libvirt/ --without-sasl --without-avahi --without- polkit --without-python --without-xen --without-qemu --without-lxc -- without-openvz --without-libvirtd --without-uml
- Apply patches
src/pci.c
#ifndef MODPROBE #define MODPROBE 0 #endif
src/virsh.c:5665
if (command_ret != 0 /* WEXITSTATUS (0) */) {
- Compile
The MACOSX_DEPLOYMENT_TARGET variable is very important, otherwise you will get symbol errors when linking.
-- -a
"Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts." -- L. Stein

On Thu, May 07, 2009 at 11:50:25PM -0500, Schley Andrew Kutz wrote:
Getting libvirt-0.6.3 (client) to compile on OS X
- Use MacPorts to install gnutls (and its several dependencies)
- Set environment variables:
export LDFLAGS="-L/opt/local/lib" export CPPFLAGS="-I/opt/local/include" export MACOSX_DEPLOYMENT_TARGET=10.4
- Configure
--prefix=/opt/libvirt/ --without-sasl --without-avahi --without-polkit --without-python --without-xen --without-qemu --without-lxc --without- openvz --without-libvirtd --without-uml
- Apply patches
src/pci.c
#ifndef MODPROBE #define MODPROBE 0 #endif
src/virsh.c:5665
if (command_ret != 0 /* WEXITSTATUS (0) */) {
That's great - we can easily fix these 2 bugs.
- Compile
The MACOSX_DEPLOYMENT_TARGET variable is very important, otherwise you will get symbol errors when linking.
We currently have a patch on the website describing how to build for Windows http://libvirt.org/windows.html I think it'd be great to get an equivalent page for OS-X, if you'd like to document your process formally. Just create a new .html.in file in the docs/ directory, and add it to docs/sitemap.html.in too. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Happy to do it, I just need permission to put a file there. Additionally, you can grab the binaries at http://files.lostcreations.com/libvirt-0.6.3-bin.tar.gz and http://files.lostcreations.com/libvirt-java-0.2.1-bin.tar.gz. Both archives belong in /opt. They will decompress to libvirt-0.6.3 and libvirt-java-0.2.1 respectively. The latter depends on the former's location. Additionally, the libvirt binaries depend on gnutls and all of its dependencies existing in /opt/local (the default MacPorts root location). -- -a "Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts." -- L. Stein On May 8, 2009, at 4:41 AM, Daniel P. Berrange wrote:
On Thu, May 07, 2009 at 11:50:25PM -0500, Schley Andrew Kutz wrote:
Getting libvirt-0.6.3 (client) to compile on OS X
- Use MacPorts to install gnutls (and its several dependencies)
- Set environment variables:
export LDFLAGS="-L/opt/local/lib" export CPPFLAGS="-I/opt/local/include" export MACOSX_DEPLOYMENT_TARGET=10.4
- Configure
--prefix=/opt/libvirt/ --without-sasl --without-avahi --without- polkit --without-python --without-xen --without-qemu --without-lxc -- without- openvz --without-libvirtd --without-uml
- Apply patches
src/pci.c
#ifndef MODPROBE #define MODPROBE 0 #endif
src/virsh.c:5665
if (command_ret != 0 /* WEXITSTATUS (0) */) {
That's great - we can easily fix these 2 bugs.
- Compile
The MACOSX_DEPLOYMENT_TARGET variable is very important, otherwise you will get symbol errors when linking.
We currently have a patch on the website describing how to build for Windows
http://libvirt.org/windows.html
I think it'd be great to get an equivalent page for OS-X, if you'd like to document your process formally. Just create a new .html.in file in the docs/ directory, and add it to docs/sitemap.html.in too.
Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, May 08, 2009 at 08:19:40AM -0500, Schley Andrew Kutz wrote:
Happy to do it, I just need permission to put a file there. Additionally, you can grab the binaries at http://files.lostcreations.com/libvirt-0.6.3-bin.tar.gz and http://files.lostcreations.com/libvirt-java-0.2.1-bin.tar.gz. Both archives belong in /opt. They will decompress to libvirt-0.6.3 and libvirt-java-0.2.1 respectively. The latter depends on the former's location. Additionally, the libvirt binaries depend on gnutls and all of its dependencies existing in /opt/local (the default MacPorts root location).
Okidoc, I have mirrored those 2 at ftp://libvirt.org/libvirt/osx/ I guess the best way if you want to maintain OS X builds is to create a specific subdir on the HTTP server (or even better FTP) that you can populate with updates, and I can mirror them for example twice a day. Just tell me where you end up creating the repository !
On Thu, May 07, 2009 at 11:50:25PM -0500, Schley Andrew Kutz wrote:
Getting libvirt-0.6.3 (client) to compile on OS X
- Use MacPorts to install gnutls (and its several dependencies)
- Set environment variables:
export LDFLAGS="-L/opt/local/lib" export CPPFLAGS="-I/opt/local/include" export MACOSX_DEPLOYMENT_TARGET=10.4
Hum ...
- Configure
--prefix=/opt/libvirt/ --without-sasl --without-avahi --without- polkit --without-python --without-xen --without-qemu --without-lxc -- without- openvz --without-libvirtd --without-uml
- Apply patches
src/pci.c
#ifndef MODPROBE #define MODPROBE 0 #endif
Actually one really expect a string, so I just defined it to "modprobe" instead.
src/virsh.c:5665
if (command_ret != 0 /* WEXITSTATUS (0) */) {
That's bizarre ... WEXITSTATUS is defined in virsh.c: #ifndef WEXITSTATUS # define WEXITSTATUS(x) ((x) & 0xff) #endif it's used only once at the place you pointed out: if (command_ret != WEXITSTATUS (0)) { I think it was used for cygwin portability, but in that case I would have expected if (WEXITSTATUS(command_ret) != 0) { Why did this break on OS-X ?
That's great - we can easily fix these 2 bugs.
- Compile
The MACOSX_DEPLOYMENT_TARGET variable is very important, otherwise you will get symbol errors when linking.
What about detecting MACOSX_DEPLOYMENT_TARGET, because I assume it will change from one environment to another, do this in configure.in and export is in all Makefiles.am ? There must be a way to export the env variable from the generated Makefiles surely... Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

I will create a specific sub-dir and let you know. -- -a "Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts." -- L. Stein On May 20, 2009, at 3:20 AM, Daniel Veillard wrote:
On Fri, May 08, 2009 at 08:19:40AM -0500, Schley Andrew Kutz wrote:
Happy to do it, I just need permission to put a file there. Additionally, you can grab the binaries at http://files.lostcreations.com/libvirt-0.6.3-bin.tar.gz and http://files.lostcreations.com/libvirt-java-0.2.1-bin.tar.gz. Both archives belong in /opt. They will decompress to libvirt-0.6.3 and libvirt-java-0.2.1 respectively. The latter depends on the former's location. Additionally, the libvirt binaries depend on gnutls and all of its dependencies existing in /opt/local (the default MacPorts root location).
Okidoc, I have mirrored those 2 at ftp://libvirt.org/libvirt/osx/
I guess the best way if you want to maintain OS X builds is to create a specific subdir on the HTTP server (or even better FTP) that you can populate with updates, and I can mirror them for example twice a day. Just tell me where you end up creating the repository !
On Thu, May 07, 2009 at 11:50:25PM -0500, Schley Andrew Kutz wrote:
Getting libvirt-0.6.3 (client) to compile on OS X
- Use MacPorts to install gnutls (and its several dependencies)
- Set environment variables:
export LDFLAGS="-L/opt/local/lib" export CPPFLAGS="-I/opt/local/include" export MACOSX_DEPLOYMENT_TARGET=10.4
Hum ...
- Configure
--prefix=/opt/libvirt/ --without-sasl --without-avahi --without- polkit --without-python --without-xen --without-qemu --without-lxc -- without- openvz --without-libvirtd --without-uml
- Apply patches
src/pci.c
#ifndef MODPROBE #define MODPROBE 0 #endif
Actually one really expect a string, so I just defined it to "modprobe" instead.
src/virsh.c:5665
if (command_ret != 0 /* WEXITSTATUS (0) */) {
That's bizarre ...
WEXITSTATUS is defined in virsh.c:
#ifndef WEXITSTATUS # define WEXITSTATUS(x) ((x) & 0xff) #endif
it's used only once at the place you pointed out:
if (command_ret != WEXITSTATUS (0)) {
I think it was used for cygwin portability, but in that case I would have expected
if (WEXITSTATUS(command_ret) != 0) {
Why did this break on OS-X ?
That's great - we can easily fix these 2 bugs.
- Compile
The MACOSX_DEPLOYMENT_TARGET variable is very important, otherwise you will get symbol errors when linking.
What about detecting MACOSX_DEPLOYMENT_TARGET, because I assume it will change from one environment to another, do this in configure.in and export is in all Makefiles.am ? There must be a way to export the env variable from the generated Makefiles surely...
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Wed, May 20, 2009 at 07:40:43AM -0500, Schley Andrew Kutz wrote:
I will create a specific sub-dir and let you know.
okay thanks, any feedback on the two other issues ?
On Thu, May 07, 2009 at 11:50:25PM -0500, Schley Andrew Kutz wrote:
- Set environment variables:
export LDFLAGS="-L/opt/local/lib" export CPPFLAGS="-I/opt/local/include" export MACOSX_DEPLOYMENT_TARGET=10.4 src/virsh.c:5665 [...]
if (command_ret != 0 /* WEXITSTATUS (0) */) {
That's bizarre ...
WEXITSTATUS is defined in virsh.c:
#ifndef WEXITSTATUS # define WEXITSTATUS(x) ((x) & 0xff) #endif
it's used only once at the place you pointed out:
if (command_ret != WEXITSTATUS (0)) {
I think it was used for cygwin portability, but in that case I would have expected
if (WEXITSTATUS(command_ret) != 0) {
Why did this break on OS-X ?
Any idea about this ?
That's great - we can easily fix these 2 bugs.
- Compile
The MACOSX_DEPLOYMENT_TARGET variable is very important, otherwise you will get symbol errors when linking.
What about detecting MACOSX_DEPLOYMENT_TARGET, because I assume it will change from one environment to another, do this in configure.in and export is in all Makefiles.am ? There must be a way to export the env variable from the generated Makefiles surely...
and this ? Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

I didn't see your earlier response on those. As for WEXITSTATUS I have no idea why it broke, but as it always compared it to Zero anyway, I just short circuited the evaluation. The MACOSX_DEPLOYMENT_TARGET is a different kind of issue. The libraries that libvirt links to, gnutls and its dependencies, are apparently hard-wired to use OS X 10.4, which doesn't define the symbol UNX2003. When I compile libvirt manually, it is linking to 10.5, and because of this, it expects itself and its dependencies to know about UNX2003 -- which they don't. So I built libvirt at a 10.4 level instead of 10.5 rather than build all of its dependencies by hand (MacPorts is sort of like apt-get or yum -- except it allows OS X devs to easily install Unix tools on their Macs). -- -a "Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts." -- L. Stein On May 20, 2009, at 7:55 AM, Daniel Veillard wrote:
On Wed, May 20, 2009 at 07:40:43AM -0500, Schley Andrew Kutz wrote:
I will create a specific sub-dir and let you know.
okay thanks, any feedback on the two other issues ?
On Thu, May 07, 2009 at 11:50:25PM -0500, Schley Andrew Kutz wrote:
- Set environment variables:
export LDFLAGS="-L/opt/local/lib" export CPPFLAGS="-I/opt/local/include" export MACOSX_DEPLOYMENT_TARGET=10.4 src/virsh.c:5665 [...]
if (command_ret != 0 /* WEXITSTATUS (0) */) {
That's bizarre ...
WEXITSTATUS is defined in virsh.c:
#ifndef WEXITSTATUS # define WEXITSTATUS(x) ((x) & 0xff) #endif
it's used only once at the place you pointed out:
if (command_ret != WEXITSTATUS (0)) {
I think it was used for cygwin portability, but in that case I would have expected
if (WEXITSTATUS(command_ret) != 0) {
Why did this break on OS-X ?
Any idea about this ?
That's great - we can easily fix these 2 bugs.
- Compile
The MACOSX_DEPLOYMENT_TARGET variable is very important, otherwise you will get symbol errors when linking.
What about detecting MACOSX_DEPLOYMENT_TARGET, because I assume it will change from one environment to another, do this in configure.in and export is in all Makefiles.am ? There must be a way to export the env variable from the generated Makefiles surely...
and this ?
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Schley Andrew Kutz