diff --git a/templates/common/build_icon.sh b/templates/common/build_icon.sh
index 6131a04c976fe61d2e579ae744e0ba49f7b3bbf3..67c648af491decfa1dda3e3e2e5c03520939453f 100644
--- a/templates/common/build_icon.sh
+++ b/templates/common/build_icon.sh
@@ -27,6 +27,7 @@ if [ ! -z "$SPACK_BUILD_ICON" ]; then
   else
     spack repo add ${WORKDIR}/proj/spack_repo
   fi
+  spack spec $SPACK_BUILD_ICON
   spack install $SPACK_BUILD_ICON
   spack load $SPACK_BUILD_ICON
 else