[Vortex] Patches for building on Mac OS X

Francis Brosnan Blazquez francis at aspl.es
Tue Jun 26 10:32:03 CEST 2007


> Hello,

Hi Jens,

> I downloaded Vortex last night and have gotten it to work on Mac OS
> X.  
> It does _not_ build or run out of the box, although the home page
> says  
> OS X is supported. (Perhaps that claim is out of date?)

It is possible. At the time that claim was done, we were using glib and
gthread. We have recently removed that dependency, causing this with
great probability. 

We are working on create an automatic test to compile and run the
project at sourceforge compilation farms (they have a couple of Max OS
X).

> These are the issues I ran into:
> 
> * The 'configure' script aborts because pkg-config doesn't think AXL  
> is installed, even after I built it and installed it in /usr/local.
> I  
> don't know anything about pkg-config so I don't know what the cause
> of  
> this is. I was able to work around it by manually setting AXL_CFLAGS  
> and AXL_LIBS environment variables.

Ok. By default pkg-config uses PKG_CONFIG_PATH env to find its
configuration files. With your description, you must set your
environment variable to: 

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

Before running the configure script.

> * 'configure' sets the variable PTHREAD_CFLAGS to "none" in the  
> generated Makefile. That's right, the string "none". This causes gcc  
> to barf when that string is used as a parameter.

This is odd. I'll check this.

> * GCC complains about your prototype for unsetenv. The problem you  
> describe that your prototype is a workaround for may be
> Linux-specific.
> In file included from vortex.c:38:
> ./vortex.h:369: error: conflicting types for 'unsetenv'
> /usr/include/stdlib.h:245: error: previous declaration of 'unsetenv'  
> was here

It is possible. Maybe the best solution will be to make more restrictive
the #ifdef section, checkig if it is being run by a gcc compiler. I've
applied some changes but I'll have to check it. 

> At that point I gave up building with 'make' and switched to Apple's  
> Xcode IDE. I set up a project file with the right sources and build  
> settings. I was able to get it to build a dylib after making a few  
> modifications to Vortex files. (Strangely, the unsetenv error above  
> didn't occur when building in Xcode.) I defined a new preprocessor  
> symbol AXL_OS_DARWIN to #ifdef my changes with.

Ok.

> * In vortex_thread.c (around line 573) your workaround of
> redeclaring  
> 'struct timespec' doesn't work because "__time_t" is not defined. On  
> OS X/Darwin, the typedef is "time_t". In fact, the workaround isn't  
> necessary at all, as timespec is available. The problem you ran into  
> is probably Linux-specific. So I #ifdef'd out your struct declaration.

This was alread fixed after 1.0.3 release, at the svn repository. Maybe
the current solution included at the svn causes other problems. Again,
it is required some checks. 

> * vortex_regression_client's  test_04 function opens 1000
> simultaneous  
> sockets. Unfortunately, on OS X the default rlimit is 255 file  
> descriptors, so the test fails to open another socket when  
> iterator=253. I added an #ifdef to lower MAX_NUM_CON to 200 when  
> building on OS X.

Ok.

> * I've disabled SASL support. Mac OS X does have a SASL library, but  
> it doesn't seem to be the same as the one Vortex uses. (According to  
> its headers, the Mac one originates from CMU and innosoft.com.) The  
> APIs are different so it looks like someone who knows about SASL
> (i.e.  
> not me) would need to heavily modify the code in Vortex to make it  
> support both libraries.

Until that happens, maybe you can try with the SASL implemetation we
use: GNU SASL. The compilation process follows the same procedure as
Vortex and SASL. (You'll have to modify your PKG_CONFIG_PATH or use the
appropiate flags from XCode).

You'll find GSASL packages at: http://www.gnu.org/software/gsasl/

> After all that, I was able to run the regression test client and  
> listener, and all the tests (except SASL) passed!

Nice.

> Here are patches for the two issues in the C code. As I said, I  
> haven't attempted to fix the command-line build scripts, but I much  
> prefer using Xcode anyway and I'll gladly contribute the project
> file  
> if you want to include that in the distribution.

Sure. Can you provide me some minimal instructions to get Vortex ready
with Xcode and the Xcode project file. I'll include it into the
documentation.

It would be great if you can check if the current Vortex svn status have
fixed problems described. 

https://dolphin.aspl.es/svn/publico/af-arch/libvortex

Cheers!

> --Jens Alfke
>    jens at mooseyard.com 
-- 
Francis Brosnan Blazquez <francis at aspl.es>
Advanced Software Production Line, S.L.




More information about the Vortex mailing list