Re: [racket-users] Can raco distribute produce a single executable?

2017-03-07 Thread Ethan Estrada
On Sat, Feb 25, 2017 at 9:57 PM, lu  wrote:
>   --enable-shared create shared libraries (ok, but not recommended)
>   --enable-dynlib same as --enable-shared

I haven't personally compiled Racket before, but these seem to be the
flags you are looking for. It seems the default behavior is to compile
a statically linked executable. For whatever reason, the distributed
Windows compile seems to be done using shared libraries instead. I
haven't used Racket on Windows, so I can't say for sure. I'm planning
to install it on my windows partition when I boot into it next time.
I'll let you know if for some reason it is statically linked (although
I highly doubt it).

--
Ethan Estrada

-- 
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.


Re: [racket-users] Can raco distribute produce a single executable?

2017-02-25 Thread lu
Thanks. That's interesting. So below are the flags `configure --help` offers. I 
don't see anything specific to link racket statically. Any hint?


`configure' configures this package to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help  display this help and exit
  --help=shortdisplay options specific to this package
  --help=recursivedisplay the short help of all the included packages
  -V, --version   display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
  --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache  alias for `--cache-file=config.cache'
  -n, --no-create do not create output files
  --srcdir=DIRfind the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX install architecture-independent files in PREFIX
  [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
  [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIRuser executables [EPREFIX/bin]
  --sysconfdir=DIRread-only single-machine data [PREFIX/etc]
  --libdir=DIRobject code libraries [EPREFIX/lib]
  --includedir=DIRC header files [PREFIX/include]
  --datarootdir=DIR   read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR   read-only architecture-independent data [DATAROOTDIR]
  --mandir=DIRman documentation [DATAROOTDIR/man]
  --docdir=DIRdocumentation root [DATAROOTDIR/doc/PACKAGE]
  --collectsdir=DIRcollects documentation [DOCDIR]
  --appsdir=DIRapps documentation [DOCDIR]

System types:
  --build=BUILD configure for building on BUILD [guessed]
  --host=HOST   cross-compile to build programs to run on HOST [BUILD]
  --target=TARGET   configure for building compilers for TARGET [HOST]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE   do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-gracketbuild GRacket as well as Racket (enabled by default)
  --enable-jitsupport JIT compiler (enabled by default)
  --enable-foreignsupport foreign calls (enabled by default)
  --enable-places support places (3m only; usually enabled by default)
  --enable-futuressupport futures (usually enabled by default)
  --enable-float  support single-precision floats (enabled by default)
  --enable-floatinstead   use single-precision by default (NOT RECOMMENDED)
  --enable-extflonum  support extflonums (enabled by default, if available)
  --enable-racket=  use  as Racket to build; or "auto" to create
  --enable-origtree   install with original directory structure
  --enable-pkgscope=   set `raco pkg' default: installation, user, or shared
  --enable-docs   build docs on install (enabled by default)
  --enable-usersetup  setup user-specific files on install
  --enable-natipkgadd "-natipkg" to library subpath
  --enable-shared create shared libraries (ok, but not recommended)
  --enable-dynlib same as --enable-shared
  --enable-lt=  use  instead of libtool; disable to use bundled
  --enable-libs   install static libraries (enabled by default for Unix)
  --enable-libffi use installed libffi (enabled by default for Unix)
  --enable-sdk= use Mac OS 10.4 SDK directory
  --enable-sdk5=use Mac OS 10.5 SDK directory
  --enable-sdk6=use Mac OS 10.6 SDK directory
  --enable-ios= use iOS SDK directory
  --enable-sysroot= use sysroot directory (e.g., for Android)
  --enable-xonx   use Unix style (e.g., use Gtk) for Mac OS
  --enable-libfw  install Mac OS frameworks to /Library/Frameworks
  --enable-userfw install Mac OS frameworks to ~/Library/Frameworks
  --enable-macprefix  allow --prefix with a Mac OS install
  --enable-mac64  allow 64-bit Mac OS build (enabled by default)
  --enable-cgcdefault use CGC as default build (NOT RECOMMENDED)
  --enable-sgcuse Senora GC instead of Boehm GC (enabled by default)
  --enable-sgcdebug   use Senora GC for debugging (expensive debug mode)
  --enable-backtrace  3m: support GC backtrace dumps (expensive debug mode)
  

Re: [racket-users] Can raco distribute produce a single executable?

2017-02-21 Thread Ethan Estrada
On Monday, February 20, 2017 at 12:33:46 PM UTC-7, lu wrote:
> In fact, I'm wondering if `raco distribute` or `raco exe` is flexible enough 
> to produce a statically linked executable where all the necessary dlls are 
> incorporated.

I believe this is possible, but probably not worth the effort considering you 
mentioned this as a toy project. To my understanding (and, please, someone 
correct me if I am wrong about this), `raco exe` will just compile your file to 
Racket bytecode, then intelligently mash it together with the racket executable 
you have installed. If the racket executable you have installed requires 
loading an external dll, then so will the executable created from `raco exe`. 
If the racket executable you have installed does NOT require an external dll, 
then neither will your executable generated from `raco exe`. The default 
Windows installer distributed for racket has the core of the language linked as 
a separate `libracket` dll, so `raco exe` follows suit. Partially this is an 
issue at the OS and linker level; after compilation, dynamically linked 
libraries can't easily be transformed to statically linked libraries and 
vice-versa. It is almost universally a compile time choice. To be clear, I am 
talking about code compiled to native machine bytecode tailored to a particular 
operating system from a source language like C, not compiled Racket bytecode.

Which brings me to my next point. To make this work, you would pretty much need 
to compile the Racket executable from source and use whatever compile flags are 
required to build everything statically into the main executable. Then `raco 
exe` should work as expected using your custom compiled version of Racket. This 
is a huge amount of work for a toy project. So, like I said, it probably isn't 
really worth it. It's ultimately simpler to just use `raco distribute` and send 
the whole bundle to someone else. Yes, it is a bit clumsy for something so 
small, but it should at least work.

-- 
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.


Re: [racket-users] Can raco distribute produce a single executable?

2017-02-20 Thread lu
On Monday, February 20, 2017 at 11:24:50 AM UTC-8, Shu-Hung You wrote:
> Sorry, I saw that you're already using raco exe and raco distribute.
> So is the problem related to some DLL issue on Windows?
> 
> Best,
> Shu-Hung
> 
> On Mon, Feb 20, 2017 at 1:19 PM, Shu-Hung You
>  wrote:
> > https://docs.racket-lang.org/raco/exe.html
> > Is raco exe in this page what you want? Just type
> >
> >> raco exe q.rkt
> >
> > And this command will produce a single executable. Now we can now run
> >
> >> ./q
> > q: expects 1  on the command line, given 0 arguments
> >
> > Best,
> > Shu-Hung
> >
> > On Mon, Feb 20, 2017 at 1:12 PM, lu  wrote:
> >> Hi all, I have this little toy project[1] to help me learn the language. I 
> >> would like to produce a single portable executable that can be executed 
> >> without reliance on racket installation. `raco distribute` does produce a 
> >> "package" folder. But for small utility tool like this, I would prefer a 
> >> simple standalone executable file rather than a folder, so I can just drop 
> >> it into a directory on `PATH` on the target machine and run it.
> >>
> >> For the start I'm looking at solving this problem for Windows 
> >> specifically, but am also interested in a solution on other systems.
> >>
> >> Thanks!
> >>
> >>
> >> [1]: https://github.com/kflu/q
> >>
> >> --
> >> 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.

No, there's nothing wrong with DLL issue on Windows specifically. It's the way 
how `raco exe` is designed to work.

The executable produced with `raco exe` is not portable to another machine of 
the same OS without Racket installed. More specifically, if you look at the 
distribution `raco distribute` produce, it includes essential dependencies for 
running the application, e.g., the GC lib `libracket3m_a1zjsw.dll`. If you run 
the executable from another machine where Racket isn't installed, you get (at 
least) an error saying that `libracket3m_a1zjsw.dll` cannot be found.

In fact, I'm wondering if `raco distribute` or `raco exe` is flexible enough to 
produce a statically linked executable where all the necessary dlls are 
incorporated.


C:\USERS\LU\WORK\RACK\Q
|   q.exe
|
\---lib
|   libiconv-2.dll
|   libracket3m_a1zjsw.dll
|   longdouble.dll
|
\---plt
\---q
+---collects
\---exts
\---ert
+---r0
|   dh4096.pem
|
\---r1
libeay32.dll
ssleay32.dll

-- 
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.


Re: [racket-users] Can raco distribute produce a single executable?

2017-02-20 Thread Shu-Hung You
Sorry, I saw that you're already using raco exe and raco distribute.
So is the problem related to some DLL issue on Windows?

Best,
Shu-Hung

On Mon, Feb 20, 2017 at 1:19 PM, Shu-Hung You
 wrote:
> https://docs.racket-lang.org/raco/exe.html
> Is raco exe in this page what you want? Just type
>
>> raco exe q.rkt
>
> And this command will produce a single executable. Now we can now run
>
>> ./q
> q: expects 1  on the command line, given 0 arguments
>
> Best,
> Shu-Hung
>
> On Mon, Feb 20, 2017 at 1:12 PM, lu  wrote:
>> Hi all, I have this little toy project[1] to help me learn the language. I 
>> would like to produce a single portable executable that can be executed 
>> without reliance on racket installation. `raco distribute` does produce a 
>> "package" folder. But for small utility tool like this, I would prefer a 
>> simple standalone executable file rather than a folder, so I can just drop 
>> it into a directory on `PATH` on the target machine and run it.
>>
>> For the start I'm looking at solving this problem for Windows specifically, 
>> but am also interested in a solution on other systems.
>>
>> Thanks!
>>
>>
>> [1]: https://github.com/kflu/q
>>
>> --
>> 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.


Re: [racket-users] Can raco distribute produce a single executable?

2017-02-20 Thread Shu-Hung You
https://docs.racket-lang.org/raco/exe.html
Is raco exe in this page what you want? Just type

> raco exe q.rkt

And this command will produce a single executable. Now we can now run

> ./q
q: expects 1  on the command line, given 0 arguments

Best,
Shu-Hung

On Mon, Feb 20, 2017 at 1:12 PM, lu  wrote:
> Hi all, I have this little toy project[1] to help me learn the language. I 
> would like to produce a single portable executable that can be executed 
> without reliance on racket installation. `raco distribute` does produce a 
> "package" folder. But for small utility tool like this, I would prefer a 
> simple standalone executable file rather than a folder, so I can just drop it 
> into a directory on `PATH` on the target machine and run it.
>
> For the start I'm looking at solving this problem for Windows specifically, 
> but am also interested in a solution on other systems.
>
> Thanks!
>
>
> [1]: https://github.com/kflu/q
>
> --
> 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.


[racket-users] Can raco distribute produce a single executable?

2017-02-20 Thread lu
Hi all, I have this little toy project[1] to help me learn the language. I 
would like to produce a single portable executable that can be executed without 
reliance on racket installation. `raco distribute` does produce a "package" 
folder. But for small utility tool like this, I would prefer a simple 
standalone executable file rather than a folder, so I can just drop it into a 
directory on `PATH` on the target machine and run it.

For the start I'm looking at solving this problem for Windows specifically, but 
am also interested in a solution on other systems.

Thanks!


[1]: https://github.com/kflu/q

-- 
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.