diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a55506b59bf52332f6b3376e563e57e47668efd..ab6e988939780c1f9663715befd27f8524f7418d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -777,6 +777,8 @@ set(PHY_NRLDPC_CODINGIF
 
 add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts_neon.c)
 
+add_library(crc_byte OBJECT ${OPENAIR1_DIR}/PHY/CODING/crc_byte.c)
+
 set(PHY_SRC_COMMON
   ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c
   ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/lte_mcs.c
@@ -802,7 +804,6 @@ set(PHY_SRC_COMMON
   ${OPENAIR1_DIR}/PHY/CODING/ccoding_byte.c
   ${OPENAIR1_DIR}/PHY/CODING/ccoding_byte_lte.c
   ${OPENAIR1_DIR}/PHY/CODING/3gpplte_sse.c
-  ${OPENAIR1_DIR}/PHY/CODING/crc_byte.c
   ${PHY_TURBOIF}
   ${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c
   ${OPENAIR1_DIR}/PHY/CODING/viterbi.c
@@ -1019,9 +1020,11 @@ if (${SMBV})
 endif  (${SMBV})
 
 add_library(PHY_COMMON ${PHY_SRC_COMMON})
-target_link_libraries(PHY_COMMON PRIVATE shlib_loader)
+target_link_libraries(PHY_COMMON
+  PRIVATE shlib_loader asn1_lte_rrc_hdrs crc_byte
+  PUBLIC UTIL
+)
 add_dependencies(PHY_COMMON dfts)
-target_link_libraries(PHY_COMMON PRIVATE asn1_lte_rrc_hdrs PUBLIC UTIL)
 
 add_library(PHY ${PHY_SRC})
 target_link_libraries(PHY PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
@@ -1954,12 +1957,17 @@ target_link_libraries(smallblocktest PRIVATE
 
 
 add_executable(ldpctest
-   ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
-   )
+  ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
+  ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_load.c
+)
 target_link_libraries(ldpctest PRIVATE
   -Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON -Wl,--end-group
-  m pthread dl shlib_loader ${T_LIB} nr_coding_segment_utils
-  )
+  m pthread dl shlib_loader ${T_LIB}
+  # link 'check_crc' to make it resolved in the LDPC coding libraries
+  # 'check_crc' is not used in ldpctest so it is not linked in the executable by default
+  # --whole-archive links 'check_crc' in the executable even though it is note used, see 'man ld'
+  -Wl,--whole-archive crc_byte -Wl,--no-whole-archive
+)
 
 add_executable(nr_dlschsim
   ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c
@@ -2113,7 +2121,7 @@ if (${T_TRACER})
         PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU
         L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_UE_NR ngap
         CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU OPENAIR0_LIB
-        dfts config_internals nr_common)
+        dfts config_internals nr_common crc_byte)
     if (TARGET ${i})
       add_dependencies(${i} generate_T)
     endif()
diff --git a/openair1/PHY/CODING/CMakeLists.txt b/openair1/PHY/CODING/CMakeLists.txt
index c469a2b2360a6704afc2e9299f3f4ce3ceb0a18f..e4e8d43a955a2faa92387a4b555e2f6a457294ce 100644
--- a/openair1/PHY/CODING/CMakeLists.txt
+++ b/openair1/PHY/CODING/CMakeLists.txt
@@ -13,28 +13,36 @@ add_library(ldpc_orig MODULE
             nrLDPC_encoder/ldpc_encoder.c
 )
 set_target_properties(ldpc_orig PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-target_link_libraries(ldpc_orig PRIVATE ldpc_gen_HEADERS)
+target_link_libraries(ldpc_orig PRIVATE ldpc_segment ldpc_gen_HEADERS)
 
 add_library(ldpc_optim MODULE
             nrLDPC_decoder/nrLDPC_decoder.c
             nrLDPC_encoder/ldpc_encoder_optim.c
 )
 set_target_properties(ldpc_optim PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-target_link_libraries(ldpc_optim PRIVATE ldpc_gen_HEADERS)
+target_link_libraries(ldpc_optim PRIVATE ldpc_segment ldpc_gen_HEADERS)
 
 add_library(ldpc_optim8seg MODULE
             nrLDPC_decoder/nrLDPC_decoder.c
             nrLDPC_encoder/ldpc_encoder_optim8seg.c
 )
 set_target_properties(ldpc_optim8seg PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-target_link_libraries(ldpc_optim8seg PRIVATE ldpc_gen_HEADERS)
+target_link_libraries(ldpc_optim8seg PRIVATE ldpc_segment ldpc_gen_HEADERS)
 
-add_library(ldpc_optim8segmulti MODULE
+add_library(ldpc MODULE
             nrLDPC_decoder/nrLDPC_decoder.c
             nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
 )
-set_target_properties(ldpc_optim8segmulti PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-target_link_libraries(ldpc_optim8segmulti PRIVATE ldpc_gen_HEADERS)
+set_target_properties(ldpc PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
+target_link_libraries(ldpc PRIVATE ldpc_segment ldpc_gen_HEADERS)
+
+add_dependencies(ldpctest ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
+add_dependencies(nr-softmodem ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
+add_dependencies(nr-uesoftmodem ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
+add_dependencies(nr_ulsim ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
+add_dependencies(nr_ulschsim ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
+add_dependencies(nr_dlsim ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
+add_dependencies(nr_dlschsim ldpc ldpc_orig ldpc_optim ldpc_optim8seg)
 
 add_custom_target(nrLDPC_decoder_kernels_CL
                   COMMAND gcc nrLDPC_decoder/nrLDPC_decoder_CL.c -dD -DNRLDPC_KERNEL_SOURCE -E -o ${CMAKE_CURRENT_BINARY_DIR}/nrLDPC_decoder_kernels_CL.clc
@@ -46,7 +54,7 @@ add_library(ldpc_cl MODULE
             nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
 )
 set_target_properties(ldpc_cl PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-target_link_libraries(ldpc_cl PRIVATE OpenCL)
+target_link_libraries(ldpc_cl PRIVATE ldpc_segment OpenCL)
 add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL)
 
 ##############################################
@@ -64,14 +72,24 @@ if (ENABLE_LDPC_CUDA)
   cuda_add_library(ldpc_cuda MODULE
                    nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
                    nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
+                   # The slot coding layer cannot be linked with
+                   # target_link_libraries like above
+                   # because of cuda_add_library
+                   # which already uses target_link_libraries
+                   nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_decoder.c
+                   nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c
+                   nrLDPC_coding/nrLDPC_coding_segment/nr_rate_matching.c
   )
   set_target_properties(ldpc_cuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
   set_target_properties(ldpc_cuda PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-endif()
 
-add_dependencies(ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc_optim8segmulti)
-if (ENABLE_LDPC_CUDA)
   add_dependencies(ldpctest ldpc_cuda)
+  add_dependencies(nr-softmodem ldpc_cuda)
+  add_dependencies(nr-uesoftmodem ldpc_cuda)
+  add_dependencies(nr_ulsim ldpc_cuda)
+  add_dependencies(nr_ulschsim ldpc_cuda)
+  add_dependencies(nr_dlsim ldpc_cuda)
+  add_dependencies(nr_dlschsim ldpc_cuda)
 endif()
 
 add_subdirectory(nrLDPC_coding)
diff --git a/openair1/PHY/CODING/DOC/LDPCImplementation.md b/openair1/PHY/CODING/DOC/LDPCImplementation.md
index cf5fb506c8591543a3ec5d7d53edd8d4dcf0c091..2880c45ecfd1f0feeddd0d9129d4ce78b0b2e27b 100644
--- a/openair1/PHY/CODING/DOC/LDPCImplementation.md
+++ b/openair1/PHY/CODING/DOC/LDPCImplementation.md
@@ -28,9 +28,6 @@ shlib_path libldpc.so
 `libldpc.so` has its decoder implemented in [nrLDPC_coding_segment_decoder.c](file://../nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_decoder.c).\
 Its encoder is implemented in [nrLDPC_coding_segment_encoder.c](file://../nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c).
 
-*Note: The segment coding library `libldpc.so` is an adaptation layer between the slot coding interface and a segment coding library.*
-*The segment coding library is `libldpc_optim8segmulti.so` by default but it can be chosen with option `--nrLDPC_coding_segment.segment_shlibversion` followed by the library version - like with `--loader.ldpc.shlibversion` in the slot coding case -*
-
 loading `libldpc_t2.so` instead of `libldpc.so`:
 
 `make ldpc_t2`
@@ -114,28 +111,29 @@ Libraries implementing the slotwise LDPC coding must be named `libldpc<_version>
 The interface of the library is defined in [nrLDPC_defs.h](file://../nrLDPC_defs.h).
 The code loading the LDPC library is in [nrLDPC_load.c](file://../nrLDPC_load.c), in function `load_nrLDPClib`, which must be called at init time.
 
-*Note: LDPC segment coding libraries are not loaded directly by OAI but by the intermediate library `libldpc.so` which is implementing the LDPC slot coding interface using a LDPC segment coding library.*
+LDPC segment coding libraries are not loaded directly by OAI but are statically linked in libraries implementing the LDPC slot coding interface using an adaptation layer between the slot coding interface and the segment coding interface.  
+This way, these libraries can be loaded to implement the slot coding interface as well as the segment coding interface in `ldpctest`.
 
 ### Selecting the LDPC library at run time
 
-By default the function `int load_nrLDPClib(void)` looks for `libldpc_optim8segmulti.so`, this default behavior can be changed using the oai loader configuration options in the configuration file or from the command line as shown below:
+By default the function `int load_nrLDPClib(void)` looks for `libldpc.so`, this default behavior can be changed using the oai loader configuration options in the configuration file or from the command line as shown below:
 
 #### Examples of ldpc shared lib selection when running nr softmodem's:
 
-loading `libldpc_optim8seg.so` instead of `libldpc_optim8segmulti.so`:
+loading `libldpc_optim8seg.so` instead of `libldpc.so`:
 
 ```
-./nr-softmodem -O libconfig:gnb.band78.tm1.106PRB.usrpx300.conf:dbgl5  --nrLDPC_coding_segment.segment_shlibversion _optim8seg
+./nr-softmodem -O libconfig:gnb.band78.tm1.106PRB.usrpx300.conf:dbgl5  --loader.ldpc.shlibversion _optim8seg
 .......................
-[CONFIG] nrLDPC_coding_segment.segment_shlibversion set to default value "_optim8segmulti"
-[LIBCONFIG] nrLDPC_coding_segment: 1/1 parameters successfully set, (0 to default value)
-[CONFIG] segment_shlibversion set to  _optim8seg from command line
-[CONFIG] nrLDPC_coding_segment 1 options set from command line
+[CONFIG] loader.ldpc.shlibversion set to default value ""
+[LIBCONFIG] loader.ldpc: 2/2 parameters successfully set, (1 to default value)
+[CONFIG] shlibversion set to  _optim8seg from command line
+[CONFIG] loader.ldpc 1 options set from command line
 [LOADER] library libldpc_optim8seg.so successfully loaded
 ........................
 ```
 
-loading `libldpc_cl.so` instead of `libldpc_optim8segmulti.so`:
+loading `libldpc_cl.so` instead of `libldpc.so`:
 
 `make ldpc_cl`
 
@@ -161,7 +159,7 @@ Built target ldpc_cl
 
 At runtime, to successfully use hardware acceleration via OpenCL, you need to install vendor specific packages which deliver the required drivers and tools to make use of their GPU (Nvidia, Intel...) , fpga (Xilinx, Intel) or CPU (Intel, AMD, ARM...) through OpenCL. 
 
-`./nr-softmodem -O  libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server  --log_config.gtpu_log_level info  --nrLDPC_coding_segment.segment_shlibversion _cl`
+`./nr-softmodem -O  libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server  --log_config.gtpu_log_level info  --loader.ldpc.shlibversion _cl`
 
 ``` 
 ------------------------------------------------
@@ -196,12 +194,12 @@ At runtime, to successfully use hardware acceleration via OpenCL, you need to in
 -----------------------------------------------------------------
 ```
 
-`./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim -O libconfig:/usr/local/oai/conf/nrue_sim.conf:dbgl5 --nrLDPC_coding_segment.segment_shlibversion _cl --log_config.hw_log_level info`
+`./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim -O libconfig:/usr/local/oai/conf/nrue_sim.conf:dbgl5 --loader.ldpc.shlibversion _cl --log_config.hw_log_level info`
 
 ```
 ............................................................
 [CONFIG] segment_shlibversion set to  _cl from command line
-[CONFIG] nrLDPC_coding_segment 1 options set from command line
+[CONFIG] loader.ldpc 1 options set from command line
 [LOADER] library libldpc_cl.so successfully loaded
 [HW]   Platform 0, OpenCL profile FULL_PROFILE
 [HW]   Platform 0, OpenCL version OpenCL 2.1 LINUX
@@ -254,7 +252,7 @@ SNR0 -2.000000:
 [CONFIG] log_config: 16/16 parameters successfully set 
 log init done
 [CONFIG] loader: 2/2 parameters successfully set 
-[CONFIG] loader.ldpc: 1/2 parameters successfully set 
+[CONFIG] loader.ldpc: 2/2 parameters successfully set 
 [LOADER] library libldpc_cuda.so successfully loaded
 ...................................
 ```
diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
index 71c2f1af27240345dc389037bd95b7219a663e06..0fa81f360bb01dbc30f7b9cbfe25979a6ac85287 100644
--- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c
+++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
@@ -403,7 +403,7 @@ int main(int argc, char *argv[])
 {
   short block_length=8448; // decoder supports length: 1201 -> 1280, 2401 -> 2560
   // default to check output inside ldpc, the NR version checks the outer CRC defined by 3GPP
-  char *ldpc_version = "_optim8segmulti";
+  char *ldpc_version = "";
   /* version of the ldpc decoder library to use (XXX suffix to use when loading libldpc_XXX.so */
   short max_iterations=5;
   int n_segments=1;
diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/CMakeLists.txt b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/CMakeLists.txt
index ed8de90594990105cf21c57d60af9704626f1827..f96a2cfacada2e46861ad82099a00e4016eee41e 100644
--- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/CMakeLists.txt
+++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/CMakeLists.txt
@@ -1,39 +1,10 @@
-add_library(nr_coding_segment_utils OBJECT
-  nrLDPC_load.c
+add_library(ldpc_segment OBJECT
   nr_rate_matching.c
-)
-
-add_library(nr_coding_segment_decoder OBJECT
   nrLDPC_coding_segment_decoder.c
-)
-
-add_library(nr_coding_segment_encoder OBJECT
   nrLDPC_coding_segment_encoder.c
 )
 
 #ensure that the T header files are generated before targets depending on them
 if (${T_TRACER})
-  add_dependencies(nr_coding_segment_utils generate_T)
-  add_dependencies(nr_coding_segment_decoder generate_T)
-  add_dependencies(nr_coding_segment_encoder generate_T)
+  add_dependencies(ldpc_segment generate_T)
 endif (${T_TRACER})
-
-add_library(ldpc MODULE)
-target_link_libraries(ldpc PRIVATE
-  nr_coding_segment_decoder
-  nr_coding_segment_encoder
-  nr_coding_segment_utils
-)
-set_target_properties(ldpc PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
-
-add_dependencies(nr-softmodem ldpc)
-add_dependencies(nr-uesoftmodem ldpc)
-add_dependencies(nr_ulsim ldpc)
-add_dependencies(nr_ulschsim ldpc)
-add_dependencies(nr_dlsim ldpc)
-add_dependencies(nr_dlschsim ldpc)
-
-add_dependencies(ldpc ldpc_orig ldpc_optim ldpc_optim8seg ldpc_optim8segmulti)
-if (ENABLE_LDPC_CUDA)
-  add_dependencies(ldpc ldpc_cuda)
-endif()
diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_decoder.c b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_decoder.c
index 3d228da0089c441cae930af0a3c6d793856e056b..9b36197e45ee9ea22a04fbfe55f4d50d5d6e8cdf 100644
--- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_decoder.c
+++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_decoder.c
@@ -120,9 +120,6 @@ typedef struct nrLDPC_decoding_parameters_s {
   time_stats_t *p_ts_ldpc_decode;
 } nrLDPC_decoding_parameters_t;
 
-// Global var to limit the rework of the dirty legacy code
-ldpc_interface_t ldpc_interface_segment;
-
 static void nr_process_decode_segment(void *arg)
 {
   nrLDPC_decoding_parameters_t *rdata = (nrLDPC_decoding_parameters_t *)arg;
@@ -219,7 +216,7 @@ static void nr_process_decode_segment(void *arg)
 
   ////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
   int decodeIterations =
-      ldpc_interface_segment.LDPCdecoder(p_decoderParms, 0, 0, 0, l, llrProcBuf, p_procTime, rdata->abort_decode);
+      LDPCdecoder(p_decoderParms, 0, 0, 0, l, llrProcBuf, p_procTime, rdata->abort_decode);
 
   if (decodeIterations <= p_decoderParms->numMaxIter) {
     memcpy(rdata->c, llrProcBuf, K >> 3);
@@ -285,19 +282,11 @@ int nrLDPC_prepare_TB_decoding(nrLDPC_slot_decoding_parameters_t *nrLDPC_slot_de
 
 int32_t nrLDPC_coding_init(void)
 {
-  char *segment_shlibversion = NULL;
-  paramdef_t LoaderParams[] = {
-      {"segment_shlibversion", NULL, 0, .strptr = &segment_shlibversion, .defstrval = "_optim8segmulti", TYPE_STRING, 0, NULL}};
-  config_get(config_get_if(), LoaderParams, sizeofArray(LoaderParams), "nrLDPC_coding_segment");
-  load_LDPClib(segment_shlibversion, &ldpc_interface_segment);
-
   return 0;
 }
 
 int32_t nrLDPC_coding_shutdown(void)
 {
-  free_LDPClib(&ldpc_interface_segment);
-
   return 0;
 }
 
diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c
index adf9dd6624109309b6a898893ef8ea2a5b0f8b3c..95141e88454a9873f0a90e18d8cdb4dddb23da83 100644
--- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c
+++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c
@@ -73,7 +73,7 @@ static void ldpc8blocks_coding_segment(void *p)
   for (int r = 0; r < nrLDPC_TB_encoding_parameters->C; r++)
     c[r] = nrLDPC_TB_encoding_parameters->segments[r].c;
   start_meas(&nrLDPC_TB_encoding_parameters->segments[impp->macro_num * 8].ts_ldpc_encode);
-  ldpc_interface_segment.LDPCencoder(c, d, impp);
+  LDPCencoder(c, d, impp);
   stop_meas(&nrLDPC_TB_encoding_parameters->segments[impp->macro_num * 8].ts_ldpc_encode);
   // Compute where to place in output buffer that is concatenation of all segments
 
diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/CMakeLists.txt b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/CMakeLists.txt
index f51eb9d8ca43c7dffa2fbcc5334eba71d705abe2..0325858389f2b07c58ee0c14f6be12a25b23bc1c 100644
--- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/CMakeLists.txt
+++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/CMakeLists.txt
@@ -10,6 +10,9 @@ if (ENABLE_LDPC_XDMA)
   add_library(ldpc_xdma MODULE
               nrLDPC_coding_xdma_offload.c
               nrLDPC_coding_xdma.c
+              ../nrLDPC_coding_segment/nr_rate_matching.c
+              ../nrLDPC_coding_segment/nrLDPC_coding_segment_encoder.c
+              ../../nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
   )
   target_include_directories(ldpc_xdma PRIVATE ../nrLDPC_coding_segment)
 
@@ -18,10 +21,7 @@ if (ENABLE_LDPC_XDMA)
     add_dependencies(ldpc_xdma generate_T)
   endif (${T_TRACER})
 
-  target_link_libraries(ldpc_xdma PRIVATE
-    nr_coding_segment_encoder
-    nr_coding_segment_utils
-  )
+  target_link_libraries(ldpc_xdma PRIVATE ldpc_gen_HEADERS)
   set_target_properties(ldpc_xdma PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
 
   add_dependencies(nr-softmodem ldpc_xdma)
@@ -31,9 +31,4 @@ if (ENABLE_LDPC_XDMA)
   add_dependencies(nr_dlsim ldpc_xdma)
   add_dependencies(nr_dlschsim ldpc_xdma)
 
-  add_dependencies(ldpc_xdma ldpc_orig ldpc_optim ldpc_optim8seg ldpc_optim8segmulti)
-  if (ENABLE_LDPC_CUDA)
-    add_dependencies(ldpc_xdma ldpc_cuda)
-  endif()
-
 endif()
diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
index 5df0bd4406f82b65edc2c91f8f2850c9065bf95c..7960215ab7bb8ba76f081196f82eb9d4c2e375a1 100644
--- a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
+++ b/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_xdma/nrLDPC_coding_xdma.c
@@ -62,7 +62,6 @@
 #include "PHY/CODING/nrLDPC_coding/nrLDPC_coding_interface.h"
 
 // Global var to limit the rework of the dirty legacy code
-ldpc_interface_t ldpc_interface_segment;
 int num_threads_prepare_max = 0;
 char *user_device = NULL;
 char *enc_read_device = NULL;
@@ -98,10 +97,8 @@ void nr_ulsch_FPGA_decoding_prepare_blocks(void *args);
 
 int32_t nrLDPC_coding_init(void)
 {
-  char *encoder_shlibversion = NULL;
   paramdef_t LoaderParams[] = {
       {"num_threads_prepare", NULL, 0, .iptr = &num_threads_prepare_max, .defintval = 0, TYPE_INT, 0, NULL},
-      {"encoder_shlibversion", NULL, 0, .strptr = &encoder_shlibversion, .defstrval = "_optim8segmulti", TYPE_STRING, 0, NULL},
       {"user_device", NULL, 0, .strptr = &user_device, .defstrval = DEVICE_NAME_DEFAULT_USER, TYPE_STRING, 0, NULL},
       {"enc_read_device", NULL, 0, .strptr = &enc_read_device, .defstrval = DEVICE_NAME_DEFAULT_ENC_READ, TYPE_STRING, 0, NULL},
       {"enc_write_device", NULL, 0, .strptr = &enc_write_device, .defstrval = DEVICE_NAME_DEFAULT_ENC_WRITE, TYPE_STRING, 0, NULL},
@@ -110,13 +107,11 @@ int32_t nrLDPC_coding_init(void)
   config_get(config_get_if(), LoaderParams, sizeofArray(LoaderParams), "nrLDPC_coding_xdma");
   AssertFatal(num_threads_prepare_max != 0, "nrLDPC_coding_xdma.num_threads_prepare was not provided");
 
-  load_LDPClib(encoder_shlibversion, &ldpc_interface_segment);
   return 0;
 }
 
 int32_t nrLDPC_coding_shutdown(void)
 {
-  free_LDPClib(&ldpc_interface_segment);
   return 0;
 }
 
diff --git a/openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_load.c b/openair1/PHY/CODING/nrLDPC_load.c
similarity index 100%
rename from openair1/PHY/CODING/nrLDPC_coding/nrLDPC_coding_segment/nrLDPC_load.c
rename to openair1/PHY/CODING/nrLDPC_load.c