Hi,
two completely orthogonal questions/remarks for PolyML 5.5.1:
1.) When building PolyML with '--with-system-libffi' the '-lffi' part is missing in the linker line in polyc.
2.) Is it somehow possible to see if an ML file is run via 'poly --script' or as a standalone executable? Because for the one the logic has to be wrapped in 'fun main ()', and for the other it should not :).
(Ie, what I want: if is_script then main() else () )
Thanks, Ren?
(Ie, what I want: if is_script then main() else () )
If your main : unit -> unit (which perhaps it must be?), then main() is equivalent to the if expression above, modulo side-effects.
Thanks, Ren? -- Ren? Neumann
Institut f?r Informatik (I7) Technische Universit?t M?nchen Boltzmannstr. 3 85748 Garching b. M?nchen
Tel: +49-89-289-17232 Office: MI 03.11.055
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
Am 11.10.2013 15:12, schrieb Ramana Kumar:
(Ie, what I want: if is_script then main() else () )
If your main : unit -> unit (which perhaps it must be?), then main() is equivalent to the if expression above, modulo side-effects.
There is a misunderstanding here: I need the main to be run with poly --script -- which does not run it by default. But if I'd include 'main ()' in the script itself, it'd be run on compiling too (which I'd like to avoid).
- Ren?
Thanks, Ren? -- Ren? Neumann
Institut f?r Informatik (I7) Technische Universit?t M?nchen Boltzmannstr. 3 85748 Garching b. M?nchen
Tel: +49-89-289-17232 Office: MI 03.11.055
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
On 11/10/2013 14:17, Ren? Neumann wrote:
Am 11.10.2013 15:12, schrieb Ramana Kumar:
(Ie, what I want: if is_script then main() else () )
If your main : unit -> unit (which perhaps it must be?), then main() is equivalent to the if expression above, modulo side-effects.
There is a misunderstanding here: I need the main to be run with poly --script -- which does not run it by default. But if I'd include 'main ()' in the script itself, it'd be run on compiling too (which I'd like to avoid).
I'm still unclear what you're trying to achieve. Are you trying to write a single file that can either be used as a script or run through polyc to generate a stand-alone executable? If so, you're going to have a problem with the #! line because it is only treated specially if --script is given. If you try to run the file through polyc it will complain about a syntax error.
You should be able to discover whether you are running as a script by looking for the presence of the --script option using CommandLine.arguments().
David
Am 11.10.2013 15:42, schrieb David Matthews:
On 11/10/2013 14:17, Ren? Neumann wrote:
Am 11.10.2013 15:12, schrieb Ramana Kumar:
(Ie, what I want: if is_script then main() else () )
If your main : unit -> unit (which perhaps it must be?), then main() is equivalent to the if expression above, modulo side-effects.
There is a misunderstanding here: I need the main to be run with poly --script -- which does not run it by default. But if I'd include 'main ()' in the script itself, it'd be run on compiling too (which I'd like to avoid).
I'm still unclear what you're trying to achieve. Are you trying to write a single file that can either be used as a script or run through polyc to generate a stand-alone executable? If so, you're going to have a problem with the #! line because it is only treated specially if --script is given. If you try to run the file through polyc it will complain about a syntax error.
You should be able to discover whether you are running as a script by looking for the presence of the --script option using CommandLine.arguments().
Thanks! This was the information I was looking for.
Some explanation for my use case:
For debugging an application, I'd like to run it with "polyc --script" (not using the shebang) as this prints out intermediate datastructures. When I only need the pure output w/o interleaved compiler output, I want to use the compiled executable.
@David: Have you seen my other issue in the original email?
- Ren?
On 15/10/2013 17:38, Ren? Neumann wrote:
Thanks! This was the information I was looking for.
Good.
@David: Have you seen my other issue in the original email?
Was this the --with-system-ffi issue? I've fixed it in SVN trunk. It may be something to port to the fixed branch.
David
Am 15.10.2013 18:50, schrieb David Matthews:
@David: Have you seen my other issue in the original email?
Was this the --with-system-ffi issue?
Yes.
I've fixed it in SVN trunk.
Great. Thanks.
Hi David,
15/10/13 17:50, David Matthews wrote:
On 15/10/2013 17:38, Ren? Neumann wrote:
@David: Have you seen my other issue in the original email?
Was this the --with-system-ffi issue? I've fixed it in SVN trunk. It may be something to port to the fixed branch.
It looks like r1871 didn't update polyml.pc.in similarly.
pkg-config is not producing -lffi when Poly/ML is built with --with-system-ffi
Phil
Hi Phil, I've changed configure so that FFI_LIBS gets added to LIBS within the configure script. This should avoid the need to add it explicitly in other places. Let me know if there are problems.
David
On 23/03/2015 23:45, Phil Clayton wrote:
Hi David,
15/10/13 17:50, David Matthews wrote:
On 15/10/2013 17:38, Ren? Neumann wrote:
@David: Have you seen my other issue in the original email?
Was this the --with-system-ffi issue? I've fixed it in SVN trunk. It may be something to port to the fixed branch.
It looks like r1871 didn't update polyml.pc.in similarly.
pkg-config is not producing -lffi when Poly/ML is built with --with-system-ffi
Phil
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
Hi David,
Thanks - I've tried building an application with r1985 in the following configurations and pkg-config is working now: static, non-system libffi static, system libffi shared, non-system libffi shared, system libffi
Phil
24/03/15 12:01, David Matthews wrote:
Hi Phil, I've changed configure so that FFI_LIBS gets added to LIBS within the configure script. This should avoid the need to add it explicitly in other places. Let me know if there are problems.
David
On 23/03/2015 23:45, Phil Clayton wrote:
Hi David,
15/10/13 17:50, David Matthews wrote:
On 15/10/2013 17:38, Ren? Neumann wrote:
@David: Have you seen my other issue in the original email?
Was this the --with-system-ffi issue? I've fixed it in SVN trunk. It may be something to port to the fixed branch.
It looks like r1871 didn't update polyml.pc.in similarly.
pkg-config is not producing -lffi when Poly/ML is built with --with-system-ffi
Phil
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml