On 2013-05-31 23:08, Rémy Mouëza wrote:
Concerning dstep,
I compiled it recently (Ubuntu 12.04 32 bits system) and it wasn't as
straightforward as it was described in the README file, nor was it that
complicated to have it work. I'll outline my experience below for those
interested.
first step that needed some care was the compilation of Tango-D2: I
downloaded the last version that did not compiled on dmd 2.060 but did
well on dmd 2.061 (and fast).
Ok, I see. I haven't updated the readme. The build script will
automatically try to use DMD 2.061 if you have DVM installed.
https://github.com/jacob-carlborg/dvm
When I got dstep compiled, I forgot to run `sudo ldconfig` so that dstep
could find libclang.so (this is not a bug nor an annoyance but it may be
confusing at first).
The last command in the instructions for Clang it copies libclang.so to
the folder of DStep. This will make the "sudo ldconfig" step
unnecessary. I didn't even know about it.
Then, (dstep or rather) clang stopped with an error telling me it could
not find "stddef.h". A quick google search seemed to indicate that I
needed to upgrade from llvm-3.1 to llvm-3.2 to automagically solve that
problem.
Yeah, I think I had a similar issue. I guess it's time to update to 3.2
or rather 3.3 when it's released.
However, what I really had to do was to find out the include path which
on my system is :
/usr/local/include
/usr/include
/usr/include/i386-linux-gnu/
/home/ray/apps/llvm-3.2/include/clang/ # wherever is installed
llvm/clang
/usr/lib/gcc/i686-linux-gnu/4.6/include/
/usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/
So I ran dstep like this:
$ ~/dev/dee/dstep/bin/dstep mongoose.h -o mongoose_d.d -v
-I/usr/local/include -I/usr/include -I/usr/include/i386-linux-gnu/
-I/home/ray/apps/llmv-3.2/include/clang
-I/usr/lib/gcc/i686-linux-gnu/4.6/include/
-I/usr/lib/gcc/i686-linux-gnu/4.6/include-fixed/
I think I just copied the file to /usr/local/include
I noticed in the output file that an embedded "typedef'ed" struct was
not handled very well but fixing this manually went really quick.
Could you please file a bug for this. With the C input you used, the
output from DStep and the expected output.
Using the output, my Mongoose test program no longer crashes with
segfaults due to a mysterious void *user_data pointer being always set
to 0x4 in my callback function even when set otherwise at initialization.
Great.
In brief: dstep is a huge improvement over manually writing a D header
interface.
That's really great to here.
As for IUP, since I happen to have iup.h on my system, I tried it with
dstep. The command line had just to be adjusted, adding the path to the
include directory like '-I/path/to/iup/include/dir' or '-I`pwd`' when
generating directly within the directory.
Cool. Could you please file a bug for all this, so it's not forgotten.
BTW, there are pre-compiled binaries available:
https://github.com/jacob-carlborg/dstep/downloads
I forgot to add that to the readme.
--
/Jacob Carlborg