# PackageCompiler not compiles some statements

**URL:** <https://discourse.julialang.org/t/packagecompiler-not-compiles-some-statements/57803>\
**Category:** General Usage\
**Tags:** package, precompilation, package-compiler\
**Created:** [March 23, 2021, 5:20pm UTC](https://discourse.julialang.org/t/packagecompiler-not-compiles-some-statements/57803 "2021-03-23T17:20:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vangelis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vangelis/32/14063_2.png) [@Vangelis](https://discourse.julialang.org/u/Vangelis)\
**Post date:** [March 23, 2021, 5:20pm UTC](https://discourse.julialang.org/t/packagecompiler-not-compiles-some-statements/57803/1 "2021-03-23T17:20:07Z")

</div>

Hi,  
I am trying to build a system image for the (simple) module below:

```julia
module TestCatAF

function myfunc(m1, m2)
        return cat(m1, m2, dims=(1,2))
end

Base.@ccallable function call_myfunc()::Cdouble
        M1 = [1 2; 3 4]
        M2 = [5 6; 7 8]
        mm=myfunc(M1,M2)
        return 2.1
end

if abspath(PROGRAM_FILE) == @ __FILE__
        println("result is:", call_myfunc())
end

end # module

```

After creating the binary, I called the `call_myfunc` from a C++ code. Running it with the callgrind tool, I was able to see the call stack and, to my surprise, the JIT was called.  
In more details, I would expect that if I have a pre-compilation statement then it should be compiled.  
Strangely, this is not always true. On the above example, the “cat” call exists on the pre-compilation file:

```julia
precompile(Tuple{getfield(Base, Symbol("#cat_t##kw")), NamedTuple{(:dims,), Tuple{Tuple{Int64, Int64}}}, typeof(Base.cat_t), Type{Int64}, Array{Int64, 2}, Vararg{Array{Int64, 2}, N} where N})
precompile(Tuple{getfield(Base, Symbol("##cat_t#110")), Tuple{Int64, Int64}, typeof(Base.cat_t), Type{Int64}, Array{Int64, 2}, Vararg{Array{Int64, 2}, N} where N})

```

but it cannot be compiled and goes through the JIT (as you can see on the attached picture)

 ![callgrind](https://global.discourse-cdn.com/julialang/original/3X/3/7/37db2816c10314ac81f3812a064759ab745dfc22.jpeg)

Diving deeper to the “cat” function, it turned out that the input argument is of type “Any”.  
below is the output of the `@which`

 ![julia_cat](https://global.discourse-cdn.com/julialang/original/3X/2/1/2107a8c8a30f4ebdf8546b2f845ab3f50ca0d284.png)  
Is there a way, to fully compile the “cat” function so that the JIT is not used?

Thanks!
