Showing posts with label premake. Show all posts
Showing posts with label premake. Show all posts

Sunday, September 27, 2009

Spherical wavelets toolbox - run on windows

I recently began to work on a project concerning dynamic visual attention (VA) on the sphere, and the current code base uses Yawtb and SpharmonicKit.
Since the camera used in the project has only MS Windows drivers, I wanted to run the algorithms in the same OS. A quick google search turned only to posts with similar questions (see questions on Chris Rodgers software blog).
So, I took the plunge and tried to compile on my WinXP SP3 box, with MS Visual Studio 2005. I used premake to create the target projects, based on a quick look at the Makefiles. Note that I replaced the SpharmonicKit27 interface with the more recent S2Kit, which uses fftw for faster Fourier transforms.
Apparently, MS compilers have gained in compliance to ANSI standards over the years. The only issues I had were:
  • undefined M_PI for both Yawtb and S2Kit
fixed with '#define _USE_MATH_DEFINES' in files including math.h
  • srand48() and drand48() could not be found (for S2Kit test files)
here, the fix is less obvious. For now I just used rand() and (double) rand() / (double) RAND_MAX , but this is probably far from optimal (please don't flame for not using your favorite RNG ;-).

A copy of the modified S2Kit is available at
while the modified Yawtb is at:

Beware, those quick patches run on my XP machine, but have not been thoroughly tested. Your mileage may vary.

Thursday, May 28, 2009

First experiments with premake4 on mac

After having delayed my transition to the new version 4 of premake for quite a long time, I'm trying to switch over without breaking too many things. I did try to switch to premake4 when it was released a few months ago, but was not able to correctly set it to build the Mac dylibs I needed. Therefore I stuck with premake3.
Now, I'm trying again. First, with the XML helper library TICPP ticpp - Google Code

premake4 --ticpp-shared gmake

which seems to work well

ticpp
TiCPP
Building configurations...
Running action 'gmake'...
Generating Makefile...
Generating TiCPP.make...
Done.
jamesMBpro:ticpp james$ make
==== Building TiCPP ====
tinyxml.cpp
tinyxmlparser.cpp
Linking TiCPP


Let's see if the dylibs were produced. And ... nope, only .so :-/

And apparently the dylib flag from premake3 was not conserved in premake4.
Next stop : try the premake4.1 beta. Unfortunately, this did not behave differently.
After some googling which returned nothing, I followed the premake forums down to the buglist. It seems this is a bug which has (recently) been submitted :
And, hurray, there is a patch ! Thank you ashberlin.

So, I downloaded the svn source for premake4:



And then applied ashberlin's patch

patch -p 1 < 0001-SharedLibs-on-macosx-should-be-called-.dylib.patch

And finally the dylib built. I'll check them tomorrow.