IRC channel logs

2014-06-09.log

back to list of logs

***sneek_ is now known as sneek
<dsmith-work>Hey hey
<civodul>Hello Guilers!
<stis>hi civodul:
<bhattigurjot>does this "GUILE_CFLAGS = @GUILE_CFLAGS@" work in guile-2.0?
<bhattigurjot>in the make file I mean?
<bhattigurjot>anyone?
<dsmith-work>bhattigurjot: Not in a Makefile, but in the Makefile.in. Usually ./configure does something with sed to change @...@ markers to the real conigured values.
<bhattigurjot>yeah in that.
<dsmith-work>IF you see @...@ in a Makefile, it's an indication that ./configured didn't do the right thign.
<bhattigurjot>dsmith-work: can you take a look at this file
<bhattigurjot> http://git.savannah.gnu.org/cgit/dr-geo.git/tree/Makefile.am?h=upgrade
<bhattigurjot>is it not correct way to include GUILE_CFLAGS ?
<bhattigurjot>this is defined in makefile.in as "GUILE_CFLAGS = @GUILE_CFLAGS@"
<bhattigurjot>is it incorrect to include it in AM_CPPFLAGS ?
<dsmith-work>Here is the way I did it: https://www.gitorious.org/guile-sqlite/guile-sqlite/source/54acbdb2efef8a9b62892b92c97dfef2024810c0:
<bhattigurjot>dsmith-work: you also used a variable to include GUILE_CFLAGS
<bhattigurjot>value
<bhattigurjot>and I did too. I don't know why is it not working
<bhattigurjot>:/
<dsmith-work>Looks like "PKG_CHECK_MODULES([GUILE], [guile-2.0])" generates that.
<dsmith-work>Anyone know how to make that work for 2.2 (2.1) also?
<dsmith-work>bhattigurjot: btw, I need to set PKG_CONFIG_PATH. As in "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure"
<bhattigurjot>dsmith-work: I can see that the Makefile has the value
<bhattigurjot>GUILE_CFLAGS = -pthread -I/usr/include/guile/2.0
<bhattigurjot>and do you know what should be used inplace of "gh_scm2doubles (v, gv);"?
<bhattigurjot>I mean this syntax was used in gh interface
<dsmith-work>bhattigurjot: I'm using pkg-config directly. Not using the /usr/local/share/aclocal/guile.m4
<bhattigurjot>what is scm interface replacement?
<dsmith-work>bhattigurjot: The NEWS file has all that
<dsmith-work>scm_to_double() probably
<dsmith-work>IT's a much cleaner, saner interface
<bhattigurjot>actually scm_to_double takes a single parameter
<bhattigurjot>dsmith-work: they said to use Uniform Numeric Vector
<bhattigurjot>that's where I am confused
<dsmith-work>bhattigurjot: Sorry, no idea.
<dsmith-work>civodul: Do you know?
<civodul>dsmith-work, bhattigurjot: scm_to_double, yes
<civodul>ah no
<civodul>bhattigurjot: you want to get a vector of doubles?
<bhattigurjot>civodul: here is the code
<bhattigurjot> http://pastebin.com/R7kq2pzM
<civodul>scm_take_f64vector would give a homogeneous vector
<civodul>bhattigurjot: i don't know what gh_scm2doubles did, hence my question :-)
<dsmith-work>bhattigurjot: Sounds like you are trying to port some really really old guile code.
<bhattigurjot>yeah
<bhattigurjot>very old
<bhattigurjot>civodul: here is what I think, https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Scheme-to-C.html
<dsmith-work>It's some work, but it might be instructive to get the source to a guile where the gh_* was in the depracated state. There are usually files that map the old api to the new one. Useful for clues on how to do it.
<civodul>bhattigurjot: the closest thing would be to use SRFI-4 "homogeneous vectors" instead of plain vectors, and then scm_f32vector_elements to access the vector's elements as a C array
<bhattigurjot>take a look here
<bhattigurjot> http://pastebin.com/ev0HPv5N
<bhattigurjot>I did that using array length
<bhattigurjot>it worked but I must use guile 2.0.11 for that
<civodul>bhattigurjot: what you did may work, but it's inefficient
<civodul>SRFI-4 homogeneous vectors were designed for these use cases
<civodul>where you have large arrays of numbers to be handled both from C and Scheme
<bhattigurjot>civodul: can you give me an example
<civodul>i don't have examples handy, and i'm a bit busy ;-)
<civodul>hopefully http://www.gnu.org/software/guile/manual/html_node/SRFI_002d4.html gives a good introduction
<bhattigurjot>ah... thanks btw :-)
<dsmith-work>civodul: Looks that gh_scm2doubles never went through the deperecation cycle.
<dsmith-work>civodul: It's in 1.8 (not deprecated) and disappears in 2.0
<civodul>oh, i think all of gh did, no?
<civodul>not deprecated?
<civodul>all of gh was deprecated AFAIK
<dsmith-work>Hmm. Maybe you are right.
<dsmith-work>NEWS never mentions a replacement.
<civodul>oh
<civodul>good night/day!