As part of the PortAudio library, I want to be able to call this code:

void bufferAdd(short *dst, short *src, int len) {
  int i;
  for (i = 0; i<len; i++) {
    dst[i] += src[i];
  }
}

... and I'm trying to figure out the most hassle-free way to distribute it, 
given that it may be installed on machines without compilers[*].  It looks to 
me like the best way is probably to explicitly add shared-object files to paths 
given by

(build-path "native" (system-library-subpath) (path-add-suffix "buffer-add" 
(system-type 'so-suffix))),

to distribute them as part of the package, and then to load these explicitly, 
signaling an error if one is not found. Note that I'm omitting the "compiled" 
part, because that would be deleted by a call to "raco setup --clean".

I looked through my existing plt tree, and was a bit startled to see that not a 
single collection includes any shared library that I could copy from.

Does this approach make sense?

Many thanks,

John

[*] See earlier thread where the general consensus was that it was not possible 
to make a Racket version of this run less than (IIRC) 5x slower than C.



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Reply via email to