Commit 1f2098fc authored by Tsung-Yu Chan's avatar Tsung-Yu Chan Committed by Robert Schmidt

feat / work with cross-compile

  can compile the target ldpc_generators and generate_T with cross-compiler
parent 73bc34b2
......@@ -102,7 +102,7 @@ add_list_string_option(CMAKE_BUILD_TYPE "RelWithDebInfo" "Choose the type of bui
# in case /proc/cpuinfo exists we want to inspect available Intrinsics
# -so not to go always through SIMDE emulation
# -so to avoid AVX512 instructions generation by gcc
if(EXISTS "/proc/cpuinfo")
if(EXISTS "/proc/cpuinfo" AND NOT CROSS_COMPILE)
file(STRINGS "/proc/cpuinfo" CPUFLAGS REGEX flags LIMIT_COUNT 1)
else()
message(WARNING "did not find /proc/cpuinfo -- not setting any x86-specific compilation variables")
......@@ -115,7 +115,10 @@ eval_boolean(AUTODETECT_AVX2 DEFINED CPUFLAGS AND CPUFLAGS MATCHES "avx2")
add_boolean_option(AVX2 ${AUTODETECT_AVX2} "Whether AVX2 intrinsics is available on the host processor" ON)
message(STATUS "CPU architecture is ${CMAKE_SYSTEM_PROCESSOR}")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
if (CROSS_COMPILE)
message(STATUS "setting as aarch64")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -gdwarf-2 -lgcc -lrt")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
# The following intrinsics are assumed to be available on any x86 system
# (avx, f16c, fma, gnfi, mmx, pclmul, sse, sse2, sse3, xop)
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -DSIMDE_X86_AVX_NATIVE -DSIMDE_X86_AVX_NATIVE -DSIMDE_X86_F16C_NATIVE -DSIMDE_X86_FMA_NATIVE -DSIMDE_X86_GFNI_NATIVE -DSIMDE_X86_MMX_NATIVE -DSIMDE_X86_PCLMUL_NATIVE -DSIMDE_X86_SSE2_NATIVE -DSIMDE_X86_SSE3_NATIVE -DSIMDE_X86_SSE_NATIVE -DSIMDE_X86_XOP_HAVE_COM_ -DSIMDE_X86_XOP_NATIVE")
......@@ -146,7 +149,11 @@ else()
message(FATAL_ERROR "compile for CPU architecture ${CPUARCH}, CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}")
endif()
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -march=native")
if (NOT CROSS_COMPILE)
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -march=native")
else ()
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -march=armv8-a")
endif()
# add autotools definitions that were maybe used!
add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP")
......
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc-9)
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++-9)
set(CROSS_COMPILE 1)
set(bnProc_gen_128_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)
set(bnProc_gen_avx2_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)
set(bnProc_gen_avx512_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)
set(cnProc_gen_128_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)
set(cnProc_gen_avx2_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)
set(cnProc_gen_avx512_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)
set(genids_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)
set(_check_vcd_DIR ${CMAKE_CURRENT_BINARY_DIR}/${NATIVE_DIR}) # /../build)
add_executable(genids genids.c)
set_target_properties(genids PROPERTIES RUNTIME_OUTPUT_DIRECTORY .)
if (CROSS_COMPILE)
find_package(genids)
else()
add_executable(genids genids.c)
set_target_properties(genids PROPERTIES RUNTIME_OUTPUT_DIRECTORY .)
export(TARGETS genids FILE
"${CMAKE_BINARY_DIR}/genidsConfig.cmake")
endif()
add_custom_command(OUTPUT T_IDs.h
COMMAND ./genids ${CMAKE_CURRENT_SOURCE_DIR}/T_messages.txt T_IDs.h
COMMAND genids ${CMAKE_CURRENT_SOURCE_DIR}/T_messages.txt T_IDs.h
DEPENDS genids
COMMENT "Generating T_IDs.h from T_messages.txt"
)
......@@ -12,14 +17,19 @@ add_custom_command(OUTPUT T_messages.txt.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_executable(_check_vcd check_vcd.c tracer/database.c tracer/utils.c T_IDs.h T_messages.txt.h)
target_include_directories(_check_vcd PRIVATE
if (CROSS_COMPILE)
find_package(_check_vcd)
else ()
add_executable(_check_vcd check_vcd.c tracer/database.c tracer/utils.c T_IDs.h T_messages.txt.h)
target_include_directories(_check_vcd PRIVATE
.. ../itti ../../../openair2/COMMON tracer
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_options(_check_vcd PRIVATE -Wall)
target_link_libraries(_check_vcd PRIVATE m pthread)
set_target_properties(_check_vcd PROPERTIES RUNTIME_OUTPUT_DIRECTORY .)
target_compile_options(_check_vcd PRIVATE -Wall)
target_link_libraries(_check_vcd PRIVATE m pthread)
set_target_properties(_check_vcd PROPERTIES RUNTIME_OUTPUT_DIRECTORY .)
export(TARGETS _check_vcd FILE
"${CMAKE_BINARY_DIR}/_check_vcdConfig.cmake")
endif()
add_custom_target(check_vcd
COMMAND _check_vcd ${CMAKE_CURRENT_SOURCE_DIR}/T_messages.txt ${CMAKE_CURRENT_SOURCE_DIR}/../LOG/vcd_signal_dumper.h
DEPENDS _check_vcd
......
......@@ -215,3 +215,8 @@ ccmake ../../..
cmake-gui ../../..
```
You can of course use all standard cmake/ninja/make commands in this directory.
# Cross Compile
If you want to use cross-compiler on x86 platform for aarch64 version, please refer the [cross-compile.md](./cross-compile.md) for more information.
......@@ -19,6 +19,7 @@
- [FEATURE_SET.md](./FEATURE_SET.md): lists supported features
- [GET_SOURCES.md](./GET_SOURCES.md): how to download the sources
- [BUILD.md](./BUILD.md): how to build the sources
- [cross-compile.md](./cross-compile.md): how to cross-compile OAI for ARM
- [clang-format.md](./clang-format.md): how to format the code
- [environment-variables.md](./environment-variables.md): the environment variables used by OAI
......
[[_TOC_]]
# OpenAirInterface Cross-Compiler User Guide
## Environment
- OS: ubuntu 20.04
### Set up the environment
Set up for install the package for aarch64.
```shell
sudo dpkg --add-architecture arm64
echo -e \
"deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted\n"\
"deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted\n"\
"deb [arch=arm64] http://ports.ubuntu.com/ focal universe\n"\
"deb [arch=arm64] http://ports.ubuntu.com/ focal-updates universe\n"\
"deb [arch=arm64] http://ports.ubuntu.com/ focal multiverse\n"\
"deb [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse\n"\
"deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse"\
| sudo tee /etc/apt/sources.list.d/arm-cross-compile-sources.list
sudo cp /etc/apt/sources.list "/etc/apt/sources.list.`date`.backup"
sudo sed -i -E "s/(deb)\ (http:.+)/\1\ [arch=amd64]\ \2/" /etc/apt/sources.list
sudo apt update
sudo apt install -y gcc-9-aarch64-linux-gnu \
g++-9-aarch64-linux-gnu
sudo apt-get install -y \
libatlas-base-dev:arm64 \
libblas-dev:arm64 \
libc6-dev-i386 \
liblapack-dev:arm64 \
liblapacke-dev:arm64 \
libreadline-dev:arm64 \
libgnutls28-dev:arm64 \
libconfig-dev:arm64 \
libsctp-dev:arm64 \
libssl-dev:arm64 \
libtool:arm64 \
zlib1g-dev:arm64
```
## Install and Build
### Install required packages
Use the host compiler to install some dependencies.
```shell
cd cmake_targets
./build_oai -I
```
### Build the LDPC generators
Use the x86 compiler to build the `ldpc_generators` and generate the header
file in the `ran_build/build` folder. They are necessary during a build for
code generation, and therefore need to be created for the x86 architecture.
```shell
rm -r ran_build
mkdir ran_build
mkdir ran_build/build
mkdir ran_build/build-cross
cd ran_build/build
cmake ../../..
make -j`nproc` ldpc_generators generate_T
```
### Build the Other Executables for aarch64
Switch to the `ran_build/build-cross` folder to build the target executables
for ARM. The `cross-arm.cmake` file defines some ARM-specific build tools
(e.g., compilers) that you might need to adapt. Further, it defines cmake
variables that define in this step where the host tools (such as LDPC
generators) are to be found. For the latter, the `NATIVE_DIR` option has to
be defined in order to tell cmake where the host tools have been built.
```shell
cd ../build-cross
cmake ../../.. -DCMAKE_TOOLCHAIN_FILE=../../../cmake_targets/cross-arm.cmake -DNATIVE_DIR=../build
make -j`nproc` dlsim ulsim ldpctest polartest smallblocktest nr_pbchsim nr_dlschsim nr_ulschsim nr_dlsim nr_ulsim nr_pucchsim nr_prachsim
make -j`nproc` lte-softmodem nr-softmodem nr-cuup oairu lte-uesoftmodem nr-uesoftmodem
make -j`nproc` params_libconfig coding rfsimulator
```
......@@ -5,13 +5,23 @@ add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/generator_cnProc_avx512 ldpc/generato
# custom target to build all generators
add_custom_target(ldpc_generators)
# if (CROSS_COMPILE)
# find_package(bnProc_gen_avx2)
# find_package(bnProc_gen_128)
# find_package(bnProc_gen_avx512)
# find_package(cnProc_gen_avx2)
# find_package(cnProc_gen_128)
# find_package(cnProc_gen_avx512)
# endif()
add_dependencies(ldpc_generators
bnProc_gen_avx2
bnProc_gen_128
bnProc_gen_avx512
cnProc_gen_avx2
cnProc_gen_128
cnProc_gen_avx512)
bnProc_gen_avx2_files
bnProc_gen_128_files
bnProc_gen_avx512_files
cnProc_gen_avx2_files
cnProc_gen_128_files
cnProc_gen_avx512_files)
add_library(ldpc_gen_HEADERS INTERFACE)
target_link_libraries(ldpc_gen_HEADERS INTERFACE
......
add_executable(bnProc_gen_avx2
if (CROSS_COMPILE)
find_package(bnProc_gen_128)
find_package(bnProc_gen_avx2)
else()
add_executable(bnProc_gen_avx2
bnProc_gen_BG1_avx2.c
bnProc_gen_BG2_avx2.c
bnProcPc_gen_BG1_avx2.c
bnProcPc_gen_BG2_avx2.c
main.c)
add_executable(bnProc_gen_128
add_executable(bnProc_gen_128
bnProc_gen_BG1_128.c
bnProc_gen_BG2_128.c
bnProcPc_gen_BG1_128.c
bnProcPc_gen_BG2_128.c
main128.c)
target_compile_options(bnProc_gen_avx2 PRIVATE -W -Wall )
target_compile_options(bnProc_gen_128 PRIVATE -W -Wall )
#set(bnProc_headers
# bnProc/nrLDPC_bnProc_BG1_R13_AVX2.h
# bnProc/nrLDPC_bnProc_BG1_R23_AVX2.h
# bnProc/nrLDPC_bnProc_BG1_R89_AVX2.h
# bnProc/rLDPC_bnProc_BG2_R13_AVX2.h
# bnProc/rLDPC_bnProc_BG2_R15_AVX2.h
# bnProc/rLDPC_bnProc_BG2_R23_AVX2.h)
#
#set(bnProcPc_headers
# bnProcPc/rLDPC_bnProcPc_BG1_R13_AVX2.h
# bnProcPc/rLDPC_bnProcPc_BG1_R23_AVX2.h
# bnProcPc/rLDPC_bnProcPc_BG1_R89_AVX2.h
# bnProcPc/rLDPC_bnProcPc_BG2_R13_AVX2.h
# bnProcPc/rLDPC_bnProcPc_BG2_R15_AVX2.h
# bnProcPc/rLDPC_bnProcPc_BG2_R23_AVX2.h)
add_custom_command(TARGET bnProc_gen_avx2 POST_BUILD
#OUTPUT ${bnProc_headers} ${bnProcPc_headers}
target_compile_options(bnProc_gen_avx2 PRIVATE -W -Wall )
target_compile_options(bnProc_gen_128 PRIVATE -W -Wall )
export(TARGETS bnProc_gen_avx2 FILE
"${CMAKE_BINARY_DIR}/bnProc_gen_avx2Config.cmake")
export(TARGETS bnProc_gen_128 FILE
"${CMAKE_BINARY_DIR}/bnProc_gen_128Config.cmake")
endif ()
set(bnProc_headers
bnProc/nrLDPC_bnProc_BG1_R13_AVX2.h
bnProc/nrLDPC_bnProc_BG1_R23_AVX2.h
bnProc/nrLDPC_bnProc_BG1_R89_AVX2.h
bnProc/nrLDPC_bnProc_BG2_R13_AVX2.h
bnProc/nrLDPC_bnProc_BG2_R15_AVX2.h
bnProc/nrLDPC_bnProc_BG2_R23_AVX2.h)
set(bnProcPc_headers
bnProcPc/nrLDPC_bnProcPc_BG1_R13_AVX2.h
bnProcPc/nrLDPC_bnProcPc_BG1_R23_AVX2.h
bnProcPc/nrLDPC_bnProcPc_BG1_R89_AVX2.h
bnProcPc/nrLDPC_bnProcPc_BG2_R13_AVX2.h
bnProcPc/nrLDPC_bnProcPc_BG2_R15_AVX2.h
bnProcPc/nrLDPC_bnProcPc_BG2_R23_AVX2.h)
set(bnProc128_headers
bnProc/nrLDPC_bnProc_BG1_R13_128.h
bnProc/nrLDPC_bnProc_BG1_R23_128.h
bnProc/nrLDPC_bnProc_BG1_R89_128.h
bnProc/nrLDPC_bnProc_BG2_R13_128.h
bnProc/nrLDPC_bnProc_BG2_R15_128.h
bnProc/nrLDPC_bnProc_BG2_R23_128.h)
set(bnProcPc128_headers
bnProcPc/nrLDPC_bnProcPc_BG1_R13_128.h
bnProcPc/nrLDPC_bnProcPc_BG1_R23_128.h
bnProcPc/nrLDPC_bnProcPc_BG1_R89_128.h
bnProcPc/nrLDPC_bnProcPc_BG2_R13_128.h
bnProcPc/nrLDPC_bnProcPc_BG2_R15_128.h
bnProcPc/nrLDPC_bnProcPc_BG2_R23_128.h)
add_custom_command(
# TARGET bnProc_gen_avx2 POST_BUILD
OUTPUT ${bnProc_headers} ${bnProcPc_headers}
COMMAND ${CMAKE_COMMAND} -E make_directory bnProc
COMMAND ${CMAKE_COMMAND} -E make_directory bnProcPc
COMMAND bnProc_gen_avx2 .
DEPENDS bnProc_gen_avx2
COMMENT "Generating LDPC bnProc header files for AVX2"
)
add_custom_command(TARGET bnProc_gen_128 POST_BUILD
#OUTPUT ${bnProc_headers} ${bnProcPc_headers}
add_custom_target(bnProc_gen_avx2_files DEPENDS ${bnProc_headers} ${bnProcPc_headers})
add_custom_command(
# TARGET bnProc_gen_128 POST_BUILD
OUTPUT ${bnProc128_headers} ${bnProcPc128_headers}
COMMAND ${CMAKE_COMMAND} -E make_directory bnProc128
COMMAND ${CMAKE_COMMAND} -E make_directory bnProcPc128
COMMAND bnProc_gen_128 .
DEPENDS bnProc_gen_128
COMMENT "Generating LDPC bnProc header files for 128-bit SIMD"
)
add_custom_target(bnProc_gen_128_files DEPENDS ${bnProc128_headers} ${bnProcPc128_headers})
add_library(bnProc_gen_avx2_HEADERS INTERFACE)
target_include_directories(bnProc_gen_avx2_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(bnProc_gen_avx2_HEADERS bnProc_gen_avx2)
add_dependencies(bnProc_gen_avx2_HEADERS bnProc_gen_avx2_files)
add_library(bnProc_gen_128_HEADERS INTERFACE)
target_include_directories(bnProc_gen_128_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(bnProc_gen_128_HEADERS bnProc_gen_128)
add_dependencies(bnProc_gen_128_HEADERS bnProc_gen_128_files)
add_executable(bnProc_gen_avx512
if (CROSS_COMPILE)
find_package(bnProc_gen_avx512)
else()
add_executable(bnProc_gen_avx512
bnProc_gen_BG1_avx512.c
bnProc_gen_BG2_avx512.c
bnProcPc_gen_BG1_avx512.c
bnProcPc_gen_BG2_avx512.c
main.c)
target_compile_options(bnProc_gen_avx512 PRIVATE -W -Wall )
target_compile_options(bnProc_gen_avx512 PRIVATE -W -Wall )
export(TARGETS bnProc_gen_avx512 FILE
"${CMAKE_BINARY_DIR}/bnProc_gen_avx512Config.cmake")
endif ()
#set(bnProc_avx512_headers
# bnProc_avx512/rLDPC_bnProc_BG1_R13_AVX512.h
# bnProc_avx512/rLDPC_bnProc_BG1_R23_AVX512.h
# bnProc_avx512/rLDPC_bnProc_BG1_R89_AVX512.h
# bnProc_avx512/rLDPC_bnProc_BG2_R13_AVX512.h
# bnProc_avx512/rLDPC_bnProc_BG2_R15_AVX512.h
# bnProc_avx512/rLDPC_bnProc_BG2_R23_AVX512.h)
#
#set(bnProcPc_avx512_headers
# bnProcPc_avx512/rLDPC_bnProcPc_BG1_R13_AVX512.h
# bnProcPc_avx512/rLDPC_bnProcPc_BG1_R23_AVX512.h
# bnProcPc_avx512/rLDPC_bnProcPc_BG1_R89_AVX512.h
# bnProcPc_avx512/rLDPC_bnProcPc_BG2_R13_AVX512.h
# bnProcPc_avx512/rLDPC_bnProcPc_BG2_R15_AVX512.h
# bnProcPc_avx512/rLDPC_bnProcPc_BG2_R23_AVX512.h)
set(bnProc_avx512_headers
bnProc_avx512/nrLDPC_bnProc_BG1_R13_AVX512.h
bnProc_avx512/nrLDPC_bnProc_BG1_R23_AVX512.h
bnProc_avx512/nrLDPC_bnProc_BG1_R89_AVX512.h
bnProc_avx512/nrLDPC_bnProc_BG2_R13_AVX512.h
bnProc_avx512/nrLDPC_bnProc_BG2_R15_AVX512.h
bnProc_avx512/nrLDPC_bnProc_BG2_R23_AVX512.h)
add_custom_command(TARGET bnProc_gen_avx512 POST_BUILD
#OUTPUT ${bnProc_avx512_headers} ${bnProcPc_avx512_headers}
set(bnProcPc_avx512_headers
bnProcPc_avx512/nrLDPC_bnProcPc_BG1_R13_AVX512.h
bnProcPc_avx512/nrLDPC_bnProcPc_BG1_R23_AVX512.h
bnProcPc_avx512/nrLDPC_bnProcPc_BG1_R89_AVX512.h
bnProcPc_avx512/nrLDPC_bnProcPc_BG2_R13_AVX512.h
bnProcPc_avx512/nrLDPC_bnProcPc_BG2_R15_AVX512.h
bnProcPc_avx512/nrLDPC_bnProcPc_BG2_R23_AVX512.h)
add_custom_command(
# TARGET bnProc_gen_avx512 POST_BUILD
OUTPUT ${bnProc_avx512_headers} ${bnProcPc_avx512_headers}
COMMAND ${CMAKE_COMMAND} -E make_directory bnProc_avx512
COMMAND ${CMAKE_COMMAND} -E make_directory bnProcPc_avx512
COMMAND bnProc_gen_avx512 .
DEPENDS bnProc_gen_avx512
COMMENT "Generating LDPC bnProc header files for AVX512"
)
add_custom_target(bnProc_gen_avx512_files DEPENDS ${bnProc_avx512_headers} ${bnProcPc_avx512_headers})
add_library(bnProc_gen_avx512_HEADERS INTERFACE)
target_include_directories(bnProc_gen_avx512_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(bnProc_gen_avx512_HEADERS bnProc_gen_avx512)
add_dependencies(bnProc_gen_avx512_HEADERS bnProc_gen_avx512_files)
add_executable(cnProc_gen_avx2
if (CROSS_COMPILE)
find_package(cnProc_gen_128)
find_package(cnProc_gen_avx2)
else()
add_executable(cnProc_gen_avx2
cnProc_gen_BG1_avx2.c
cnProc_gen_BG2_avx2.c
main.c)
add_executable(cnProc_gen_128
add_executable(cnProc_gen_128
cnProc_gen_BG1_128.c
cnProc_gen_BG2_128.c
main128.c)
target_compile_options(cnProc_gen_avx2 PRIVATE -W -Wall )
target_compile_options(cnProc_gen_128 PRIVATE -W -Wall )
target_compile_options(cnProc_gen_avx2 PRIVATE -W -Wall )
target_compile_options(cnProc_gen_128 PRIVATE -W -Wall )
export(TARGETS cnProc_gen_avx2 FILE
"${CMAKE_BINARY_DIR}/cnProc_gen_avx2Config.cmake")
export(TARGETS cnProc_gen_128 FILE
"${CMAKE_BINARY_DIR}/cnProc_gen_128Config.cmake")
endif()
#set(cnProc_headers
# cnProc/rLDPC_cnProc_BG1_R13_AVX2.h
# cnProc/rLDPC_cnProc_BG1_R23_AVX2.h
# cnProc/rLDPC_cnProc_BG1_R89_AVX2.h
# cnProc/rLDPC_cnProc_BG2_R13_AVX2.h
# cnProc/rLDPC_cnProc_BG2_R15_AVX2.h
# cnProc/rLDPC_cnProc_BG2_R23_AVX2.h)
set(cnProc_headers
cnProc/nrLDPC_cnProc_BG1_R13_AVX2.h
cnProc/nrLDPC_cnProc_BG1_R23_AVX2.h
cnProc/nrLDPC_cnProc_BG1_R89_AVX2.h
cnProc/nrLDPC_cnProc_BG2_R13_AVX2.h
cnProc/nrLDPC_cnProc_BG2_R15_AVX2.h
cnProc/nrLDPC_cnProc_BG2_R23_AVX2.h)
add_custom_command(TARGET cnProc_gen_avx2 POST_BUILD
#OUTPUT ${cnProc_headers}
set(cnProc128_headers
cnProc/nrLDPC_cnProc_BG1_R13_128.h
cnProc/nrLDPC_cnProc_BG1_R23_128.h
cnProc/nrLDPC_cnProc_BG1_R89_128.h
cnProc/nrLDPC_cnProc_BG2_R13_128.h
cnProc/nrLDPC_cnProc_BG2_R15_128.h
cnProc/nrLDPC_cnProc_BG2_R23_128.h)
add_custom_command(
# TARGET cnProc_gen_avx2 POST_BUILD
OUTPUT ${cnProc_headers}
COMMAND ${CMAKE_COMMAND} -E make_directory cnProc
COMMAND cnProc_gen_avx2 .
DEPENDS cnProc_gen_avx2
COMMENT "Generating LDPC cnProc header files for AVX2"
)
add_custom_target(cnProc_gen_avx2_files DEPENDS ${cnProc_headers})
add_custom_command(TARGET cnProc_gen_128 POST_BUILD
#OUTPUT ${cnProc_headers}
add_custom_command(
# TARGET cnProc_gen_128 POST_BUILD
OUTPUT ${cnProc128_headers}
COMMAND ${CMAKE_COMMAND} -E make_directory cnProc128
COMMAND cnProc_gen_128 .
DEPENDS cnProc_gen_128
COMMENT "Generating LDPC cnProc header files for 128-bit SIMD"
)
add_custom_target(cnProc_gen_128_files DEPENDS ${cnProc128_headers})
add_library(cnProc_gen_avx2_HEADERS INTERFACE)
target_include_directories(cnProc_gen_avx2_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(cnProc_gen_avx2_HEADERS cnProc_gen_avx2)
add_dependencies(cnProc_gen_avx2_HEADERS cnProc_gen_avx2_files)
add_library(cnProc_gen_128_HEADERS INTERFACE)
target_include_directories(cnProc_gen_128_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(cnProc_gen_128_HEADERS cnProc_gen_128)
add_dependencies(cnProc_gen_128_HEADERS cnProc_gen_128_files)
add_executable(cnProc_gen_avx512
if (CROSS_COMPILE)
find_package(cnProc_gen_avx512)
else()
add_executable(cnProc_gen_avx512
cnProc_gen_BG1_avx512.c
cnProc_gen_BG2_avx512.c
main.c)
target_compile_options(cnProc_gen_avx512 PRIVATE -W -Wall )
target_compile_options(cnProc_gen_avx512 PRIVATE -W -Wall )
export(TARGETS cnProc_gen_avx512 FILE
"${CMAKE_BINARY_DIR}/cnProc_gen_avx512Config.cmake")
endif()
#set(cnProc_avx512_headers
# cnProc_avx512/nrLDPC_cnProc_BG1_R13_AVX512.h
# cnProc_avx512/nrLDPC_cnProc_BG1_R23_AVX512.h
# cnProc_avx512/nrLDPC_cnProc_BG1_R89_AVX512.h
# cnProc_avx512/nrLDPC_cnProc_BG2_R13_AVX512.h
# cnProc_avx512/nrLDPC_cnProc_BG2_R15_AVX512.h
# cnProc_avx512/nrLDPC_cnProc_BG2_R23_AVX512.h)
set(cnProc_avx512_headers
cnProc_avx512/nrLDPC_cnProc_BG1_R13_AVX512.h
cnProc_avx512/nrLDPC_cnProc_BG1_R23_AVX512.h
cnProc_avx512/nrLDPC_cnProc_BG1_R89_AVX512.h
cnProc_avx512/nrLDPC_cnProc_BG2_R13_AVX512.h
cnProc_avx512/nrLDPC_cnProc_BG2_R15_AVX512.h
cnProc_avx512/nrLDPC_cnProc_BG2_R23_AVX512.h)
add_custom_command(TARGET cnProc_gen_avx512 POST_BUILD
#OUTPUT ${cnProc_avx512_headers}
add_custom_command(
# TARGET cnProc_gen_avx512 POST_BUILD
OUTPUT ${cnProc_avx512_headers}
COMMAND ${CMAKE_COMMAND} -E make_directory cnProc_avx512
COMMAND cnProc_gen_avx512 .
DEPENDS cnProc_gen_avx512
COMMENT "Generating LDPC cnProc header files for AVX512"
)
add_custom_target(cnProc_gen_avx512_files DEPENDS ${cnProc_avx512_headers})
add_library(cnProc_gen_avx512_HEADERS INTERFACE)
target_include_directories(cnProc_gen_avx512_HEADERS INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(cnProc_gen_avx512_HEADERS cnProc_gen_avx512)
add_dependencies(cnProc_gen_avx512_HEADERS cnProc_gen_avx512_files)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment