# How to install PackageCompiler

**URL:** <https://discourse.julialang.org/t/how-to-install-packagecompiler/23824>\
**Category:** General Usage\
**Tags:** first-steps\
**Created:** [May 3, 2019, 5:21pm UTC](https://discourse.julialang.org/t/how-to-install-packagecompiler/23824 "2019-05-03T17:21:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![certik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/certik/32/2651_2.png) [@certik](https://discourse.julialang.org/u/certik)\
**Post date:** [May 3, 2019, 5:21pm UTC](https://discourse.julialang.org/t/how-to-install-packagecompiler/23824/1 "2019-05-03T17:21:22Z")

</div>

I want to install the `PackageCompiler`, so that I can execute `juliac.jl -vae --compile=all hello.jl`.

Here is how I have done it:

```julia
julia> using Pkg

julia> Pkg.add("PackageCompiler")

```

Here is a simple script called `hello.jl`:

```julia
module Hello

Base.@ccallable function julia_main(ARGS::Vector{String})::Cint
    println("hello, world")
    @show sin(0.0)
    return 0
end

end

```

In order to compile it, I use:

```julia
julia ~/.julia/packages/PackageCompiler/oT98U/juliac.jl -vae --compile=all hello.jl

```

This creates an executable that can be executed as follows:

```julia
$ ./builddir/hello
hello, world
sin(0.0) = 0.0

```

So everything seems to work.

But is there a better way to call the `juliac.jl`? The README for PackageCompiler says I should be able to run it with just `juliac.jl -h`. As you can see, I have to use `julia ~/.julia/packages/PackageCompiler/oT98U/juliac.jl -h` which seems ugly to me.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 3, 2019, 5:28pm UTC](https://discourse.julialang.org/t/how-to-install-packagecompiler/23824/2 "2019-05-03T17:28:45Z")

</div>

I think not. But you can always copy the `juliac.jl` file to another location which is “better”. If you choose your home directory, then you will only need to execute `julia ~/juliac.jl ...`

EDIT: Much better than copying is to create a symbolic link. That way, you will have the new versions when you update the package.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [May 3, 2019, 10:55pm UTC](https://discourse.julialang.org/t/how-to-install-packagecompiler/23824/3 "2019-05-03T22:55:41Z")

</div>

> [@Ronis\_BR](#):
>
> Much better than copying is to create a symbolic link. That way, you will have the new versions when you update the package.

OT but no, because the new version of the package will not be located in the same folder.

---

<div class="post-metadata">

**Author:** ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Post date:** [May 3, 2019, 11:06pm UTC](https://discourse.julialang.org/t/how-to-install-packagecompiler/23824/4 "2019-05-03T23:06:29Z")

</div>

Oh… then, no symlink 😄

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [July 15, 2019, 10:58am UTC](https://discourse.julialang.org/t/how-to-install-packagecompiler/23824/5 "2019-07-15T10:58:23Z")

</div>

just run is O.K. for me

```julia
using PackageCompiler
build_executable("hello.jl")

```

---

<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 5, 2021, 4:38pm UTC](https://discourse.julialang.org/t/how-to-install-packagecompiler/23824/6 "2021-02-05T16:38:48Z")

</div>

This is no longer possible? juliac.jl is not available right now, it’s it?

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 6, 2021, 12:08am UTC](https://discourse.julialang.org/t/how-to-install-packagecompiler/23824/7 "2021-02-06T00:08:17Z")

</div>

The package was rewritten from scratch so instructions from before Feb 2020 are no longer valid. See the current docs.
