# Only make compilation of a script

**URL:** <https://discourse.julialang.org/t/only-make-compilation-of-a-script/55001>\
**Category:** General Usage\
**Created:** [February 10, 2021, 3:05pm UTC](https://discourse.julialang.org/t/only-make-compilation-of-a-script/55001 "2021-02-10T15:05:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ludsrill](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ludsrill/32/21729_2.png) [@Ludsrill](https://discourse.julialang.org/u/Ludsrill)\
**Post date:** [February 10, 2021, 3:05pm UTC](https://discourse.julialang.org/t/only-make-compilation-of-a-script/55001/1 "2021-02-10T15:05:44Z")

</div>

I only want to know if it’s possible to make a compilation for a script without running the script  
if it’s possible, how can I do it?

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [February 10, 2021, 3:58pm UTC](https://discourse.julialang.org/t/only-make-compilation-of-a-script/55001/2 "2021-02-10T15:58:18Z")

</div>

Are you thinking about a sysimage?

[https://julialang.github.io/PackageCompiler.jl/dev/sysimages/](https://julialang.github.io/PackageCompiler.jl/dev/sysimages/)

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [February 10, 2021, 4:01pm UTC](https://discourse.julialang.org/t/only-make-compilation-of-a-script/55001/3 "2021-02-10T16:01:02Z")

</div>

Sysimages depend on a “tracing” run. Therefore, they do not exactly fit the “make a compilation for a script without running the script” criteria. However, I suppose you could somehow fake the output of the tracing run, and use it to generate the sysimage.

---

<div class="post-metadata">

**Author:** ![Ludsrill](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ludsrill/32/21729_2.png) [@Ludsrill](https://discourse.julialang.org/u/Ludsrill)\
**Post date:** [February 10, 2021, 4:12pm UTC](https://discourse.julialang.org/t/only-make-compilation-of-a-script/55001/4 "2021-02-10T16:12:55Z")

</div>

my program needs to read stdin, if I try to create the sysimage I’m going to get a failure, isn’t it?

If it’s like that this approach won’t work for me

Also, I need to do this task (create the sysimage) with only one command is a little complex if I follow de docs for PackageCompiler same thing If I try to create a executable.

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [February 10, 2021, 4:51pm UTC](https://discourse.julialang.org/t/only-make-compilation-of-a-script/55001/5 "2021-02-10T16:51:29Z")

</div>

The link shared by @johnh has a section handling this case. You can create the sysimage from a REPL execution in which you can interact with any stdin requests your code does.
