Issues building with caffe2 enabled
Labels: caffe2, triaged

### 🐛 Describe the bug

When attempting to build from main (57e19ad86d072c10851c12e77d03a78e54bd7ad4) i am unable to build successfully with the following cmake commands:
```shell
BUILD_CAFFE2=ON BUILD_CAFFE2_OPS=ON USE_MKLDNN=ON python setup.py install
```
Output:
```shell
#31 5185.6 /opt/pytorch/caffe2/operators/generate_proposals_op_util_nms_gpu_test.cc:449:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
#31 5185.6    for (int itest = 0; itest < input_thresh.size(); ++itest) {
#31 5185.6                        ~~~~~~^~~~~~~~~~~~~~~~~~~~~
#31 5209.1 In file included from /opt/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include/dnnl.h:20:0,
#31 5209.1                  from /opt/pytorch/third_party/ideep/include/ideep/abstract_types.hpp:4,
#31 5209.1                  from /opt/pytorch/third_party/ideep/include/ideep.hpp:39,
#31 5209.1                  from /opt/pytorch/caffe2/ideep/ideep_utils.h:6,
#31 5209.1                  from /opt/pytorch/caffe2/python/pybind_state_ideep.cc:12:
#31 5209.1 /opt/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include/oneapi/dnnl/dnnl.h:23:10: fatal error: oneapi/dnnl/dnnl_config.h: No such file or directory
#31 5209.1  #include "oneapi/dnnl/dnnl_config.h"
#31 5209.1           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#31 5209.1 compilation terminated.
#31 5209.1 make[2]: *** [caffe2/CMakeFiles/caffe2_pybind11_state_gpu.dir/python/pybind_state_ideep.cc.o] Error 1
#31 5209.1 make[2]: *** Waiting for unfinished jobs....
#31 5225.2 make[1]: *** [caffe2/CMakeFiles/caffe2_pybind11_state_gpu.dir/all] Error 2
#31 5225.2 make[1]: *** Waiting for unfinished jobs....
#31 5258.6 /opt/pytorch/torch/csrc/cuda/shared/cudart.cpp: In function ‘void torch::cuda::shared::initCudartBindings(PyObject*)’:
#31 5258.6 /opt/pytorch/torch/csrc/cuda/shared/cudart.cpp:103:7: warning: ‘cudaError_t cudaProfilerInitialize(const char*, const char*, cudaOutputMode_t)’ is deprecated [-Wdeprecated-declarations]
#31 5258.6        cudaProfilerInitialize);
#31 5258.6        ^~~~~~~~~~~~~~~~~~~~~~
#31 5258.6 In file included from /opt/pytorch/torch/csrc/cuda/shared/cudart.cpp:5:0:
#31 5258.6 /usr/local/cuda/include/cuda_profiler_api.h:134:57: note: declared here
#31 5258.6  extern __CUDA_DEPRECATED __host__ cudaError_t CUDARTAPI cudaProfilerInitialize(const char *configFile,
#31 5258.6                                                          ^~~~~~~~~~~~~~~~~~~~~~
#31 5317.0 make: *** [all] Error 2
```

It looks like the `dnnl_config.h.in` is not being configured in `third_party/ideep/mkl-dnn/third_party/oneDNN/CMakeLists.txt`

### Versions

Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.27

Python version: 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.4.0-128-generic-x86_64-with-glibc2.27
Is CUDA available: N/A
CUDA runtime version: 11.7.99
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 470.161.03
Nvidia driver version: Could not collect
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.5.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

CPU:
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              16
On-line CPU(s) list: 0-15
Thread(s) per core:  2
Core(s) per socket:  8
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               165
Model name:          Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
Stepping:            5
CPU MHz:             4818.277
CPU max MHz:         5100.0000
CPU min MHz:         800.0000
BogoMIPS:            7599.80
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            16384K
NUMA node0 CPU(s):   0-15
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp pku ospke md_clear flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.24.3
[conda] blas                      1.0                         mkl  
[conda] mkl                       2023.1.0         h6d00ec8_46342  
[conda] mkl-service               2.4.0           py310h5eee18b_1  
[conda] mkl_fft                   1.3.6           py310h1128e8f_1  
[conda] mkl_random                1.2.2           py310h1128e8f_1  
[conda] numpy                     1.24.3          py310h5f9d8c6_1  
[conda] numpy-base                1.24.3          py310hb5e798b_1