Failed to install opencv 4.6.0 on ubuntu

Hi
I am a newbie on installing opencv from scratch. I am trying to install opencv-4.6.0 on ubuntu followed the instruction. The first step is successful without any error:

cmake -D CMAKE_INSTALL_PREFIX=my_opencv_4.6.0 /scratch/softwares/packages/opencv-4.6.0

However, in the second step cmake --build .
I met the following errors:

/home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw/iw_image.h:72:8: note: in expansion of macro 'IW_INLINE'
   72 | static IW_INLINE IwiBorderSize iwiSizeToBorderSize(
      |        ^~~~~~~~~
In file included from /home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw_own.h:22,
                 from /home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/src/iw_core.c:15:
/home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw/iw_image.h:72:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'iwiSizeToBorderSize'
   72 | static IW_INLINE IwiBorderSize iwiSizeToBorderSize(
      |                                ^~~~~~~~~~~~~~~~~~~
In file included from /home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw_own.h:21,
                 from /home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/src/iw_core.c:15:
/home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw/iw_core.h:79:19: error: unknown type name 'inline'
   79 | #define IW_INLINE inline
      |                   ^~~~~~
/home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw/iw_image.h:85:8: note: in expansion of macro 'IW_INLINE'
   85 | static IW_INLINE IwiBorderSize iwiSizeSymToBorderSize(
      |        ^~~~~~~~~
In file included from /home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw_own.h:22,
                 from /home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/src/iw_core.c:15:
/home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw/iw_image.h:85:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'iwiSizeSymToBorderSize'
   85 | static IW_INLINE IwiBorderSize iwiSizeSymToBorderSize(
      |                                ^~~~~~~~~~~~~~~~~~~~~~
/home/btan/prodisk/softwares/tmp/3rdparty/ippicv/ippicv_lnx/iw/include/iw/iw_image.h:98:18: error: expected ';' before 'void'
   98 | static IW_INLINE void* iwiShiftPtr(
      |                  ^~~~

Does anyone can help how to correct it?

Thanks