From d103ec8d3469b80183a9993ebf4062f1cf164488 Mon Sep 17 00:00:00 2001 From: owais-kali Date: Sun, 19 Mar 2023 05:16:57 +0530 Subject: [PATCH 1/5] Add CMakeLists.txt --- CMakeLists.txt | 0 src/CMakeLists.txt | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..e69de29b diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..e69de29b From f95705c3543f7b066ce2849dffdf66f01e313604 Mon Sep 17 00:00:00 2001 From: owais-kali Date: Sun, 26 Mar 2023 02:27:15 +0530 Subject: [PATCH 2/5] Update --- CMakeLists.txt | 1 + setup.sh | 10 +++++----- src/CMakeLists.txt | 34 +++++++++++++++++++++++++++++++++ src/Communication/AsioService.h | 10 ++++------ 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e69de29b..130b119d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(src) \ No newline at end of file diff --git a/setup.sh b/setup.sh index 10a365b1..e4769423 100755 --- a/setup.sh +++ b/setup.sh @@ -9,12 +9,12 @@ export QUICKFAST_ROOT=`readlink -f $SOURCE_DIR` if test "$MPC_ROOT" = "" then - export MPC_ROOT=$ACE_ROOT/MPC + export MPC_ROOT=/usr/lib/ace/MPC fi if test "$BOOST_ROOT" = "" then - export BOOST_ROOT=~/boost/boost_1_38_0 + export BOOST_ROOT=/usr/include/boost fi if test "$BOOST_ROOT_LIB" = "" @@ -24,17 +24,17 @@ fi if test "$BOOST_VERSION" = "" then - export BOOST_VERSION=boost-1_38 + export BOOST_VERSION=boost-1_74 fi if test "$XERCES_ROOT" = "" then - export XERCES_ROOT=~/xerces/xerces-c-3.0.1 + export XERCES_ROOT=/usr/include/xercesc fi if test "$XERCES_LIBPATH" = "" then - export XERCES_LIBPATH=$XERCES_ROOT/src/.libs + export XERCES_LIBPATH=/usr/lib/x86_64-linux-gnu fi if test "$XERCES_LIBNAME" = "" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e69de29b..83c22937 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -0,0 +1,34 @@ +add_library(QuickFAST SHARED) + +find_package(Boost REQUIRED) + +#Function to Glob all files by extension +function(GET_FILES NAME DIR EXTENSION) + file(GLOB_RECURSE FILES + ${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*${EXTENSION} + ) + set(${NAME} ${FILES} PARENT_SCOPE) +endfunction() + +#CPP Source Files +GET_FILES(Application_CPP Application .cpp) +GET_FILES(Codecs_CPP Codecs .cpp) +GET_FILES(Common_CPP Common .cpp) +GET_FILES(Communication_CPP Communication .cpp) +GET_FILES(Messages_CPP Messages .cpp) + +#Header Directory +target_include_directories(QuickFAST PRIVATE .) + +target_sources(QuickFAST + PRIVATE + ${Application_CPP} + ${Codecs_CPP} + ${Common_CPP} + ${Communication_CPP} + ${Messages_CPP} + ) + +target_compile_definitions(QuickFAST + PRIVATE + BOOST_ASIO_NO_DEPRECATED) \ No newline at end of file diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h index 4f619156..7f701338 100644 --- a/src/Communication/AsioService.h +++ b/src/Communication/AsioService.h @@ -7,13 +7,11 @@ #endif #ifndef ASIOSERVICE_H #define ASIOSERVICE_H -#include "AsioService_fwd.h" -#include -#include -#include - // In gcc including asio.hpp in precompiled headers causes problems -#include +#include "boost/asio.hpp" +#include +#include +#include namespace QuickFAST { From 69b27152cf207f3658fb8132822732625648c11f Mon Sep 17 00:00:00 2001 From: owais-kali Date: Sun, 26 Mar 2023 03:55:13 +0530 Subject: [PATCH 3/5] Build Finished! --- src/CMakeLists.txt | 39 +++++++++++++++------------------ src/Communication/AsioService.h | 12 +++++----- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 83c22937..d3c0e4e5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,33 +2,30 @@ add_library(QuickFAST SHARED) find_package(Boost REQUIRED) -#Function to Glob all files by extension -function(GET_FILES NAME DIR EXTENSION) - file(GLOB_RECURSE FILES - ${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*${EXTENSION} - ) - set(${NAME} ${FILES} PARENT_SCOPE) -endfunction() - -#CPP Source Files -GET_FILES(Application_CPP Application .cpp) -GET_FILES(Codecs_CPP Codecs .cpp) -GET_FILES(Common_CPP Common .cpp) -GET_FILES(Communication_CPP Communication .cpp) -GET_FILES(Messages_CPP Messages .cpp) #Header Directory target_include_directories(QuickFAST PRIVATE .) target_sources(QuickFAST PRIVATE - ${Application_CPP} - ${Codecs_CPP} - ${Common_CPP} - ${Communication_CPP} - ${Messages_CPP} + #Common + Common/QuickFASTPch.cpp + Common/Types.cpp + Common/WorkingBuffer.cpp + Common/Profiler.cpp + Common/dllmain.cpp + Common/Decimal.cpp + Common/BitMap.cpp + + #Communication + Communication/AsioService.cpp + Communication/AsynchFileSender.cpp + Communication/AsynchSender.cpp + Communication/FileSender.cpp + Communication/MulticastReceiverHandle.cpp + Communication/PCapReader.cpp ) target_compile_definitions(QuickFAST - PRIVATE - BOOST_ASIO_NO_DEPRECATED) \ No newline at end of file + PUBLIC + ASIOSERVICE_FWD_H) \ No newline at end of file diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h index 7f701338..b5fa821a 100644 --- a/src/Communication/AsioService.h +++ b/src/Communication/AsioService.h @@ -7,11 +7,13 @@ #endif #ifndef ASIOSERVICE_H #define ASIOSERVICE_H -// In gcc including asio.hpp in precompiled headers causes problems -#include "boost/asio.hpp" -#include -#include +#include "AsioService_fwd.h" #include +#include +#include + +// In gcc including asio.hpp in precompiled headers causes problems +#include namespace QuickFAST { @@ -22,7 +24,7 @@ namespace QuickFAST /// Normal case is for all classes derived from AsioService to share /// the same boost::io_service. The alternate constructor gives the /// application more control if it is needed. - class QuickFAST_Export AsioService + class QuickFAST_Export AsioService : public boost::asio::io_service { public: /// @brief Construct using the internal, common io service From 40a12bb18a100240cf6e56d3d2c3582975f82131 Mon Sep 17 00:00:00 2001 From: owais-kali Date: Sun, 26 Mar 2023 06:07:33 +0530 Subject: [PATCH 4/5] Add Glob. Build Finished for Everything except Application_CPP; --- src/CMakeLists.txt | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d3c0e4e5..bf04d127 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,30 +2,34 @@ add_library(QuickFAST SHARED) find_package(Boost REQUIRED) +#Function to Glob all files by extension +function(GET_FILES NAME DIR EXTENSION) + file(GLOB_RECURSE FILES + ${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*${EXTENSION} + ) + set(${NAME} ${FILES} PARENT_SCOPE) +endfunction() + +#CPP Source Files +GET_FILES(Application_CPP Application .cpp) +GET_FILES(Codecs_CPP Codecs .cpp) +GET_FILES(Common_CPP Common .cpp) +GET_FILES(Communication_CPP Communication .cpp) +GET_FILES(Messages_CPP Messages .cpp) #Header Directory target_include_directories(QuickFAST PRIVATE .) target_sources(QuickFAST PRIVATE - #Common - Common/QuickFASTPch.cpp - Common/Types.cpp - Common/WorkingBuffer.cpp - Common/Profiler.cpp - Common/dllmain.cpp - Common/Decimal.cpp - Common/BitMap.cpp - - #Communication - Communication/AsioService.cpp - Communication/AsynchFileSender.cpp - Communication/AsynchSender.cpp - Communication/FileSender.cpp - Communication/MulticastReceiverHandle.cpp - Communication/PCapReader.cpp + #Application + ${Codecs_CPP} + ${Common_CPP} + ${Communication_CPP} + ${Messages_CPP} ) target_compile_definitions(QuickFAST PUBLIC + BOOST_BIND_GLOBAL_PLACEHOLDERS ASIOSERVICE_FWD_H) \ No newline at end of file From 1d201e7652b857f7fec706d7b46736b321645d74 Mon Sep 17 00:00:00 2001 From: owais-kali Date: Sun, 26 Mar 2023 07:03:16 +0530 Subject: [PATCH 5/5] Compile Examples! --- src/Application/DecoderConnection.h | 2 + src/CMakeLists.txt | 17 ++++++-- src/Examples/CMakeLists.txt | 47 ++++++++++++++++++++++ src/Examples/Examples/MessageInterpreter.h | 2 +- 4 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 src/Examples/CMakeLists.txt diff --git a/src/Application/DecoderConnection.h b/src/Application/DecoderConnection.h index 99ed938c..c83e55a2 100644 --- a/src/Application/DecoderConnection.h +++ b/src/Application/DecoderConnection.h @@ -19,6 +19,8 @@ #include #include +#include "boost/asio.hpp" + namespace QuickFAST{ namespace Application{ /// @brief Support a single source of FAST encoded data. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bf04d127..b5a5b399 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(QuickFAST SHARED) +add_library(QuickFAST STATIC) find_package(Boost REQUIRED) @@ -22,7 +22,7 @@ target_include_directories(QuickFAST PRIVATE .) target_sources(QuickFAST PRIVATE - #Application + ${Application_CPP} ${Codecs_CPP} ${Common_CPP} ${Communication_CPP} @@ -32,4 +32,15 @@ target_sources(QuickFAST target_compile_definitions(QuickFAST PUBLIC BOOST_BIND_GLOBAL_PLACEHOLDERS - ASIOSERVICE_FWD_H) \ No newline at end of file + ASIOSERVICE_FWD_H) + +find_package(Boost COMPONENTS date_time filesystem system thread ...) +find_package(XercesC COMPONENTS sax ...) + +target_link_libraries(QuickFAST + PUBLIC + ${Boost_LIBRARIES} + ${XercesC_LIBRARIES} + ) + +add_subdirectory(Examples) \ No newline at end of file diff --git a/src/Examples/CMakeLists.txt b/src/Examples/CMakeLists.txt new file mode 100644 index 00000000..9bed07ac --- /dev/null +++ b/src/Examples/CMakeLists.txt @@ -0,0 +1,47 @@ +GET_FILES(Examples_CPP Examples .cpp) + +#TutorialApplication +add_executable(TutorialApplication) +target_include_directories(TutorialApplication + PRIVATE + . + ${CMAKE_SOURCE_DIR}/quickfast/src) + +target_sources(TutorialApplication + PRIVATE + ${Examples_CPP} + TutorialApplication/main.cpp + TutorialApplication/TutorialApplication.cpp) + +target_compile_definitions(TutorialApplication + PUBLIC + BOOST_BIND_GLOBAL_PLACEHOLDERS + ASIOSERVICE_FWD_H) + +target_link_libraries(TutorialApplication + PUBLIC + QuickFAST) + +#PerformanceTest +add_executable(PerformanceTest) +target_include_directories(PerformanceTest + PRIVATE + . + ${CMAKE_SOURCE_DIR}/quickfast/src) + +target_sources(PerformanceTest + PRIVATE + ${Examples_CPP} + PerformanceTest/main.cpp + PerformanceTest/MessageCounter.cpp + PerformanceTest/NullMessage.cpp + PerformanceTest/PerformanceTest.cpp) + +target_compile_definitions(PerformanceTest + PUBLIC + BOOST_BIND_GLOBAL_PLACEHOLDERS + ASIOSERVICE_FWD_H) + +target_link_libraries(PerformanceTest + PUBLIC + QuickFAST) \ No newline at end of file diff --git a/src/Examples/Examples/MessageInterpreter.h b/src/Examples/Examples/MessageInterpreter.h index f0599331..807d720e 100644 --- a/src/Examples/Examples/MessageInterpreter.h +++ b/src/Examples/Examples/MessageInterpreter.h @@ -6,7 +6,7 @@ #endif #ifndef MESSAGEINTERPRETER_H #define MESSAGEINTERPRETER_H -#include +#include "Codecs/MessageConsumer.h" #include namespace QuickFAST{