Re: 'guild compile' and C(++) extensions (in the context of LilyPond)

2022-02-21 Thread Jean Abou Samra
Le 19/02/2022 à 22:25, Olivier Dion a écrit : On Sat, 19 Feb 2022, Jean Abou Samra wrote: I had similar problem with Jami. I added C++ primitives to Guile, but these were not load using the foreign function interface. Note, I'm using Guile 3.0.8, but I think the same could be done for Guil

Re: 'guild compile' and C(++) extensions (in the context of LilyPond)

2022-02-19 Thread Olivier Dion via General Guile related discussions
On Sat, 19 Feb 2022, Jean Abou Samra wrote: I had similar problem with Jami. I added C++ primitives to Guile, but these were not load using the foreign function interface. Note, I'm using Guile 3.0.8, but I think the same could be done for Guile 2.0. Basically what I do is to add a `compile` c

'guild compile' and C(++) extensions (in the context of LilyPond)

2022-02-19 Thread Jean Abou Samra
Hi, (Cross-posted to guile-user, guile-devel and the debbugs issue, I'm unsure where this should go.) In LilyPond, we have now made a development release with binaries using Guile 2.2. However, a major problem is that we don't ship Guile bytecode yet. Notably, one problem to get the bytecode in

Re: C extensions

2021-02-21 Thread Olivier Dion via General Guile related discussions
ble (_mu); > double sigma = scm_to_double (_sigma); > return scm_from_double (exp (mu + sigma*scm_c_normal01 > (SCM_RSTATE(state; > } > #undef FUNC_NAME > > On Sun, Feb 21, 2021 at 9:59 AM Olivier Dion > wrote: > >> On Sat, 20 Feb 2021, Tim Meehan wrot

Re: C extensions

2021-02-21 Thread Tim Meehan
RSTATE (1, state); > > if (scm_is_false (scm_positive_p (_sigma))) > return SCM_BOOL_F; // I'd like to return some meaningful error here ... > > double mu = scm_to_double (_mu); > double sigma = scm_to_double (_sigma); > return scm_from_double (exp (mu + sigma*scm_

Re: C extensions

2021-02-21 Thread Tim Meehan
double (exp (mu + sigma*scm_c_normal01 (SCM_RSTATE(state; } #undef FUNC_NAME On Sun, Feb 21, 2021 at 9:59 AM Olivier Dion wrote: > On Sat, 20 Feb 2021, Tim Meehan wrote: > > I'm trying my hand a writing C extensions. > > I've done this for stuff like Matlab before, an

Re: C extensions

2021-02-21 Thread Olivier Dion via General Guile related discussions
On Sat, 20 Feb 2021, Tim Meehan wrote: > I'm trying my hand a writing C extensions. > I've done this for stuff like Matlab before, and was wondering how you do > the usual checking of the arguments that are passed in from Guile. > > In the manual, 6.13.13.1 "

Re: C extensions

2021-02-20 Thread Nala Ginrut
Hi Tim! I think you may try these functions: scm_is_true scm_is_real_p scm_geq_p Best regards. On Sun, Feb 21, 2021 at 11:57 AM Tim Meehan wrote: > I'm trying my hand a writing C extensions. > I've done this for stuff like Matlab before, and was wondering how you do > th

C extensions

2021-02-20 Thread Tim Meehan
I'm trying my hand a writing C extensions. I've done this for stuff like Matlab before, and was wondering how you do the usual checking of the arguments that are passed in from Guile. In the manual, 6.13.13.1 "C Support" has a few functions. libguile/numbers.h has a bunch more

Re: Guile, Guix, and C extensions

2020-04-08 Thread Stephen Scheck
Ok - I built a small sandbox with a simple module and extension which exhibits the same installation behavior with Guix: https://gitlab.com/singularsyntax/guile-sandman

Re: Guile, Guix, and C extensions

2020-04-03 Thread Stephen Scheck
> Oh, pity. I can’t help without seeing the code, I’m afraid. You won't be able to try and reproduce - but at the moment that's a lesser concern of mine (you can still see that the module definition itself isn't doing anything special or unexpected, but nonetheless, I'll work on getting some code

Re: Guile, Guix, and C extensions

2020-04-03 Thread Ricardo Wurmus
Stephen Scheck writes: >> Could you show us your my-module.scm please? > > The source is not yet ready for public distribution, so I've elided > references: Oh, pity. I can’t help without seeing the code, I’m afraid. -- Ricardo

Re: Guile, Guix, and C extensions

2020-04-03 Thread Stephen Scheck
> Could you show us your my-module.scm please? The source is not yet ready for public distribution, so I've elided references: (use-modules ((guix licenses) #:prefix license:) (guix utils) (guix packages) (guix git-download) (guix build-system gnu) (gnu pac

Re: Guile, Guix, and C extensions

2020-04-03 Thread Ricardo Wurmus
Hi Stephen, > When I try to install the package by invoking `guix package -f > my-module.scm`. Here's the output from the build log: Could you show us your my-module.scm please? > make[2]: Nothing to be done for 'install-exec-am'. > /gnu/store/9kzrrccpzl6i1sfwb0drb00gi2gwk0x0-coreutil

Re: Guile, Guix, and C extensions

2020-04-03 Thread Stephen Scheck
Ricardo, > I don’t understand this. At what point does it use that Guile? When > building a package that has “guile” as one of the inputs it is *that* > variant of Guile that is used. Within the build environment Guix > doesn’t use any profiles. When I try to install the package by invoking `g

Re: Guile, Guix, and C extensions

2020-04-02 Thread Ricardo Wurmus
Hi Stephen, > 1) If I use the Guile `GUILE_SITE_DIR` Autoconf macro to provide locations > of Guile's site, compiled code, and dynamic library extension directories, > installation of the package fails because it tries to install these into > Guile's own directory in the Guix store, which I beli

Guile, Guix, and C extensions

2020-03-30 Thread Stephen Scheck
Hello, I am working on a couple of C extension modules for Guile, and I'd like to offer end-users a quality installation experience. Towards that end, I plan on initially supporting two installation mechanisms - the traditional GNU Autotools process, and Guix. I am looking for guidance on best pr

Re: snarfing docstrings in c extensions

2018-04-09 Thread Samuel Barreto
> On Sat, Apr 07, 2018 at 08:59:32PM +0200, Samuel Barreto wrote: > >> So I do am able to generate the info files that I want. My two problems >> are: >> >> 1. how to use guile-snarf-docs portably ? (I have hardcoded them in my >>Makefile for now.) > > Since they don't get installed, it is hard

snarfing docstrings in c extensions

2018-04-07 Thread Samuel Barreto
Hi everyone, I'm trying to write a GSL wrapper in guile. I have written a lot of simple functions using SCM_DEFINE and documented them using the last SCM_DEFINE macro argument. Now I'd like to make those docstrings accessible from Scheme code. The way I do it for now is with this makefile instruc