diff --git a/README.md b/README.md
index d7f700fcd33e22a17f7b41b9228d355ce5b119d6..7ff1a0d4f3dcdf2972f777949530ebb342636fa7 100644
--- a/README.md
+++ b/README.md
@@ -36,9 +36,16 @@ Download the trained models at [Onedrive](https://mailstsinghuaeducn-my.sharepoi
 * Ubuntu 18.04/20.04, CUDA 10.1/10.2/11.6, python >= 3.7, PyTorch >= 1.9, torchvision
 * Install `detectron2` from [source](https://github.com/facebookresearch/detectron2)
 * `sh scripts/install_deps.sh`
-* Compile the cpp extension for `farthest points sampling (fps)`:
+* Compile the cpp extensions for 
+1. `farthest points sampling (fps)`
+2. `flow`
+3. `uncertainty pnp`
+4. `ransac_voting`
+5. `chamfer distance`
+6. `egl renderer`
+
     ```
-    sh core/csrc/compile.sh
+    sh ./scripts/compile_all.sh
     ```
 
 ## Detection
diff --git a/core/csrc/flow/src/flow_cuda_kernel.cu b/core/csrc/flow/src/flow_cuda_kernel.cu
index f0c822734c7733e6ffe7096a8ebdfcae9946f107..c21abcb5d9ff15ce126e2c433c359c4fb679eb4b 100644
--- a/core/csrc/flow/src/flow_cuda_kernel.cu
+++ b/core/csrc/flow/src/flow_cuda_kernel.cu
@@ -1,9 +1,7 @@
 #include <torch/extension.h>
 #include <ATen/cuda/CUDAContext.h>
 
-#include <THC/THC.h>
-#include <THC/THCAtomics.cuh>
-#include <THC/THCDeviceUtils.cuh>
+
 #include <cfloat>
 
 #include <cuda.h>
diff --git a/core/csrc/ransac_voting/src/ransac_voting.cpp b/core/csrc/ransac_voting/src/ransac_voting.cpp
index 2abb995b79350f694234c756a6cc785a0efd11da..24ec3b5ffc28ab03df556adcb8092bbb49313b1a 100644
--- a/core/csrc/ransac_voting/src/ransac_voting.cpp
+++ b/core/csrc/ransac_voting/src/ransac_voting.cpp
@@ -3,8 +3,6 @@
 #include <iostream>
 #include <vector>
 
-extern THCState* state;
-
 
 #define CHECK_CUDA(x)                                          \
   do {                                                         \
diff --git a/core/csrc/uncertainty_pnp/_ext.o b/core/csrc/uncertainty_pnp/_ext.o
deleted file mode 100644
index 8dfa888c91d23dcfab9a93806e257ca5e491ec31..0000000000000000000000000000000000000000
Binary files a/core/csrc/uncertainty_pnp/_ext.o and /dev/null differ
diff --git a/core/csrc/uncertainty_pnp/src/uncertainty_pnp.cpp.o b/core/csrc/uncertainty_pnp/src/uncertainty_pnp.cpp.o
deleted file mode 100644
index ffed8c4179c1813e9c81548dac2d0570af7b82e9..0000000000000000000000000000000000000000
Binary files a/core/csrc/uncertainty_pnp/src/uncertainty_pnp.cpp.o and /dev/null differ