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

Use ccache for CI #977

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
17 changes: 13 additions & 4 deletions scripts/gitlab/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,19 @@ then
rm -rf ${build_dir} 2>/dev/null
mkdir -p ${build_dir} && cd ${build_dir}

cmake \
-C ${hostconfig_path} \
${project_dir}
cmake --build . -j 32
if [[ ${sys_type} == *toss_3* ]]; then
cmake \
-DENABLE_CCACHE=ON \
-DCCACHE_DIR=/collab/usr/global/tools/ccache/toss_3_x86_64_ib/ccache-4.2/bin/ccache \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does ccache work well with a single location that may be targeted by several builds simultaneously? (Maybe it creates a unique subdir per configuration hash?)
Also, in the log I see:

CMake Warning:
  Manually-specified variables were not used by the project:
    CCACHE_DIR

Are we sure this is taken into account by BLT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that's the binary location, not the location of the data...

Then, where is the data stored? If it's in the working directory, then I'm afraid this won't help much. That's because the working directory changes with the runner hash, the job rank on the runner (0 to 7), and then we have no guarantee that the same target will be rebuilt there.

This is not a lost cause though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a typo in my BLT changes :D and we can change the location via a config file. I am trying to work out the best way to set up the config, I think we will need to it via env var.

-C ${hostconfig_path} \
${project_dir}
cmake --build . -j 32
else
cmake \
-C ${hostconfig_path} \
${project_dir}
cmake --build . -j 32
fi
fi

# Test
Expand Down