Commit 0563a1dd authored by Rohit Gupta's avatar Rohit Gupta

updated build scripts to provide sanity check for cpu flags

parent ac9dd459
...@@ -143,8 +143,16 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") ...@@ -143,8 +143,16 @@ else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3") set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
endif() endif()
endif() endif()
set(C_FLAGS_PROCESSOR " ${C_FLAGS_PROCESSOR} ${CFLAGS_PROCESSOR_USER}")
Message("C_FLAGS_PROCESSOR is ${C_FLAGS_PROCESSOR}") Message("C_FLAGS_PROCESSOR is ${C_FLAGS_PROCESSOR}")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.2")) )
Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1 -msse4.2. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1 -msse4.2\" ")
endif()
endif()
# #
set(CMAKE_C_FLAGS set(CMAKE_C_FLAGS
......
...@@ -49,6 +49,7 @@ REL="Rel10" ...@@ -49,6 +49,7 @@ REL="Rel10"
HW="EXMIMO" HW="EXMIMO"
EPC=0 EPC=0
VERBOSE_COMPILE=0 VERBOSE_COMPILE=0
CFLAGS_PROCESSOR_USER=""
function print_help() { function print_help() {
echo_info ' echo_info '
...@@ -105,6 +106,9 @@ Options ...@@ -105,6 +106,9 @@ Options
Compiles oaisim or lte-softmodem without S1 interface, using direct link to IP instead Compiles oaisim or lte-softmodem without S1 interface, using direct link to IP instead
--verbose-compile --verbose-compile
Shows detailed compilation instructions in makefile Shows detailed compilation instructions in makefile
--cflags_processor
Manually Add CFLAGS of processor if they are not detected correctly by script. Only add these flags if you know your processor supports them. Example flags: -msse3 -msse4.1 -msse4.2 -mavx2
Usage (first build): Usage (first build):
oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB --EPC -x --install-system-files Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB --EPC -x --install-system-files
...@@ -211,6 +215,10 @@ function main() { ...@@ -211,6 +215,10 @@ function main() {
VERBOSE_COMPILE=1 VERBOSE_COMPILE=1
echo_info "Will compile with verbose instructions" echo_info "Will compile with verbose instructions"
shift;; shift;;
--cflags_processor)
CFLAGS_PROCESSOR_USER=$2
echo_info "setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
shift 2;;
-h | --help) -h | --help)
print_help print_help
exit 1;; exit 1;;
...@@ -302,6 +310,7 @@ function main() { ...@@ -302,6 +310,7 @@ function main() {
if [ "$NOS1" = "1" ] ; then if [ "$NOS1" = "1" ] ; then
cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
fi fi
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file echo "set ( XFORMS $XFORMS )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
...@@ -430,6 +439,7 @@ function main() { ...@@ -430,6 +439,7 @@ function main() {
echo_info "Compiling $oaisim_exec ($oaisim_build_dir)" echo_info "Compiling $oaisim_exec ($oaisim_build_dir)"
cmake_file=$DIR/$oaisim_build_dir/CMakeLists.txt cmake_file=$DIR/$oaisim_build_dir/CMakeLists.txt
cp $DIR/$oaisim_build_dir/CMakeLists.template $cmake_file cp $DIR/$oaisim_build_dir/CMakeLists.template $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file echo "set ( XFORMS $XFORMS )" >> $cmake_file
echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
......
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