# Using PackageCompiler Header file time modified even content not changed using force

**URL:** <https://discourse.julialang.org/t/using-packagecompiler-header-file-time-modified-even-content-not-changed-using-force/124441>\
**Category:** General Usage\
**Tags:** package-compiler, c\
**Created:** [January 5, 2025, 6:51am UTC](https://discourse.julialang.org/t/using-packagecompiler-header-file-time-modified-even-content-not-changed-using-force/124441 "2025-01-05T06:51:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xgdgsc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xgdgsc/32/608_2.png) [@xgdgsc](https://discourse.julialang.org/u/xgdgsc)\
**Post date:** [January 5, 2025, 6:51am UTC](https://discourse.julialang.org/t/using-packagecompiler-header-file-time-modified-even-content-not-changed-using-force/124441/1 "2025-01-05T06:51:17Z")

</div>

Currently the build command

```julia
create_library(".", "MyLib";
    lib_name="libmine",
    precompile_execution_file="build/generate_precompile.jl",
    precompile_statements_file="build/additional_precompile.jl",
    header_files=["build/mylib.h"], force=true, filter_stdlibs=true,
    incremental=true)

```

have to recreate the header files. And in the Cpp project that uses the header, I have to recompile the cpp project everytime I recompile the julia project. Is there a way to keep the c interface header files untouched if not changed anything in the interface so that the cpp project doesn’ t needs recompiling just a relinking? Do I have to copy the interface headers everytime there’ s a change?

---

<div class="post-metadata">

**Author:** ![benc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/benc/32/46974_2.png) [@benc](https://discourse.julialang.org/u/benc)\
**Post date:** [January 5, 2025, 2:00pm UTC](https://discourse.julialang.org/t/using-packagecompiler-header-file-time-modified-even-content-not-changed-using-force/124441/2 "2025-01-05T14:00:00Z")

</div>

For the C/C++ part, C++ compilers with the right toolchain usually do not recompile (it’s been a few years though since I’ve used them) if the header has not changed, and even if the compiler checks by timestamp, and not content, then tools suchs as ccache can drastically reduce recompile times. [https://ccache.dev/](https://ccache.dev/)  
If that does not work, you can add a hook to your build system that only recompiles if the md5/sha hash of that header has changed, or even use a symlink that only gets updated if the hash changes?
