Also, if it matters, I usually make my Windows builds on Linux
with MinGW (i686-w64-mingw32-gcc, x86_64-w64-mingw32). But I can
use Visual Studio too, I guess, if that will make things easier
for raco distribute or whatever.

Best regards,

Dmitry


On 09/16/2015 03:52 PM, Dmitry Pavlov wrote:
Matthew,

The most likely solution is to make the executable look enough like a
"PLT executable", but I'll have to try it out to pin down additions
that will work.

Are you interested in this only for Unix variants or for all platforms?
I think Windows will be more difficult.

Thank you for the reply.

Not only I need this for both Windows and Linux, but ideally
in the future I would like to ship also a dynamic C library that
uses a Racket library that has runtime paths. For the start,
though, Windows and Linux executables will be enough for my purposes.

Also, if it matters, my Racket library uses some low-level C
libraries itself.

I can not estimate the difficulty of either approach to this problem,
but I am entirely open to solutions that require some special
handling from the C level --- hijacking runtime paths from C maybe?
I do not know.

Best regards,

Dmitry


At Wed, 16 Sep 2015 14:26:41 +0300, Dmitry Pavlov wrote:
Hello,

I just created a C program that uses my Racket library via
Racket's embedding mechanism, and it works fantastic.

Now I am wondering---how to ship my C program's
executable if the underlying Racket library has runtime
paths in it? The executable seems to have been set up for
absolute paths of the runtime paths that Racket library uses.

I know that for pure Racket programs, raco distribute
does the job of handling the paths and shipping the program
with all the needed files. I tried (maybe too naively)
to apply raco distribute to my executable, and got the following:

assemble-distribution: file is not a PLT executable

OK, maybe it is not. But what other options do I have?
FWIW, I used the following commands to create the executable:

raco ctool --c-mods base.c ++lib my-library

gcc -c -g -DMZ_PRECISE_GC -I/opt/racket/include -o main.o main.c

gcc -o myprog main.o -lpthread -lm -ldl /opt/racket/lib/libracket3m.a
-rdynamic

the contents of main.c for the most part copies the example
at http://docs.racket-lang.org/inside/embedding.html


Best regards,

Dmitry

--
You received this message because you are subscribed to the Google
Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it,
send an
email to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to