Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Always on" -run flag and running encore without -clang or -gcc broken #19

Closed
TobiasWrigstad opened this issue Jul 23, 2014 · 10 comments
Closed
Assignees

Comments

@TobiasWrigstad
Copy link
Contributor

Stephan has added a really nice "shebang" feature to the compiler to facilitate running Encore programs.

Bug
When you run encore file.enc (i.e,. you don't write -clang or -gcc), then you get an error because no runnable file is produced:

../release/encorec test.enc
/bin/sh: ./test: No such file or directory

Request for change
I would like to be able to "just compile" without running, especially right now when I am forced to do some C tweaking of most programs to get them to run.

I suggest that we add a –run switch to the compiler and only run the program if we have a successful compilation and the -run switch is present.

As I type this, I see that there is a -run switch but it seems to be on by default.

I am equally happy to be forced to write --just-compile or something similar to not have the program being run.

@kaeluka
Copy link
Contributor

kaeluka commented Jul 23, 2014

Sorry about that! I'll fix it asap.

The -run switch is indeed there and intended to build, execute, and remove the executable. This is not perfect yet (when the executable already exists, it also gets removed, f.ex).

No argument will be the "just-compile" again.

@supercooldave
Copy link

I reckon the flag should name the target codes you want to generate (consider when we generate llvm intermediate code, or perhaps dump internal EXPR trees as text).

Maybe --generate-c, etc
Or --intermediate c

It might be useful also to dump various intermediate trees for debugging.

Dave

Sent from my iPhone

On 23/07/2014, at 14:51, TobiasWrigstad [email protected] wrote:

Stephan has added a really nice "shebang" feature to the compiler to facilitate running Encore programs.

Bug
When you run encore file.enc (i.e,. you don't write -clang or -gcc), then you get an error because no runnable file is produced:

../release/encorec test.enc
/bin/sh: ./test: No such file or directory
Stephan said that the executable should be removed after running. It is not.

Request for change
I would like to be able to "just compile" without running, especially right now when I am forced to do some C tweaking of most programs to get them to run.

I suggest that we add a –run switch to the compiler and only run the program if we have a successful compilation and the -run switch is present.

As I type this, I see that there is a -run switch but it seems to be on by default.

I am equally happy to be forced to write --just-compile or something similar to not have the program being run.


Reply to this email directly or view it on GitHub.

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

@supercooldave
Copy link

Having -run delete the executable seems odd to me. Maybe -run-once.

Sent from my iPhone

On 23/07/2014, at 15:12, Stephan Brandauer [email protected] wrote:

Sorry about that! I'll fix it asap.

The -run switch is indeed there and intended to build, execute, and remove the executable. This is not perfect yet (when the executable already exists, it also gets removed, f.ex).

No argument will be the "just-compile" again.


Reply to this email directly or view it on GitHub.

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

@EliasC
Copy link
Contributor

EliasC commented Jul 23, 2014

@supercooldave: @TobiasWrigstad was wrong, it deletes the intermediate C-file, not the executable

/Elias (under voodoo control by @TobiasWrigstad )

@kaeluka
Copy link
Contributor

kaeluka commented Jul 23, 2014

Having -run delete the executable seems odd to me. Maybe -run-once.

@supercooldave It deletes the executable because the intended semantics is to mirror a script. A later optimisation will be to not delete the executable and only recompile if the source is newer than the executable.

@supercooldave
Copy link

None of what you say convinces me that it is a good idea.
Why should the compiler run and delete the program?
(Or is this a part of some build script?)

In any case, —run-once better captures the semantics.

Dave

On 23 Jul 2014, at 16:39, Stephan Brandauer [email protected] wrote:

Having -run delete the executable seems odd to me. Maybe -run-once.

@supercooldave It deletes the executable because the intended semantics is to mirror a script. A later optimisation will be to not delete the executable and only recompile if the source is newer than the executable.


Reply to this email directly or view it on GitHub.

[email protected]
Dept. of Computer Science
Celestijnenlaan 200A
B-3001 Heverlee
BELGIUM
Tel: +32 16 327866

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

@supercooldave
Copy link

Did I reply to this?
It is questionable whether we want to build "make" functionality" into the compiler. This is not where our optimisation energies should be spent.

Sent from my iPhone

On 23/07/2014, at 16:39, Stephan Brandauer [email protected] wrote:

Having -run delete the executable seems odd to me. Maybe -run-once.

@supercooldave It deletes the executable because the intended semantics is to mirror a script. A later optimisation will be to not delete the executable and only recompile if the source is newer than the executable.


Reply to this email directly or view it on GitHub.

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

@kaeluka kaeluka self-assigned this Jul 23, 2014
kaeluka pushed a commit that referenced this issue Jul 24, 2014
@kaeluka kaeluka closed this as completed Jul 24, 2014
@kaeluka
Copy link
Contributor

kaeluka commented Jul 24, 2014

encorec abc.enc # compiles, but doesn't run
encorec abc.enc -clang # compiles, but doesn't run
encorec abc.enc -run # compiles, runs, deletes

@TobiasWrigstad
Copy link
Contributor Author

encorec abc.enc # compiles, but doesn't run
encorec abc.enc -clang # compiles, but doesn't run
encorec abc.enc -run # compiles, runs, deletes

Beaut!

@TobiasWrigstad
Copy link
Contributor Author

Encorec could check whether argv[0] is "encore" (without the c). If so, run would be implicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants