Friday, December 17, 2010

Building Hypermammut in Debian.

So, I've been trying to get hypermammut to compile and run for me.  The released tarball has a few problems in it.  I've gotten it to compile, but it still crashes when I try to open a file.  However, I figure the steps I've shown are at least closer to getting it to work.

I should note that I am on a 64 bit system, but I think I will explicitly point out everywhere where this is relevant.

First of all, you need to install the proper dev files.  Obviously you need a C++ compiler, etc, but the libraries you need to install specially are (and I list them with their Debian package names): magick++-dev libfftw3-dev
libwxgtk2.8-dev libaudiofile-dev.  You also need to install the build tool scons.  I should note that there is also a package named libmagick++-dev, which is not the same as magick++-dev.  The former will not work, and the two are mutually exclusive.

 Second the Scons build script is horribly broken (SConstruct).  I don't know scons, but I was able to figure out enough to fix it.

It would try to generate commands like

g++ -o IO/AInput.o -c -fPIE -pie "-ggdb `wx-config --cppflags` -Wno-unused-macros" IO/AInput.cpp

The double quotation marks just messing things up.  Additionally, it was missing the correct flags for fftw and audiofile in some cases.

I was able to clean it up enough to this point (I am only posting the bottom part of the file, because the top is just a big list, which I didn't change at all.)


env = Environment();
SConsignFile(".scons-signatures")
env.ParseConfig('Magick++-config --ldflags --libs')
env.ParseConfig('wx-config  --libs --cppflags')
env.ParseConfig('pkg-config fftw3f audiofile --libs')
env.Append(CCFLAGS = '-ggdb')
env.Append(LINKFLAGS = '-ggdb')
env.Program('test_s2i2s',lista);

Another issue which popped up (I'm pretty sure only due to 64 bit architecture) was in Process/Generator/Random.cpp. In the function Random::Random(), you need to replace the line

s1=get32bits()+(int) this;
with
s1=get32bits()+(int) ((intptr_t)this);

and add the include

#include <stdint.h>

to the top of the file.  This basically does the proper cast when ints and pointers aren't necessarily the same size.

Also, the file UI/ParametersDialog.cpp is missing the include

#include <wx/wx.h>

Now, run 

scons

It will build (at least on my system).  It will create the executable "test_s2i2s".  Unfortunately, whenever I try to load a file, it crashes.  If it is an audio file, it says

Audio File Library: could not open file 'test.wav' [error 3]
ERROR: Could not import audio file.

If it is an image file, it says 

test_s2i2s: magick/semaphore.c:525: LockSemaphoreInfo: Assertion `semaphore_info != (SemaphoreInfo *) ((void *)0)' failed.
Aborted

I don't have the time nor energy to track down these bugs, but they seem to be much deeper than misconfigured dependencies.  Hopefully I've sent someone down the right path to getting it to build correctly.

Tuesday, December 7, 2010

Uninstall/Disable feature/plugin in Eclipse Helios (3.6)

Not that I want to editorialize often, but Eclipse is just horrible when trying to remove a plugin.

I tried going to help ->install new software -> check what's already installed... The uninstall option is grayed out for all the relevant plugins.  No indication whatsoever why, or how to fix this.

I instead try going to Help-> Check for New updates.  It simply pops up a dialog saying no updates were found.  No further options.

I try going to Help-> Eclipse marketplace.  It seems Solutions (which are the only things you can modify using this dialog) are different than plugins.

I try going to Help->about eclipse ->installation details.  I get the same menu as if I click install new software.

I try googling.  It either says go to Help->about eclipse ->installation details (which I already tried), or to do  Help -> Software Updates -> Manage Configuration. The second suggestion is simply not available on Eclipse Helios.  I assume I am looking at the documentation for a different version of eclipse.  I find the documentation for Eclipse Helios (3.6), and nope, it's exactly the same.  At this point I hit a lucky break, and I notice that the text describing the menus to open is a link.  I click on it and it says "you can only do this with local help".  I find the same page again in the local eclipse help.  I click the link.  Viola, the magical hidden window pops up that finally allows me do uninstall the plugins.  Did it really have to be that hard?