Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alex037yang
OpenXG-RAN
Commits
a2ffa29f
Commit
a2ffa29f
authored
Jun 03, 2020
by
Raphael Defosseux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making CUDA additions conditional on CUDA installation
Signed-off-by:
Raphael Defosseux
<
raphael.defosseux@eurecom.fr
>
parent
79899c8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
31 deletions
+56
-31
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+56
-31
No files found.
cmake_targets/CMakeLists.txt
View file @
a2ffa29f
...
...
@@ -45,20 +45,26 @@ project (OpenAirInterface)
# Base CUDA setting
##############################################
find_package
(
CUDA
)
message
(
"cuda include
${
CUDA_INCLUDE_DIRS
}
"
)
message
(
"cuda library
${
CUDA_LIBRARY_DIRS
}
"
)
if
(
CUDA_FOUND
)
message
(
"cuda include
${
CUDA_INCLUDE_DIRS
}
"
)
message
(
"cuda library
${
CUDA_LIBRARY_DIRS
}
"
)
add_definitions
(
"-L/usr/local/cuda/lib64"
)
add_definitions
(
"-L/usr/local/cuda/lib64"
)
SET
(
CUDA_NVCC_FLAGS
"
${
CUDA_NVCC_FLAGS
}
;-arch=sm_60;"
)
SET
(
CUDA_NVCC_FLAGS
"
${
CUDA_NVCC_FLAGS
}
;-arch=sm_60;"
)
# Disable warnings for CUDA
SET
(
CUDA_NVCC_FLAGS
"
${
CUDA_NVCC_FLAGS
}
;-lpthread;-w;-O3;--default-stream;per-thread;-I/usr/local/cuda/inc;-L/usr/local/cuda/lib -lcutil;-rdc=true;-lcudadevrt"
)
SET
(
CUDA_VERBOSE_BUILD ON
)
SET
(
CUDA_HOST_COMPILER
"/usr/bin/g++"
)
# Disable warnings for CUDA
SET
(
CUDA_NVCC_FLAGS
"
${
CUDA_NVCC_FLAGS
}
;-lpthread;-w;-O3;--default-stream;per-thread;-I/usr/local/cuda/inc;-L/usr/local/cuda/lib -lcutil;-rdc=true;-lcudadevrt"
)
SET
(
CUDA_VERBOSE_BUILD ON
)
SET
(
CUDA_HOST_COMPILER
"/usr/bin/g++"
)
SET
(
CUDA_SEPARABLE_COMPILATION ON
)
else
(
CUDA_FOUND
)
message
(
"No CUDA tool installed"
)
endif
()
SET
(
CUDA_SEPARABLE_COMPILATION ON
)
###########################################
# macros to define options as there is numerous options in oai
...
...
@@ -190,13 +196,22 @@ endif()
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
C_FLAGS_PROCESSOR
}
-pipe -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC"
)
# add autotools definitions that were maybe used!
# set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-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_CXX_FLAGS
if
(
CUDA_FOUND
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-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_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
-Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 "
)
)
else
(
CUDA_FOUND
)
set
(
MKVER
"'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-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 -D
${
MKVER
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
-Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 -D
${
MKVER
}
"
)
endif
()
add_definitions
(
"-DASN_DISABLE_OER_SUPPORT"
)
...
...
@@ -2821,25 +2836,35 @@ target_link_libraries(smallblocktest
m pthread
${
ATLAS_LIBRARIES
}
dl
)
if
(
CUDA_FOUND
)
###################################################
# For CUDA library
###################################################
CUDA_ADD_LIBRARY
(
LDPC_CU
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
)
CUDA_ADD_CUFFT_TO_TARGET
(
LDPC_CU
)
cuda_add_executable
(
ldpctest
${
OPENAIR1_DIR
}
/PHY/CODING/TESTBENCH/ldpctest.c
${
T_SOURCE
}
${
SHLIB_LOADER_SOURCES
}
)
CUDA_ADD_LIBRARY
(
LDPC_CU
${
OPENAIR1_DIR
}
/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
)
CUDA_ADD_CUFFT_TO_TARGET
(
LDPC_CU
)
cuda_add_executable
(
ldpctest
${
OPENAIR1_DIR
}
/PHY/CODING/TESTBENCH/ldpctest.c
${
T_SOURCE
}
${
SHLIB_LOADER_SOURCES
}
)
target_link_libraries
(
ldpctest -ldl
-Wl,--start-group
LDPC_CU UTIL SIMU PHY_NR CONFIG_LIB
-Wl,--end-group
m pthread
${
ATLAS_LIBRARIES
}
dl
)
else
(
CUDA_FOUND
)
add_executable
(
ldpctest
${
PHY_NR_CODINGIF
}
${
OPENAIR1_DIR
}
/PHY/CODING/TESTBENCH/ldpctest.c
${
T_SOURCE
}
${
SHLIB_LOADER_SOURCES
}
)
target_link_libraries
(
ldpctest -ldl
-Wl,--start-group
LDPC_CU UTIL SIMU PHY_NR CONFIG_LIB
-Wl,--end-group
m pthread
${
ATLAS_LIBRARIES
}
dl
)
endif
()
# add_executable(ldpctest
# ${PHY_NR_CODINGIF}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment