[gambit-list] changing the ld options on dynamically loaded files
Bradley Lucier
lucier at math.purdue.edu
Thu Aug 25 15:46:07 EDT 2005
Marc:
I have the following code that used to work in an older beta of gambit:
> (define-macro (setup-loader)
> (set! ##ld-cmd "/usr/ccs/bin/ld -G %s.o libfftw.so.2.0.5 -o %s")
> '(begin))
>
> (setup-loader)
>
> (c-declare
> "
> #include \"fftw.h\"
>
> fftwnd_plan p;
>
> ")
>
> (define fftw2d_create_plan_backward
> (c-lambda ()
> void
> "p = fftw2d_create_plan(64,
> 64,
> FFTW_BACKWARD,
> FFTW_ESTIMATE | FFTW_IN_PLACE);
> "))
>
> (define fftw2d_create_plan_forward
> (c-lambda ()
> void
> "p = fftw2d_create_plan(64,
> 64,
> FFTW_FORWARD,
> FFTW_ESTIMATE | FFTW_IN_PLACE);
> "))
>
> ;;; Both forward and backward ffts, depends on which way the plan
> was created.
>
> (define fftwc
> (c-lambda (scheme-object)
> void
> "
> int j; double *fp = (double *)((___WORD)___BODY_AS
> (___arg1,___tSUBTYPED));
> fftwnd_one(p,
> (fftw_complex *)(fp),
> NULL);
> for (j = 0; j < 64 * 64 * 2; j++)
> fp[j] *= .015625;
> "))
Now I get
Gambit Version 4.0 beta 13
> (compile-file "all.scm")
*** ERROR IN #<procedure #2> -- Unbound variable: ##ld-cmd
and there's no ##ld-cmd in gambc40b14, either.
How can I set things up to link all dynamically loaded files against
libfftw.so.2.0.5?
Brad
More information about the Gambit-list
mailing list