Skip to content

Commit

Permalink
Merge branch 'master' into release/4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
javmorcas committed Oct 4, 2022
2 parents 6a3abb0 + d6c3b84 commit 447f338
Show file tree
Hide file tree
Showing 25 changed files with 3,794 additions and 100 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
/srcC*/perftestSupport.*
/srcC*/perftest_publisher.*
/srcC*/perftest_subscriber.*
/srcC*/perftest_TypeSupport.*
/srcC*/perftest_QosSupport.*
/srcC*/perftest_Config.*
/srcC*/perftest_TypedTS*
/srcC*/makefile_*
/srcC*/objs
/srcCs/bin
Expand Down
26 changes: 26 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,32 @@
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
},
{
"name": "Linux TSS C++",
"includePath": [
"${workspaceFolder}/srcCpp/",
"${workspaceFolder}/srcCppCommon/",
"${workspaceFolder}/srcCpp/connextDDS",
"${workspaceFolder}/srcCpp/connextDDS/TSS",
"${env.NDDSHOME}/include",
"${env.NDDSHOME}/include/ndds",
"${env.NDDSHOME}/include/ndds/hpp",
"${env.RTIMEHOME}/include/",
"${env.RTITSSHOME}/include",
"${env.RTITSSHOME}/include/*"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"RTI_PERF_TSS",
"RTI_PERF_TSS_PRO",
"PERFTEST_RTI_MICRO_24x_COMPATIBILITY"
],
"intelliSenseMode": "${default}",
"cStandard": "c11",
"cppStandard": "c++11"
}
],
"version": 4
Expand Down
125 changes: 120 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ cStringifyFile_script="${script_location}/resource/scripts/cStringifyFile.pl"
qos_file="${script_location}/perftest_qos_profiles.xml"
doc_folder="${script_location}/srcDoc"
generate_doc_folder="${script_location}/doc"
resource_folder="${script_location}/resource"

# By default we will not build TSS with Pro libs
BUILD_TSS=0
BUILD_TSS_PRO=0
FACE_COMPLIANCE="None"

# By default we will build pro, not micro
BUILD_MICRO=0
Expand Down Expand Up @@ -178,12 +184,16 @@ function usage()
echo " --flatData-max-size <size> Specify the maximum bounded size on bytes "
echo " for sequences when using FlatData language "
echo " binding. Default 10MB "
echo " --no-zeroCopy Do not try to compile against Zero-Copy libs "
echo " --osx-shmem-shmmax <size> Maximum segment size for shared memory in OSX "
echo " in bytes. Default 400MB "
echo " --ns-resolution Try to use the system real-time clock to get "
echo " nano-second resolution. "
echo " For the Classic C++ Implementation only. "
echo " Default is not enabled. "
echo " --tss Build against Connext TSS (pro and micro) "
echo " For the Classic C++ Implementation only. "
echo " Default is not enabled. "
echo " --help -h Display this message. "
echo " "
echo "================================================================================"
Expand Down Expand Up @@ -256,7 +266,22 @@ function executable_checking()
fi

# If we are Building MICRO
if [ "${BUILD_MICRO}" -eq "1" ]; then
if [ "${BUILD_TSS}" -eq "1" ]; then
if [ -z "${RTITSSHOME}" ]; then
echo -e "${ERROR_TAG} The RTITSSHOME variable is not set or the path does not exist"
usage
exit -1
elif [ "${BUILD_TSS_PRO}" -eq "1" ] && [ -z "${NDDSHOME}" ]; then
echo -e "${ERROR_TAG} The NDDSHOME variable is not set or the path does not exist"
usage
exit -1
elif [ "${BUILD_MICRO}" -eq "1" ] && [ -z "${RTIMEHOME}" ]; then
echo -e "${ERROR_TAG} The RTIMEHOME variable is not set or the path does not exist"
usage
exit -1
fi

elif [ "${BUILD_MICRO}" -eq "1" ]; then

# Is RTIMEHOME set?
if [ -z "${RTIMEHOME}" ]; then
Expand Down Expand Up @@ -285,6 +310,7 @@ function executable_checking()
echo -e "${WARNING_TAG} ${MAKE_EXE} executable not found, perftest_cpp will not be built."
fi
fi

else # If building pro

# Is NDDSHOME set?
Expand Down Expand Up @@ -371,7 +397,7 @@ function executable_checking()
BUILD_CS=0
fi

fi #Micro/Pro
fi #TSS/Micro/Pro

}

Expand Down Expand Up @@ -410,9 +436,9 @@ function additional_defines_calculation()
# Avoid optimized out variables when debugging
if [ "${RELEASE_DEBUG}" == "release" ]; then
echo -e "${INFO_TAG} C++ code will be optimized."
additional_defines=${additional_defines}"O3"
additional_defines=${additional_defines}" O3"
else
additional_defines=${additional_defines}"O0"
additional_defines=${additional_defines}" O0"
fi

if [ "${LEGACY_DD_IMPL}" == "1" ]; then
Expand Down Expand Up @@ -498,6 +524,10 @@ function additional_defines_calculation()
additional_rtiddsgen_defines_flatdata=${additional_rtiddsgen_defines_flatdata}" -D RTI_FLATDATA_MAX_SIZE=${RTI_FLATDATA_MAX_SIZE}"
fi

if [ "${SKIP_ZEROCOPY}" == "1" ]; then
export ZEROCOPY_AVAILABLE="0"
fi

if [ "${ZEROCOPY_AVAILABLE}" == "1" ]; then
additional_rti_libs="nddsmetp ${additional_rti_libs}"
additional_defines=${additional_defines}" DRTI_ZEROCOPY_AVAILABLE"
Expand Down Expand Up @@ -1069,6 +1099,68 @@ function build_micro_cpp()
fi
}

function build_tss_cpp()
{
copy_src_cpp_common

##############################################################################
# Generate files for the custom type files
additional_defines_custom_type=""
additional_header_files_custom_type=""
additional_source_files_custom_type=""

if [ "${USE_CUSTOM_TYPE}" == "1" ]; then
build_cpp_custom_type
fi

if [ "${BUILD_MICRO}" == "1" ]; then
TSS_IMPL="micro"
else
additional_defines_calculation "CppTraditional"
TSS_IMPL="pro"
fi

additional_defines=${additional_defines}" DRTI_PERF_TSS"

cp "${resource_folder}/tss/CMakeLists.txt" \
"${classic_cpp_folder}/CMakeLists.txt"

##############################################################################
# Compile srcCpp code
echo ""
echo -e "${INFO_TAG} Compiling perftest_cpp"
cd "${classic_cpp_folder}"

cmake_generate_command="RTITSSARCH=${platform} ${CMAKE_EXE} \
-DRTI_CONNEXT_TYPE=${TSS_IMPL} \
-DRTI_TSS_ENABLE_FACE_COMPLIANCE=${FACE_COMPLIANCE} \
-DCMAKE_BUILD_TYPE=${RELEASE_DEBUG} \
-G \"Unix Makefiles\" \
-B./perftest_build -H."

echo -e "${INFO_TAG} Cmake Generate Command: $cmake_generate_command"
eval $cmake_generate_command
if [ "$?" != 0 ]; then
echo -e "${ERROR_TAG} Failure generating makefiles with cmake for ${classic_cpp_lang_string}."
cd ..
exit -1
fi

cmake_build_command="${CMAKE_EXE} --build ./perftest_build --config ${RELEASE_DEBUG}"
echo -e "${INFO_TAG} Cmake Build Command: $cmake_build_command"
eval $cmake_build_command
if [ "$?" != 0 ]; then
echo -e "${ERROR_TAG} Failure compiling code for ${classic_cpp_lang_string}."
cd ..
exit -1
fi

echo -e "${INFO_TAG} Compilation successful"
cd ..

clean_copied_files
}

function build_cpp11()
{
copy_src_cpp_common
Expand Down Expand Up @@ -1466,6 +1558,13 @@ while [ "$1" != "" ]; do
clean
exit
;;
--tss)
BUILD_TSS=1
;;
--face-profile)
FACE_COMPLIANCE=$2
shift
;;
--micro)
BUILD_MICRO=1
;;
Expand Down Expand Up @@ -1643,6 +1742,9 @@ while [ "$1" != "" ]; do
--fastQueue)
FAST_QUEUE=1
;;
--no-zeroCopy)
SKIP_ZEROCOPY="1"
;;
*)
echo -e "${ERROR_TAG} unknown parameter \"$1\""
usage
Expand All @@ -1652,9 +1754,22 @@ while [ "$1" != "" ]; do
shift
done

if [ "${BUILD_TSS}" -eq "1" ] && [ "${BUILD_MICRO}" -eq "0" ]; then
BUILD_TSS_PRO=1
fi

executable_checking

if [ "${BUILD_MICRO}" -eq "1" ]; then
if [ "${BUILD_TSS}" -eq "1" ]; then
rtiddsgen_executable="$RTITSSHOME/bin/rtiddsgen"
classic_cpp_lang_string=FACEC++

if [ "${BUILD_CPP}" -eq "1" ]; then
library_sufix_calculation
build_tss_cpp
fi

elif [ "${BUILD_MICRO}" -eq "1" ]; then

rtiddsgen_executable="$RTIMEHOME/rtiddsgen/scripts/rtiddsgen"

Expand Down
Loading

0 comments on commit 447f338

Please sign in to comment.