From 025ccb6d618f9ef574c9c099ccff108ec333f416 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Wed, 8 Nov 2023 12:43:23 +0100 Subject: [PATCH 01/13] Start working on CMake compilation --- src/Am/AdaptedAcousticModel.hh | 2 + src/Am/Module.cc | 2 + src/Am/TransitionModel.cc | 2 + src/Audio/Module.cc | 2 + src/Audio/Wav.cc | 2 + src/Bliss/CorpusDescription.cc | 2 + src/Cart/CMakeLists.txt | 15 ++ src/Core/Application.cc | 2 + src/Core/CMakeLists.txt | 60 ++++++++ src/Core/CacheManager.hh | 3 +- src/Core/Configuration.hh | 3 +- src/Core/OpenMPWrapper.hh | 2 + src/Core/Utility.hh | 2 + src/Flf/Archive.cc | 2 + src/Flf/NodeRegistration.hh | 3 +- src/Flf/Traceback.cc | 2 + src/Flow/NetworkParser.cc | 2 + src/Lattice/Archive.cc | 2 + src/Lm/Module.cc | 2 + src/Math/Blas.hh | 2 + src/Math/CublasWrapper.hh | 2 + src/Math/CudaMatrixKernelsWrapper.hh | 3 +- src/Math/CudaWrapper.hh | 2 + src/Math/FastVectorOperations.hh | 3 +- src/Math/ProfileMatrix.cc | 2 + src/Math/Random.cc | 2 + src/Math/Random.hh | 2 + src/Mm/MixtureSet.cc | 2 + src/Mm/MixtureSetReader.cc | 2 + src/Mm/Module.cc | 2 + src/Mm/Module.hh | 2 + src/Nn/BufferedAlignedFeatureProcessor.cc | 2 + src/Nn/FeedForwardTrainer.hh | 2 + src/Nn/Module.cc | 2 + src/Nn/NeuralNetworkTrainer.cc | 3 +- src/Nn/SegmentwiseNnTrainer.hh | 2 + src/Python/Numpy.hh | 2 + src/Python/check.cc | 2 + src/Search/Module.cc | 2 + src/Search/Wfst/check.cc | 2 + src/Search/Wfst/check_ctrans.cc | 2 + src/Search/WordConditionedTreeSearch.cc | 2 + src/Search/check.cc | 2 + src/Signal/Module.cc | 2 + src/Signal/WindowFunction.cc | 2 + src/Speech/AbstractSegmentwiseTrainer.cc | 2 + src/Speech/AcousticSegmentwiseTrainer.cc | 2 + src/Speech/AdvancedLatticeExtractor.cc | 2 + src/Speech/CMakeLists.txt | 132 ++++++++++++++++++ src/Speech/LatticeSetExtractor.cc | 2 + src/Speech/Module.hh | 2 + src/Speech/Recognizer.hh | 2 + src/Speech/SegmentwiseGmmTrainer.cc | 4 +- src/Speech/WordLatticeExtractor.hh | 2 + .../AcousticModelTrainer.hh | 2 + src/Tools/AcousticModelTrainer/CMakeLists.txt | 4 + src/Tools/CMakeLists.txt | 2 + src/Tools/Cart/CMakeLists.txt | 4 + src/Tools/CorpusStatistics/Costa.cc | 2 + .../FeatureExtraction/FeatureExtraction.cc | 2 + src/Tools/Flf/FlfTool.cc | 2 + src/Tools/Fsa/Fsa.cc | 3 +- .../LatticeProcessor/LatticeProcessor.hh | 2 + src/Tools/NnTrainer/NnTrainer.hh | 2 + .../SpeechRecognizer/SpeechRecognizer.cc | 2 + 65 files changed, 335 insertions(+), 9 deletions(-) create mode 100644 src/Cart/CMakeLists.txt create mode 100644 src/Core/CMakeLists.txt create mode 100644 src/Speech/CMakeLists.txt create mode 100644 src/Tools/AcousticModelTrainer/CMakeLists.txt create mode 100644 src/Tools/CMakeLists.txt create mode 100644 src/Tools/Cart/CMakeLists.txt diff --git a/src/Am/AdaptedAcousticModel.hh b/src/Am/AdaptedAcousticModel.hh index 908e4d5a2..360005a95 100644 --- a/src/Am/AdaptedAcousticModel.hh +++ b/src/Am/AdaptedAcousticModel.hh @@ -22,7 +22,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include namespace Am { diff --git a/src/Am/Module.cc b/src/Am/Module.cc index 0052c7863..cf8a8675f 100644 --- a/src/Am/Module.cc +++ b/src/Am/Module.cc @@ -15,7 +15,9 @@ #include "Module.hh" #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "ClassicAcousticModel.hh" #ifdef MODULE_CART diff --git a/src/Am/TransitionModel.cc b/src/Am/TransitionModel.cc index 10894ae43..d620f81d0 100644 --- a/src/Am/TransitionModel.cc +++ b/src/Am/TransitionModel.cc @@ -17,7 +17,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include // implementation details for the TransitionModel::apply function diff --git a/src/Audio/Module.cc b/src/Audio/Module.cc index c79734ff7..a920bf066 100644 --- a/src/Audio/Module.cc +++ b/src/Audio/Module.cc @@ -14,7 +14,9 @@ */ #include "Module.hh" #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif // predefined filter #ifdef MODULE_AUDIO_RAW diff --git a/src/Audio/Wav.cc b/src/Audio/Wav.cc index 13b687f7a..8f0e4d6a4 100644 --- a/src/Audio/Wav.cc +++ b/src/Audio/Wav.cc @@ -15,7 +15,9 @@ #include "Wav.hh" #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include diff --git a/src/Bliss/CorpusDescription.cc b/src/Bliss/CorpusDescription.cc index 0e54b0aac..77c918b83 100644 --- a/src/Bliss/CorpusDescription.cc +++ b/src/Bliss/CorpusDescription.cc @@ -23,7 +23,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #ifdef MODULE_THEANO_INTERFACE diff --git a/src/Cart/CMakeLists.txt b/src/Cart/CMakeLists.txt new file mode 100644 index 000000000..8435d8c40 --- /dev/null +++ b/src/Cart/CMakeLists.txt @@ -0,0 +1,15 @@ +set(Cart_SOURCES + Conditions.cc + Properties.cc + Example.cc + BinaryTree.cc + DecisionTree.cc + Cluster.cc + DecisionTreeTrainer.cc + Parser.cc + ) + +add_library(RasrCart STATIC ${Cart_SOURCES}) +#target_link_libraries(RasrCart PRIVATE RasrCore) + +target_include_directories(RasrCart PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/src/Core/Application.cc b/src/Core/Application.cc index 8de675e27..67ee0fd2c 100644 --- a/src/Core/Application.cc +++ b/src/Core/Application.cc @@ -22,7 +22,9 @@ #ifdef OS_linux #include #endif +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "Application.hh" #include "CacheManager.hh" #include "Channel.hh" diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt new file mode 100644 index 000000000..9aedf73fc --- /dev/null +++ b/src/Core/CMakeLists.txt @@ -0,0 +1,60 @@ +set(Core_SOURCES + Application.cc + Archive.cc + ArithmeticExpressionParser.cc + Assertions.cc + BinaryStream.cc + BinaryTree.cc + BundleArchive.cc + CacheManager.cc + Channel.cc + Choice.cc + CodeGenerator.cc + Component.cc + CompressedStream.cc + Configuration.cc + Debug.cc + Dependency.cc + Description.cc + Directory.cc + DirectoryArchive.cc + FileArchive.cc + FormatSet.cc + IoUtilities.cc + MappedArchive.cc + MemoryInfo.cc + MD5.cc + MurmurHash.cc + Parameter.cc + ProgressIndicator.cc + ReferenceCounting.cc + ResourceUsageInfo.cc + Statistics.cc + StringExpression.cc + StringUtilities.cc + TextStream.cc + Tokenizer.cc + Types.cc + Unicode.cc + Utility.cc + Version.cc + XmlBuilder.cc + XmlBuilder2.cc + XmlParser.cc + XmlStream.cc + ) + +BISON_TARGET( + ArithmeticExpressionParser + ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.yy + ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.cc + DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.hh + COMPILE_FLAGS "-d" +) +set(Core_SOURCES ${Core_SOURCES} ${BISON_ArithmeticExpressionParser_OUTPUTS}) + +add_library(RasrCore STATIC ${Core_SOURCES}) + +target_include_directories(RasrCore PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + +add_dependencies(RasrCore SourceVersion) diff --git a/src/Core/CacheManager.hh b/src/Core/CacheManager.hh index 246aa8057..039b4d113 100644 --- a/src/Core/CacheManager.hh +++ b/src/Core/CacheManager.hh @@ -1,8 +1,9 @@ #ifndef _CORE_CACHE_MANAGER #define _CORE_CACHE_MANAGER +#ifndef CMAKE_DISABLE_MODULE_HH #include - +#endif #ifdef MODULE_CORE_CACHE_MANAGER #include diff --git a/src/Core/Configuration.hh b/src/Core/Configuration.hh index fdcd3f33e..359ec6842 100644 --- a/src/Core/Configuration.hh +++ b/src/Core/Configuration.hh @@ -17,8 +17,9 @@ #ifndef _CORE_CONFIGURATION_HH #define _CORE_CONFIGURATION_HH +#ifndef CMAKE_DISABLE_MODULE_HH #include - +#endif #include #include #include diff --git a/src/Core/OpenMPWrapper.hh b/src/Core/OpenMPWrapper.hh index 2c80d34a4..348006107 100644 --- a/src/Core/OpenMPWrapper.hh +++ b/src/Core/OpenMPWrapper.hh @@ -16,7 +16,9 @@ #define OPENMP_WRAPPER_HH_ #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #ifdef MODULE_OPENMP #include diff --git a/src/Core/Utility.hh b/src/Core/Utility.hh index 68074f040..d00a4e462 100644 --- a/src/Core/Utility.hh +++ b/src/Core/Utility.hh @@ -15,7 +15,9 @@ #ifndef _CORE_UTILITY_HH #define _CORE_UTILITY_HH +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include diff --git a/src/Flf/Archive.cc b/src/Flf/Archive.cc index 506f26a44..bd7871ff5 100644 --- a/src/Flf/Archive.cc +++ b/src/Flf/Archive.cc @@ -20,7 +20,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "Archive.hh" #include "ConfusionNetworkIo.hh" diff --git a/src/Flf/NodeRegistration.hh b/src/Flf/NodeRegistration.hh index 8beb4e47f..e8ac822d2 100644 --- a/src/Flf/NodeRegistration.hh +++ b/src/Flf/NodeRegistration.hh @@ -15,8 +15,9 @@ #ifndef _FLF_NODE_REGISTRATION_HH #define _FLF_NODE_REGISTRATION_HH +#ifndef CMAKE_DISABLE_MODULE_HH #include - +#endif #include "Archive.hh" #include "Best.hh" #include "Cache.hh" diff --git a/src/Flf/Traceback.cc b/src/Flf/Traceback.cc index 704c36977..1f41b0278 100644 --- a/src/Flf/Traceback.cc +++ b/src/Flf/Traceback.cc @@ -18,7 +18,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include "Best.hh" diff --git a/src/Flow/NetworkParser.cc b/src/Flow/NetworkParser.cc index a3e8af6c2..7877ce113 100644 --- a/src/Flow/NetworkParser.cc +++ b/src/Flow/NetworkParser.cc @@ -15,7 +15,9 @@ #include "NetworkParser.hh" #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include "Filter.hh" #include "Network.hh" diff --git a/src/Lattice/Archive.cc b/src/Lattice/Archive.cc index c43ddd6a0..3cc0bb469 100644 --- a/src/Lattice/Archive.cc +++ b/src/Lattice/Archive.cc @@ -21,7 +21,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "Archive.hh" #ifdef MODULE_LATTICE_HTK diff --git a/src/Lm/Module.cc b/src/Lm/Module.cc index 845a5f789..fd633aef2 100644 --- a/src/Lm/Module.cc +++ b/src/Lm/Module.cc @@ -14,7 +14,9 @@ */ #include "Module.hh" #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "ClassLm.hh" #ifdef MODULE_LM_ARPA #include "ArpaLm.hh" diff --git a/src/Math/Blas.hh b/src/Math/Blas.hh index ae5513a83..df43a5b02 100644 --- a/src/Math/Blas.hh +++ b/src/Math/Blas.hh @@ -16,7 +16,9 @@ #define MATH_BLAS_HH_ // ACML is included with cblas.h and linking to correct cblas library +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #ifdef MODULE_INTEL_MKL diff --git a/src/Math/CublasWrapper.hh b/src/Math/CublasWrapper.hh index a4958a875..fba71d102 100644 --- a/src/Math/CublasWrapper.hh +++ b/src/Math/CublasWrapper.hh @@ -17,7 +17,9 @@ #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include diff --git a/src/Math/CudaMatrixKernelsWrapper.hh b/src/Math/CudaMatrixKernelsWrapper.hh index 58d2f6641..cfaa3fb15 100644 --- a/src/Math/CudaMatrixKernelsWrapper.hh +++ b/src/Math/CudaMatrixKernelsWrapper.hh @@ -15,8 +15,9 @@ #ifndef CUDAMATRIXKERNELSWRAPPER_HH_ #define CUDAMATRIXKERNELSWRAPPER_HH_ +#ifndef CMAKE_DISABLE_MODULE_HH #include - +#endif /** * Macro CUDACALL inserts the first parameter, if MODULE_CUDA is enabled. * Otherwise, a critical error is raised. diff --git a/src/Math/CudaWrapper.hh b/src/Math/CudaWrapper.hh index 8fdfc736e..36c46106d 100644 --- a/src/Math/CudaWrapper.hh +++ b/src/Math/CudaWrapper.hh @@ -17,7 +17,9 @@ #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #ifdef MODULE_CUDA #include diff --git a/src/Math/FastVectorOperations.hh b/src/Math/FastVectorOperations.hh index 3f105b653..0f86ac1e6 100644 --- a/src/Math/FastVectorOperations.hh +++ b/src/Math/FastVectorOperations.hh @@ -15,8 +15,9 @@ #ifndef FAST_VECTOR_OPERATIONS_HH_ #define FAST_VECTOR_OPERATIONS_HH_ +#ifndef CMAKE_DISABLE_MODULE_HH #include - +#endif #include #include #include diff --git a/src/Math/ProfileMatrix.cc b/src/Math/ProfileMatrix.cc index 6690ead3f..4dee8d9ab 100644 --- a/src/Math/ProfileMatrix.cc +++ b/src/Math/ProfileMatrix.cc @@ -21,7 +21,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "ProfileMatrix.hh" const Core::ParameterInt MatrixProfiler::paramNumberOfRepetitions("number-of-repetitions", "number of repetitions", 5); diff --git a/src/Math/Random.cc b/src/Math/Random.cc index 60b939f69..c9caad34c 100644 --- a/src/Math/Random.cc +++ b/src/Math/Random.cc @@ -13,7 +13,9 @@ * limitations under the License. */ #include "Random.hh" +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #ifdef MODULE_MATH_NR #include "Nr/Random.hh" #endif diff --git a/src/Math/Random.hh b/src/Math/Random.hh index 450c642c3..c067b2660 100644 --- a/src/Math/Random.hh +++ b/src/Math/Random.hh @@ -16,7 +16,9 @@ #define _MATH_RANDOM_HH #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include diff --git a/src/Mm/MixtureSet.cc b/src/Mm/MixtureSet.cc index 0d300a14c..b5f40dde1 100644 --- a/src/Mm/MixtureSet.cc +++ b/src/Mm/MixtureSet.cc @@ -15,7 +15,9 @@ #include "MixtureSet.hh" #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include using namespace Mm; diff --git a/src/Mm/MixtureSetReader.cc b/src/Mm/MixtureSetReader.cc index f11490922..bc189d75f 100644 --- a/src/Mm/MixtureSetReader.cc +++ b/src/Mm/MixtureSetReader.cc @@ -15,7 +15,9 @@ #include "MixtureSetReader.hh" #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "Module.hh" namespace Mm { class LogLinearMixtureSet : public Core::ReferenceCounted {}; diff --git a/src/Mm/Module.cc b/src/Mm/Module.cc index 75b97b6d6..b11e856f6 100644 --- a/src/Mm/Module.cc +++ b/src/Mm/Module.cc @@ -15,7 +15,9 @@ #include "Module.hh" #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "FeatureScorerFactory.hh" #include "GaussDiagonalMaximumFeatureScorer.hh" #include "MixtureSet.hh" diff --git a/src/Mm/Module.hh b/src/Mm/Module.hh index 8510902f4..f9354fdbb 100644 --- a/src/Mm/Module.hh +++ b/src/Mm/Module.hh @@ -17,7 +17,9 @@ #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "AssigningFeatureScorer.hh" #include "MixtureSetEstimator.hh" #include "ScaledFeatureScorer.hh" diff --git a/src/Nn/BufferedAlignedFeatureProcessor.cc b/src/Nn/BufferedAlignedFeatureProcessor.cc index 2f2e21cfc..172f0bf9e 100644 --- a/src/Nn/BufferedAlignedFeatureProcessor.cc +++ b/src/Nn/BufferedAlignedFeatureProcessor.cc @@ -18,7 +18,9 @@ #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include "FeedForwardTrainer.hh" diff --git a/src/Nn/FeedForwardTrainer.hh b/src/Nn/FeedForwardTrainer.hh index 5a04be44f..939e0ed1f 100644 --- a/src/Nn/FeedForwardTrainer.hh +++ b/src/Nn/FeedForwardTrainer.hh @@ -18,7 +18,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include "BufferedAlignedFeatureProcessor.hh" diff --git a/src/Nn/Module.cc b/src/Nn/Module.cc index efb1485d5..05e4be1b6 100644 --- a/src/Nn/Module.cc +++ b/src/Nn/Module.cc @@ -15,7 +15,9 @@ #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "Module.hh" #include "Statistics.hh" diff --git a/src/Nn/NeuralNetworkTrainer.cc b/src/Nn/NeuralNetworkTrainer.cc index c3eb5ae37..305e35b6d 100644 --- a/src/Nn/NeuralNetworkTrainer.cc +++ b/src/Nn/NeuralNetworkTrainer.cc @@ -22,8 +22,9 @@ #include #include // XML I/O stuff for writing parameters +#ifndef CMAKE_DISABLE_MODULE_HH #include - +#endif #ifdef MODULE_PYTHON #include "PythonTrainer.hh" #endif diff --git a/src/Nn/SegmentwiseNnTrainer.hh b/src/Nn/SegmentwiseNnTrainer.hh index 39b5920a4..2faf20280 100644 --- a/src/Nn/SegmentwiseNnTrainer.hh +++ b/src/Nn/SegmentwiseNnTrainer.hh @@ -17,7 +17,9 @@ #include #include // for mix2phoneme map ( lattice coverage statistics) +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include "ActivationLayer.hh" diff --git a/src/Python/Numpy.hh b/src/Python/Numpy.hh index 10ded046d..fb7a5026e 100644 --- a/src/Python/Numpy.hh +++ b/src/Python/Numpy.hh @@ -22,7 +22,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include diff --git a/src/Python/check.cc b/src/Python/check.cc index df24ea1e3..6983092f6 100644 --- a/src/Python/check.cc +++ b/src/Python/check.cc @@ -13,7 +13,9 @@ * limitations under the License. */ #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "Init.hh" #include "Numpy.hh" diff --git a/src/Search/Module.cc b/src/Search/Module.cc index 2dd703b21..9535cb128 100644 --- a/src/Search/Module.cc +++ b/src/Search/Module.cc @@ -12,7 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include diff --git a/src/Search/Wfst/check.cc b/src/Search/Wfst/check.cc index aaa7ae83e..87c5589b3 100644 --- a/src/Search/Wfst/check.cc +++ b/src/Search/Wfst/check.cc @@ -14,7 +14,9 @@ */ #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include diff --git a/src/Search/Wfst/check_ctrans.cc b/src/Search/Wfst/check_ctrans.cc index ada0066fe..69c4d6dbf 100644 --- a/src/Search/Wfst/check_ctrans.cc +++ b/src/Search/Wfst/check_ctrans.cc @@ -17,7 +17,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include diff --git a/src/Search/WordConditionedTreeSearch.cc b/src/Search/WordConditionedTreeSearch.cc index f37da4646..ace4c056f 100644 --- a/src/Search/WordConditionedTreeSearch.cc +++ b/src/Search/WordConditionedTreeSearch.cc @@ -29,7 +29,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "Histogram.hh" #include "LanguageModelLookahead.hh" #include "StateTree.hh" diff --git a/src/Search/check.cc b/src/Search/check.cc index 58db27399..cd1fb012a 100644 --- a/src/Search/check.cc +++ b/src/Search/check.cc @@ -13,7 +13,9 @@ * limitations under the License. */ #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "StateTree.hh" #ifdef MODULE_SEARCH_WFST #include diff --git a/src/Signal/Module.cc b/src/Signal/Module.cc index 910d21b39..f1e43a6fc 100644 --- a/src/Signal/Module.cc +++ b/src/Signal/Module.cc @@ -14,7 +14,9 @@ */ #include "Module.hh" #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "ComplexVectorFunction.hh" #include "CosineTransform.hh" #include "DcDetection.hh" diff --git a/src/Signal/WindowFunction.cc b/src/Signal/WindowFunction.cc index 9a50c4651..f57c8bec9 100644 --- a/src/Signal/WindowFunction.cc +++ b/src/Signal/WindowFunction.cc @@ -13,7 +13,9 @@ * limitations under the License. */ #include "WindowFunction.hh" +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #if defined(MODULE_MATH_NR) && defined(MODULE_SIGNAL_ADVANCED) #include "KaiserWindowFunction.hh" #endif diff --git a/src/Speech/AbstractSegmentwiseTrainer.cc b/src/Speech/AbstractSegmentwiseTrainer.cc index ab82dfe4e..2525f0ac0 100644 --- a/src/Speech/AbstractSegmentwiseTrainer.cc +++ b/src/Speech/AbstractSegmentwiseTrainer.cc @@ -18,7 +18,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "AcousticSegmentwiseTrainer.hh" using namespace Speech; diff --git a/src/Speech/AcousticSegmentwiseTrainer.cc b/src/Speech/AcousticSegmentwiseTrainer.cc index afb43db14..77a7b2b14 100644 --- a/src/Speech/AcousticSegmentwiseTrainer.cc +++ b/src/Speech/AcousticSegmentwiseTrainer.cc @@ -14,7 +14,9 @@ */ #include "AcousticSegmentwiseTrainer.hh" +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "SegmentwiseGmmTrainer.hh" #ifdef MODULE_NN_SEQUENCE_TRAINING #include diff --git a/src/Speech/AdvancedLatticeExtractor.cc b/src/Speech/AdvancedLatticeExtractor.cc index e5a38790c..1f1e7578d 100644 --- a/src/Speech/AdvancedLatticeExtractor.cc +++ b/src/Speech/AdvancedLatticeExtractor.cc @@ -33,7 +33,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include "AdvancedAccuracyFsaBuilder.hh" diff --git a/src/Speech/CMakeLists.txt b/src/Speech/CMakeLists.txt new file mode 100644 index 000000000..a07ac7b58 --- /dev/null +++ b/src/Speech/CMakeLists.txt @@ -0,0 +1,132 @@ +set(SPEECH_SOURCES + /AcousticModelTrainer.cc + /AlignerModelAcceptor.cc + /AligningFeatureExtractor.cc + /Alignment.cc + /AlignmentNode.cc + /AlignmentWithLinearSegmentation.cc + /AllophoneStateGraphBuilder.cc + /AverageFeatureScorerActivation.cc + /CorpusProcessor.cc + /CorpusVisitor.cc + /CovarianceEstimator.cc + /DataExtractor.cc + /DataSource.cc + /DelayedRecognizer.cc + /Feature.cc + /FeatureScorer.cc + /FeatureScorerNode.cc + /FsaCache.cc + /LabelingFeatureExtractor.cc + /MixtureSetTrainer.cc + /ModelCombination.cc + /Module.cc + /Recognizer.cc + /ScatterMatricesEstimator.cc + /TextDependentSequenceFiltering.cc + /TextIndependentMixtureSetTrainer.cc +) + +if(${MODULE_SPEECH_LATTICE_ALIGNMENT}) + list(APPEND SPEECH_SOURCES + PhonemeSequenceAlignmentGenerator.cc + SegmentwiseAlignmentGenerator.cc + SegmentwiseFeatureExtractor.cc + ) +endif () + +if (${MODULE_SPEECH_DT}) + list(APPEND Speech_Sources + AbstractSegmentwiseTrainer.cc + AccuracyFsaBuilder.cc + AcousticSegmentwiseTrainer.cc + Confidences.cc + DiscriminativeMixtureSetTrainer.cc + EbwDiscriminativeMixtureSetTrainer.cc + LatticeExtractor.cc + LatticeSetExtractor.cc + LatticeSetProcessor.cc + PruningLatticeSetNode.cc + SegmentwiseGmmTrainer.cc + WordLatticeExtractor.cc + ) +endif () + +if (${MODULE_SPEECH_DT_ADVANCED}) + list(APPEND SPEECH_SOURCES + AdvancedAccuracyFsaBuilder.cc + AdvancedLatticeExtractor.cc + AuxiliarySegmentwiseTrainer.cc + ClusterMixtureSetTrainer.cc + AdvancedLatticeSetProcessor.cc + NBestListExtractor.cc + RpropDiscriminativeMixtureSetTrainer.cc + ) +endif () + +if (${MODULE_FLF_EXT}) + list(APPEND SPEECH_SOURCES AlignedFeatureCache.cc) +endif () + +if (${MODULE_SPEECH_LATTICE_FLOW_NODES}) + list(APPEND SPEECH_SOURCES + AlignmentFromLattice.cc + LatticeNodes.cc + LatticeArcAccumulator.cc + ) +endif () + +if (${MODULE_SPEECH_ALIGNMENT_FLOW_NODES}) + list(APPEND SPEECH_SOURCES + AlignmentGeneratorNode.cc + AlignmentTransformNode.cc + SegmentNode.cc + ) +endif () + +if (${MODULE_ADAPT_MLLR}) + list(APPEND SPEECH_SOURCES + ModelTransformEstimator.cc + FeatureShiftAdaptor.cc + ) +endif () + +if (${MODULE_ADAPT_CMLLR}) + list(APPEND SPEECH_SOURCES + AffineFeatureTransformEstimator.cc + KeyedEstimator.cc + ) +endif () + +if (${MODULE_CART}) + list(APPEND SPEECH_SOURCES + DecisionTreeTrainer.cc + KeyedEstimator.cc + ) +endif () + +if (${MODULE_SPEECH_LATTICE_RESCORING}) + list(APPEND SPEECH_SOURCES + LatticeRescorerAutomaton.cc + LatticeRescorerNodes.cc + StatePosteriorFeatureScorerNode.cc + ) +endif () + +if (${MODULE_SIGNAL_ADVANCED}) + list(APPEND SPEECH_SOURCES + HistogramEstimator.cc + MeanEstimator.cc + ) +endif () + +if (${MODULE_SEARCH_MBR}) + list(APPEND SPEECH_SOURCES + MinimumBayesRiskSearch.cc + ) +endif () + +add_library(RasrCart STATIC ${Cart_SOURCES}) +target_link_libraries(RasrCart PRIVATE RasrCore) + +target_include_directories(RasrCart PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/src/Speech/LatticeSetExtractor.cc b/src/Speech/LatticeSetExtractor.cc index 4fc263b29..486e6f0e2 100644 --- a/src/Speech/LatticeSetExtractor.cc +++ b/src/Speech/LatticeSetExtractor.cc @@ -16,7 +16,9 @@ #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include diff --git a/src/Speech/Module.hh b/src/Speech/Module.hh index 9b670cdaf..f437a6531 100644 --- a/src/Speech/Module.hh +++ b/src/Speech/Module.hh @@ -16,7 +16,9 @@ #define _SPEECH_MODULE_HH #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include namespace Search { diff --git a/src/Speech/Recognizer.hh b/src/Speech/Recognizer.hh index da8c2c66b..ccdb5ff19 100644 --- a/src/Speech/Recognizer.hh +++ b/src/Speech/Recognizer.hh @@ -18,7 +18,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include "DataExtractor.hh" diff --git a/src/Speech/SegmentwiseGmmTrainer.cc b/src/Speech/SegmentwiseGmmTrainer.cc index 31ca80639..3235e91d1 100644 --- a/src/Speech/SegmentwiseGmmTrainer.cc +++ b/src/Speech/SegmentwiseGmmTrainer.cc @@ -25,9 +25,9 @@ #include "AlignmentNode.hh" #include "Module.hh" -/*! @todo: remove Modules.hh dependency (see below) */ +#ifndef CMAKE_DISABLE_MODULE_HH #include - +#endif using namespace Speech; /** diff --git a/src/Speech/WordLatticeExtractor.hh b/src/Speech/WordLatticeExtractor.hh index 0e29bdbe7..92ad5d154 100644 --- a/src/Speech/WordLatticeExtractor.hh +++ b/src/Speech/WordLatticeExtractor.hh @@ -19,7 +19,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include "CorpusProcessor.hh" #include "LatticeSetProcessor.hh" diff --git a/src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh b/src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh index ceae424e9..cb9c9ebdd 100644 --- a/src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh +++ b/src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh @@ -15,7 +15,9 @@ #ifndef _TOOLS_ACOUSTIC_MODEL_TRAINER_ACOUSTIC_MODEL_TRAINER_HH #define _TOOLS_ACOUSTIC_MODEL_TRAINER_ACOUSTIC_MODEL_TRAINER_HH +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include diff --git a/src/Tools/AcousticModelTrainer/CMakeLists.txt b/src/Tools/AcousticModelTrainer/CMakeLists.txt new file mode 100644 index 000000000..7b55e6784 --- /dev/null +++ b/src/Tools/AcousticModelTrainer/CMakeLists.txt @@ -0,0 +1,4 @@ +add_executable(acoustic-model-trainer AcousticModelTrainer.cc) + +#target_link_libraries(cart-trainer PRIVATE RasrCart RasrCore LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads) +target_link_libraries(acoustic-model-trainer PRIVATE RasrCart RasrCore) \ No newline at end of file diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt new file mode 100644 index 000000000..855f90d37 --- /dev/null +++ b/src/Tools/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(AcousticModelTrainer) +add_subdirectory(Cart) \ No newline at end of file diff --git a/src/Tools/Cart/CMakeLists.txt b/src/Tools/Cart/CMakeLists.txt new file mode 100644 index 000000000..0c6c4c661 --- /dev/null +++ b/src/Tools/Cart/CMakeLists.txt @@ -0,0 +1,4 @@ +set(EXE_NAME "cart-trainer") +add_executable(${EXE_NAME} CartTrainer.cc) +target_link_libraries(${EXE_NAME} PRIVATE RasrCart RasrCore LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads) +add_install_executable(${EXE_NAME}) diff --git a/src/Tools/CorpusStatistics/Costa.cc b/src/Tools/CorpusStatistics/Costa.cc index c3520c6ba..70781228e 100644 --- a/src/Tools/CorpusStatistics/Costa.cc +++ b/src/Tools/CorpusStatistics/Costa.cc @@ -21,7 +21,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #ifdef MODULE_TENSORFLOW diff --git a/src/Tools/FeatureExtraction/FeatureExtraction.cc b/src/Tools/FeatureExtraction/FeatureExtraction.cc index c648bd79f..030158ff5 100644 --- a/src/Tools/FeatureExtraction/FeatureExtraction.cc +++ b/src/Tools/FeatureExtraction/FeatureExtraction.cc @@ -20,7 +20,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include diff --git a/src/Tools/Flf/FlfTool.cc b/src/Tools/Flf/FlfTool.cc index 53fc9d6d9..9a8925411 100644 --- a/src/Tools/Flf/FlfTool.cc +++ b/src/Tools/Flf/FlfTool.cc @@ -25,7 +25,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include diff --git a/src/Tools/Fsa/Fsa.cc b/src/Tools/Fsa/Fsa.cc index 6f0506ba3..e7e37c284 100644 --- a/src/Tools/Fsa/Fsa.cc +++ b/src/Tools/Fsa/Fsa.cc @@ -44,8 +44,9 @@ #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include - +#endif #ifdef MODULE_OPENFST #include #endif diff --git a/src/Tools/LatticeProcessor/LatticeProcessor.hh b/src/Tools/LatticeProcessor/LatticeProcessor.hh index fd911dc29..9399f1b7d 100644 --- a/src/Tools/LatticeProcessor/LatticeProcessor.hh +++ b/src/Tools/LatticeProcessor/LatticeProcessor.hh @@ -23,7 +23,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include diff --git a/src/Tools/NnTrainer/NnTrainer.hh b/src/Tools/NnTrainer/NnTrainer.hh index 0e21933ab..e8ae7433b 100644 --- a/src/Tools/NnTrainer/NnTrainer.hh +++ b/src/Tools/NnTrainer/NnTrainer.hh @@ -16,7 +16,9 @@ #define _TOOLS_NN_TRAINER_NN_TRAINER_HH #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include diff --git a/src/Tools/SpeechRecognizer/SpeechRecognizer.cc b/src/Tools/SpeechRecognizer/SpeechRecognizer.cc index 266bf9e7d..a08a68a36 100644 --- a/src/Tools/SpeechRecognizer/SpeechRecognizer.cc +++ b/src/Tools/SpeechRecognizer/SpeechRecognizer.cc @@ -20,7 +20,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULE_HH #include +#endif #include #include #include From 78ccfb26830b2592e6e9adfa2dbe439fb6b9c4b3 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Wed, 8 Nov 2023 12:46:04 +0100 Subject: [PATCH 02/13] Don't ignore CMakeLists.txt --- .gitignore | 1 - CMakeLists.txt | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt diff --git a/.gitignore b/.gitignore index 32a05d264..b1f727632 100644 --- a/.gitignore +++ b/.gitignore @@ -48,7 +48,6 @@ /Sprint.includes # CLion /.idea -/CMakeLists.txt # Other .history* *.autosave diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..06488a3ab --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,99 @@ +cmake_minimum_required(VERSION 3.14) +project(RASR) + +find_library( + TENSORFLOW_CC + NAMES tensorflow_cc + HINTS /usr/local/lib/tensorflow/ + PATH_SUFFIXES lib REQUIRED) + +find_library( + TENSORFLOW_FRAMEWORK + NAMES tensorflow_framework + HINTS /usr/local/lib/tensorflow/ + PATH_SUFFIXES lib REQUIRED) + +if(TENSORFLOW_CC) + message(STATUS "TensorFlow CC library found at ${TENSORFLOW_CC}") +else() + message(FATAL_ERROR "TensorFlow CC library not found") +endif() + +if(TENSORFLOW_FRAMEWORK) + message(STATUS "TensorFlow Framework library found at ${TENSORFLOW_FRAMEWORK}") +else() + message(FATAL_ERROR "TensorFlow Framework library not found") +endif() + +# Find Python interpreter +find_package(PythonInterp REQUIRED) + +# Get the TensorFlow include directory by executing a Python command +execute_process( + COMMAND "${PYTHON_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_include())" + RESULT_VARIABLE _tensorflow_include_res + OUTPUT_VARIABLE TENSORFLOW_INCLUDE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# Check if we got the include directory +if(NOT _tensorflow_include_res EQUAL "0") + message(FATAL_ERROR "Failed to get TensorFlow include directory") +endif() + +# Output the found directory for debugging purposes +message(STATUS "TensorFlow include directory: ${TENSORFLOW_INCLUDE_DIR}") + +string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME) +if(CMAKE_BUILD_TYPE MATCHES Debug) + set(BUILD_SUFFIX "debug") +else() + set(BUILD_SUFFIX "standard") +endif() +set(ARCH_DESCRIPTION "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_SUFFIX}") +set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH_DESCRIPTION}/") + +function(add_install_executable EXECUTABLE_NAME) + install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION .) + set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}.${ARCH_DESCRIPTION}") +endfunction() + +add_compile_definitions(CMAKE_DISABLE_MODULES_HH) + +function(add_module_option MODULE_NAME DEFAULT_VALUE) + option(${MODULE_NAME} "Enable module ${MODULE_NAME})" ${DEFAULT_VALUE}) + if(${MODULE_NAME}) + add_compile_definitions(${MODULE_NAME}) + message(STATUS "Module ${MODULE_NAME} is enabled") + else() + message(STATUS "Module ${MODULE_NAME} is not enabled") + endif() +endfunction() + +add_module_option(MODULE_AUDIO_FFMPEG ON) +add_module_option(MODULE_CORE_CACHE_MANAGER ON) +add_module_option(MODULE_CART ON) + +add_custom_command( + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc + COMMAND + ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.release + ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.release) + +add_custom_target(SourceVersion + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc) + +find_package(LibXml2 REQUIRED) +find_package(BISON REQUIRED) +find_package(Threads REQUIRED) +find_package(ZLIB REQUIRED) + +include_directories(${CMAKE_SOURCE_DIR}/src) +# include_directories(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${LIBXML2_INCLUDE_DIR}) + +add_subdirectory(src/Cart) +add_subdirectory(src/Core) +add_subdirectory(src/Tools) From 1cda2e8d9d565a134342e6b4864aeb2f9da7cfc5 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Wed, 8 Nov 2023 18:58:07 +0100 Subject: [PATCH 03/13] Optional Modules.hh imports --- src/Am/AdaptedAcousticModel.hh | 2 +- src/Am/Module.cc | 2 +- src/Am/TransitionModel.cc | 2 +- src/Audio/Module.cc | 2 +- src/Audio/Wav.cc | 2 +- src/Bliss/CorpusDescription.cc | 2 +- src/Core/Application.cc | 2 +- src/Core/CacheManager.hh | 2 +- src/Core/Configuration.hh | 2 +- src/Core/OpenMPWrapper.hh | 2 +- src/Core/Statistics.cc | 2 +- src/Core/Utility.hh | 2 +- src/Flf/Archive.cc | 2 +- src/Flf/GammaCorrection.cc | 2 +- src/Flf/NodeRegistration.hh | 2 +- src/Flf/SegmentwiseSpeechProcessor.cc | 2 +- src/Flf/Traceback.cc | 2 +- src/Flow/NetworkParser.cc | 2 +- src/Lattice/Archive.cc | 2 +- src/Lm/Module.cc | 2 +- src/Math/Blas.hh | 2 +- src/Math/CublasWrapper.hh | 2 +- src/Math/CudaMatrixKernelsWrapper.hh | 2 +- src/Math/CudaWrapper.hh | 2 +- src/Math/FastVectorOperations.hh | 2 +- src/Math/ProfileMatrix.cc | 2 +- src/Math/Random.cc | 2 +- src/Math/Random.hh | 2 +- src/Mm/MixtureSet.cc | 2 +- src/Mm/MixtureSetReader.cc | 2 +- src/Mm/Module.cc | 2 +- src/Mm/Module.hh | 2 +- src/Nn/BufferedAlignedFeatureProcessor.cc | 2 +- src/Nn/FeedForwardTrainer.hh | 2 +- src/Nn/Module.cc | 2 +- src/Nn/NeuralNetworkTrainer.cc | 2 +- src/Nn/SegmentwiseNnTrainer.hh | 2 +- src/Python/Numpy.hh | 2 +- src/Python/check.cc | 2 +- src/Search/Module.cc | 2 +- src/Search/Wfst/check.cc | 2 +- src/Search/Wfst/check_ctrans.cc | 2 +- src/Search/WordConditionedTreeSearch.cc | 2 +- src/Search/check.cc | 2 +- src/Signal/Module.cc | 2 +- src/Signal/WindowFunction.cc | 2 +- src/Speech/AbstractSegmentwiseTrainer.cc | 2 +- src/Speech/AcousticSegmentwiseTrainer.cc | 2 +- src/Speech/AdvancedLatticeExtractor.cc | 2 +- src/Speech/LatticeSetExtractor.cc | 2 +- src/Speech/Module.hh | 2 +- src/Speech/Recognizer.hh | 2 +- src/Speech/SegmentwiseGmmTrainer.cc | 2 +- src/Speech/WordLatticeExtractor.hh | 2 +- src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh | 2 +- src/Tools/CorpusStatistics/Costa.cc | 2 +- src/Tools/FeatureExtraction/FeatureExtraction.cc | 2 +- src/Tools/Flf/FlfTool.cc | 2 +- src/Tools/Fsa/Fsa.cc | 2 +- src/Tools/LatticeProcessor/LatticeProcessor.hh | 2 +- src/Tools/NnTrainer/NnTrainer.hh | 2 +- src/Tools/SpeechRecognizer/SpeechRecognizer.cc | 2 +- 62 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/Am/AdaptedAcousticModel.hh b/src/Am/AdaptedAcousticModel.hh index 360005a95..31701b158 100644 --- a/src/Am/AdaptedAcousticModel.hh +++ b/src/Am/AdaptedAcousticModel.hh @@ -22,7 +22,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Am/Module.cc b/src/Am/Module.cc index cf8a8675f..ae91c485f 100644 --- a/src/Am/Module.cc +++ b/src/Am/Module.cc @@ -15,7 +15,7 @@ #include "Module.hh" #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif diff --git a/src/Am/TransitionModel.cc b/src/Am/TransitionModel.cc index d620f81d0..5e986996b 100644 --- a/src/Am/TransitionModel.cc +++ b/src/Am/TransitionModel.cc @@ -17,7 +17,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Audio/Module.cc b/src/Audio/Module.cc index a920bf066..28802065a 100644 --- a/src/Audio/Module.cc +++ b/src/Audio/Module.cc @@ -14,7 +14,7 @@ */ #include "Module.hh" #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif diff --git a/src/Audio/Wav.cc b/src/Audio/Wav.cc index 8f0e4d6a4..1da84e763 100644 --- a/src/Audio/Wav.cc +++ b/src/Audio/Wav.cc @@ -15,7 +15,7 @@ #include "Wav.hh" #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Bliss/CorpusDescription.cc b/src/Bliss/CorpusDescription.cc index 77c918b83..1adb74ceb 100644 --- a/src/Bliss/CorpusDescription.cc +++ b/src/Bliss/CorpusDescription.cc @@ -23,7 +23,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Core/Application.cc b/src/Core/Application.cc index 67ee0fd2c..b45a7f500 100644 --- a/src/Core/Application.cc +++ b/src/Core/Application.cc @@ -22,7 +22,7 @@ #ifdef OS_linux #include #endif -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "Application.hh" diff --git a/src/Core/CacheManager.hh b/src/Core/CacheManager.hh index 039b4d113..66f779d88 100644 --- a/src/Core/CacheManager.hh +++ b/src/Core/CacheManager.hh @@ -1,7 +1,7 @@ #ifndef _CORE_CACHE_MANAGER #define _CORE_CACHE_MANAGER -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #ifdef MODULE_CORE_CACHE_MANAGER diff --git a/src/Core/Configuration.hh b/src/Core/Configuration.hh index 359ec6842..bad437dc4 100644 --- a/src/Core/Configuration.hh +++ b/src/Core/Configuration.hh @@ -17,7 +17,7 @@ #ifndef _CORE_CONFIGURATION_HH #define _CORE_CONFIGURATION_HH -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Core/OpenMPWrapper.hh b/src/Core/OpenMPWrapper.hh index 348006107..d0f68d412 100644 --- a/src/Core/OpenMPWrapper.hh +++ b/src/Core/OpenMPWrapper.hh @@ -16,7 +16,7 @@ #define OPENMP_WRAPPER_HH_ #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif diff --git a/src/Core/Statistics.cc b/src/Core/Statistics.cc index 25ad4cf83..6bbe01954 100644 --- a/src/Core/Statistics.cc +++ b/src/Core/Statistics.cc @@ -15,7 +15,7 @@ // $Id$ #include "Statistics.hh" -#include +#include "Application.hh" #include #include #include diff --git a/src/Core/Utility.hh b/src/Core/Utility.hh index d00a4e462..d5bf39e17 100644 --- a/src/Core/Utility.hh +++ b/src/Core/Utility.hh @@ -15,7 +15,7 @@ #ifndef _CORE_UTILITY_HH #define _CORE_UTILITY_HH -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Flf/Archive.cc b/src/Flf/Archive.cc index bd7871ff5..7fdb09d53 100644 --- a/src/Flf/Archive.cc +++ b/src/Flf/Archive.cc @@ -20,7 +20,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif diff --git a/src/Flf/GammaCorrection.cc b/src/Flf/GammaCorrection.cc index 700f7de02..cfcd91fd2 100644 --- a/src/Flf/GammaCorrection.cc +++ b/src/Flf/GammaCorrection.cc @@ -14,7 +14,7 @@ */ #include #include -#include +#include "GammaCorrection.hh" namespace Flf { diff --git a/src/Flf/NodeRegistration.hh b/src/Flf/NodeRegistration.hh index e8ac822d2..0cabadeab 100644 --- a/src/Flf/NodeRegistration.hh +++ b/src/Flf/NodeRegistration.hh @@ -15,7 +15,7 @@ #ifndef _FLF_NODE_REGISTRATION_HH #define _FLF_NODE_REGISTRATION_HH -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "Archive.hh" diff --git a/src/Flf/SegmentwiseSpeechProcessor.cc b/src/Flf/SegmentwiseSpeechProcessor.cc index 0f42fff39..10adf79a8 100644 --- a/src/Flf/SegmentwiseSpeechProcessor.cc +++ b/src/Flf/SegmentwiseSpeechProcessor.cc @@ -14,7 +14,7 @@ */ #include #include -#include +#include "SegmentwiseSpeechProcessor.hh" #include namespace Flf { diff --git a/src/Flf/Traceback.cc b/src/Flf/Traceback.cc index 1f41b0278..f365cb6c7 100644 --- a/src/Flf/Traceback.cc +++ b/src/Flf/Traceback.cc @@ -18,7 +18,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Flow/NetworkParser.cc b/src/Flow/NetworkParser.cc index 7877ce113..3ab1f94c5 100644 --- a/src/Flow/NetworkParser.cc +++ b/src/Flow/NetworkParser.cc @@ -15,7 +15,7 @@ #include "NetworkParser.hh" #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Lattice/Archive.cc b/src/Lattice/Archive.cc index 3cc0bb469..b8ea84924 100644 --- a/src/Lattice/Archive.cc +++ b/src/Lattice/Archive.cc @@ -21,7 +21,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif diff --git a/src/Lm/Module.cc b/src/Lm/Module.cc index fd633aef2..cf195ed13 100644 --- a/src/Lm/Module.cc +++ b/src/Lm/Module.cc @@ -14,7 +14,7 @@ */ #include "Module.hh" #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "ClassLm.hh" diff --git a/src/Math/Blas.hh b/src/Math/Blas.hh index df43a5b02..6a0d57132 100644 --- a/src/Math/Blas.hh +++ b/src/Math/Blas.hh @@ -16,7 +16,7 @@ #define MATH_BLAS_HH_ // ACML is included with cblas.h and linking to correct cblas library -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Math/CublasWrapper.hh b/src/Math/CublasWrapper.hh index fba71d102..64f6c4a9f 100644 --- a/src/Math/CublasWrapper.hh +++ b/src/Math/CublasWrapper.hh @@ -17,7 +17,7 @@ #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif diff --git a/src/Math/CudaMatrixKernelsWrapper.hh b/src/Math/CudaMatrixKernelsWrapper.hh index cfaa3fb15..ff840015a 100644 --- a/src/Math/CudaMatrixKernelsWrapper.hh +++ b/src/Math/CudaMatrixKernelsWrapper.hh @@ -15,7 +15,7 @@ #ifndef CUDAMATRIXKERNELSWRAPPER_HH_ #define CUDAMATRIXKERNELSWRAPPER_HH_ -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif /** diff --git a/src/Math/CudaWrapper.hh b/src/Math/CudaWrapper.hh index 36c46106d..9441db6b6 100644 --- a/src/Math/CudaWrapper.hh +++ b/src/Math/CudaWrapper.hh @@ -17,7 +17,7 @@ #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif diff --git a/src/Math/FastVectorOperations.hh b/src/Math/FastVectorOperations.hh index 0f86ac1e6..b16edb5df 100644 --- a/src/Math/FastVectorOperations.hh +++ b/src/Math/FastVectorOperations.hh @@ -15,7 +15,7 @@ #ifndef FAST_VECTOR_OPERATIONS_HH_ #define FAST_VECTOR_OPERATIONS_HH_ -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Math/ProfileMatrix.cc b/src/Math/ProfileMatrix.cc index 4dee8d9ab..4b9216d35 100644 --- a/src/Math/ProfileMatrix.cc +++ b/src/Math/ProfileMatrix.cc @@ -21,7 +21,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "ProfileMatrix.hh" diff --git a/src/Math/Random.cc b/src/Math/Random.cc index c9caad34c..fea157ae3 100644 --- a/src/Math/Random.cc +++ b/src/Math/Random.cc @@ -13,7 +13,7 @@ * limitations under the License. */ #include "Random.hh" -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #ifdef MODULE_MATH_NR diff --git a/src/Math/Random.hh b/src/Math/Random.hh index c067b2660..5ebd0f0a8 100644 --- a/src/Math/Random.hh +++ b/src/Math/Random.hh @@ -16,7 +16,7 @@ #define _MATH_RANDOM_HH #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Mm/MixtureSet.cc b/src/Mm/MixtureSet.cc index b5f40dde1..6e221385c 100644 --- a/src/Mm/MixtureSet.cc +++ b/src/Mm/MixtureSet.cc @@ -15,7 +15,7 @@ #include "MixtureSet.hh" #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Mm/MixtureSetReader.cc b/src/Mm/MixtureSetReader.cc index bc189d75f..3ce7ed347 100644 --- a/src/Mm/MixtureSetReader.cc +++ b/src/Mm/MixtureSetReader.cc @@ -15,7 +15,7 @@ #include "MixtureSetReader.hh" #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "Module.hh" diff --git a/src/Mm/Module.cc b/src/Mm/Module.cc index b11e856f6..6d544cb92 100644 --- a/src/Mm/Module.cc +++ b/src/Mm/Module.cc @@ -15,7 +15,7 @@ #include "Module.hh" #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "FeatureScorerFactory.hh" diff --git a/src/Mm/Module.hh b/src/Mm/Module.hh index f9354fdbb..8d770c34d 100644 --- a/src/Mm/Module.hh +++ b/src/Mm/Module.hh @@ -17,7 +17,7 @@ #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "AssigningFeatureScorer.hh" diff --git a/src/Nn/BufferedAlignedFeatureProcessor.cc b/src/Nn/BufferedAlignedFeatureProcessor.cc index 172f0bf9e..30da22777 100644 --- a/src/Nn/BufferedAlignedFeatureProcessor.cc +++ b/src/Nn/BufferedAlignedFeatureProcessor.cc @@ -18,7 +18,7 @@ #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Nn/FeedForwardTrainer.hh b/src/Nn/FeedForwardTrainer.hh index 939e0ed1f..85d281ab0 100644 --- a/src/Nn/FeedForwardTrainer.hh +++ b/src/Nn/FeedForwardTrainer.hh @@ -18,7 +18,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Nn/Module.cc b/src/Nn/Module.cc index 05e4be1b6..4d461c3ad 100644 --- a/src/Nn/Module.cc +++ b/src/Nn/Module.cc @@ -15,7 +15,7 @@ #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "Module.hh" diff --git a/src/Nn/NeuralNetworkTrainer.cc b/src/Nn/NeuralNetworkTrainer.cc index 305e35b6d..215d1f856 100644 --- a/src/Nn/NeuralNetworkTrainer.cc +++ b/src/Nn/NeuralNetworkTrainer.cc @@ -22,7 +22,7 @@ #include #include // XML I/O stuff for writing parameters -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #ifdef MODULE_PYTHON diff --git a/src/Nn/SegmentwiseNnTrainer.hh b/src/Nn/SegmentwiseNnTrainer.hh index 2faf20280..e3f7ee8d7 100644 --- a/src/Nn/SegmentwiseNnTrainer.hh +++ b/src/Nn/SegmentwiseNnTrainer.hh @@ -17,7 +17,7 @@ #include #include // for mix2phoneme map ( lattice coverage statistics) -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Python/Numpy.hh b/src/Python/Numpy.hh index fb7a5026e..fc3b37256 100644 --- a/src/Python/Numpy.hh +++ b/src/Python/Numpy.hh @@ -22,7 +22,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Python/check.cc b/src/Python/check.cc index 6983092f6..814b4630d 100644 --- a/src/Python/check.cc +++ b/src/Python/check.cc @@ -13,7 +13,7 @@ * limitations under the License. */ #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif diff --git a/src/Search/Module.cc b/src/Search/Module.cc index 9535cb128..5eb4afae4 100644 --- a/src/Search/Module.cc +++ b/src/Search/Module.cc @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Search/Wfst/check.cc b/src/Search/Wfst/check.cc index 87c5589b3..350d64936 100644 --- a/src/Search/Wfst/check.cc +++ b/src/Search/Wfst/check.cc @@ -14,7 +14,7 @@ */ #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Search/Wfst/check_ctrans.cc b/src/Search/Wfst/check_ctrans.cc index 69c4d6dbf..32938a574 100644 --- a/src/Search/Wfst/check_ctrans.cc +++ b/src/Search/Wfst/check_ctrans.cc @@ -17,7 +17,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Search/WordConditionedTreeSearch.cc b/src/Search/WordConditionedTreeSearch.cc index ace4c056f..13fe7f9ca 100644 --- a/src/Search/WordConditionedTreeSearch.cc +++ b/src/Search/WordConditionedTreeSearch.cc @@ -29,7 +29,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "Histogram.hh" diff --git a/src/Search/check.cc b/src/Search/check.cc index cd1fb012a..f583806bf 100644 --- a/src/Search/check.cc +++ b/src/Search/check.cc @@ -13,7 +13,7 @@ * limitations under the License. */ #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "StateTree.hh" diff --git a/src/Signal/Module.cc b/src/Signal/Module.cc index f1e43a6fc..7abf72cef 100644 --- a/src/Signal/Module.cc +++ b/src/Signal/Module.cc @@ -14,7 +14,7 @@ */ #include "Module.hh" #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "ComplexVectorFunction.hh" diff --git a/src/Signal/WindowFunction.cc b/src/Signal/WindowFunction.cc index f57c8bec9..c8e88a998 100644 --- a/src/Signal/WindowFunction.cc +++ b/src/Signal/WindowFunction.cc @@ -13,7 +13,7 @@ * limitations under the License. */ #include "WindowFunction.hh" -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #if defined(MODULE_MATH_NR) && defined(MODULE_SIGNAL_ADVANCED) diff --git a/src/Speech/AbstractSegmentwiseTrainer.cc b/src/Speech/AbstractSegmentwiseTrainer.cc index 2525f0ac0..109c2d802 100644 --- a/src/Speech/AbstractSegmentwiseTrainer.cc +++ b/src/Speech/AbstractSegmentwiseTrainer.cc @@ -18,7 +18,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "AcousticSegmentwiseTrainer.hh" diff --git a/src/Speech/AcousticSegmentwiseTrainer.cc b/src/Speech/AcousticSegmentwiseTrainer.cc index 77a7b2b14..faeccc946 100644 --- a/src/Speech/AcousticSegmentwiseTrainer.cc +++ b/src/Speech/AcousticSegmentwiseTrainer.cc @@ -14,7 +14,7 @@ */ #include "AcousticSegmentwiseTrainer.hh" -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "SegmentwiseGmmTrainer.hh" diff --git a/src/Speech/AdvancedLatticeExtractor.cc b/src/Speech/AdvancedLatticeExtractor.cc index 1f1e7578d..6bb4fd6f2 100644 --- a/src/Speech/AdvancedLatticeExtractor.cc +++ b/src/Speech/AdvancedLatticeExtractor.cc @@ -33,7 +33,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Speech/LatticeSetExtractor.cc b/src/Speech/LatticeSetExtractor.cc index 486e6f0e2..34850dbde 100644 --- a/src/Speech/LatticeSetExtractor.cc +++ b/src/Speech/LatticeSetExtractor.cc @@ -16,7 +16,7 @@ #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Speech/Module.hh b/src/Speech/Module.hh index f437a6531..184f228d9 100644 --- a/src/Speech/Module.hh +++ b/src/Speech/Module.hh @@ -16,7 +16,7 @@ #define _SPEECH_MODULE_HH #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Speech/Recognizer.hh b/src/Speech/Recognizer.hh index ccdb5ff19..797891df6 100644 --- a/src/Speech/Recognizer.hh +++ b/src/Speech/Recognizer.hh @@ -18,7 +18,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Speech/SegmentwiseGmmTrainer.cc b/src/Speech/SegmentwiseGmmTrainer.cc index 3235e91d1..a9f8d365b 100644 --- a/src/Speech/SegmentwiseGmmTrainer.cc +++ b/src/Speech/SegmentwiseGmmTrainer.cc @@ -25,7 +25,7 @@ #include "AlignmentNode.hh" #include "Module.hh" -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif using namespace Speech; diff --git a/src/Speech/WordLatticeExtractor.hh b/src/Speech/WordLatticeExtractor.hh index 92ad5d154..485a80707 100644 --- a/src/Speech/WordLatticeExtractor.hh +++ b/src/Speech/WordLatticeExtractor.hh @@ -19,7 +19,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include "CorpusProcessor.hh" diff --git a/src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh b/src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh index cb9c9ebdd..27b18e618 100644 --- a/src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh +++ b/src/Tools/AcousticModelTrainer/AcousticModelTrainer.hh @@ -15,7 +15,7 @@ #ifndef _TOOLS_ACOUSTIC_MODEL_TRAINER_ACOUSTIC_MODEL_TRAINER_HH #define _TOOLS_ACOUSTIC_MODEL_TRAINER_ACOUSTIC_MODEL_TRAINER_HH -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Tools/CorpusStatistics/Costa.cc b/src/Tools/CorpusStatistics/Costa.cc index 70781228e..dbfe892c1 100644 --- a/src/Tools/CorpusStatistics/Costa.cc +++ b/src/Tools/CorpusStatistics/Costa.cc @@ -21,7 +21,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Tools/FeatureExtraction/FeatureExtraction.cc b/src/Tools/FeatureExtraction/FeatureExtraction.cc index 030158ff5..806380bd5 100644 --- a/src/Tools/FeatureExtraction/FeatureExtraction.cc +++ b/src/Tools/FeatureExtraction/FeatureExtraction.cc @@ -20,7 +20,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Tools/Flf/FlfTool.cc b/src/Tools/Flf/FlfTool.cc index 9a8925411..d4333f76f 100644 --- a/src/Tools/Flf/FlfTool.cc +++ b/src/Tools/Flf/FlfTool.cc @@ -25,7 +25,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Tools/Fsa/Fsa.cc b/src/Tools/Fsa/Fsa.cc index e7e37c284..3ec6b50b7 100644 --- a/src/Tools/Fsa/Fsa.cc +++ b/src/Tools/Fsa/Fsa.cc @@ -44,7 +44,7 @@ #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #ifdef MODULE_OPENFST diff --git a/src/Tools/LatticeProcessor/LatticeProcessor.hh b/src/Tools/LatticeProcessor/LatticeProcessor.hh index 9399f1b7d..bd7ae3aa4 100644 --- a/src/Tools/LatticeProcessor/LatticeProcessor.hh +++ b/src/Tools/LatticeProcessor/LatticeProcessor.hh @@ -23,7 +23,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Tools/NnTrainer/NnTrainer.hh b/src/Tools/NnTrainer/NnTrainer.hh index e8ae7433b..e26dba60b 100644 --- a/src/Tools/NnTrainer/NnTrainer.hh +++ b/src/Tools/NnTrainer/NnTrainer.hh @@ -16,7 +16,7 @@ #define _TOOLS_NN_TRAINER_NN_TRAINER_HH #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include diff --git a/src/Tools/SpeechRecognizer/SpeechRecognizer.cc b/src/Tools/SpeechRecognizer/SpeechRecognizer.cc index a08a68a36..25fe7ed2c 100644 --- a/src/Tools/SpeechRecognizer/SpeechRecognizer.cc +++ b/src/Tools/SpeechRecognizer/SpeechRecognizer.cc @@ -20,7 +20,7 @@ #include #include #include -#ifndef CMAKE_DISABLE_MODULE_HH +#ifndef CMAKE_DISABLE_MODULES_HH #include #endif #include From f45d4e5cf2145d51fdff0deca2f38c80a5305ec5 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Wed, 8 Nov 2023 18:59:25 +0100 Subject: [PATCH 04/13] Python/Tensorflow imports, sub-cmake-files, more module directories --- .gitignore | 3 +- CMakeLists.txt | 79 ++---------- cmake_resources/ConfigurationTypes.cmake | 23 ++++ cmake_resources/Modules.cmake | 155 +++++++++++++++++++++++ cmake_resources/Python.cmake | 5 + cmake_resources/Tensorflow.cmake | 50 ++++++++ src/Am/CMakeLists.txt | 21 +++ src/Audio/CMakeLists.txt | 26 ++++ src/Bliss/CMakeLists.txt | 33 +++++ src/Cart/CMakeLists.txt | 5 +- src/Core/CMakeLists.txt | 7 +- src/Flf/CMakeLists.txt | 67 ++++++++++ src/Flf/FlfCore/CMakeLists.txt | 15 +++ src/Flf/FlfExt/CMakeLists.txt | 8 ++ src/Speech/CMakeLists.txt | 52 ++++---- src/Tools/CMakeLists.txt | 5 +- src/Tools/Cart/CMakeLists.txt | 10 +- 17 files changed, 458 insertions(+), 106 deletions(-) create mode 100644 cmake_resources/ConfigurationTypes.cmake create mode 100644 cmake_resources/Modules.cmake create mode 100644 cmake_resources/Python.cmake create mode 100644 cmake_resources/Tensorflow.cmake create mode 100644 src/Am/CMakeLists.txt create mode 100644 src/Audio/CMakeLists.txt create mode 100644 src/Bliss/CMakeLists.txt create mode 100644 src/Flf/CMakeLists.txt create mode 100644 src/Flf/FlfCore/CMakeLists.txt create mode 100644 src/Flf/FlfExt/CMakeLists.txt diff --git a/.gitignore b/.gitignore index b1f727632..62d2846eb 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,8 @@ /src/Core/stack.hh # From build. -.build +.build* +cmake-build* *.a *.pyc *.o diff --git a/CMakeLists.txt b/CMakeLists.txt index 06488a3ab..ceb624625 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,56 +1,15 @@ cmake_minimum_required(VERSION 3.14) project(RASR) -find_library( - TENSORFLOW_CC - NAMES tensorflow_cc - HINTS /usr/local/lib/tensorflow/ - PATH_SUFFIXES lib REQUIRED) +#set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON" FORCE) -find_library( - TENSORFLOW_FRAMEWORK - NAMES tensorflow_framework - HINTS /usr/local/lib/tensorflow/ - PATH_SUFFIXES lib REQUIRED) - -if(TENSORFLOW_CC) - message(STATUS "TensorFlow CC library found at ${TENSORFLOW_CC}") -else() - message(FATAL_ERROR "TensorFlow CC library not found") -endif() - -if(TENSORFLOW_FRAMEWORK) - message(STATUS "TensorFlow Framework library found at ${TENSORFLOW_FRAMEWORK}") -else() - message(FATAL_ERROR "TensorFlow Framework library not found") -endif() - -# Find Python interpreter -find_package(PythonInterp REQUIRED) - -# Get the TensorFlow include directory by executing a Python command -execute_process( - COMMAND "${PYTHON_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_include())" - RESULT_VARIABLE _tensorflow_include_res - OUTPUT_VARIABLE TENSORFLOW_INCLUDE_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE -) - -# Check if we got the include directory -if(NOT _tensorflow_include_res EQUAL "0") - message(FATAL_ERROR "Failed to get TensorFlow include directory") -endif() - -# Output the found directory for debugging purposes -message(STATUS "TensorFlow include directory: ${TENSORFLOW_INCLUDE_DIR}") +include(cmake_resources/ConfigurationTypes.cmake) +include(cmake_resources/Modules.cmake) +include(cmake_resources/Python.cmake) string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME) -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(BUILD_SUFFIX "debug") -else() - set(BUILD_SUFFIX "standard") -endif() -set(ARCH_DESCRIPTION "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_SUFFIX}") +string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE) +set(ARCH_DESCRIPTION "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_TYPE}") set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH_DESCRIPTION}/") function(add_install_executable EXECUTABLE_NAME) @@ -58,21 +17,6 @@ function(add_install_executable EXECUTABLE_NAME) set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}.${ARCH_DESCRIPTION}") endfunction() -add_compile_definitions(CMAKE_DISABLE_MODULES_HH) - -function(add_module_option MODULE_NAME DEFAULT_VALUE) - option(${MODULE_NAME} "Enable module ${MODULE_NAME})" ${DEFAULT_VALUE}) - if(${MODULE_NAME}) - add_compile_definitions(${MODULE_NAME}) - message(STATUS "Module ${MODULE_NAME} is enabled") - else() - message(STATUS "Module ${MODULE_NAME} is not enabled") - endif() -endfunction() - -add_module_option(MODULE_AUDIO_FFMPEG ON) -add_module_option(MODULE_CORE_CACHE_MANAGER ON) -add_module_option(MODULE_CART ON) add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc @@ -86,14 +30,19 @@ add_custom_target(SourceVersion DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc) find_package(LibXml2 REQUIRED) -find_package(BISON REQUIRED) find_package(Threads REQUIRED) find_package(ZLIB REQUIRED) -include_directories(${CMAKE_SOURCE_DIR}/src) -# include_directories(${CMAKE_CURRENT_BINARY_DIR}) +link_libraries(LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads) + include_directories(${LIBXML2_INCLUDE_DIR}) +include_directories(${CMAKE_SOURCE_DIR}/src) + +add_subdirectory(src/Am) +add_subdirectory(src/Audio) +add_subdirectory(src/Bliss) add_subdirectory(src/Cart) add_subdirectory(src/Core) +add_subdirectory(src/Flf) add_subdirectory(src/Tools) diff --git a/cmake_resources/ConfigurationTypes.cmake b/cmake_resources/ConfigurationTypes.cmake new file mode 100644 index 000000000..9ee722a0c --- /dev/null +++ b/cmake_resources/ConfigurationTypes.cmake @@ -0,0 +1,23 @@ +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "standard" "debug" "release") + +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'standard' as none was specified.") + set(CMAKE_BUILD_TYPE standard CACHE STRING "Choose the type of build." FORCE) +endif() + + +add_compile_definitions(CMAKE_DISABLE_MODULES_HH) +set(CMAKE_C_FLAGS_STANDARD "-O2") +set(CMAKE_CXX_FLAGS_STANDARD "-O2") +set(CMAKE_EXE_LINKER_FLAGS_STANDARD "") +set(CMAKE_DEF_FLAGS_STANDARD "-DSPRINT_STANDARD_BUILD") + +set(CMAKE_C_FLAGS_RELEASE "-O3") +set(CMAKE_CXX_FLAGS_RELEASE "-O3") +set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-rdynamic") +set(CMAKE_DEF_FLAGS_RELEASE "-DSPRINT_RELEASE_BUILD -DNDEBUG") + +set(CMAKE_C_FLAGS_DEBUG "-O0 -g") +set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") +set(CMAKE_EXE_LINKER_FLAGS_DEBUG "") +set(CMAKE_DEF_FLAGS_DEBUG "-D_GLIBCXX_DEBUG -DDEBUG") diff --git a/cmake_resources/Modules.cmake b/cmake_resources/Modules.cmake new file mode 100644 index 000000000..46ce46023 --- /dev/null +++ b/cmake_resources/Modules.cmake @@ -0,0 +1,155 @@ +function(add_module_option MODULE_NAME DEFAULT_VALUE) + option(${MODULE_NAME} "Enable module ${MODULE_NAME})" ${DEFAULT_VALUE}) + if(${MODULE_NAME}) + add_compile_definitions(${MODULE_NAME}) +# message(STATUS "Module ${MODULE_NAME} is enabled") + else() +# message(STATUS "Module ${MODULE_NAME} disabled") + endif() +endfunction() + +set(TOOLS "") + +function(add_tool_option TOOL_NAME DEFAULT_VALUE) + option(${TOOL_NAME} "Enable tool ${TOOL_NAME})" ${DEFAULT_VALUE}) + if(${TOOL_NAME}) + set(TOOLS ${TOOLS} ${TOOL_NAME} PARENT_SCOPE) +# message(STATUS "Tool ${TOOL_NAME} is enabled") + else() +# message(STATUS "Tool ${TOOL_NAME} is disabled") + endif() +endfunction() + +# ****** Adaptation ****** +add_module_option(MODULE_ADAPT_CMLLR ON) +add_module_option(MODULE_ADAPT_MLLR ON) +add_module_option(MODULE_ADAPT_ADVANCED ON) + +# ****** Audio ****** +add_module_option(MODULE_AUDIO_FFMPEG OFF) +add_module_option(MODULE_AUDIO_FLAC ON) +add_module_option(MODULE_AUDIO_OTK ON) +add_module_option(MODULE_AUDIO_OSS ON) +add_module_option(MODULE_AUDIO_RAW ON) +add_module_option(MODULE_AUDIO_WAV_SYSTEM ON) + +# ****** Cache Manager integration ****** +add_module_option(MODULE_CORE_CACHE_MANAGER ON) + +# ****** Cart ****** +add_module_option(MODULE_CART ON) + +# ****** Flf ****** +add_module_option(MODULE_FLF_CORE ON) +add_module_option(MODULE_FLF_EXT ON) +add_module_option(MODULE_FLF ON) + +# ****** Lattice ****** +add_module_option(MODULE_LATTICE_BASIC ON) +add_module_option(MODULE_LATTICE_HTK ON) +add_module_option(MODULE_LATTICE_DT ON) + +# ****** Lm ****** +add_module_option(MODULE_LM_ARPA ON) +add_module_option(MODULE_LM_FSA ON) +add_module_option(MODULE_LM_ZEROGRAM ON) +add_module_option(MODULE_LM_FFNN ON) +add_module_option(MODULE_LM_TFRNN ON) + +# ****** Math ****** +add_module_option(MODULE_MATH_NR ON) + +# ****** Mm ****** +add_module_option(MODULE_MM_BATCH ON) +add_module_option(MODULE_MM_DT ON) + +# ****** Neural Network ****** +add_module_option(MODULE_NN ON) +add_module_option(MODULE_NN_SEQUENCE_TRAINING ON) +add_module_option(MODULE_THEANO_INTERFACE ON) +add_module_option(MODULE_PYTHON ON) + +# ****** OpenFst ****** +add_module_option(MODULE_OPENFST ON) + +# ****** Search ****** +add_module_option(MODULE_SEARCH_MBR ON) +add_module_option(MODULE_SEARCH_WFST ON) +add_module_option(MODULE_SEARCH_LINEAR ON) +add_module_option(MODULE_ADVANCED_TREE_SEARCH ON) +add_module_option(MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH ON) + +# ****** Signal ****** +add_module_option(MODULE_SIGNAL_GAMMATONE ON) +add_module_option(MODULE_SIGNAL_PLP ON) +add_module_option(MODULE_SIGNAL_VTLN ON) +add_module_option(MODULE_SIGNAL_VOICEDNESS ON) +add_module_option(MODULE_SIGNAL_ADVANCED ON) +add_module_option(MODULE_SIGNAL_ADVANCED_NR ON) + +# ****** Speech ****** +add_module_option(MODULE_SPEECH_DT ON) +add_module_option(MODULE_SPEECH_DT_ADVANCED ON) +add_module_option(MODULE_SPEECH_ALIGNMENT_FLOW_NODES ON) +add_module_option(MODULE_SPEECH_LATTICE_FLOW_NODES ON) +add_module_option(MODULE_SPEECH_LATTICE_ALIGNMENT ON) +add_module_option(MODULE_SPEECH_LATTICE_RESCORING ON) + +# ****** Unit Tests ****** +add_module_option(MODULE_TEST ON) + +# ****** Intel Threading Building Blocks ****** +add_module_option(MODULE_TBB OFF) + +# ****** OpenMP library ****** +add_module_option(MODULE_OPENMP OFF) +# **** choose optimized blas library if available ****** +add_module_option(MODULE_INTEL_MKL OFF) +add_module_option(MODULE_ACML OFF) +add_module_option(MODULE_CUDA OFF) + +# ****** Tensorflow integration ****** +add_module_option(MODULE_TENSORFLOW ON) + +# ****** ONNX integration ****** +add_module_option(MODULE_ONNX OFF) + +# ****** Tools ****** +add_tool_option(AcousticModelTrainer ON) +add_tool_option(Archiver ON) +add_tool_option(CorpusStatistics ON) +add_tool_option(FeatureExtraction ON) +add_tool_option(FeatureStatistics ON) +add_tool_option(Fsa ON) +add_tool_option(Lm ON) +add_tool_option(SpeechRecognizer ON) +add_tool_option(Xml ON) + +if(${MODULE_CART}) + add_tool_option(Cart ON) +endif() + +if(${MODULE_MM_DT} AND ${MODULE_LATTICE_DT} AND ${MODULE_SPEECH_DT}) + add_tool_option(LatticeProcessor ON) +endif() + +if(${MODULE_FLF}) + add_tool_option(Flf ON) +endif() + +if(${MODULE_NN}) + add_tool_option(NnTrainer ON) +endif() + +set(TOOLS Cart) + +set(SEARCH_LIBS libRasrSearch) +if(${MODULE_SEARCH_WFST}) + list(APPEND SEARCH_LIBS libRasrSearchWfst libRasrOpenFst) +endif() +if(${MODULE_ADVANCED_TREE_SEARCH}) + list(APPEND SEARCH_LIBS libRasrAdvancedTreeSearch) +endif() +if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + list(APPEND SEARCH_LIBS libRasrGenericSeq2SeqTreeSearch) +endif() diff --git a/cmake_resources/Python.cmake b/cmake_resources/Python.cmake new file mode 100644 index 000000000..71d9e6fe3 --- /dev/null +++ b/cmake_resources/Python.cmake @@ -0,0 +1,5 @@ +if(${MODULE_PYTHON}) + # Find Python interpreter + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + include(cmake_resources/Tensorflow.cmake) +endif() \ No newline at end of file diff --git a/cmake_resources/Tensorflow.cmake b/cmake_resources/Tensorflow.cmake new file mode 100644 index 000000000..432d6d6e2 --- /dev/null +++ b/cmake_resources/Tensorflow.cmake @@ -0,0 +1,50 @@ +if(${MODULE_TENSORFLOW}) + # Get the TensorFlow include directory by executing a Python command + execute_process( + COMMAND "${Python3_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_include())" + RESULT_VARIABLE _tensorflow_include_res + OUTPUT_VARIABLE Tensorflow_INCLUDE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + execute_process( + COMMAND "${Python3_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_lib())" + RESULT_VARIABLE _tensorflow_lib_res + OUTPUT_VARIABLE Tensorflow_LIB_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + # Check if we got the include directory + if(NOT _tensorflow_include_res EQUAL "0") + message(FATAL_ERROR "Failed to get TensorFlow include directory") + endif() + + # Output the found directory for debugging purposes + message(STATUS "Tensorflow include directory: ${Tensorflow_INCLUDE_DIR}") + + find_library( + Tensorflow_CC + NAMES tensorflow_cc + HINTS ${Tensorflow_LIB_DIR} + PATH_SUFFIXES lib REQUIRED) + + find_library( + Tensorflow_FRAMEWORK + NAMES tensorflow_framework + HINTS ${Tensorflow_LIB_DIR} + PATH_SUFFIXES lib REQUIRED) + + if(Tensorflow_CC) + message(STATUS "Tensorflow CC library found at ${Tensorflow_CC}") + else() + message(FATAL_ERROR "Tensorflow CC library not found") + endif() + + if(Tensorflow_FRAMEWORK) + message(STATUS "Tensorflow Framework library found at ${Tensorflow_FRAMEWORK}") + else() + message(FATAL_ERROR "TensorFlow Framework library not found") + endif() + + set(Tensorflow_LIBRARIES ${Tensorflow_CC} ${Tensorflow_FRAMEWORK}) +endif() \ No newline at end of file diff --git a/src/Am/CMakeLists.txt b/src/Am/CMakeLists.txt new file mode 100644 index 000000000..b838f178b --- /dev/null +++ b/src/Am/CMakeLists.txt @@ -0,0 +1,21 @@ +set(Am_SOURCES + AcousticModel.cc + AcousticModelAdaptor.cc + ClassicAcousticModel.cc + ClassicHmmTopologySet.cc + ClassicStateModel.cc + ClassicTransducerBuilder.cc + Module.cc + TransitionModel.cc + Utilities.cc +) + +if(${MODULE_CART}) + list(APPEND Am_SOURCES DecisionTreeStateTying.cc ClassicDecisionTree.cc) +endif() + +if(${MODULE_MATH_NR}) + list(APPEND Am_SOURCES AdaptedAcousticModel.cc AdaptationTree.cc) +endif() + +add_library(RasrAm ${Am_SOURCES}) \ No newline at end of file diff --git a/src/Audio/CMakeLists.txt b/src/Audio/CMakeLists.txt new file mode 100644 index 000000000..1021dbc26 --- /dev/null +++ b/src/Audio/CMakeLists.txt @@ -0,0 +1,26 @@ +set(Audio_SOURCES + Module.cc + Node.cc +) + +if(${MODULE_AUDIO_FFMPEG}) + list(APPEND Audio_SOURCES Ffmpeg.cc) +endif() + +if(${MODULE_AUDIO_FLAC}) + list(APPEND Audio_SOURCES Flac.cc flac/FlacDecoder.cc) +endif() + +if(${SYSTEM_NAME} STREQUAL "linux" AND ${MODULE_AUDIO_OSS}) + list(APPEND Audio_SOURCES Oss.cc) +endif() + +if(${MODULE_AUDIO_RAW}) + list(APPEND Audio_SOURCES Raw.cc) +endif() + +if(${MODULE_AUDIO_WAV_SYSTEM}) + list(APPEND Audio_SOURCES Wav.cc) +endif() + +add_library(RasrAudio ${Audio_SOURCES}) \ No newline at end of file diff --git a/src/Bliss/CMakeLists.txt b/src/Bliss/CMakeLists.txt new file mode 100644 index 000000000..db5f51fdb --- /dev/null +++ b/src/Bliss/CMakeLists.txt @@ -0,0 +1,33 @@ +set(Bliss_SOURCES + CorpusDescription.cc + CorpusKey.cc + CorpusParser.cc + CorpusStatistics.cc + EditDistance.cc + Evaluation.cc + Fsa.cc + Lexicon.cc + LexiconParser.cc + Orthography.cc + Phoneme.cc + Phonology.cc + PrefixTree.cc + SegmentOrdering.cc + Symbol.cc + Unknown.cc +) + +if(${MODULE_THEANO_INTERFACE}) + list(APPEND Bliss_SOURCES TheanoCommunicator.cc TheanoSegmentOrderingVisitor.cc) +endif() + +if(${MODULE_PYTHON}) + list(APPEND Bliss_SOURCES PythonSegmentOrdering.cc) +endif() + +add_library(RasrBliss ${Bliss_SOURCES}) + +if(${MODULE_PYTHON}) + target_compile_definitions(RasrBliss PRIVATE ${Python3_DEFINITIONS}) + target_include_directories(RasrBliss PRIVATE ${Python3_INCLUDE_DIRS}) +endif() diff --git a/src/Cart/CMakeLists.txt b/src/Cart/CMakeLists.txt index 8435d8c40..ebf612750 100644 --- a/src/Cart/CMakeLists.txt +++ b/src/Cart/CMakeLists.txt @@ -9,7 +9,4 @@ set(Cart_SOURCES Parser.cc ) -add_library(RasrCart STATIC ${Cart_SOURCES}) -#target_link_libraries(RasrCart PRIVATE RasrCore) - -target_include_directories(RasrCart PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file +add_library(RasrCart STATIC ${Cart_SOURCES}) \ No newline at end of file diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt index 9aedf73fc..9b6210cb1 100644 --- a/src/Core/CMakeLists.txt +++ b/src/Core/CMakeLists.txt @@ -44,6 +44,8 @@ set(Core_SOURCES XmlStream.cc ) +find_package(BISON REQUIRED) + BISON_TARGET( ArithmeticExpressionParser ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.yy @@ -51,10 +53,7 @@ BISON_TARGET( DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.hh COMPILE_FLAGS "-d" ) -set(Core_SOURCES ${Core_SOURCES} ${BISON_ArithmeticExpressionParser_OUTPUTS}) +list(APPEND Core_SOURCES ${BISON_ArithmeticExpressionParser_OUTPUTS}) add_library(RasrCore STATIC ${Core_SOURCES}) - -target_include_directories(RasrCore PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) - add_dependencies(RasrCore SourceVersion) diff --git a/src/Flf/CMakeLists.txt b/src/Flf/CMakeLists.txt new file mode 100644 index 000000000..1070e8ee0 --- /dev/null +++ b/src/Flf/CMakeLists.txt @@ -0,0 +1,67 @@ +add_subdirectory(FlfCore) + +if(${MODULE_FLF_EXT}) + add_subdirectory(FlfExt) +endif() + +set(Flf_SOURCES + Archive.cc + Best.cc + Cache.cc + CenterFrameConfusionNetworkBuilder.cc + Combination.cc + Compose.cc + Concatenate.cc + ConfusionNetwork.cc + ConfusionNetworkCombination.cc + ConfusionNetworkIo.cc + CorpusProcessor.cc + Copy.cc + Convert.cc + Draw.cc + Determinize.cc + EpsilonRemoval.cc + Evaluate.cc + Filter.cc + Formattings.cc + FlfIo.cc + FwdBwd.cc + GammaCorrection.cc + HtkSlfIo.cc + Info.cc + Io.cc + LanguageModel.cc + LatticeAdaptor.cc + LatticeHandler.cc + Lexicon.cc + LocalCostDecoder.cc + Map.cc + Miscellaneous.cc + Module.cc + NBest.cc + Network.cc + NodeFactory.cc + NonWordFilter.cc + PivotArcConfusionNetworkBuilder.cc + Processor.cc + Prune.cc + PushForwardRescoring.cc + Recognizer.cc + IncrementalRecognizer.cc + Rescore.cc + RescoreLm.cc + RescoreInternal.cc + Rescale.cc + Segment.cc + SegmentwiseSpeechProcessor.cc + StateClusterConfusionNetworkBuilder.cc + TimeAlignment.cc + TimeframeConfusionNetwork.cc + TimeframeConfusionNetworkBuilder.cc + TimeframeConfusionNetworkCombination.cc + TimeframeConfusionNetworkIo.cc + TimeframeError.cc + Union.cc +) + +add_library(RasrFlf STATIC ${Flf_SOURCES}) \ No newline at end of file diff --git a/src/Flf/FlfCore/CMakeLists.txt b/src/Flf/FlfCore/CMakeLists.txt new file mode 100644 index 000000000..6663570b6 --- /dev/null +++ b/src/Flf/FlfCore/CMakeLists.txt @@ -0,0 +1,15 @@ +set(FlfCore_SOURCES + Ftl.cc + Basic.cc + Boundaries.cc + Lattice.cc + LatticeInternal.cc + Semiring.cc + TopologicalOrderQueue.cc + Traverse.cc + Types.cc + Utility.cc + Weight.cc +) + +add_library(RasrFlfCore STATIC ${FlfCore_SOURCES}) \ No newline at end of file diff --git a/src/Flf/FlfExt/CMakeLists.txt b/src/Flf/FlfExt/CMakeLists.txt new file mode 100644 index 000000000..19c0e7f35 --- /dev/null +++ b/src/Flf/FlfExt/CMakeLists.txt @@ -0,0 +1,8 @@ +set(FlfExt_SOURCES + AcousticAlignment.cc + MapDecoder.cc + MtConfusionNetwork.cc + WindowedLevenshteinDistanceDecoder.cc +) + +add_library(RasrFlfExt STATIC ${FlfExt_SOURCES}) \ No newline at end of file diff --git a/src/Speech/CMakeLists.txt b/src/Speech/CMakeLists.txt index a07ac7b58..bafab219b 100644 --- a/src/Speech/CMakeLists.txt +++ b/src/Speech/CMakeLists.txt @@ -1,30 +1,30 @@ set(SPEECH_SOURCES - /AcousticModelTrainer.cc - /AlignerModelAcceptor.cc - /AligningFeatureExtractor.cc - /Alignment.cc - /AlignmentNode.cc - /AlignmentWithLinearSegmentation.cc - /AllophoneStateGraphBuilder.cc - /AverageFeatureScorerActivation.cc - /CorpusProcessor.cc - /CorpusVisitor.cc - /CovarianceEstimator.cc - /DataExtractor.cc - /DataSource.cc - /DelayedRecognizer.cc - /Feature.cc - /FeatureScorer.cc - /FeatureScorerNode.cc - /FsaCache.cc - /LabelingFeatureExtractor.cc - /MixtureSetTrainer.cc - /ModelCombination.cc - /Module.cc - /Recognizer.cc - /ScatterMatricesEstimator.cc - /TextDependentSequenceFiltering.cc - /TextIndependentMixtureSetTrainer.cc + AcousticModelTrainer.cc + AlignerModelAcceptor.cc + AligningFeatureExtractor.cc + Alignment.cc + AlignmentNode.cc + AlignmentWithLinearSegmentation.cc + AllophoneStateGraphBuilder.cc + AverageFeatureScorerActivation.cc + CorpusProcessor.cc + CorpusVisitor.cc + CovarianceEstimator.cc + DataExtractor.cc + DataSource.cc + DelayedRecognizer.cc + Feature.cc + FeatureScorer.cc + FeatureScorerNode.cc + FsaCache.cc + LabelingFeatureExtractor.cc + MixtureSetTrainer.cc + ModelCombination.cc + Module.cc + Recognizer.cc + ScatterMatricesEstimator.cc + TextDependentSequenceFiltering.cc + TextIndependentMixtureSetTrainer.cc ) if(${MODULE_SPEECH_LATTICE_ALIGNMENT}) diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt index 855f90d37..b3ae547ec 100644 --- a/src/Tools/CMakeLists.txt +++ b/src/Tools/CMakeLists.txt @@ -1,2 +1,3 @@ -add_subdirectory(AcousticModelTrainer) -add_subdirectory(Cart) \ No newline at end of file +foreach(TOOL ${TOOLS}) + add_subdirectory(${TOOL}) +endforeach () \ No newline at end of file diff --git a/src/Tools/Cart/CMakeLists.txt b/src/Tools/Cart/CMakeLists.txt index 0c6c4c661..559199e39 100644 --- a/src/Tools/Cart/CMakeLists.txt +++ b/src/Tools/Cart/CMakeLists.txt @@ -1,4 +1,6 @@ -set(EXE_NAME "cart-trainer") -add_executable(${EXE_NAME} CartTrainer.cc) -target_link_libraries(${EXE_NAME} PRIVATE RasrCart RasrCore LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads) -add_install_executable(${EXE_NAME}) +set(EXE_NAMES "cart-trainer" "cart-viewer") +foreach(EXE_NAME ${EXE_NAMES}) + add_executable(${EXE_NAME} CartTrainer.cc) + target_link_libraries(${EXE_NAME} PRIVATE RasrCart RasrCore) + add_install_executable(${EXE_NAME}) +endforeach () \ No newline at end of file From 240a3dc1cc7074fca32e0235a098afbd76b5970c Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 10 Nov 2023 11:04:52 +0100 Subject: [PATCH 05/13] Adding more CMakeLists up to Search --- CMakeLists.txt | 6 ++ cmake_resources/Modules.cmake | 8 +- cmake_resources/Tensorflow.cmake | 14 ++- src/Am/CMakeLists.txt | 22 ++++- src/Audio/CMakeLists.txt | 4 +- src/Bliss/CMakeLists.txt | 3 + src/Cart/CMakeLists.txt | 6 +- src/Flf/CMakeLists.txt | 22 ++++- src/Flf/FlfCore/CMakeLists.txt | 4 +- src/Flf/FlfExt/CMakeLists.txt | 3 +- src/Flow/CMakeLists.txt | 30 +++++++ src/Fsa/CMakeLists.txt | 49 +++++++++++ src/Lattice/CMakeLists.txt | 54 ++++++++++++ src/Lm/CMakeLists.txt | 66 ++++++++++++++ src/Math/CMakeLists.txt | 27 ++++++ src/Math/Lapack/CMakeLists.txt | 9 ++ src/Math/Nr/CMakeLists.txt | 15 ++++ src/Mc/CMakeLists.txt | 1 + src/Mm/CMakeLists.txt | 85 +++++++++++++++++++ src/Nn/CMakeLists.txt | 77 +++++++++++++++++ src/Onnx/CMakeLists.txt | 12 +++ src/OpenFst/CMakeLists.txt | 14 +++ src/Python/CMakeLists.txt | 9 ++ src/Search/AdvancedTreeSearch/CMakeLists.txt | 30 +++++++ src/Search/CMakeLists.txt | 40 +++++++++ .../GenericSeq2SeqTreeSearch/CMakeLists.txt | 12 +++ 26 files changed, 607 insertions(+), 15 deletions(-) create mode 100644 src/Flow/CMakeLists.txt create mode 100644 src/Fsa/CMakeLists.txt create mode 100644 src/Lattice/CMakeLists.txt create mode 100644 src/Lm/CMakeLists.txt create mode 100644 src/Math/CMakeLists.txt create mode 100644 src/Math/Lapack/CMakeLists.txt create mode 100644 src/Math/Nr/CMakeLists.txt create mode 100644 src/Mc/CMakeLists.txt create mode 100644 src/Mm/CMakeLists.txt create mode 100644 src/Nn/CMakeLists.txt create mode 100644 src/Onnx/CMakeLists.txt create mode 100644 src/OpenFst/CMakeLists.txt create mode 100644 src/Python/CMakeLists.txt create mode 100644 src/Search/AdvancedTreeSearch/CMakeLists.txt create mode 100644 src/Search/CMakeLists.txt create mode 100644 src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index ceb624625..fb4ec6962 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,11 @@ include(cmake_resources/ConfigurationTypes.cmake) include(cmake_resources/Modules.cmake) include(cmake_resources/Python.cmake) +if(${MODULE_CUDA}) + enable_language(CUDA) + set(CMAKE_CUDA_ARCHITECTURES 61;75;86) +endif() + string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME) string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE) set(ARCH_DESCRIPTION "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_TYPE}") @@ -45,4 +50,5 @@ add_subdirectory(src/Bliss) add_subdirectory(src/Cart) add_subdirectory(src/Core) add_subdirectory(src/Flf) +add_subdirectory(src/Fsa) add_subdirectory(src/Tools) diff --git a/cmake_resources/Modules.cmake b/cmake_resources/Modules.cmake index 46ce46023..2a0c563c9 100644 --- a/cmake_resources/Modules.cmake +++ b/cmake_resources/Modules.cmake @@ -143,13 +143,13 @@ endif() set(TOOLS Cart) -set(SEARCH_LIBS libRasrSearch) +set(SEARCH_LIBS RasrSearch) if(${MODULE_SEARCH_WFST}) - list(APPEND SEARCH_LIBS libRasrSearchWfst libRasrOpenFst) + list(APPEND SEARCH_LIBS RasrSearchWfst RasrOpenFst) endif() if(${MODULE_ADVANCED_TREE_SEARCH}) - list(APPEND SEARCH_LIBS libRasrAdvancedTreeSearch) + list(APPEND SEARCH_LIBS RasrAdvancedTreeSearch) endif() if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - list(APPEND SEARCH_LIBS libRasrGenericSeq2SeqTreeSearch) + list(APPEND SEARCH_LIBS RasrGenericSeq2SeqTreeSearch) endif() diff --git a/cmake_resources/Tensorflow.cmake b/cmake_resources/Tensorflow.cmake index 432d6d6e2..d50b025f0 100644 --- a/cmake_resources/Tensorflow.cmake +++ b/cmake_resources/Tensorflow.cmake @@ -25,13 +25,13 @@ if(${MODULE_TENSORFLOW}) find_library( Tensorflow_CC NAMES tensorflow_cc - HINTS ${Tensorflow_LIB_DIR} + HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow PATH_SUFFIXES lib REQUIRED) find_library( Tensorflow_FRAMEWORK NAMES tensorflow_framework - HINTS ${Tensorflow_LIB_DIR} + HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow PATH_SUFFIXES lib REQUIRED) if(Tensorflow_CC) @@ -46,5 +46,13 @@ if(${MODULE_TENSORFLOW}) message(FATAL_ERROR "TensorFlow Framework library not found") endif() - set(Tensorflow_LIBRARIES ${Tensorflow_CC} ${Tensorflow_FRAMEWORK}) + find_package(OpenSSL REQUIRED) + + function(add_tf_dependencies TARGET) + target_compile_options(${TARGET} PUBLIC "-fexceptions") + target_include_directories(${TARGET} PUBLIC ${Tensorflow_INCLUDE_DIR}) + target_link_options(${TARGET} PUBLIC "LINKER:-Wl,--no-as-needed -Wl,--allow-multiple-definition") + target_link_libraries(${TARGET} PUBLIC OpenSSL::Crypto) + target_link_libraries(${TARGET} ${Tensorflow_CC} ${Tensorflow_FRAMEWORK}) + endfunction() endif() \ No newline at end of file diff --git a/src/Am/CMakeLists.txt b/src/Am/CMakeLists.txt index b838f178b..d6e756ae7 100644 --- a/src/Am/CMakeLists.txt +++ b/src/Am/CMakeLists.txt @@ -14,8 +14,26 @@ if(${MODULE_CART}) list(APPEND Am_SOURCES DecisionTreeStateTying.cc ClassicDecisionTree.cc) endif() -if(${MODULE_MATH_NR}) +if(${MODULE_ADAPT_MLLR}) list(APPEND Am_SOURCES AdaptedAcousticModel.cc AdaptationTree.cc) endif() -add_library(RasrAm ${Am_SOURCES}) \ No newline at end of file +add_library(RasrAm ${Am_SOURCES}) + +target_link_libraries(RasrAm INTERFACE + RasrMm + RasrBliss + RasrFsa + RasrCore + RasrMc + RasrMath + RasrMathLapack +) + +if(${MODULE_CART}) + target_link_libraries(RasrAm INTERFACE RasrCart) +endif() + +if(${MODULE_MATH_NR}) + target_link_libraries(RasrAm INTERFACE RasrMathNr) +endif() diff --git a/src/Audio/CMakeLists.txt b/src/Audio/CMakeLists.txt index 1021dbc26..ade02da6e 100644 --- a/src/Audio/CMakeLists.txt +++ b/src/Audio/CMakeLists.txt @@ -23,4 +23,6 @@ if(${MODULE_AUDIO_WAV_SYSTEM}) list(APPEND Audio_SOURCES Wav.cc) endif() -add_library(RasrAudio ${Audio_SOURCES}) \ No newline at end of file +add_library(RasrAudio ${Audio_SOURCES}) + +target_link_libraries(RasrAudio INTERFACE RasrFlow RasrCore) \ No newline at end of file diff --git a/src/Bliss/CMakeLists.txt b/src/Bliss/CMakeLists.txt index db5f51fdb..4d5a264c5 100644 --- a/src/Bliss/CMakeLists.txt +++ b/src/Bliss/CMakeLists.txt @@ -27,7 +27,10 @@ endif() add_library(RasrBliss ${Bliss_SOURCES}) +target_link_libraries(RasrBliss INTERFACE RasrFsa RasrMath RasrCore) + if(${MODULE_PYTHON}) target_compile_definitions(RasrBliss PRIVATE ${Python3_DEFINITIONS}) target_include_directories(RasrBliss PRIVATE ${Python3_INCLUDE_DIRS}) + target_link_libraries(RasrBliss INTERFACE RasrPython ${Python3_LIBRARIES}) endif() diff --git a/src/Cart/CMakeLists.txt b/src/Cart/CMakeLists.txt index ebf612750..5a85e7a53 100644 --- a/src/Cart/CMakeLists.txt +++ b/src/Cart/CMakeLists.txt @@ -7,6 +7,8 @@ set(Cart_SOURCES Cluster.cc DecisionTreeTrainer.cc Parser.cc - ) +) -add_library(RasrCart STATIC ${Cart_SOURCES}) \ No newline at end of file +add_library(RasrCart STATIC ${Cart_SOURCES}) + +target_link_libraries(RasrCart INTERFACE RasrCore) \ No newline at end of file diff --git a/src/Flf/CMakeLists.txt b/src/Flf/CMakeLists.txt index 1070e8ee0..7164dc479 100644 --- a/src/Flf/CMakeLists.txt +++ b/src/Flf/CMakeLists.txt @@ -64,4 +64,24 @@ set(Flf_SOURCES Union.cc ) -add_library(RasrFlf STATIC ${Flf_SOURCES}) \ No newline at end of file +add_library(RasrFlf STATIC ${Flf_SOURCES}) + +target_link_libraries(RasrFlf INTERFACE RasrFlfCore) + +if(${MODULE_FLF_EXT}) + target_link_libraries(RasrFlf INTERFACE RasrFlfExt) +endif() + +target_link_libraries(RasrFlf INTERFACE + RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrCart + RasrBliss + RasrFlow + RasrFsa + RasrCore +) \ No newline at end of file diff --git a/src/Flf/FlfCore/CMakeLists.txt b/src/Flf/FlfCore/CMakeLists.txt index 6663570b6..4c4987b77 100644 --- a/src/Flf/FlfCore/CMakeLists.txt +++ b/src/Flf/FlfCore/CMakeLists.txt @@ -12,4 +12,6 @@ set(FlfCore_SOURCES Weight.cc ) -add_library(RasrFlfCore STATIC ${FlfCore_SOURCES}) \ No newline at end of file +add_library(RasrFlfCore STATIC ${FlfCore_SOURCES}) + +target_link_libraries(RasrFlfCore INTERFACE RasrFsa RasrCore) \ No newline at end of file diff --git a/src/Flf/FlfExt/CMakeLists.txt b/src/Flf/FlfExt/CMakeLists.txt index 19c0e7f35..457c3cea6 100644 --- a/src/Flf/FlfExt/CMakeLists.txt +++ b/src/Flf/FlfExt/CMakeLists.txt @@ -5,4 +5,5 @@ set(FlfExt_SOURCES WindowedLevenshteinDistanceDecoder.cc ) -add_library(RasrFlfExt STATIC ${FlfExt_SOURCES}) \ No newline at end of file +add_library(RasrFlfExt STATIC ${FlfExt_SOURCES}) +target_link_libraries(RasrFlfExt INTERFACE RasrFlf RasrFsa RasrCore) \ No newline at end of file diff --git a/src/Flow/CMakeLists.txt b/src/Flow/CMakeLists.txt new file mode 100644 index 000000000..a617ffb64 --- /dev/null +++ b/src/Flow/CMakeLists.txt @@ -0,0 +1,30 @@ +set(Flow_SOURCES + AbstractNode.cc + Aggregate.cc + Attributes.cc + Cache.cc + Cutter.cc + CorpusKeyMap.cc + Data.cc + DataAdaptor.cc + Datatype.cc + Demo.cc + Link.cc + Module.cc + Network.cc + NetworkParser.cc + Node.cc + Registry.cc + Repeater.cc + SequenceFilter.cc + WarpTimeFilter.cc + StringExpressionNode.cc + Synchronization.cc + Timestamp.cc + Vector.cc + VectorTextInput.cc +) + +add_library(RasrFlow STATIC ${Flow_SOURCES}) + +target_link_libraries(RasrFlow INTERFACE RasrCore) \ No newline at end of file diff --git a/src/Fsa/CMakeLists.txt b/src/Fsa/CMakeLists.txt new file mode 100644 index 000000000..e0b1cfbf9 --- /dev/null +++ b/src/Fsa/CMakeLists.txt @@ -0,0 +1,49 @@ +set(Fsa_SOURCES + Accessible.cc + Alphabet.cc + AlphabetUtility.cc + AlphabetXml.cc + Archive.cc + Arithmetic.cc + Basic.cc + Best.cc + Cache.cc + Compose.cc + Determinize.cc + Input.cc + Levenshtein.cc + Linear.cc + Minimize.cc + Output.cc + Packed.cc + Permute.cc + Properties.cc + Project.cc + Prune.cc + Random.cc + Resources.cc + Rational.cc + RemoveEpsilons.cc + Semiring.cc + Semiring64.cc + Sort.cc + Sssp.cc + Sssp4SpecialSymbols.cc + Static.cc + Storage.cc + Types.cc + Utility.cc +) + +add_library(RasrFsa STATIC ${Fsa_SOURCES}) + +target_link_libraries(RasrFsa INTERFACE RasrCore) + +if(${MODULE_PYTHON}) + find_package(SWIG REQUIRED) + include(${SWIG_USE_FILE}) + set_source_files_properties(fsa.i PROPERTIES CPLUSPLUS ON) + swig_add_library(_fsa TYPE MODULE LANGUAGE python OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} SOURCES fsa.i ) + target_include_directories(_fsa PRIVATE ${Python3_INCLUDE_DIRS}) + target_link_libraries(_fsa INTERFACE ${Python3_LIBRARIES}) +endif() \ No newline at end of file diff --git a/src/Lattice/CMakeLists.txt b/src/Lattice/CMakeLists.txt new file mode 100644 index 000000000..584989d31 --- /dev/null +++ b/src/Lattice/CMakeLists.txt @@ -0,0 +1,54 @@ +set(Lattice_SOURCES + Archive.cc + Basic.cc + Lattice.cc + LatticeAdaptor.cc + Morphism.cc + Utilities.cc +) + +if(${MODULE_LATTICE_BASIC}) + list(APPEND Lattice_SOURCES Cache.cc Static.cc Compose.cc) +endif() + +if(${MODULE_LATTICE_DT}) + list(APPEND Lattice_SOURCES + Accuracy.cc + Arithmetic.cc + Best.cc + Merge.cc + Posterior.cc + Rational.cc + RemoveEpsilons.cc + SmoothedAccuracy.cc + SmoothingFunction.cc + TimeframeError.cc + ) +endif() + +if(${MODULE_LATTICE_HTK}) + list(APPEND Lattice_SOURCES HtkReader.cc HtkWriter.cc) +endif() + +add_library(RasrLattice STATIC ${Lattice_SOURCES}) + +target_link_libraries(RasrLattice INTERFACE + RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrFsa + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrCart +) + +if(${MODULE_MATH_NR}) + target_link_libraries(RasrLattice INTERFACE RasrMathNr) +endif() \ No newline at end of file diff --git a/src/Lm/CMakeLists.txt b/src/Lm/CMakeLists.txt new file mode 100644 index 000000000..e7fa36bfe --- /dev/null +++ b/src/Lm/CMakeLists.txt @@ -0,0 +1,66 @@ +set(Lm_SOURCES + AbstractNNLanguageModel.cc + BackingOff.cc + ClassLm.cc + CombineLm.cc + Compose.cc + CorpusStatistics.cc + IndexMap.cc + LanguageModel.cc + Module.cc + NNHistoryManager.cc + ReverseArpaLm.cc + ScaledLanguageModel.cc + WordlistInterface.cc +) + +if(${MODULE_LM_ARPA}) + list(APPEND Lm_SOURCES ArpaLm.cc) +endif() + +if(${MODULE_LM_FSA}) + list(APPEND Lm_SOURCES FsaLm.cc CheatingSegmentLm.cc) +endif() + +if(${MODULE_LM_ZEROGRAM}) + list(APPEND Lm_SOURCES Zerogram.cc) +endif() + +if(${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) + list(APPEND Lm_SOURCES Zerogram.cc) +endif() + +add_library(RasrLm STATIC ${Lm_SOURCES}) + +target_link_libraries(RasrLm INTERFACE + RasrFlf + RasrFlfCore + RasrSpeech + RasrAm + RasrMc + RasrBliss + RasrNn + RasrMe + RasrMm + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrLattice + RasrFsa + RasrCore +) +if(${MODULE_CART}) + target_link_libraries(RasrLm INTERFACE RasrCart) +endif() +if(${MODULE_MATH_NR}) + target_link_libraries(RasrLm INTERFACE RasrMathNr) +endif() +if(${MODULE_PYTHON}) + target_link_libraries(RasrLm INTERFACE RasrPython) +endif() +if(${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) + target_link_libraries(RasrLm INTERFACE RasrTensorflow) + add_tf_dependencies(RasrLm) +endif() diff --git a/src/Math/CMakeLists.txt b/src/Math/CMakeLists.txt new file mode 100644 index 000000000..7061162bb --- /dev/null +++ b/src/Math/CMakeLists.txt @@ -0,0 +1,27 @@ +add_subdirectory(Lapack) +if(${MODULE_MATH_NR}) + add_subdirectory(Nr) +endif() + +set(RasrMath_SOURCES + AcousticalAnalyticFunctions.cc + AnalyticFunctionFactory.cc + EigenvalueProblem.cc + FastFourierTransform.cc + Module.cc + PiecewiseLinearFunction.cc + Random.cc + CudaDataStructure.cc +) + +if(${MODULE_CUDA}) + list(APPEND RasrMath_SOURCES CudaMatrixKernels.cu) +endif() + +if(${MODULE_SIGNAL_PLP}) + list(APPEND RasrMath_SOURCES LevinsonLse.cc) +endif() + +add_library(RasrMath STATIC ${RasrMath_SOURCES}) + +target_link_libraries(RasrMath INTERFACE RasrMathNr RasrMathLapack RasrCore) \ No newline at end of file diff --git a/src/Math/Lapack/CMakeLists.txt b/src/Math/Lapack/CMakeLists.txt new file mode 100644 index 000000000..3e7fee0ff --- /dev/null +++ b/src/Math/Lapack/CMakeLists.txt @@ -0,0 +1,9 @@ +set(RasrMathLapack_SOURCES + Lapack.cc + EigenvalueProblem.cc + Svd.cc +) + +add_library(RasrMathLapack STATIC ${RasrMathLapack_SOURCE}) + +target_link_libraries(RasrMathLapack INTERFACE RasrCore) \ No newline at end of file diff --git a/src/Math/Nr/CMakeLists.txt b/src/Math/Nr/CMakeLists.txt new file mode 100644 index 000000000..cc3caa8db --- /dev/null +++ b/src/Math/Nr/CMakeLists.txt @@ -0,0 +1,15 @@ +set(RasrMathNr_SOURCES + BesselFunctions.cc + ConjugateGradient.cc + FastFourierTransform.cc + integration.cc + ludcmp.cc + pythag.cc + PowerSpectrum.cc + Random.cc + svdcmp.cc +) + +add_library(RasrMathNr STATIC ${RasrMathNr_SOURCES}) + +target_link_libraries(RasrMathNr INTERFACE RasrCore) \ No newline at end of file diff --git a/src/Mc/CMakeLists.txt b/src/Mc/CMakeLists.txt new file mode 100644 index 000000000..c0447f917 --- /dev/null +++ b/src/Mc/CMakeLists.txt @@ -0,0 +1 @@ +add_library(RasrMc STATIC Component.cc) \ No newline at end of file diff --git a/src/Mm/CMakeLists.txt b/src/Mm/CMakeLists.txt new file mode 100644 index 000000000..d5f176fd6 --- /dev/null +++ b/src/Mm/CMakeLists.txt @@ -0,0 +1,85 @@ +set(RasrMm_SOURCES + AbstractMixtureSetEstimator.cc + CombinedFeatureScorer.cc + CovarianceFeatureScorerElement.cc + CovarianceWeightedFeatureScorerElement.cc + Feature.cc + GaussDensity.cc + GaussDensityEstimator.cc + GaussDiagonalMaximumFeatureScorer.cc + IntelCodeGenerator.cc + IntelOptimization.cc + Mixture.cc + MixtureEstimator.cc + MixtureFeatureScorerElement.cc + MixtureSet.cc + MixtureSetBuilder.cc + MixtureSetEstimator.cc + MixtureSetLoader.cc + MixtureSetReader.cc + MixtureSetSplitter.cc + MixtureSetTopology.cc + Module.cc + StatePosteriorFeatureScorer.cc + SimdFeatureScorer.cc + SSE2CodeGenerator.cc + Utilities.cc +) + +if(${MODULE_MM_DT}) + list(APPEND RasrMm_SOURCES + ConvertGaussDensityEstimator.cc + ConvertMixtureEstimator.cc + ConvertMixtureSetEstimator.cc + DiscriminativeGaussDensityEstimator.cc + DiscriminativeMixtureEstimator.cc + DiscriminativeMixtureSetEstimator.cc + EbwDiscriminativeGaussDensityEstimator.cc + EbwDiscriminativeMixtureEstimator.cc + EbwDiscriminativeMixtureSetEstimator.cc + ISmoothingGaussDensityEstimator.cc + ISmoothingMixtureEstimator.cc + ISmoothingMixtureSetEstimator.cc + IterationConstants.cc + RpropOptimization.cc + RpropDiscriminativeGaussDensityEstimator.cc + RpropDiscriminativeMixtureEstimator.cc + RpropDiscriminativeMixtureSetEstimator.cc + ) +endif() +if(${MODULE_MM_BATCH}) + list(APPEND RasrMm_SOURCES + BatchFeatureScorer.cc + DensityClustering.cc + ) +endif() +if(${MODULE_ADAPT_ADVANCED}) + list(APPEND RasrMm_SOURCES + BandMllrAdaptation.cc + SemiTiedAdaptation.cc + ) +endif() +if(${MODULE_ADAPT_MLLR}) + list(APPEND RasrMm_SOURCES + MllrAdaptation.cc + ) +endif() +if(${MODULE_ADAPT_CMLLR}) + list(APPEND RasrMm_SOURCES + AffineFeatureTransformAccumulator.cc + ) +endif() + +add_library(RasrMm STATIC ${RasrMm_SOURCES}) + +target_link_libraries(RasrMm INTERFACE + RasrMath + RasrMathLapack + RasrFsa + RasrCore + RasrMc +) + +if(${MODULE_MM_BATCH}) + target_compile_options(RasrMm PRIVATE "-msse2") +endif() diff --git a/src/Nn/CMakeLists.txt b/src/Nn/CMakeLists.txt new file mode 100644 index 000000000..fa9a7f84c --- /dev/null +++ b/src/Nn/CMakeLists.txt @@ -0,0 +1,77 @@ +set(RasrNn_SOURCES + Module.cc +) + +if (${MODULE_NN}) + list(APPEND RasrNn_SOURCES + ActivationLayer.cc + Activations.cc + AllophoneStateFsaExporter.cc + BatchEstimator.cc + BatchFeatureScorer.cc + BufferedAlignedFeatureProcessor.cc + BufferedFeatureExtractor.cc + BufferedSegmentFeatureProcessor.cc + ClassLabelWrapper.cc + Criterion.cc + CtcCriterion.cc + Estimator.cc + FeatureScorer.cc + FeedForwardTrainer.cc + GradientCheck.cc + LinearAndActivationLayer.cc + LinearLayer.cc + LookupLayer.cc + MeanNormalizedSgdEstimator.cc + NetworkTopology.cc + NeuralNetworkForwardNode.cc + NeuralNetworkLayer.cc + NeuralNetworkTrainer.cc + OperationLayer.cc + PoolingLayer.cc + PreprocessingLayer.cc + Prior.cc + Regularizer.cc + RpropEstimator.cc + Statistics.cc + TrainerFeatureScorer.cc + ) +endif () +if (${MODULE_NN_SEQUENCE_TRAINING}) + list(APPEND RasrNn_SOURCES + EmissionLatticeRescorer.cc + LatticeAccumulators.cc + SegmentwiseNnTrainer.cc + MmiSegmentwiseNnTrainer.cc + MeSegmentwiseNnTrainer.cc + SharedNeuralNetwork.cc + ) +endif () +if (${MODULE_PYTHON}) + list(APPEND RasrNn_SOURCES + PythonFeatureScorer.cc + PythonTrainer.cc + PythonControl.cc + PythonLayer.cc + ) +endif () +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + list(APPEND RasrNn_SOURCES LabelScorer.cc) + if (${MODULE_TENSORFLOW}) + list(APPEND RasrNn_SOURCES TFLabelScorer.cc) + endif () +endif () + +add_library(RasrNn STATIC ${RasrNn_SOURCES}) + +target_link_libraries(RasrNn INTERFACE + RasrCore + RasrMath + RasrMathLapack + RasrFlow + RasrSignal +) + +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH} AND ${MODULE_TENSORFLOW}) + add_tf_dependencies(RasrNn) +endif () diff --git a/src/Onnx/CMakeLists.txt b/src/Onnx/CMakeLists.txt new file mode 100644 index 000000000..b9d1e4a57 --- /dev/null +++ b/src/Onnx/CMakeLists.txt @@ -0,0 +1,12 @@ +set(RasrOnnx_SOURCES + Session.cc + IOSpecification.cc + Module.cc + OnnxFeatureScorer.cc + OnnxForwardNode.cc + Value.cc +) + +add_library(RasrOnnx STATIC ${RasrOnnx_SOURCES}) + +target_link_libraries(RasrOnnx INTERFACE RasrCore) \ No newline at end of file diff --git a/src/OpenFst/CMakeLists.txt b/src/OpenFst/CMakeLists.txt new file mode 100644 index 000000000..f9fa196f6 --- /dev/null +++ b/src/OpenFst/CMakeLists.txt @@ -0,0 +1,14 @@ +set(RasrOpenFst_SOURCES + Input.cc + Module.cc + Output.cc + SymbolTable.cc +) + +add_library(RasrOpenFst STATIC ${RasrOpenFst_SOURCES}) + +target_link_libraries(RasrOpenFst INTERFACE + RasrBliss + RasrFsa + RasrCore +) \ No newline at end of file diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt new file mode 100644 index 000000000..af803e930 --- /dev/null +++ b/src/Python/CMakeLists.txt @@ -0,0 +1,9 @@ +set(RasrPython_SOURCES + Init.cc + Numpy.cc + Utilities.cc +) + +add_library(RasrPython STATIC ${RasrPython_SOURCES}) + +target_link_libraries(RasrPython INTERFACE RasrMath RasrCore) \ No newline at end of file diff --git a/src/Search/AdvancedTreeSearch/CMakeLists.txt b/src/Search/AdvancedTreeSearch/CMakeLists.txt new file mode 100644 index 000000000..36dbfc882 --- /dev/null +++ b/src/Search/AdvancedTreeSearch/CMakeLists.txt @@ -0,0 +1,30 @@ +set(RasrAdvancedTreeSearch_SOURCES + AcousticLookAhead.cc + AdvancedTreeSearch.cc + DynamicBeamPruningStrategy.cc + Helpers.cc + LanguageModelLookahead.cc + PathRecombination.cc + PathRecombinationApproximation.cc + PersistentStateTree.cc + PrefixFilter.cc + SearchSpace.cc + SearchSpaceHelpers.cc + SearchSpaceStatistics.cc + SimpleThreadPool.cc + Trace.cc + TreeBuilder.cc + TreeStructure.cc +) + +add_library(RasrAdvancedTreeSearch STATIC ${RasrAdvancedTreeSearch_SOURCES}) +target_link_libraries(RasrAdvancedTreeSearch INTERFACE + RasrSearch + RasrBliss + RasrFsa + RasrCore +) + +target_compile_options(RasrAdvancedTreeSearch PRIVATE + "-Wno-sign-compare -Winline --param max-inline-insns-auto=10000 --param max-inline-insns-single=10000 --param large-function-growth=25000 --param inline-unit-growth=400" +) \ No newline at end of file diff --git a/src/Search/CMakeLists.txt b/src/Search/CMakeLists.txt new file mode 100644 index 000000000..9478052a9 --- /dev/null +++ b/src/Search/CMakeLists.txt @@ -0,0 +1,40 @@ +if (${MOULE_SEARCH_WFST}) + add_subdirectory(Wfst) +endif () +if (${MOULE_ADVANCED_TREE_SEARCH}) + add_subdirectory(AdvancedTreeSearch) +endif () +if (${MOULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + add_subdirectory(GenericSeq2SeqTreeSearch) +endif () + +set(RasrSearch_SOURCES + Aligner.cc + LatticeHandler.cc + LanguageModelLookahead.cc + Module.cc + Search.cc + StateTree.cc + StateTreeIo.cc + WordConditionedTreeSearch.cc +) + +if (${MODULE_SEARCH_MBR}) + list(APPEND RasrSearch_SOURCES + MinimumBayesRiskSearch.cc + MinimumBayesRiskAStarSearch.cc + MinimumBayesRiskNBestListSearch.cc + MinimumBayesRiskSearchUtil.cc + ) +endif () +if (${MOULE_SEARCH_LINEAR}) + list(APPEND RasrSearch_SOURCES LinearSearch.cc) +endif () + +add_library(RasrSearch STATIC ${RasrSearch_SOURCES}) + +target_link_libraries(RasrSearch INTERFACE + RasrBliss + RasrFsa + RasrCore +) \ No newline at end of file diff --git a/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt b/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt new file mode 100644 index 000000000..2b4a845ce --- /dev/null +++ b/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt @@ -0,0 +1,12 @@ +set(RasrGenericSeq2SeqTreeSearch_SOURCES + Seq2SeqAligner.cc + Seq2SeqTreeSearch.cc +) + +add_library(RasrGenericSeq2SeqTreeSearch STATIC ${RasrgenericSeq2SeqTreeSearch_SOURCES}) +target_link_libraries(RasrGenericSeq2SeqTreeSearch INTERFACE + RasrSearch + RasrBliss + RasrFsa + RasrCore +) From 69e9cb30d2d6b9e20302ccc186e4d6a6528d793f Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 10 Nov 2023 19:48:26 +0100 Subject: [PATCH 06/13] Fully compilable state --- CMakeLists.txt | 25 +--- cmake_resources/ConfigurationTypes.cmake | 2 - cmake_resources/Modules.cmake | 16 +-- cmake_resources/Python.cmake | 14 +- cmake_resources/Tensorflow.cmake | 116 ++++++++--------- cmake_resources/UniversalSettings.cmake | 80 ++++++++++++ src/Am/CMakeLists.txt | 1 + src/Bliss/CMakeLists.txt | 4 +- src/CMakeLists.txt | 49 +++++++ src/Core/CMakeLists.txt | 2 + src/Flf/CMakeLists.txt | 1 + src/Flow/CMakeLists.txt | 1 + src/Fsa/CMakeLists.txt | 11 +- src/Lm/CMakeLists.txt | 55 +++++--- src/Math/Lapack/CMakeLists.txt | 2 +- src/Nn/BufferedFeatureExtractor.cc | 2 +- src/Nn/CMakeLists.txt | 5 + src/Python/CMakeLists.txt | 4 +- src/Search/CMakeLists.txt | 8 +- .../GenericSeq2SeqTreeSearch/CMakeLists.txt | 2 +- src/Search/Wfst/CMakeLists.txt | 51 ++++++++ src/Signal/CMakeLists.txt | 111 ++++++++++++++++ src/Signal/RandomVector.cc | 2 +- src/Speech/CMakeLists.txt | 79 +++++++++--- src/Tensorflow/CMakeLists.txt | 16 +++ src/Test/CMakeLists.txt | 120 ++++++++++++++++++ src/Tools/AcousticModelTrainer/CMakeLists.txt | 63 ++++++++- src/Tools/Aligner/CMakeLists.txt | 14 ++ src/Tools/Archiver/CMakeLists.txt | 50 ++++++++ src/Tools/Cart/CMakeLists.txt | 13 +- src/Tools/CorpusStatistics/CMakeLists.txt | 42 ++++++ src/Tools/FeatureExtraction/CMakeLists.txt | 45 +++++++ src/Tools/FeatureStatistics/CMakeLists.txt | 46 +++++++ src/Tools/Flf/CMakeLists.txt | 54 ++++++++ src/Tools/Fsa/CMakeLists.txt | 8 ++ src/Tools/LatticeProcessor/CMakeLists.txt | 43 +++++++ src/Tools/Lm/CMakeLists.txt | 45 +++++++ src/Tools/Math/CMakeLists.txt | 9 ++ src/Tools/NnTrainer/CMakeLists.txt | 42 ++++++ src/Tools/SpeechRecognizer/CMakeLists.txt | 60 +++++++++ src/Tools/Xml/CMakeLists.txt | 5 + 41 files changed, 1153 insertions(+), 165 deletions(-) create mode 100644 cmake_resources/UniversalSettings.cmake create mode 100644 src/CMakeLists.txt create mode 100644 src/Search/Wfst/CMakeLists.txt create mode 100644 src/Signal/CMakeLists.txt create mode 100644 src/Tensorflow/CMakeLists.txt create mode 100644 src/Test/CMakeLists.txt create mode 100644 src/Tools/Aligner/CMakeLists.txt create mode 100644 src/Tools/Archiver/CMakeLists.txt create mode 100644 src/Tools/CorpusStatistics/CMakeLists.txt create mode 100644 src/Tools/FeatureExtraction/CMakeLists.txt create mode 100644 src/Tools/FeatureStatistics/CMakeLists.txt create mode 100644 src/Tools/Flf/CMakeLists.txt create mode 100644 src/Tools/Fsa/CMakeLists.txt create mode 100644 src/Tools/LatticeProcessor/CMakeLists.txt create mode 100644 src/Tools/Lm/CMakeLists.txt create mode 100644 src/Tools/Math/CMakeLists.txt create mode 100644 src/Tools/NnTrainer/CMakeLists.txt create mode 100644 src/Tools/SpeechRecognizer/CMakeLists.txt create mode 100644 src/Tools/Xml/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index fb4ec6962..d141735a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,11 +6,7 @@ project(RASR) include(cmake_resources/ConfigurationTypes.cmake) include(cmake_resources/Modules.cmake) include(cmake_resources/Python.cmake) - -if(${MODULE_CUDA}) - enable_language(CUDA) - set(CMAKE_CUDA_ARCHITECTURES 61;75;86) -endif() +include(cmake_resources/UniversalSettings.cmake) string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME) string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE) @@ -34,21 +30,4 @@ add_custom_command( add_custom_target(SourceVersion DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc) -find_package(LibXml2 REQUIRED) -find_package(Threads REQUIRED) -find_package(ZLIB REQUIRED) - -link_libraries(LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads) - -include_directories(${LIBXML2_INCLUDE_DIR}) -include_directories(${CMAKE_SOURCE_DIR}/src) - - -add_subdirectory(src/Am) -add_subdirectory(src/Audio) -add_subdirectory(src/Bliss) -add_subdirectory(src/Cart) -add_subdirectory(src/Core) -add_subdirectory(src/Flf) -add_subdirectory(src/Fsa) -add_subdirectory(src/Tools) +add_subdirectory(src/) \ No newline at end of file diff --git a/cmake_resources/ConfigurationTypes.cmake b/cmake_resources/ConfigurationTypes.cmake index 9ee722a0c..907db7868 100644 --- a/cmake_resources/ConfigurationTypes.cmake +++ b/cmake_resources/ConfigurationTypes.cmake @@ -5,8 +5,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE standard CACHE STRING "Choose the type of build." FORCE) endif() - -add_compile_definitions(CMAKE_DISABLE_MODULES_HH) set(CMAKE_C_FLAGS_STANDARD "-O2") set(CMAKE_CXX_FLAGS_STANDARD "-O2") set(CMAKE_EXE_LINKER_FLAGS_STANDARD "") diff --git a/cmake_resources/Modules.cmake b/cmake_resources/Modules.cmake index 2a0c563c9..cecb22771 100644 --- a/cmake_resources/Modules.cmake +++ b/cmake_resources/Modules.cmake @@ -2,9 +2,9 @@ function(add_module_option MODULE_NAME DEFAULT_VALUE) option(${MODULE_NAME} "Enable module ${MODULE_NAME})" ${DEFAULT_VALUE}) if(${MODULE_NAME}) add_compile_definitions(${MODULE_NAME}) -# message(STATUS "Module ${MODULE_NAME} is enabled") + message(STATUS "Module ${MODULE_NAME} is enabled") else() -# message(STATUS "Module ${MODULE_NAME} disabled") + message(STATUS "Module ${MODULE_NAME} disabled") endif() endfunction() @@ -14,9 +14,9 @@ function(add_tool_option TOOL_NAME DEFAULT_VALUE) option(${TOOL_NAME} "Enable tool ${TOOL_NAME})" ${DEFAULT_VALUE}) if(${TOOL_NAME}) set(TOOLS ${TOOLS} ${TOOL_NAME} PARENT_SCOPE) -# message(STATUS "Tool ${TOOL_NAME} is enabled") + message(STATUS "Tool ${TOOL_NAME} is enabled") else() -# message(STATUS "Tool ${TOOL_NAME} is disabled") + message(STATUS "Tool ${TOOL_NAME} is disabled") endif() endfunction() @@ -70,11 +70,11 @@ add_module_option(MODULE_THEANO_INTERFACE ON) add_module_option(MODULE_PYTHON ON) # ****** OpenFst ****** -add_module_option(MODULE_OPENFST ON) +add_module_option(MODULE_OPENFST OFF) # ****** Search ****** add_module_option(MODULE_SEARCH_MBR ON) -add_module_option(MODULE_SEARCH_WFST ON) +add_module_option(MODULE_SEARCH_WFST OFF) add_module_option(MODULE_SEARCH_LINEAR ON) add_module_option(MODULE_ADVANCED_TREE_SEARCH ON) add_module_option(MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH ON) @@ -96,7 +96,7 @@ add_module_option(MODULE_SPEECH_LATTICE_ALIGNMENT ON) add_module_option(MODULE_SPEECH_LATTICE_RESCORING ON) # ****** Unit Tests ****** -add_module_option(MODULE_TEST ON) +add_module_option(MODULE_TEST OFF) # ****** Intel Threading Building Blocks ****** add_module_option(MODULE_TBB OFF) @@ -141,8 +141,6 @@ if(${MODULE_NN}) add_tool_option(NnTrainer ON) endif() -set(TOOLS Cart) - set(SEARCH_LIBS RasrSearch) if(${MODULE_SEARCH_WFST}) list(APPEND SEARCH_LIBS RasrSearchWfst RasrOpenFst) diff --git a/cmake_resources/Python.cmake b/cmake_resources/Python.cmake index 71d9e6fe3..313eb717e 100644 --- a/cmake_resources/Python.cmake +++ b/cmake_resources/Python.cmake @@ -1,5 +1,9 @@ -if(${MODULE_PYTHON}) - # Find Python interpreter - find_package(Python3 REQUIRED COMPONENTS Interpreter Development) - include(cmake_resources/Tensorflow.cmake) -endif() \ No newline at end of file +find_package(Python3 REQUIRED COMPONENTS Development NumPy) + +function(add_python_dependencies TARGET) + target_compile_definitions(${TARGET} PUBLIC ${Python3_DEFINITIONS}) + target_include_directories(${TARGET} PUBLIC ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS}) + target_link_libraries(${TARGET} PUBLIC ${Python3_LIBRARIES}) +endfunction() + +include(cmake_resources/Tensorflow.cmake) \ No newline at end of file diff --git a/cmake_resources/Tensorflow.cmake b/cmake_resources/Tensorflow.cmake index d50b025f0..5a0777e51 100644 --- a/cmake_resources/Tensorflow.cmake +++ b/cmake_resources/Tensorflow.cmake @@ -1,58 +1,58 @@ -if(${MODULE_TENSORFLOW}) - # Get the TensorFlow include directory by executing a Python command - execute_process( - COMMAND "${Python3_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_include())" - RESULT_VARIABLE _tensorflow_include_res - OUTPUT_VARIABLE Tensorflow_INCLUDE_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - execute_process( - COMMAND "${Python3_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_lib())" - RESULT_VARIABLE _tensorflow_lib_res - OUTPUT_VARIABLE Tensorflow_LIB_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - # Check if we got the include directory - if(NOT _tensorflow_include_res EQUAL "0") - message(FATAL_ERROR "Failed to get TensorFlow include directory") - endif() - - # Output the found directory for debugging purposes - message(STATUS "Tensorflow include directory: ${Tensorflow_INCLUDE_DIR}") - - find_library( - Tensorflow_CC - NAMES tensorflow_cc - HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow - PATH_SUFFIXES lib REQUIRED) - - find_library( - Tensorflow_FRAMEWORK - NAMES tensorflow_framework - HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow - PATH_SUFFIXES lib REQUIRED) - - if(Tensorflow_CC) - message(STATUS "Tensorflow CC library found at ${Tensorflow_CC}") - else() - message(FATAL_ERROR "Tensorflow CC library not found") - endif() - - if(Tensorflow_FRAMEWORK) - message(STATUS "Tensorflow Framework library found at ${Tensorflow_FRAMEWORK}") - else() - message(FATAL_ERROR "TensorFlow Framework library not found") - endif() - - find_package(OpenSSL REQUIRED) - - function(add_tf_dependencies TARGET) - target_compile_options(${TARGET} PUBLIC "-fexceptions") - target_include_directories(${TARGET} PUBLIC ${Tensorflow_INCLUDE_DIR}) - target_link_options(${TARGET} PUBLIC "LINKER:-Wl,--no-as-needed -Wl,--allow-multiple-definition") - target_link_libraries(${TARGET} PUBLIC OpenSSL::Crypto) - target_link_libraries(${TARGET} ${Tensorflow_CC} ${Tensorflow_FRAMEWORK}) - endfunction() -endif() \ No newline at end of file +find_package(Python3 REQUIRED COMPONENTS Interpreter) + +# Get the TensorFlow include directory by executing a Python command +execute_process( + COMMAND "${Python3_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_include())" + RESULT_VARIABLE _tensorflow_include_res + OUTPUT_VARIABLE Tensorflow_INCLUDE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +execute_process( + COMMAND "${Python3_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_lib())" + RESULT_VARIABLE _tensorflow_lib_res + OUTPUT_VARIABLE Tensorflow_LIB_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE +) + +# Check if we got the include directory +if(NOT _tensorflow_include_res EQUAL "0") + message(FATAL_ERROR "Failed to get TensorFlow include directory") +endif() + +# Output the found directory for debugging purposes +message(STATUS "Tensorflow include directory: ${Tensorflow_INCLUDE_DIR}") + +find_library( + Tensorflow_CC + NAMES tensorflow_cc + HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow + PATH_SUFFIXES lib REQUIRED) + +find_library( + Tensorflow_FRAMEWORK + NAMES tensorflow_framework + HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow + PATH_SUFFIXES lib REQUIRED) + +if(Tensorflow_CC) + message(STATUS "Tensorflow CC library found at ${Tensorflow_CC}") +else() + message(FATAL_ERROR "Tensorflow CC library not found") +endif() + +if(Tensorflow_FRAMEWORK) + message(STATUS "Tensorflow Framework library found at ${Tensorflow_FRAMEWORK}") +else() + message(FATAL_ERROR "TensorFlow Framework library not found") +endif() + +find_package(OpenSSL REQUIRED) + +function(add_tf_dependencies TARGET) + target_compile_options(${TARGET} PUBLIC "-fexceptions") + target_include_directories(${TARGET} PUBLIC ${Tensorflow_INCLUDE_DIR}) + target_link_options(${TARGET} PUBLIC "LINKER:--no-as-needed" "LINKER:--allow-multiple-definition") + target_link_libraries(${TARGET} PUBLIC OpenSSL::Crypto) + target_link_libraries(${TARGET} PUBLIC ${Tensorflow_CC} ${Tensorflow_FRAMEWORK}) +endfunction() \ No newline at end of file diff --git a/cmake_resources/UniversalSettings.cmake b/cmake_resources/UniversalSettings.cmake new file mode 100644 index 000000000..423687805 --- /dev/null +++ b/cmake_resources/UniversalSettings.cmake @@ -0,0 +1,80 @@ +set(CMAKE_CXX_STANDARD 17) + +add_compile_definitions(CMAKE_DISABLE_MODULES_HH) + +add_compile_definitions(_GNU_SOURCE) +add_compile_options( + -pipe + -funsigned-char + -fno-exceptions + -Wno-unknown-pragmas + -Wall + -Wno-long-long + -Wno-deprecated + -fno-strict-aliasing + -ffast-math + -msse3 +) + +if (NOT DEFINED MARCH) + set(MARCH "native" CACHE STRING "Default target architecture") +endif () +include(CheckCXXCompilerFlag) +CHECK_CXX_COMPILER_FLAG("-march=${MARCH}" COMPILER_SUPPORTS_MARCH) +if (COMPILER_SUPPORTS_MARCH) + add_compile_options("-march=${MARCH}") + message(STATUS "Using -march=${MARCH}") +else () + message(STATUS "Architecture -march=${MARCH} is not supported") +endif () + +find_package(LibXml2 REQUIRED) +find_package(Threads REQUIRED) +find_package(ZLIB REQUIRED) +find_package(LAPACK REQUIRED) + +find_library(LIB_RT rt REQUIRED) + +link_libraries(LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads LAPACK::LAPACK ${LIB_RT}) + +include_directories(${LIBXML2_INCLUDE_DIR}) +include_directories(${CMAKE_SOURCE_DIR}/src) + +if (${MODULE_AUDIO_FFMPEG}) + find_package(PkgConfig REQUIRED) + pkg_check_modules(AVFORMAT REQUIRED IMPORTED_TARGET libavformat) + pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample) + pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec) + pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil) + + include_directories(${AVFORMAT_INCLUDE_DIRS} ${SWRESAMPLE_INCLUDE_DIRS} ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS}) + link_libraries(PkgConfig::AVFORMAT PkgConfig::SWRESAMPLE PkgConfig::AVCODEC PkgConfig::AVUTIL) +endif () + +if (${MODULE_OPENMP}) + find_package(OpenMP REQUIRED) + add_compile_options(OpenMP_CXX_FLAGS) + include_directories(OpenMP_CXX_INCLUDE_DIRS) + link_libraries(OpenMP::OpenMP_CXX) +endif () + +if (${MODULE_TENSORFLOW}) + include(cmake_resources/Tensorflow.cmake) +endif () + +if(${MODULE_CUDA}) + enable_language(CUDA) + set(CMAKE_CUDA_ARCHITECTURES 61;75;86) +endif() + +if (${MODULE_AUDIO_FLAC}) + link_libraries(FLAC) +endif () + +if (${MODULE_AUDIO_WAV_SYSTEM}) + link_libraries(sndfile) +endif () + +if (${MODULE_PYTHON}) + include(cmake_resources/Python.cmake) +endif () \ No newline at end of file diff --git a/src/Am/CMakeLists.txt b/src/Am/CMakeLists.txt index d6e756ae7..55e62b39a 100644 --- a/src/Am/CMakeLists.txt +++ b/src/Am/CMakeLists.txt @@ -4,6 +4,7 @@ set(Am_SOURCES ClassicAcousticModel.cc ClassicHmmTopologySet.cc ClassicStateModel.cc + ClassicStateTying.cc ClassicTransducerBuilder.cc Module.cc TransitionModel.cc diff --git a/src/Bliss/CMakeLists.txt b/src/Bliss/CMakeLists.txt index 4d5a264c5..433029ce1 100644 --- a/src/Bliss/CMakeLists.txt +++ b/src/Bliss/CMakeLists.txt @@ -30,7 +30,5 @@ add_library(RasrBliss ${Bliss_SOURCES}) target_link_libraries(RasrBliss INTERFACE RasrFsa RasrMath RasrCore) if(${MODULE_PYTHON}) - target_compile_definitions(RasrBliss PRIVATE ${Python3_DEFINITIONS}) - target_include_directories(RasrBliss PRIVATE ${Python3_INCLUDE_DIRS}) - target_link_libraries(RasrBliss INTERFACE RasrPython ${Python3_LIBRARIES}) + add_python_dependencies(RasrBliss) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..a5020d1bc --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,49 @@ + + +add_subdirectory(Am) +add_subdirectory(Audio) +add_subdirectory(Bliss) +add_subdirectory(Core) +add_subdirectory(Flow) +add_subdirectory(Fsa) +add_subdirectory(Lattice) +add_subdirectory(Lm) +add_subdirectory(Math) +add_subdirectory(Mc) +add_subdirectory(Mm) +add_subdirectory(Search) +add_subdirectory(Signal) +add_subdirectory(Speech) +add_subdirectory(Tools) + +if (${MODULE_CART}) + add_subdirectory(Cart) +endif () + +if (${MODULE_FLF}) + add_subdirectory(Flf) +endif () + +if (${MODULE_OPENFST}) + add_subdirectory(OpenFst) +endif () + +if (${MODULE_NN}) + add_subdirectory(Nn) +endif () + +if (${MODULE_ONNX}) + add_subdirectory(Onnx) +endif () + +if (${MODULE_PYTHON}) + add_subdirectory(Python) +endif () + +if (${MODULE_TENSORFLOW}) + add_subdirectory(Tensorflow) +endif () + +if (${MODULE_TEST}) + add_subdirectory(Test) +endif () diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt index 9b6210cb1..96253bb63 100644 --- a/src/Core/CMakeLists.txt +++ b/src/Core/CMakeLists.txt @@ -57,3 +57,5 @@ list(APPEND Core_SOURCES ${BISON_ArithmeticExpressionParser_OUTPUTS}) add_library(RasrCore STATIC ${Core_SOURCES}) add_dependencies(RasrCore SourceVersion) + +target_compile_options(RasrCore PRIVATE "-fexceptions") diff --git a/src/Flf/CMakeLists.txt b/src/Flf/CMakeLists.txt index 7164dc479..299442dda 100644 --- a/src/Flf/CMakeLists.txt +++ b/src/Flf/CMakeLists.txt @@ -61,6 +61,7 @@ set(Flf_SOURCES TimeframeConfusionNetworkCombination.cc TimeframeConfusionNetworkIo.cc TimeframeError.cc + Traceback.cc Union.cc ) diff --git a/src/Flow/CMakeLists.txt b/src/Flow/CMakeLists.txt index a617ffb64..e6d5c7f0f 100644 --- a/src/Flow/CMakeLists.txt +++ b/src/Flow/CMakeLists.txt @@ -9,6 +9,7 @@ set(Flow_SOURCES DataAdaptor.cc Datatype.cc Demo.cc + Dump.cc Link.cc Module.cc Network.cc diff --git a/src/Fsa/CMakeLists.txt b/src/Fsa/CMakeLists.txt index e0b1cfbf9..8358c171f 100644 --- a/src/Fsa/CMakeLists.txt +++ b/src/Fsa/CMakeLists.txt @@ -37,13 +37,4 @@ set(Fsa_SOURCES add_library(RasrFsa STATIC ${Fsa_SOURCES}) -target_link_libraries(RasrFsa INTERFACE RasrCore) - -if(${MODULE_PYTHON}) - find_package(SWIG REQUIRED) - include(${SWIG_USE_FILE}) - set_source_files_properties(fsa.i PROPERTIES CPLUSPLUS ON) - swig_add_library(_fsa TYPE MODULE LANGUAGE python OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} SOURCES fsa.i ) - target_include_directories(_fsa PRIVATE ${Python3_INCLUDE_DIRS}) - target_link_libraries(_fsa INTERFACE ${Python3_LIBRARIES}) -endif() \ No newline at end of file +target_link_libraries(RasrFsa INTERFACE RasrCore) \ No newline at end of file diff --git a/src/Lm/CMakeLists.txt b/src/Lm/CMakeLists.txt index e7fa36bfe..349739a33 100644 --- a/src/Lm/CMakeLists.txt +++ b/src/Lm/CMakeLists.txt @@ -26,31 +26,46 @@ if(${MODULE_LM_ZEROGRAM}) list(APPEND Lm_SOURCES Zerogram.cc) endif() +if (${MODULE_LM_FFNN}) + list(APPEND Lm_SOURCES FFNeuralNetworkLanguageModel.cc) +endif () + if(${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) - list(APPEND Lm_SOURCES Zerogram.cc) + list(APPEND Lm_SOURCES + BlasNceSoftmaxAdapter.cc + CompressedVector.cc + FixedQuantizationCompressedVectorFactory.cc + LstmStateManager.cc + NceSoftmaxAdapter.cc + PassthroughSoftmaxAdapter.cc + QuantizedBlasNceSoftmaxAdapter.cc + QuantizedCompressedVectorFactory.cc + ReducedPrecisionCompressedVectorFactory.cc + TransformerStateManager.cc + TFRecurrentLanguageModel.cc + ) endif() add_library(RasrLm STATIC ${Lm_SOURCES}) -target_link_libraries(RasrLm INTERFACE - RasrFlf - RasrFlfCore - RasrSpeech - RasrAm - RasrMc - RasrBliss - RasrNn - RasrMe - RasrMm - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrLattice - RasrFsa - RasrCore -) + target_link_libraries(RasrLm INTERFACE + RasrFlf + RasrFlfCore + RasrSpeech + RasrAm + RasrMc + RasrBliss + RasrNn + RasrMm + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrLattice + RasrFsa + RasrCore + ) if(${MODULE_CART}) target_link_libraries(RasrLm INTERFACE RasrCart) endif() diff --git a/src/Math/Lapack/CMakeLists.txt b/src/Math/Lapack/CMakeLists.txt index 3e7fee0ff..9d95ba27f 100644 --- a/src/Math/Lapack/CMakeLists.txt +++ b/src/Math/Lapack/CMakeLists.txt @@ -4,6 +4,6 @@ set(RasrMathLapack_SOURCES Svd.cc ) -add_library(RasrMathLapack STATIC ${RasrMathLapack_SOURCE}) +add_library(RasrMathLapack STATIC ${RasrMathLapack_SOURCES}) target_link_libraries(RasrMathLapack INTERFACE RasrCore) \ No newline at end of file diff --git a/src/Nn/BufferedFeatureExtractor.cc b/src/Nn/BufferedFeatureExtractor.cc index a1b8caa52..714d6423d 100644 --- a/src/Nn/BufferedFeatureExtractor.cc +++ b/src/Nn/BufferedFeatureExtractor.cc @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include "BufferedFeatureExtractor.hh" #include #include diff --git a/src/Nn/CMakeLists.txt b/src/Nn/CMakeLists.txt index fa9a7f84c..d649203c6 100644 --- a/src/Nn/CMakeLists.txt +++ b/src/Nn/CMakeLists.txt @@ -24,6 +24,7 @@ if (${MODULE_NN}) LookupLayer.cc MeanNormalizedSgdEstimator.cc NetworkTopology.cc + NeuralNetwork.cc NeuralNetworkForwardNode.cc NeuralNetworkLayer.cc NeuralNetworkTrainer.cc @@ -72,6 +73,10 @@ target_link_libraries(RasrNn INTERFACE RasrSignal ) +if (${MODULE_PYTHON}) + add_python_dependencies(RasrNn) +endif () + if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH} AND ${MODULE_TENSORFLOW}) add_tf_dependencies(RasrNn) endif () diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index af803e930..1002be25c 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -5,5 +5,5 @@ set(RasrPython_SOURCES ) add_library(RasrPython STATIC ${RasrPython_SOURCES}) - -target_link_libraries(RasrPython INTERFACE RasrMath RasrCore) \ No newline at end of file +add_python_dependencies(RasrPython) +target_compile_options(RasrPython PRIVATE "-fexceptions") \ No newline at end of file diff --git a/src/Search/CMakeLists.txt b/src/Search/CMakeLists.txt index 9478052a9..68192d967 100644 --- a/src/Search/CMakeLists.txt +++ b/src/Search/CMakeLists.txt @@ -1,10 +1,10 @@ -if (${MOULE_SEARCH_WFST}) +if (${MODULE_SEARCH_WFST}) add_subdirectory(Wfst) endif () -if (${MOULE_ADVANCED_TREE_SEARCH}) +if (${MODULE_ADVANCED_TREE_SEARCH}) add_subdirectory(AdvancedTreeSearch) endif () -if (${MOULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) add_subdirectory(GenericSeq2SeqTreeSearch) endif () @@ -27,7 +27,7 @@ if (${MODULE_SEARCH_MBR}) MinimumBayesRiskSearchUtil.cc ) endif () -if (${MOULE_SEARCH_LINEAR}) +if (${MODULE_SEARCH_LINEAR}) list(APPEND RasrSearch_SOURCES LinearSearch.cc) endif () diff --git a/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt b/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt index 2b4a845ce..09a6b1f80 100644 --- a/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt +++ b/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt @@ -3,7 +3,7 @@ set(RasrGenericSeq2SeqTreeSearch_SOURCES Seq2SeqTreeSearch.cc ) -add_library(RasrGenericSeq2SeqTreeSearch STATIC ${RasrgenericSeq2SeqTreeSearch_SOURCES}) +add_library(RasrGenericSeq2SeqTreeSearch STATIC ${RasrGenericSeq2SeqTreeSearch_SOURCES}) target_link_libraries(RasrGenericSeq2SeqTreeSearch INTERFACE RasrSearch RasrBliss diff --git a/src/Search/Wfst/CMakeLists.txt b/src/Search/Wfst/CMakeLists.txt new file mode 100644 index 000000000..b873c07da --- /dev/null +++ b/src/Search/Wfst/CMakeLists.txt @@ -0,0 +1,51 @@ +set(RasrSearchWfst_SOURCES + BookKeeping.cc + Builder.cc + ComposedNetwork.cc + CompressedNetwork.cc + ContextTransducerBuilder.cc + CreateOperations.cc + DynamicLmFst.cc + ExpandingFsaSearch.cc + GrammarFst.cc + IoOperations.cc + Lattice.cc + LatticeAdaptor.cc + LatticeArchive.cc + LatticeGenerator.cc + LatticeHandler.cc + LatticeNetwork.cc + LatticeReader.cc + LexiconBuilder.cc + LexiconFst.cc + Module.cc + NonWordTokens.cc + Network.cc + SearchSpace.cc + StateSequence.cc + StateTree.cc + Traceback.cc + FstOperations.cc + UtilityOperations.cc + WordEnd.cc +) + +add_library(RasrSearchWfst STATIC ${SearchWfst_SOURCES}) + +target_compile_options(RasrSearchWfst PRIVATE "-Wno-sign-compare") + +target_link_libraries(RasrSearchWfst INTERFACE + RasrSearch + RasrSpeech + RasrAm + RasrCart + RastMath + RasrMathLapack + RasrMathNr + RasrBliss + RasrLm + RasrFsa + RasrOpenFst + RasrMc + RasrCore +) diff --git a/src/Signal/CMakeLists.txt b/src/Signal/CMakeLists.txt new file mode 100644 index 000000000..18220ee8f --- /dev/null +++ b/src/Signal/CMakeLists.txt @@ -0,0 +1,111 @@ +set(RasrSignal_SOURCES + CosineTransform.cc + DcDetection.cc + SilenceNormalization.cc + Delay.cc + Delimiter.cc + EigenTransform.cc + FramePrediction.cc + FastFourierTransform.cc + Filterbank.cc + Module.cc + Mrasta.cc + Normalization.cc + Preemphasis.cc + RepeatingFramePrediction.cc + Regression.cc + ScatterEstimator.cc + ScatterTransform.cc + SegmentClustering.cc + SegmentEstimator.cc + TempoRAlPattern.cc + VectorSequenceAggregation.cc + VectorSequenceConcatenation.cc + VectorResize.cc + Window.cc + WindowBuffer.cc + WindowFunction.cc +) + +if (${MODULE_SIGNAL_GAMMATONE}) + list(APPEND RasrSignal_SOURCES + GammaTone.cc + SpectralIntegration.cc + TemporalIntegration.cc + TimeWindowBuffer.cc + ) +endif () + +if (${MODULE_SIGNAL_VTLN}) + list(APPEND RasrSignal_SOURCES + LikelihoodFunction.cc + BayesClassification.cc + AprioriProbability.cc + ) +endif () + +if (${MODULE_SIGNAL_VOICEDNESS}) + list(APPEND RasrSignal_SOURCES + CrossCorrelation.cc + PeakDetection.cc + ) +endif () + +if (${MODULE_SIGNAL_PLP}) + list(APPEND RasrSignal_SOURCES + ArEstimator.cc + VectorTransform.cc + AutoregressionToCepstrum.cc + AutoregressionToSpectrum.cc + ) +endif () + +if (${MODULE_SIGNAL_ADVANCED}) + list(APPEND RasrSignal_SOURCES + ArxEstimator.cc + Convolution.cc + FastHartleyTransform.cc + Formant.cc + FrameInterpolation.cc + GenericWarping.cc + HarmonicSum.cc + Histogram.cc + HistogramNormalization.cc + LinearFilter.cc + LinearWarping.cc + Lpc.cc + MeanEstimator.cc + NthOrderFeatures.cc + PolinomialVectorInterpolation.cc + QuantileEqualization.cc + SampleNormalization.cc + SegmentwiseFormantExtraction.cc + SilenceDetection.cc + Warping.cc + ) +endif () + +if (${MODULE_SIGNAL_ADVANCED_NR}) + list(APPEND RasrSignal_SOURCES + AllPolesPowerSpectrum.cc + KaiserWindowFunction.cc + RandomVector.cc + WindowingFirFilter.cc + ) +endif () + +add_library(RasrSignal STATIC ${RasrSignal_SOURCES}) + +target_link_libraries(RasrSignal INTERFACE + RasrFlow + RasrBliss + RasrMm + RasrMath + RasrMathLapack + RasrMc + RasrCore +) + +if (${MODULE_SIGNAL_ADVANCED_NR}) + target_link_libraries(RasrSignal INTERFACE RasrMathNr) +endif () diff --git a/src/Signal/RandomVector.cc b/src/Signal/RandomVector.cc index 944b93909..db81f7665 100644 --- a/src/Signal/RandomVector.cc +++ b/src/Signal/RandomVector.cc @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include "RandomVector.hh" using namespace Signal; diff --git a/src/Speech/CMakeLists.txt b/src/Speech/CMakeLists.txt index bafab219b..ed681a423 100644 --- a/src/Speech/CMakeLists.txt +++ b/src/Speech/CMakeLists.txt @@ -1,4 +1,4 @@ -set(SPEECH_SOURCES +set(Speech_SOURCES AcousticModelTrainer.cc AlignerModelAcceptor.cc AligningFeatureExtractor.cc @@ -28,7 +28,7 @@ set(SPEECH_SOURCES ) if(${MODULE_SPEECH_LATTICE_ALIGNMENT}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES PhonemeSequenceAlignmentGenerator.cc SegmentwiseAlignmentGenerator.cc SegmentwiseFeatureExtractor.cc @@ -36,7 +36,7 @@ if(${MODULE_SPEECH_LATTICE_ALIGNMENT}) endif () if (${MODULE_SPEECH_DT}) - list(APPEND Speech_Sources + list(APPEND Speech_SOURCES AbstractSegmentwiseTrainer.cc AccuracyFsaBuilder.cc AcousticSegmentwiseTrainer.cc @@ -53,7 +53,7 @@ if (${MODULE_SPEECH_DT}) endif () if (${MODULE_SPEECH_DT_ADVANCED}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES AdvancedAccuracyFsaBuilder.cc AdvancedLatticeExtractor.cc AuxiliarySegmentwiseTrainer.cc @@ -65,11 +65,11 @@ if (${MODULE_SPEECH_DT_ADVANCED}) endif () if (${MODULE_FLF_EXT}) - list(APPEND SPEECH_SOURCES AlignedFeatureCache.cc) + list(APPEND Speech_SOURCES AlignedFeatureCache.cc) endif () if (${MODULE_SPEECH_LATTICE_FLOW_NODES}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES AlignmentFromLattice.cc LatticeNodes.cc LatticeArcAccumulator.cc @@ -77,7 +77,7 @@ if (${MODULE_SPEECH_LATTICE_FLOW_NODES}) endif () if (${MODULE_SPEECH_ALIGNMENT_FLOW_NODES}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES AlignmentGeneratorNode.cc AlignmentTransformNode.cc SegmentNode.cc @@ -85,28 +85,27 @@ if (${MODULE_SPEECH_ALIGNMENT_FLOW_NODES}) endif () if (${MODULE_ADAPT_MLLR}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES ModelTransformEstimator.cc FeatureShiftAdaptor.cc ) endif () if (${MODULE_ADAPT_CMLLR}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES AffineFeatureTransformEstimator.cc KeyedEstimator.cc ) endif () if (${MODULE_CART}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES DecisionTreeTrainer.cc - KeyedEstimator.cc ) endif () if (${MODULE_SPEECH_LATTICE_RESCORING}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES LatticeRescorerAutomaton.cc LatticeRescorerNodes.cc StatePosteriorFeatureScorerNode.cc @@ -114,19 +113,65 @@ if (${MODULE_SPEECH_LATTICE_RESCORING}) endif () if (${MODULE_SIGNAL_ADVANCED}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES HistogramEstimator.cc MeanEstimator.cc ) endif () if (${MODULE_SEARCH_MBR}) - list(APPEND SPEECH_SOURCES + list(APPEND Speech_SOURCES MinimumBayesRiskSearch.cc ) endif () -add_library(RasrCart STATIC ${Cart_SOURCES}) -target_link_libraries(RasrCart PRIVATE RasrCore) +add_library(RasrSpeech STATIC ${Speech_SOURCES}) + +target_link_libraries(RasrSpeech INTERFACE + RasrLm + RasrAm + RasrMm + RasrMc + RasrSearch + RasrBliss + RasrFlow + RasrFsa + RasrCore + RasrLattice + RasrMath + RasrMathLapack +) + +if (${MODULE_CART}) + target_link_libraries(RasrSpeech INTERFACE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(RasrSpeech INTERFACE RasrMathNr) +endif () + +if (${MODULE_NN_SEQUENCE_TRAINING}) + target_link_libraries(RasrSpeech INTERFACE RasrNn) +endif () + +if (${MODULE_SEARCH_WFST}) + target_link_libraries(RasrSpeech INTERFACE RasrSearchWfst RasrOpenFst) +endif () + +if (${MODULE_ADVANCED_TREE_SEARCH}) + target_link_libraries(RasrSpeech INTERFACE RasrAdvancedTreeSearch) +endif () + +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(RasrSpeech INTERFACE RasrGenericSeq2SeqTreeSearch) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(RasrSpeech INTERFACE RasrPython) + add_python_dependencies(RasrSpeech) +endif () -target_include_directories(RasrCart PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file +if (${MODULE_TENSORFLOW}) + add_tf_dependencies(RasrSpeech) + target_link_libraries(RasrSpeech INTERFACE RasrTensorflow) +endif () \ No newline at end of file diff --git a/src/Tensorflow/CMakeLists.txt b/src/Tensorflow/CMakeLists.txt new file mode 100644 index 000000000..a909143b4 --- /dev/null +++ b/src/Tensorflow/CMakeLists.txt @@ -0,0 +1,16 @@ +set(RasrTensorflow_SOURCES + Graph.cc + GraphLoader.cc + MetaGraphLoader.cc + Module.cc + Session.cc + Tensor.cc + TensorflowForwardNode.cc + TensorMap.cc + VanillaGraphLoader.cc +) + +add_library(RasrTensorflow STATIC ${RasrTensorflow_SOURCES}) + +target_link_libraries(RasrTensorflow INTERFACE RasrCore) +add_tf_dependencies(RasrTensorflow) \ No newline at end of file diff --git a/src/Test/CMakeLists.txt b/src/Test/CMakeLists.txt new file mode 100644 index 000000000..711fb1a40 --- /dev/null +++ b/src/Test/CMakeLists.txt @@ -0,0 +1,120 @@ +set(RasrTest_SOURCES + Registry.cc + Lexicon.cc + File.cc +) + +add_library(RasrTest ${RasrTest_SOURCES}) + +set(test_SOURCES + UnitTester.cc + Bliss_SegmentOrdering.cc + Core_StringUtilities.cc + Core_Thread.cc + Core_ThreadPool.cc + Fsa_Sssp4SpecialSymbols.cc + Math_Utilities.cc + Math_Blas.cc + Math_FastVectorOperations.cc + Math_CudaVector.cc + Math_CudaMatrix.cc + Math_FastMatrix.cc + Test_File.cc + Test_Lexicon.cc +) + +if (${MODULE_NN}) + list(APPEND test_SOURCES + Nn_NetworkTopology.cc + Nn_BufferedFeatureExtractor.cc + Nn_BufferedAlignedFeatureProcessor.cc + Nn_ClassLabelWrapper.cc + Nn_FeedForwardCrossEntropyTrainer.cc + Nn_LinearAndActivationLayer.cc + Nn_LinearLayer.cc + Nn_NeuralNetwork.cc + Nn_NeuralNetworkLayer.cc + Nn_NeuralNetworkTrainer.cc + Nn_PreprocessingLayer.cc + Nn_Statistics.cc + ) +endif () + +if (${MODULE_OPENMP}) + list(APPEND test_SOURCES Math_MultithreadingHelper.cc) +endif () + +if (${MODULE_TBB}) + list(APPEND test_SOURCES Core_Tbb.cc) +endif () + +add_executable(unit-test ${test_SOURCES}) +add_install_executable(unit-test) + +target_link_libraries(unit-test PRIVATE + RasrTest + RasrBliss + RasrFsa + RasrCore + RasrSpeech + RasrSearch + RasrLattice + RasrAm + RasrLm + RasrMc + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack +) + +if (${MODULE_FLF}) + target_link_libraries(unit-test PRIVATE RasrFlf) +endif () + +if (${MODULE_FLF_CORE}) + target_link_libraries(unit-test PRIVATE RasrFlfCore) +endif () + +if (${MODULE_FLF_EXT}) + target_link_libraries(unit-test PRIVATE RasrFlfExt) +endif () + +if (${MODULE_ADVANCED_TREE_SEARCH}) + target_link_libraries(unit-test PRIVATE RasrAdvancedTreeSearch) +endif () + +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(unit-test PRIVATE RasrGenericSeq2SeqTreeSearch) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(unit-test PRIVATE RasrPython) + add_python_dependencies(unit-test) +endif () + +if (${MODULE_NN}) + target_link_libraries(unit-test PRIVATE RasrNn) +endif () + +if (${MODULE_CART}) + target_link_libraries(unit-test PRIVATE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(unit-test PRIVATE RasrMathNr) +endif () + +if (${MODULE_SEARCH_WFST}) + target_link_libraries(unit-test PRIVATE RasrSearchWfst) +endif () + +if (${MODULE_OPENFST}) + target_link_libraries(unit-test PRIVATE RasrOpenFst) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(unit-test PRIVATE RasrTensorflow) + add_tf_dependencies(unit-test) +endif () diff --git a/src/Tools/AcousticModelTrainer/CMakeLists.txt b/src/Tools/AcousticModelTrainer/CMakeLists.txt index 7b55e6784..6896c1f68 100644 --- a/src/Tools/AcousticModelTrainer/CMakeLists.txt +++ b/src/Tools/AcousticModelTrainer/CMakeLists.txt @@ -1,4 +1,63 @@ add_executable(acoustic-model-trainer AcousticModelTrainer.cc) +add_install_executable(acoustic-model-trainer) +target_link_libraries(acoustic-model-trainer PRIVATE + RasrSpeech + RasrFlow + RasrAm + RasrMm + RasrLm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrMath + RasrMathLapack + RasrCore + RasrFsa + ${SEARCH_LIBS} +) -#target_link_libraries(cart-trainer PRIVATE RasrCart RasrCore LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads) -target_link_libraries(acoustic-model-trainer PRIVATE RasrCart RasrCore) \ No newline at end of file +add_executable(allophone-tool AllophoneTool.cc) +add_install_executable(allophone-tool) +target_link_libraries(allophone-tool PRIVATE + RasrAm + RasrMm + RasrBliss + RasrFsa + RasrMc + RasrCore + RasrMathLapack +) + +if (${MODULE_CART}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrCart) + target_link_libraries(allophone-tool PRIVATE RasrCart) +endif () + +if (${MODULE_FLF_CORE}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrFlfCore) + target_link_libraries(allophone-tool PRIVATE RasrFlfCore) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrMathNr) + target_link_libraries(allophone-tool PRIVATE RasrMathNr) +endif () + +if (${MODULE_ONNX}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrOnnx) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrPython) + add_python_dependencies(acoustic-model-trainer) +endif () + +if (${MODULE_NN}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrNn) +endif () + +if (${MODULE_TENSORFLOW}) + add_tf_dependencies(acoustic-model-trainer) + target_link_libraries(acoustic-model-trainer PRIVATE RasrTensorflow) +endif () diff --git a/src/Tools/Aligner/CMakeLists.txt b/src/Tools/Aligner/CMakeLists.txt new file mode 100644 index 000000000..0fd358bf8 --- /dev/null +++ b/src/Tools/Aligner/CMakeLists.txt @@ -0,0 +1,14 @@ +set(aligner_SOURCES + Aligner.cc + AlignAutomaton.cc + SimpleAlignAutomaton.cc + ZeroOrderAlignAutomaton.cc + Common.cc + ConditionalLexicon.cc + ConditionalLexiconPlain.cc + ConditionalLexiconSri.cc +) +add_executable(aligner ${ALIGNER_SOURCES}) +add_install_executable(aligner) + +target_link_libraries(aligner PRIVATE RasrFsa RasrCore) \ No newline at end of file diff --git a/src/Tools/Archiver/CMakeLists.txt b/src/Tools/Archiver/CMakeLists.txt new file mode 100644 index 000000000..808cc67ff --- /dev/null +++ b/src/Tools/Archiver/CMakeLists.txt @@ -0,0 +1,50 @@ +add_executable(archiver Archiver.cc) +add_install_executable(archiver) + +target_link_libraries(archiver PRIVATE + RasrSpeech + RasrSearch + RasrAdvancedTreeSearch + RasrLattice + RasrLm + RasrFlf + RasrFlfCore + RasrMc + RasrAm + RasrMm + RasrCart + RasrSignal + RasrBliss + RasrMath + RasrMathLapack + RasrMathNr + RasrCore + RasrFlow + RasrFsa +) + +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(archiver PRIVATE RasrGenericSeq2SeqTreeSearch) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(archiver PRIVATE RasrPython) + add_python_dependencies(archiver) +endif () + +if (${MODULE_NN}) + target_link_libraries(archiver PRIVATE RasrNn) +endif () + +if (${MODULE_SEARCH_WFST}) + target_link_libraries(archiver PRIVATE RasrSearchWfst) +endif () + +if (${MODULE_OPENFST}) + target_link_libraries(archiver PRIVATE RasrOpenFst) +endif () + +if (${MODULE_LM_TFRNN}) + target_link_libraries(archiver PRIVATE RasrTensorflow) + add_tf_dependencies(archiver) +endif () diff --git a/src/Tools/Cart/CMakeLists.txt b/src/Tools/Cart/CMakeLists.txt index 559199e39..68ab7fe70 100644 --- a/src/Tools/Cart/CMakeLists.txt +++ b/src/Tools/Cart/CMakeLists.txt @@ -1,6 +1,7 @@ -set(EXE_NAMES "cart-trainer" "cart-viewer") -foreach(EXE_NAME ${EXE_NAMES}) - add_executable(${EXE_NAME} CartTrainer.cc) - target_link_libraries(${EXE_NAME} PRIVATE RasrCart RasrCore) - add_install_executable(${EXE_NAME}) -endforeach () \ No newline at end of file +add_executable(cart-trainer CartTrainer.cc) +target_link_libraries(cart-trainer PRIVATE RasrCart RasrCore) +add_install_executable(cart-trainer) + +add_executable(cart-viewer CartViewer.cc) +target_link_libraries(cart-viewer PRIVATE RasrCart RasrCore) +add_install_executable(cart-viewer) diff --git a/src/Tools/CorpusStatistics/CMakeLists.txt b/src/Tools/CorpusStatistics/CMakeLists.txt new file mode 100644 index 000000000..67097cc25 --- /dev/null +++ b/src/Tools/CorpusStatistics/CMakeLists.txt @@ -0,0 +1,42 @@ +add_executable(costa Costa.cc) + +target_link_libraries(costa PRIVATE + RasrLm + RasrMc + RasrBliss + RasrFsa + RasrFlfCore + RasrAudio + RasrSignal + RasrSpeech + RasrAm + RasrMm + RasrFlow + RasrCore + RasrMath + RasrMathLapack + RasrLattice + ${SEARCH_LIBS} +) + +if (${MODULE_CART}) + target_link_libraries(costa PRIVATE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(costa PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(costa PRIVATE RasrPython) + add_python_dependencies(costa) +endif () + +if (${MODULE_NN}) + target_link_libraries(costa PRIVATE RasrNn) +endif () + +if (${MODULE_TENSORFLOW}) + add_tf_dependencies(costa) + target_link_libraries(costa PRIVATE RasrTensorflow) +endif () diff --git a/src/Tools/FeatureExtraction/CMakeLists.txt b/src/Tools/FeatureExtraction/CMakeLists.txt new file mode 100644 index 000000000..831ae9da3 --- /dev/null +++ b/src/Tools/FeatureExtraction/CMakeLists.txt @@ -0,0 +1,45 @@ +add_executable(feature-extraction FeatureExtraction.cc FeatureExtractor.cc) + +target_link_libraries(feature-extraction PRIVATE + RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrFsa + ${SEARCH_LIBS} +) + +if (${MODULE_CART}) + target_link_libraries(feature-extraction PRIVATE RasrCart) +endif () + +if (${MODULE_FLF_CORE}) + target_link_libraries(feature-extraction PRIVATE RasrFlfCore) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(feature-extraction PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(feature-extraction PRIVATE RasrPython) + add_python_dependencies(feature-extraction) +endif () + +if (${MODULE_NN}) + target_link_libraries(feature-extraction PRIVATE RasrNn) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(feature-extraction PRIVATE RasrTensorflow) + add_tf_dependencies(feature-extraction) +endif () diff --git a/src/Tools/FeatureStatistics/CMakeLists.txt b/src/Tools/FeatureStatistics/CMakeLists.txt new file mode 100644 index 000000000..649154922 --- /dev/null +++ b/src/Tools/FeatureStatistics/CMakeLists.txt @@ -0,0 +1,46 @@ +add_executable(feature-statistics FeatureStatistics.cc) +add_install_executable(feature-statistics) + +target_link_libraries(feature-statistics PRIVATE + RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrCore + RasrFsa +) + +if (${MODULE_CART}) + target_link_libraries(feature-statistics PRIVATE RasrCart) +endif () + +if (${MODULE_FLF_CORE}) + target_link_libraries(feature-statistics PRIVATE RasrFlfCore) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(feature-statistics PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(feature-statistics PRIVATE RasrPython) + add_python_dependencies(feature-statistics) +endif () + +if (${MODULE_NN}) + target_link_libraries(feature-statistics PRIVATE RasrNn) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(feature-statistics PRIVATE RasrTensorflow) + add_tf_dependencies(feature-statistics) +endif () + diff --git a/src/Tools/Flf/CMakeLists.txt b/src/Tools/Flf/CMakeLists.txt new file mode 100644 index 000000000..372ab9505 --- /dev/null +++ b/src/Tools/Flf/CMakeLists.txt @@ -0,0 +1,54 @@ +add_executable(flf-tool FlfTool.cc) + +target_link_libraries(flf-tool PRIVATE + RasrFlf + RasrFlfCore + RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrCore + RasrFsa + ${SEARCH_LIBS} + RasrLattice +) + +if (${MODULE_FLF_EXT}) + target_link_libraries(flf-tool PRIVATE RasrFlfExt) +endif () + +target_link_libraries(flf-tool PRIVATE + RasrSignal + RasrFlow + RasrMath + RasrMathLapack +) + +if (${MODULE_CART}) + target_link_libraries(flf-tool PRIVATE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(flf-tool PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(flf-tool PRIVATE RasrPython) + add_python_dependencies(flf-tool) +endif () + +if (${MODULE_NN}) + target_link_libraries(flf-tool PRIVATE RasrNn) +endif () + +if (${MODULE_ONNX}) + target_link_libraries(flf-tool PRIVATE RasrOnnx) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(flf-tool PRIVATE RasrTensorflow) + add_tf_dependencies(flf-tool) +endif () diff --git a/src/Tools/Fsa/CMakeLists.txt b/src/Tools/Fsa/CMakeLists.txt new file mode 100644 index 000000000..1bae04362 --- /dev/null +++ b/src/Tools/Fsa/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable(fsa Fsa.cc) +add_install_executable(fsa) + +target_link_libraries(fsa PRIVATE RasrFsa RasrCore) + +if (${MODULE_OPENFST}) + target_link_libraries(fsa PRIVATE RasrOpenFst) +endif () \ No newline at end of file diff --git a/src/Tools/LatticeProcessor/CMakeLists.txt b/src/Tools/LatticeProcessor/CMakeLists.txt new file mode 100644 index 000000000..80897e674 --- /dev/null +++ b/src/Tools/LatticeProcessor/CMakeLists.txt @@ -0,0 +1,43 @@ +add_executable(lattice-processor LatticeProcessor.cc) +add_install_executable(lattice-processor) + +target_link_libraries(lattice-processor PRIVATE + RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrFsa + RasrFlfCore + ${SEARCH_LIBS} +) + +if (${MODULE_CART}) + target_link_libraries(lattice-processor PRIVATE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(lattice-processor PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(lattice-processor PRIVATE RasrPython) + add_python_dependencies(lattice-processor) +endif () + +if (${MODULE_NN}) + target_link_libraries(lattice-processor PRIVATE RasrNn) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(lattice-processor PRIVATE RasrTensorflow) + add_tf_dependencies(lattice-processor) +endif () diff --git a/src/Tools/Lm/CMakeLists.txt b/src/Tools/Lm/CMakeLists.txt new file mode 100644 index 000000000..ec1d660c1 --- /dev/null +++ b/src/Tools/Lm/CMakeLists.txt @@ -0,0 +1,45 @@ +add_executable(lm-util LmUtilityTool.cc) +add_install_executable(lm-util) + +target_link_libraries(lm-util PRIVATE + RasrFlf + RasrFlfCore + RasrSpeech + RasrAm + RasrMc + RasrBliss + RasrNn + RasrMm + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrLattice + RasrFsa + RasrLm + RasrCore +) + +if (${MODULE_FLF_EXT}) + target_link_libraries(lm-util PRIVATE RasrFlfExt) +endif () + +if (${MODULE_CART}) + target_link_libraries(lm-util PRIVATE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(lm-util PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(lm-util PRIVATE RasrPython) + add_python_dependencies(lm-util) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(lm-util PRIVATE RasrTensorflow) + add_tf_dependencies(lm-util) +endif () + diff --git a/src/Tools/Math/CMakeLists.txt b/src/Tools/Math/CMakeLists.txt new file mode 100644 index 000000000..ab50eceee --- /dev/null +++ b/src/Tools/Math/CMakeLists.txt @@ -0,0 +1,9 @@ +add_executable(matrix-tool MatrixTool.cc) +add_install_executable(matrix-tool) + +target_link_libraries(matrix-tool PRIVATE + RasrMath + RasrMathNr + RasrMathLapack + RasrCore +) \ No newline at end of file diff --git a/src/Tools/NnTrainer/CMakeLists.txt b/src/Tools/NnTrainer/CMakeLists.txt new file mode 100644 index 000000000..d82577681 --- /dev/null +++ b/src/Tools/NnTrainer/CMakeLists.txt @@ -0,0 +1,42 @@ +add_executable(nn-trainer NnTrainer.cc) +add_install_executable(nn-trainer) + +target_link_libraries(nn-trainer PRIVATE + RasrAm + RasrAudio + RasrBliss + RasrFlow + RasrLm + RasrMathLapack + RasrMath + RasrMc + RasrMm + RasrSignal + RasrSpeech + ${SEARCH_LIBS} + RasrNn + RasrFsa + RasrCore +) + +if (${MODULE_CART}) + target_link_libraries(nn-trainer PRIVATE RasrCart) +endif () + +if (${MODULE_FLF_CORE}) + target_link_libraries(nn-trainer PRIVATE RasrFlfCore) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(nn-trainer PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(nn-trainer PRIVATE RasrPython) + add_python_dependencies(nn-trainer) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(nn-trainer PRIVATE RasrTensorflow) + add_tf_dependencies(nn-trainer) +endif () \ No newline at end of file diff --git a/src/Tools/SpeechRecognizer/CMakeLists.txt b/src/Tools/SpeechRecognizer/CMakeLists.txt new file mode 100644 index 000000000..ece73ed8c --- /dev/null +++ b/src/Tools/SpeechRecognizer/CMakeLists.txt @@ -0,0 +1,60 @@ +add_executable(speech-recognizer SpeechRecognizer.cc) +add_install_executable(speech-recognizer) + +set(SpeechRecognizer_LIBRARIES + RasrSpeech + RasrLattice + RasrAm + RasrLm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrCore + RasrFsa +) + +if (${MODULE_CART}) + list(APPEND SpeechRecognizer_LIBRARIES RasrCart) +endif () + +if (${MODULE_FLF_CORE}) + list(APPEND SpeechRecognizer_LIBRARIES RasrFlfCore) +endif () + +if (${MODULE_MATH_NR}) + list(APPEND SpeechRecognizer_LIBRARIES RasrMathNr) +endif () + +if (${MODULE_SEARCH_WFST}) + list(APPEND SpeechRecognizer_LIBRARIES RasrSearchWfst) +endif () + +if (${MODULE_PYTHON}) + list(APPEND SpeechRecognizer_LIBRARIES RasrPython) +endif () + +if (${MODULE_ONNX}) + list(APPEND SpeechRecognizer_LIBRARIES RasrOnnx) +endif () + +if (${MODULE_NN}) + list(APPEND SpeechRecognizer_LIBRARIES RasrNn) +endif () + +if (${MODULE_NN}) + list(APPEND SpeechRecognizer_LIBRARIES RasrTensorflow) +endif () + +target_link_libraries(speech-recognizer PRIVATE ${SpeechRecognizer_LIBRARIES}) + +if (${MODULE_SEARCH_WFST}) + add_executable(fsa-search-builder FsaSearchBuilder.cc) + add_install_executable(fsa-search-builder) + target_link_libraries(fsa-search-builder PRIVATE ${SpeechRecognizer_LIBRARIES}) +endif () \ No newline at end of file diff --git a/src/Tools/Xml/CMakeLists.txt b/src/Tools/Xml/CMakeLists.txt new file mode 100644 index 000000000..5b3c63a52 --- /dev/null +++ b/src/Tools/Xml/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable(xml2line xml2line.c) +add_install_executable(xml2line) + +add_executable(line2xml line2xml.c) +add_install_executable(line2xml) From 9a954d3650c491644b6207fc6407f12f54602be9 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 10 Nov 2023 20:37:39 +0100 Subject: [PATCH 07/13] Fix two missing executable installs --- src/Tools/CorpusStatistics/CMakeLists.txt | 1 + src/Tools/FeatureExtraction/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Tools/CorpusStatistics/CMakeLists.txt b/src/Tools/CorpusStatistics/CMakeLists.txt index 67097cc25..c36703a35 100644 --- a/src/Tools/CorpusStatistics/CMakeLists.txt +++ b/src/Tools/CorpusStatistics/CMakeLists.txt @@ -1,4 +1,5 @@ add_executable(costa Costa.cc) +add_install_executable(costa) target_link_libraries(costa PRIVATE RasrLm diff --git a/src/Tools/FeatureExtraction/CMakeLists.txt b/src/Tools/FeatureExtraction/CMakeLists.txt index 831ae9da3..c5e4f523c 100644 --- a/src/Tools/FeatureExtraction/CMakeLists.txt +++ b/src/Tools/FeatureExtraction/CMakeLists.txt @@ -1,4 +1,5 @@ add_executable(feature-extraction FeatureExtraction.cc FeatureExtractor.cc) +add_install_executable(feature-extraction) target_link_libraries(feature-extraction PRIVATE RasrSpeech From fc5f2f3644c18625fee2bf1ed07b7009040a7ef5 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 15 Mar 2024 10:44:05 +0100 Subject: [PATCH 08/13] CMakeLists formatting --- CMakeLists.txt | 26 +- cmake_resources/ConfigurationTypes.cmake | 11 +- cmake_resources/Modules.cmake | 48 +-- cmake_resources/Onnx.cmake | 9 + cmake_resources/Python.cmake | 9 +- cmake_resources/Tensorflow.cmake | 61 ++-- cmake_resources/UniversalSettings.cmake | 102 +++--- src/Am/CMakeLists.txt | 47 ++- src/Audio/CMakeLists.txt | 19 +- src/Bliss/CMakeLists.txt | 40 +-- src/CMakeLists.txt | 50 ++- src/Cart/CMakeLists.txt | 19 +- src/Core/CMakeLists.txt | 100 +++--- src/Flf/CMakeLists.txt | 147 ++++---- src/Flow/CMakeLists.txt | 53 ++- src/Fsa/CMakeLists.txt | 71 ++-- src/Lattice/CMakeLists.txt | 75 ++-- src/Lm/CMakeLists.txt | 114 ++++--- src/Math/CMakeLists.txt | 27 +- src/Mc/CMakeLists.txt | 2 +- src/Mm/CMakeLists.txt | 119 +++---- src/Nn/CMakeLists.txt | 145 ++++---- src/Onnx/CMakeLists.txt | 13 +- src/OpenFst/CMakeLists.txt | 13 +- src/Python/CMakeLists.txt | 8 +- src/Search/CMakeLists.txt | 60 ++-- .../GenericSeq2SeqTreeSearch/CMakeLists.txt | 5 +- src/Search/Wfst/CMakeLists.txt | 2 +- src/Signal/CMakeLists.txt | 182 +++++----- src/Speech/CMakeLists.txt | 319 ++++++++---------- src/Tensorflow/CMakeLists.txt | 21 +- src/Test/CMakeLists.txt | 220 ++++++------ src/Tools/AcousticModelTrainer/CMakeLists.txt | 117 +++---- src/Tools/Aligner/CMakeLists.txt | 19 +- src/Tools/Archiver/CMakeLists.txt | 82 ++--- src/Tools/CMakeLists.txt | 4 +- src/Tools/CorpusStatistics/CMakeLists.txt | 70 ++-- src/Tools/FeatureExtraction/CMakeLists.txt | 74 ++-- src/Tools/FeatureStatistics/CMakeLists.txt | 85 +++-- src/Tools/Flf/CMakeLists.txt | 104 +++--- src/Tools/Fsa/CMakeLists.txt | 6 +- src/Tools/LatticeProcessor/CMakeLists.txt | 70 ++-- src/Tools/Lm/CMakeLists.txt | 73 ++-- src/Tools/Math/CMakeLists.txt | 8 +- src/Tools/NnTrainer/CMakeLists.txt | 70 ++-- src/Tools/SpeechRecognizer/CMakeLists.txt | 110 +++--- 46 files changed, 1472 insertions(+), 1557 deletions(-) create mode 100644 cmake_resources/Onnx.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index d141735a6..e006d1f75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,24 +1,32 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.22) project(RASR) -#set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON" FORCE) - include(cmake_resources/ConfigurationTypes.cmake) include(cmake_resources/Modules.cmake) -include(cmake_resources/Python.cmake) include(cmake_resources/UniversalSettings.cmake) +if(${MODULE_PYTHON}) + include(cmake_resources/Python.cmake) +endif() + +if(${MODULE_TENSORFLOW}) + include(cmake_resources/Tensorflow.cmake) +endif() + string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME) string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE) -set(ARCH_DESCRIPTION "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_TYPE}") -set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH_DESCRIPTION}/") +set(ARCH_DESCRIPTION + "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_TYPE}") +set(CMAKE_INSTALL_PREFIX + "${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH_DESCRIPTION}/") function(add_install_executable EXECUTABLE_NAME) install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION .) - set_target_properties(${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME "${EXECUTABLE_NAME}.${ARCH_DESCRIPTION}") + set_target_properties( + ${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME + "${EXECUTABLE_NAME}.${ARCH_DESCRIPTION}") endfunction() - add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc COMMAND @@ -30,4 +38,4 @@ add_custom_command( add_custom_target(SourceVersion DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc) -add_subdirectory(src/) \ No newline at end of file +add_subdirectory(src/) diff --git a/cmake_resources/ConfigurationTypes.cmake b/cmake_resources/ConfigurationTypes.cmake index 907db7868..4060c7b95 100644 --- a/cmake_resources/ConfigurationTypes.cmake +++ b/cmake_resources/ConfigurationTypes.cmake @@ -1,8 +1,11 @@ -set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "standard" "debug" "release") +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "standard" "debug" + "release") -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'standard' as none was specified.") - set(CMAKE_BUILD_TYPE standard CACHE STRING "Choose the type of build." FORCE) +if(NOT CMAKE_BUILD_TYPE) + message(STATUS "Setting build type to 'standard' as none was specified.") + set(CMAKE_BUILD_TYPE + standard + CACHE STRING "Choose the type of build." FORCE) endif() set(CMAKE_C_FLAGS_STANDARD "-O2") diff --git a/cmake_resources/Modules.cmake b/cmake_resources/Modules.cmake index cecb22771..5771f3f61 100644 --- a/cmake_resources/Modules.cmake +++ b/cmake_resources/Modules.cmake @@ -1,23 +1,25 @@ function(add_module_option MODULE_NAME DEFAULT_VALUE) - option(${MODULE_NAME} "Enable module ${MODULE_NAME})" ${DEFAULT_VALUE}) - if(${MODULE_NAME}) - add_compile_definitions(${MODULE_NAME}) - message(STATUS "Module ${MODULE_NAME} is enabled") - else() - message(STATUS "Module ${MODULE_NAME} disabled") - endif() + option(${MODULE_NAME} "Enable module ${MODULE_NAME}" ${DEFAULT_VALUE}) + if(${MODULE_NAME}) + add_compile_definitions(${MODULE_NAME}) + message(STATUS "Module ${MODULE_NAME} is enabled") + else() + message(STATUS "Module ${MODULE_NAME} disabled") + endif() endfunction() set(TOOLS "") function(add_tool_option TOOL_NAME DEFAULT_VALUE) - option(${TOOL_NAME} "Enable tool ${TOOL_NAME})" ${DEFAULT_VALUE}) - if(${TOOL_NAME}) - set(TOOLS ${TOOLS} ${TOOL_NAME} PARENT_SCOPE) - message(STATUS "Tool ${TOOL_NAME} is enabled") - else() - message(STATUS "Tool ${TOOL_NAME} is disabled") - endif() + option(${TOOL_NAME} "Enable tool ${TOOL_NAME}" ${DEFAULT_VALUE}) + if(${TOOL_NAME}) + set(TOOLS + ${TOOLS} ${TOOL_NAME} + PARENT_SCOPE) + message(STATUS "Tool ${TOOL_NAME} is enabled") + else() + message(STATUS "Tool ${TOOL_NAME} is disabled") + endif() endfunction() # ****** Adaptation ****** @@ -126,28 +128,30 @@ add_tool_option(SpeechRecognizer ON) add_tool_option(Xml ON) if(${MODULE_CART}) - add_tool_option(Cart ON) + add_tool_option(Cart ON) endif() -if(${MODULE_MM_DT} AND ${MODULE_LATTICE_DT} AND ${MODULE_SPEECH_DT}) - add_tool_option(LatticeProcessor ON) +if(${MODULE_MM_DT} + AND ${MODULE_LATTICE_DT} + AND ${MODULE_SPEECH_DT}) + add_tool_option(LatticeProcessor ON) endif() if(${MODULE_FLF}) - add_tool_option(Flf ON) + add_tool_option(Flf ON) endif() if(${MODULE_NN}) - add_tool_option(NnTrainer ON) + add_tool_option(NnTrainer ON) endif() set(SEARCH_LIBS RasrSearch) if(${MODULE_SEARCH_WFST}) - list(APPEND SEARCH_LIBS RasrSearchWfst RasrOpenFst) + list(APPEND SEARCH_LIBS RasrSearchWfst RasrOpenFst) endif() if(${MODULE_ADVANCED_TREE_SEARCH}) - list(APPEND SEARCH_LIBS RasrAdvancedTreeSearch) + list(APPEND SEARCH_LIBS RasrAdvancedTreeSearch) endif() if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - list(APPEND SEARCH_LIBS RasrGenericSeq2SeqTreeSearch) + list(APPEND SEARCH_LIBS RasrGenericSeq2SeqTreeSearch) endif() diff --git a/cmake_resources/Onnx.cmake b/cmake_resources/Onnx.cmake new file mode 100644 index 000000000..e28e8abf8 --- /dev/null +++ b/cmake_resources/Onnx.cmake @@ -0,0 +1,9 @@ +set(onnx_INCLUDE_DIR "/opt/thirdparty/usr/include") + +find_library(onnxruntime_LIBRARY onnxruntime PATHS "/opt/thirdparty/usr/lib") + +function(add_onnx_dependencies TARGET) + target_compile_options(${TARGET} PUBLIC "-fexceptions") + target_include_directories(${TARGET} PUBLIC ${onnx_INCLUDE_DIR}) + target_link_libraries(${TARGET} PUBLIC ${onnxruntime_LIBRARY}) +endfunction() diff --git a/cmake_resources/Python.cmake b/cmake_resources/Python.cmake index 313eb717e..9c48b1c74 100644 --- a/cmake_resources/Python.cmake +++ b/cmake_resources/Python.cmake @@ -1,9 +1,8 @@ find_package(Python3 REQUIRED COMPONENTS Development NumPy) function(add_python_dependencies TARGET) - target_compile_definitions(${TARGET} PUBLIC ${Python3_DEFINITIONS}) - target_include_directories(${TARGET} PUBLIC ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS}) - target_link_libraries(${TARGET} PUBLIC ${Python3_LIBRARIES}) + target_compile_definitions(${TARGET} PUBLIC ${Python3_DEFINITIONS}) + target_include_directories(${TARGET} PUBLIC ${Python3_INCLUDE_DIRS} + ${Python3_NumPy_INCLUDE_DIRS}) + target_link_libraries(${TARGET} PUBLIC ${Python3_LIBRARIES}) endfunction() - -include(cmake_resources/Tensorflow.cmake) \ No newline at end of file diff --git a/cmake_resources/Tensorflow.cmake b/cmake_resources/Tensorflow.cmake index 5a0777e51..01de86766 100644 --- a/cmake_resources/Tensorflow.cmake +++ b/cmake_resources/Tensorflow.cmake @@ -2,57 +2,60 @@ find_package(Python3 REQUIRED COMPONENTS Interpreter) # Get the TensorFlow include directory by executing a Python command execute_process( - COMMAND "${Python3_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_include())" - RESULT_VARIABLE _tensorflow_include_res - OUTPUT_VARIABLE Tensorflow_INCLUDE_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE -) + COMMAND "${Python3_EXECUTABLE}" -c + "import tensorflow as tf; print(tf.sysconfig.get_include())" + RESULT_VARIABLE _tensorflow_include_res + OUTPUT_VARIABLE Tensorflow_INCLUDE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process( - COMMAND "${Python3_EXECUTABLE}" -c "import tensorflow as tf; print(tf.sysconfig.get_lib())" - RESULT_VARIABLE _tensorflow_lib_res - OUTPUT_VARIABLE Tensorflow_LIB_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE -) + COMMAND "${Python3_EXECUTABLE}" -c + "import tensorflow as tf; print(tf.sysconfig.get_lib())" + RESULT_VARIABLE _tensorflow_lib_res + OUTPUT_VARIABLE Tensorflow_LIB_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) # Check if we got the include directory if(NOT _tensorflow_include_res EQUAL "0") - message(FATAL_ERROR "Failed to get TensorFlow include directory") + message(FATAL_ERROR "Failed to get TensorFlow include directory") endif() # Output the found directory for debugging purposes message(STATUS "Tensorflow include directory: ${Tensorflow_INCLUDE_DIR}") find_library( - Tensorflow_CC - NAMES tensorflow_cc - HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow - PATH_SUFFIXES lib REQUIRED) + Tensorflow_CC + NAMES tensorflow_cc + HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow + PATH_SUFFIXES lib REQUIRED) find_library( - Tensorflow_FRAMEWORK - NAMES tensorflow_framework - HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow - PATH_SUFFIXES lib REQUIRED) + Tensorflow_FRAMEWORK + NAMES tensorflow_framework + HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow + PATH_SUFFIXES lib REQUIRED) if(Tensorflow_CC) - message(STATUS "Tensorflow CC library found at ${Tensorflow_CC}") + message(STATUS "Tensorflow CC library found at ${Tensorflow_CC}") else() - message(FATAL_ERROR "Tensorflow CC library not found") + message(FATAL_ERROR "Tensorflow CC library not found") endif() if(Tensorflow_FRAMEWORK) - message(STATUS "Tensorflow Framework library found at ${Tensorflow_FRAMEWORK}") + message( + STATUS "Tensorflow Framework library found at ${Tensorflow_FRAMEWORK}") else() - message(FATAL_ERROR "TensorFlow Framework library not found") + message(FATAL_ERROR "TensorFlow Framework library not found") endif() find_package(OpenSSL REQUIRED) function(add_tf_dependencies TARGET) - target_compile_options(${TARGET} PUBLIC "-fexceptions") - target_include_directories(${TARGET} PUBLIC ${Tensorflow_INCLUDE_DIR}) - target_link_options(${TARGET} PUBLIC "LINKER:--no-as-needed" "LINKER:--allow-multiple-definition") - target_link_libraries(${TARGET} PUBLIC OpenSSL::Crypto) - target_link_libraries(${TARGET} PUBLIC ${Tensorflow_CC} ${Tensorflow_FRAMEWORK}) -endfunction() \ No newline at end of file + target_compile_options(${TARGET} PUBLIC "-fexceptions") + target_include_directories(${TARGET} PUBLIC ${Tensorflow_INCLUDE_DIR}) + target_link_options(${TARGET} PUBLIC "LINKER:--no-as-needed" + "LINKER:--allow-multiple-definition") + target_link_libraries(${TARGET} PUBLIC OpenSSL::Crypto) + target_link_libraries(${TARGET} PUBLIC ${Tensorflow_CC} + ${Tensorflow_FRAMEWORK}) +endfunction() diff --git a/cmake_resources/UniversalSettings.cmake b/cmake_resources/UniversalSettings.cmake index 423687805..d2e6437a9 100644 --- a/cmake_resources/UniversalSettings.cmake +++ b/cmake_resources/UniversalSettings.cmake @@ -4,29 +4,30 @@ add_compile_definitions(CMAKE_DISABLE_MODULES_HH) add_compile_definitions(_GNU_SOURCE) add_compile_options( - -pipe - -funsigned-char - -fno-exceptions - -Wno-unknown-pragmas - -Wall - -Wno-long-long - -Wno-deprecated - -fno-strict-aliasing - -ffast-math - -msse3 -) + -pipe + -funsigned-char + -fno-exceptions + -Wno-unknown-pragmas + -Wall + -Wno-long-long + -Wno-deprecated + -fno-strict-aliasing + -ffast-math + -msse3) -if (NOT DEFINED MARCH) - set(MARCH "native" CACHE STRING "Default target architecture") -endif () +if(NOT DEFINED MARCH) + set(MARCH + "native" + CACHE STRING "Default target architecture") +endif() include(CheckCXXCompilerFlag) -CHECK_CXX_COMPILER_FLAG("-march=${MARCH}" COMPILER_SUPPORTS_MARCH) -if (COMPILER_SUPPORTS_MARCH) - add_compile_options("-march=${MARCH}") - message(STATUS "Using -march=${MARCH}") -else () - message(STATUS "Architecture -march=${MARCH} is not supported") -endif () +check_cxx_compiler_flag("-march=${MARCH}" COMPILER_SUPPORTS_MARCH) +if(COMPILER_SUPPORTS_MARCH) + add_compile_options("-march=${MARCH}") + message(STATUS "Using -march=${MARCH}") +else() + message(STATUS "Architecture -march=${MARCH} is not supported") +endif() find_package(LibXml2 REQUIRED) find_package(Threads REQUIRED) @@ -35,46 +36,41 @@ find_package(LAPACK REQUIRED) find_library(LIB_RT rt REQUIRED) -link_libraries(LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads LAPACK::LAPACK ${LIB_RT}) +link_libraries(LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads LAPACK::LAPACK + ${LIB_RT}) include_directories(${LIBXML2_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src) -if (${MODULE_AUDIO_FFMPEG}) - find_package(PkgConfig REQUIRED) - pkg_check_modules(AVFORMAT REQUIRED IMPORTED_TARGET libavformat) - pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample) - pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec) - pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil) +if(${MODULE_AUDIO_FFMPEG}) + find_package(PkgConfig REQUIRED) + pkg_check_modules(AVFORMAT REQUIRED IMPORTED_TARGET libavformat) + pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample) + pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec) + pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil) - include_directories(${AVFORMAT_INCLUDE_DIRS} ${SWRESAMPLE_INCLUDE_DIRS} ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS}) - link_libraries(PkgConfig::AVFORMAT PkgConfig::SWRESAMPLE PkgConfig::AVCODEC PkgConfig::AVUTIL) -endif () - -if (${MODULE_OPENMP}) - find_package(OpenMP REQUIRED) - add_compile_options(OpenMP_CXX_FLAGS) - include_directories(OpenMP_CXX_INCLUDE_DIRS) - link_libraries(OpenMP::OpenMP_CXX) -endif () + include_directories(${AVFORMAT_INCLUDE_DIRS} ${SWRESAMPLE_INCLUDE_DIRS} + ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS}) + link_libraries(PkgConfig::AVFORMAT PkgConfig::SWRESAMPLE PkgConfig::AVCODEC + PkgConfig::AVUTIL) +endif() -if (${MODULE_TENSORFLOW}) - include(cmake_resources/Tensorflow.cmake) -endif () +if(${MODULE_OPENMP}) + find_package(OpenMP REQUIRED) + add_compile_options(OpenMP_CXX_FLAGS) + include_directories(OpenMP_CXX_INCLUDE_DIRS) + link_libraries(OpenMP::OpenMP_CXX) +endif() if(${MODULE_CUDA}) - enable_language(CUDA) - set(CMAKE_CUDA_ARCHITECTURES 61;75;86) + enable_language(CUDA) + set(CMAKE_CUDA_ARCHITECTURES 61;75;86;89) endif() -if (${MODULE_AUDIO_FLAC}) - link_libraries(FLAC) -endif () - -if (${MODULE_AUDIO_WAV_SYSTEM}) - link_libraries(sndfile) -endif () +if(${MODULE_AUDIO_FLAC}) + link_libraries(FLAC) +endif() -if (${MODULE_PYTHON}) - include(cmake_resources/Python.cmake) -endif () \ No newline at end of file +if(${MODULE_AUDIO_WAV_SYSTEM}) + link_libraries(sndfile) +endif() diff --git a/src/Am/CMakeLists.txt b/src/Am/CMakeLists.txt index 55e62b39a..f0ff43fcf 100644 --- a/src/Am/CMakeLists.txt +++ b/src/Am/CMakeLists.txt @@ -1,40 +1,39 @@ set(Am_SOURCES - AcousticModel.cc - AcousticModelAdaptor.cc - ClassicAcousticModel.cc - ClassicHmmTopologySet.cc - ClassicStateModel.cc - ClassicStateTying.cc - ClassicTransducerBuilder.cc - Module.cc - TransitionModel.cc - Utilities.cc -) + AcousticModel.cc + AcousticModelAdaptor.cc + ClassicAcousticModel.cc + ClassicHmmTopologySet.cc + ClassicStateModel.cc + ClassicStateTying.cc + ClassicTransducerBuilder.cc + Module.cc + TransitionModel.cc + Utilities.cc) if(${MODULE_CART}) - list(APPEND Am_SOURCES DecisionTreeStateTying.cc ClassicDecisionTree.cc) + list(APPEND Am_SOURCES DecisionTreeStateTying.cc ClassicDecisionTree.cc) endif() if(${MODULE_ADAPT_MLLR}) - list(APPEND Am_SOURCES AdaptedAcousticModel.cc AdaptationTree.cc) + list(APPEND Am_SOURCES AdaptedAcousticModel.cc AdaptationTree.cc) endif() add_library(RasrAm ${Am_SOURCES}) -target_link_libraries(RasrAm INTERFACE - RasrMm - RasrBliss - RasrFsa - RasrCore - RasrMc - RasrMath - RasrMathLapack -) +target_link_libraries( + RasrAm + INTERFACE RasrMm + RasrBliss + RasrFsa + RasrCore + RasrMc + RasrMath + RasrMathLapack) if(${MODULE_CART}) - target_link_libraries(RasrAm INTERFACE RasrCart) + target_link_libraries(RasrAm INTERFACE RasrCart) endif() if(${MODULE_MATH_NR}) - target_link_libraries(RasrAm INTERFACE RasrMathNr) + target_link_libraries(RasrAm INTERFACE RasrMathNr) endif() diff --git a/src/Audio/CMakeLists.txt b/src/Audio/CMakeLists.txt index ade02da6e..d07803eb9 100644 --- a/src/Audio/CMakeLists.txt +++ b/src/Audio/CMakeLists.txt @@ -1,28 +1,25 @@ -set(Audio_SOURCES - Module.cc - Node.cc -) +set(Audio_SOURCES Module.cc Node.cc) if(${MODULE_AUDIO_FFMPEG}) - list(APPEND Audio_SOURCES Ffmpeg.cc) + list(APPEND Audio_SOURCES Ffmpeg.cc) endif() if(${MODULE_AUDIO_FLAC}) - list(APPEND Audio_SOURCES Flac.cc flac/FlacDecoder.cc) + list(APPEND Audio_SOURCES Flac.cc flac/FlacDecoder.cc) endif() if(${SYSTEM_NAME} STREQUAL "linux" AND ${MODULE_AUDIO_OSS}) - list(APPEND Audio_SOURCES Oss.cc) + list(APPEND Audio_SOURCES Oss.cc) endif() if(${MODULE_AUDIO_RAW}) - list(APPEND Audio_SOURCES Raw.cc) + list(APPEND Audio_SOURCES Raw.cc) endif() if(${MODULE_AUDIO_WAV_SYSTEM}) - list(APPEND Audio_SOURCES Wav.cc) + list(APPEND Audio_SOURCES Wav.cc) endif() -add_library(RasrAudio ${Audio_SOURCES}) +add_library(RasrAudio STATIC ${Audio_SOURCES}) -target_link_libraries(RasrAudio INTERFACE RasrFlow RasrCore) \ No newline at end of file +target_link_libraries(RasrAudio INTERFACE RasrFlow RasrCore) diff --git a/src/Bliss/CMakeLists.txt b/src/Bliss/CMakeLists.txt index 433029ce1..caf7cd572 100644 --- a/src/Bliss/CMakeLists.txt +++ b/src/Bliss/CMakeLists.txt @@ -1,28 +1,28 @@ set(Bliss_SOURCES - CorpusDescription.cc - CorpusKey.cc - CorpusParser.cc - CorpusStatistics.cc - EditDistance.cc - Evaluation.cc - Fsa.cc - Lexicon.cc - LexiconParser.cc - Orthography.cc - Phoneme.cc - Phonology.cc - PrefixTree.cc - SegmentOrdering.cc - Symbol.cc - Unknown.cc -) + CorpusDescription.cc + CorpusKey.cc + CorpusParser.cc + CorpusStatistics.cc + EditDistance.cc + Evaluation.cc + Fsa.cc + Lexicon.cc + LexiconParser.cc + Orthography.cc + Phoneme.cc + Phonology.cc + PrefixTree.cc + SegmentOrdering.cc + Symbol.cc + Unknown.cc) if(${MODULE_THEANO_INTERFACE}) - list(APPEND Bliss_SOURCES TheanoCommunicator.cc TheanoSegmentOrderingVisitor.cc) + list(APPEND Bliss_SOURCES TheanoCommunicator.cc + TheanoSegmentOrderingVisitor.cc) endif() if(${MODULE_PYTHON}) - list(APPEND Bliss_SOURCES PythonSegmentOrdering.cc) + list(APPEND Bliss_SOURCES PythonSegmentOrdering.cc) endif() add_library(RasrBliss ${Bliss_SOURCES}) @@ -30,5 +30,5 @@ add_library(RasrBliss ${Bliss_SOURCES}) target_link_libraries(RasrBliss INTERFACE RasrFsa RasrMath RasrCore) if(${MODULE_PYTHON}) - add_python_dependencies(RasrBliss) + add_python_dependencies(RasrBliss) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5020d1bc..26911f7e0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,3 @@ - - add_subdirectory(Am) add_subdirectory(Audio) add_subdirectory(Bliss) @@ -16,34 +14,34 @@ add_subdirectory(Signal) add_subdirectory(Speech) add_subdirectory(Tools) -if (${MODULE_CART}) - add_subdirectory(Cart) -endif () +if(${MODULE_CART}) + add_subdirectory(Cart) +endif() -if (${MODULE_FLF}) - add_subdirectory(Flf) -endif () +if(${MODULE_FLF}) + add_subdirectory(Flf) +endif() -if (${MODULE_OPENFST}) - add_subdirectory(OpenFst) -endif () +if(${MODULE_OPENFST}) + add_subdirectory(OpenFst) +endif() -if (${MODULE_NN}) - add_subdirectory(Nn) -endif () +if(${MODULE_NN}) + add_subdirectory(Nn) +endif() -if (${MODULE_ONNX}) - add_subdirectory(Onnx) -endif () +if(${MODULE_ONNX}) + add_subdirectory(Onnx) +endif() -if (${MODULE_PYTHON}) - add_subdirectory(Python) -endif () +if(${MODULE_PYTHON}) + add_subdirectory(Python) +endif() -if (${MODULE_TENSORFLOW}) - add_subdirectory(Tensorflow) -endif () +if(${MODULE_TENSORFLOW}) + add_subdirectory(Tensorflow) +endif() -if (${MODULE_TEST}) - add_subdirectory(Test) -endif () +if(${MODULE_TEST}) + add_subdirectory(Test) +endif() diff --git a/src/Cart/CMakeLists.txt b/src/Cart/CMakeLists.txt index 5a85e7a53..c0a79b114 100644 --- a/src/Cart/CMakeLists.txt +++ b/src/Cart/CMakeLists.txt @@ -1,14 +1,13 @@ set(Cart_SOURCES - Conditions.cc - Properties.cc - Example.cc - BinaryTree.cc - DecisionTree.cc - Cluster.cc - DecisionTreeTrainer.cc - Parser.cc -) + Conditions.cc + Properties.cc + Example.cc + BinaryTree.cc + DecisionTree.cc + Cluster.cc + DecisionTreeTrainer.cc + Parser.cc) add_library(RasrCart STATIC ${Cart_SOURCES}) -target_link_libraries(RasrCart INTERFACE RasrCore) \ No newline at end of file +target_link_libraries(RasrCart INTERFACE RasrCore) diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt index 96253bb63..d207ce110 100644 --- a/src/Core/CMakeLists.txt +++ b/src/Core/CMakeLists.txt @@ -1,58 +1,56 @@ set(Core_SOURCES - Application.cc - Archive.cc - ArithmeticExpressionParser.cc - Assertions.cc - BinaryStream.cc - BinaryTree.cc - BundleArchive.cc - CacheManager.cc - Channel.cc - Choice.cc - CodeGenerator.cc - Component.cc - CompressedStream.cc - Configuration.cc - Debug.cc - Dependency.cc - Description.cc - Directory.cc - DirectoryArchive.cc - FileArchive.cc - FormatSet.cc - IoUtilities.cc - MappedArchive.cc - MemoryInfo.cc - MD5.cc - MurmurHash.cc - Parameter.cc - ProgressIndicator.cc - ReferenceCounting.cc - ResourceUsageInfo.cc - Statistics.cc - StringExpression.cc - StringUtilities.cc - TextStream.cc - Tokenizer.cc - Types.cc - Unicode.cc - Utility.cc - Version.cc - XmlBuilder.cc - XmlBuilder2.cc - XmlParser.cc - XmlStream.cc - ) + Application.cc + Archive.cc + ArithmeticExpressionParser.cc + Assertions.cc + BinaryStream.cc + BinaryTree.cc + BundleArchive.cc + CacheManager.cc + Channel.cc + Choice.cc + CodeGenerator.cc + Component.cc + CompressedStream.cc + Configuration.cc + Debug.cc + Dependency.cc + Description.cc + Directory.cc + DirectoryArchive.cc + FileArchive.cc + FormatSet.cc + IoUtilities.cc + MappedArchive.cc + MemoryInfo.cc + MD5.cc + MurmurHash.cc + Parameter.cc + ProgressIndicator.cc + ReferenceCounting.cc + ResourceUsageInfo.cc + Statistics.cc + StringExpression.cc + StringUtilities.cc + TextStream.cc + Tokenizer.cc + Types.cc + Unicode.cc + Utility.cc + Version.cc + XmlBuilder.cc + XmlBuilder2.cc + XmlParser.cc + XmlStream.cc) find_package(BISON REQUIRED) -BISON_TARGET( - ArithmeticExpressionParser - ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.yy - ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.cc - DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.hh - COMPILE_FLAGS "-d" -) +bison_target( + ArithmeticExpressionParser + ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.yy + ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.cc + DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.hh + COMPILE_FLAGS "-d") list(APPEND Core_SOURCES ${BISON_ArithmeticExpressionParser_OUTPUTS}) add_library(RasrCore STATIC ${Core_SOURCES}) diff --git a/src/Flf/CMakeLists.txt b/src/Flf/CMakeLists.txt index 299442dda..59adc4806 100644 --- a/src/Flf/CMakeLists.txt +++ b/src/Flf/CMakeLists.txt @@ -1,88 +1,87 @@ add_subdirectory(FlfCore) if(${MODULE_FLF_EXT}) - add_subdirectory(FlfExt) + add_subdirectory(FlfExt) endif() set(Flf_SOURCES - Archive.cc - Best.cc - Cache.cc - CenterFrameConfusionNetworkBuilder.cc - Combination.cc - Compose.cc - Concatenate.cc - ConfusionNetwork.cc - ConfusionNetworkCombination.cc - ConfusionNetworkIo.cc - CorpusProcessor.cc - Copy.cc - Convert.cc - Draw.cc - Determinize.cc - EpsilonRemoval.cc - Evaluate.cc - Filter.cc - Formattings.cc - FlfIo.cc - FwdBwd.cc - GammaCorrection.cc - HtkSlfIo.cc - Info.cc - Io.cc - LanguageModel.cc - LatticeAdaptor.cc - LatticeHandler.cc - Lexicon.cc - LocalCostDecoder.cc - Map.cc - Miscellaneous.cc - Module.cc - NBest.cc - Network.cc - NodeFactory.cc - NonWordFilter.cc - PivotArcConfusionNetworkBuilder.cc - Processor.cc - Prune.cc - PushForwardRescoring.cc - Recognizer.cc - IncrementalRecognizer.cc - Rescore.cc - RescoreLm.cc - RescoreInternal.cc - Rescale.cc - Segment.cc - SegmentwiseSpeechProcessor.cc - StateClusterConfusionNetworkBuilder.cc - TimeAlignment.cc - TimeframeConfusionNetwork.cc - TimeframeConfusionNetworkBuilder.cc - TimeframeConfusionNetworkCombination.cc - TimeframeConfusionNetworkIo.cc - TimeframeError.cc - Traceback.cc - Union.cc -) + Archive.cc + Best.cc + Cache.cc + CenterFrameConfusionNetworkBuilder.cc + Combination.cc + Compose.cc + Concatenate.cc + ConfusionNetwork.cc + ConfusionNetworkCombination.cc + ConfusionNetworkIo.cc + CorpusProcessor.cc + Copy.cc + Convert.cc + Draw.cc + Determinize.cc + EpsilonRemoval.cc + Evaluate.cc + Filter.cc + Formattings.cc + FlfIo.cc + FwdBwd.cc + GammaCorrection.cc + HtkSlfIo.cc + Info.cc + Io.cc + LanguageModel.cc + LatticeAdaptor.cc + LatticeHandler.cc + Lexicon.cc + LocalCostDecoder.cc + Map.cc + Miscellaneous.cc + Module.cc + NBest.cc + Network.cc + NodeFactory.cc + NonWordFilter.cc + PivotArcConfusionNetworkBuilder.cc + Processor.cc + Prune.cc + PushForwardRescoring.cc + Recognizer.cc + IncrementalRecognizer.cc + Rescore.cc + RescoreLm.cc + RescoreInternal.cc + Rescale.cc + Segment.cc + SegmentwiseSpeechProcessor.cc + StateClusterConfusionNetworkBuilder.cc + TimeAlignment.cc + TimeframeConfusionNetwork.cc + TimeframeConfusionNetworkBuilder.cc + TimeframeConfusionNetworkCombination.cc + TimeframeConfusionNetworkIo.cc + TimeframeError.cc + Traceback.cc + Union.cc) add_library(RasrFlf STATIC ${Flf_SOURCES}) target_link_libraries(RasrFlf INTERFACE RasrFlfCore) if(${MODULE_FLF_EXT}) - target_link_libraries(RasrFlf INTERFACE RasrFlfExt) + target_link_libraries(RasrFlf INTERFACE RasrFlfExt) endif() -target_link_libraries(RasrFlf INTERFACE - RasrSpeech - RasrLattice - RasrLm - RasrAm - RasrMm - RasrMc - RasrCart - RasrBliss - RasrFlow - RasrFsa - RasrCore -) \ No newline at end of file +target_link_libraries( + RasrFlf + INTERFACE RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrCart + RasrBliss + RasrFlow + RasrFsa + RasrCore) diff --git a/src/Flow/CMakeLists.txt b/src/Flow/CMakeLists.txt index e6d5c7f0f..909414a5e 100644 --- a/src/Flow/CMakeLists.txt +++ b/src/Flow/CMakeLists.txt @@ -1,31 +1,30 @@ set(Flow_SOURCES - AbstractNode.cc - Aggregate.cc - Attributes.cc - Cache.cc - Cutter.cc - CorpusKeyMap.cc - Data.cc - DataAdaptor.cc - Datatype.cc - Demo.cc - Dump.cc - Link.cc - Module.cc - Network.cc - NetworkParser.cc - Node.cc - Registry.cc - Repeater.cc - SequenceFilter.cc - WarpTimeFilter.cc - StringExpressionNode.cc - Synchronization.cc - Timestamp.cc - Vector.cc - VectorTextInput.cc -) + AbstractNode.cc + Aggregate.cc + Attributes.cc + Cache.cc + Cutter.cc + CorpusKeyMap.cc + Data.cc + DataAdaptor.cc + Datatype.cc + Demo.cc + Dump.cc + Link.cc + Module.cc + Network.cc + NetworkParser.cc + Node.cc + Registry.cc + Repeater.cc + SequenceFilter.cc + WarpTimeFilter.cc + StringExpressionNode.cc + Synchronization.cc + Timestamp.cc + Vector.cc + VectorTextInput.cc) add_library(RasrFlow STATIC ${Flow_SOURCES}) -target_link_libraries(RasrFlow INTERFACE RasrCore) \ No newline at end of file +target_link_libraries(RasrFlow INTERFACE RasrCore) diff --git a/src/Fsa/CMakeLists.txt b/src/Fsa/CMakeLists.txt index 8358c171f..3a9926d98 100644 --- a/src/Fsa/CMakeLists.txt +++ b/src/Fsa/CMakeLists.txt @@ -1,40 +1,39 @@ set(Fsa_SOURCES - Accessible.cc - Alphabet.cc - AlphabetUtility.cc - AlphabetXml.cc - Archive.cc - Arithmetic.cc - Basic.cc - Best.cc - Cache.cc - Compose.cc - Determinize.cc - Input.cc - Levenshtein.cc - Linear.cc - Minimize.cc - Output.cc - Packed.cc - Permute.cc - Properties.cc - Project.cc - Prune.cc - Random.cc - Resources.cc - Rational.cc - RemoveEpsilons.cc - Semiring.cc - Semiring64.cc - Sort.cc - Sssp.cc - Sssp4SpecialSymbols.cc - Static.cc - Storage.cc - Types.cc - Utility.cc -) + Accessible.cc + Alphabet.cc + AlphabetUtility.cc + AlphabetXml.cc + Archive.cc + Arithmetic.cc + Basic.cc + Best.cc + Cache.cc + Compose.cc + Determinize.cc + Input.cc + Levenshtein.cc + Linear.cc + Minimize.cc + Output.cc + Packed.cc + Permute.cc + Properties.cc + Project.cc + Prune.cc + Random.cc + Resources.cc + Rational.cc + RemoveEpsilons.cc + Semiring.cc + Semiring64.cc + Sort.cc + Sssp.cc + Sssp4SpecialSymbols.cc + Static.cc + Storage.cc + Types.cc + Utility.cc) add_library(RasrFsa STATIC ${Fsa_SOURCES}) -target_link_libraries(RasrFsa INTERFACE RasrCore) \ No newline at end of file +target_link_libraries(RasrFsa INTERFACE RasrCore) diff --git a/src/Lattice/CMakeLists.txt b/src/Lattice/CMakeLists.txt index 584989d31..b57513b4e 100644 --- a/src/Lattice/CMakeLists.txt +++ b/src/Lattice/CMakeLists.txt @@ -1,54 +1,49 @@ -set(Lattice_SOURCES - Archive.cc - Basic.cc - Lattice.cc - LatticeAdaptor.cc - Morphism.cc - Utilities.cc -) +set(Lattice_SOURCES Archive.cc Basic.cc Lattice.cc LatticeAdaptor.cc + Morphism.cc Utilities.cc) if(${MODULE_LATTICE_BASIC}) - list(APPEND Lattice_SOURCES Cache.cc Static.cc Compose.cc) + list(APPEND Lattice_SOURCES Cache.cc Static.cc Compose.cc) endif() if(${MODULE_LATTICE_DT}) - list(APPEND Lattice_SOURCES - Accuracy.cc - Arithmetic.cc - Best.cc - Merge.cc - Posterior.cc - Rational.cc - RemoveEpsilons.cc - SmoothedAccuracy.cc - SmoothingFunction.cc - TimeframeError.cc - ) + list( + APPEND + Lattice_SOURCES + Accuracy.cc + Arithmetic.cc + Best.cc + Merge.cc + Posterior.cc + Rational.cc + RemoveEpsilons.cc + SmoothedAccuracy.cc + SmoothingFunction.cc + TimeframeError.cc) endif() if(${MODULE_LATTICE_HTK}) - list(APPEND Lattice_SOURCES HtkReader.cc HtkWriter.cc) + list(APPEND Lattice_SOURCES HtkReader.cc HtkWriter.cc) endif() add_library(RasrLattice STATIC ${Lattice_SOURCES}) -target_link_libraries(RasrLattice INTERFACE - RasrSpeech - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrFsa - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - RasrCore - RasrCart -) +target_link_libraries( + RasrLattice + INTERFACE RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrFsa + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrCart) if(${MODULE_MATH_NR}) - target_link_libraries(RasrLattice INTERFACE RasrMathNr) -endif() \ No newline at end of file + target_link_libraries(RasrLattice INTERFACE RasrMathNr) +endif() diff --git a/src/Lm/CMakeLists.txt b/src/Lm/CMakeLists.txt index 349739a33..577daab41 100644 --- a/src/Lm/CMakeLists.txt +++ b/src/Lm/CMakeLists.txt @@ -1,81 +1,83 @@ set(Lm_SOURCES - AbstractNNLanguageModel.cc - BackingOff.cc - ClassLm.cc - CombineLm.cc - Compose.cc - CorpusStatistics.cc - IndexMap.cc - LanguageModel.cc - Module.cc - NNHistoryManager.cc - ReverseArpaLm.cc - ScaledLanguageModel.cc - WordlistInterface.cc -) + AbstractNNLanguageModel.cc + BackingOff.cc + ClassLm.cc + CombineLm.cc + Compose.cc + CorpusStatistics.cc + IndexMap.cc + LanguageModel.cc + Module.cc + NNHistoryManager.cc + ReverseArpaLm.cc + ScaledLanguageModel.cc + WordlistInterface.cc) if(${MODULE_LM_ARPA}) - list(APPEND Lm_SOURCES ArpaLm.cc) + list(APPEND Lm_SOURCES ArpaLm.cc) endif() if(${MODULE_LM_FSA}) - list(APPEND Lm_SOURCES FsaLm.cc CheatingSegmentLm.cc) + list(APPEND Lm_SOURCES FsaLm.cc CheatingSegmentLm.cc) endif() if(${MODULE_LM_ZEROGRAM}) - list(APPEND Lm_SOURCES Zerogram.cc) + list(APPEND Lm_SOURCES Zerogram.cc) endif() -if (${MODULE_LM_FFNN}) - list(APPEND Lm_SOURCES FFNeuralNetworkLanguageModel.cc) -endif () +if(${MODULE_LM_FFNN}) + list(APPEND Lm_SOURCES FFNeuralNetworkLanguageModel.cc) +endif() if(${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) - list(APPEND Lm_SOURCES - BlasNceSoftmaxAdapter.cc - CompressedVector.cc - FixedQuantizationCompressedVectorFactory.cc - LstmStateManager.cc - NceSoftmaxAdapter.cc - PassthroughSoftmaxAdapter.cc - QuantizedBlasNceSoftmaxAdapter.cc - QuantizedCompressedVectorFactory.cc - ReducedPrecisionCompressedVectorFactory.cc - TransformerStateManager.cc - TFRecurrentLanguageModel.cc - ) + list( + APPEND + Lm_SOURCES + BlasNceSoftmaxAdapter.cc + CompressedVector.cc + FixedQuantizationCompressedVectorFactory.cc + LstmStateManager.cc + NceSoftmaxAdapter.cc + PassthroughSoftmaxAdapter.cc + QuantizedBlasNceSoftmaxAdapter.cc + QuantizedCompressedVectorFactory.cc + ReducedPrecisionCompressedVectorFactory.cc + TransformerStateManager.cc + TFRecurrentLanguageModel.cc) endif() add_library(RasrLm STATIC ${Lm_SOURCES}) - target_link_libraries(RasrLm INTERFACE - RasrFlf - RasrFlfCore - RasrSpeech - RasrAm - RasrMc - RasrBliss - RasrNn - RasrMm - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrLattice - RasrFsa - RasrCore - ) +target_compile_options(RasrLm PRIVATE "-fexceptions") + +target_link_libraries( + RasrLm + INTERFACE RasrFlf + RasrFlfCore + RasrSpeech + RasrAm + RasrMc + RasrBliss + RasrNn + RasrMm + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrLattice + RasrFsa + RasrCore) if(${MODULE_CART}) - target_link_libraries(RasrLm INTERFACE RasrCart) + target_link_libraries(RasrLm INTERFACE RasrCart) endif() if(${MODULE_MATH_NR}) - target_link_libraries(RasrLm INTERFACE RasrMathNr) + target_link_libraries(RasrLm INTERFACE RasrMathNr) endif() if(${MODULE_PYTHON}) - target_link_libraries(RasrLm INTERFACE RasrPython) + target_link_libraries(RasrLm INTERFACE RasrPython) endif() if(${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) - target_link_libraries(RasrLm INTERFACE RasrTensorflow) - add_tf_dependencies(RasrLm) + target_link_libraries(RasrLm INTERFACE RasrTensorflow) + add_tf_dependencies(RasrLm) endif() diff --git a/src/Math/CMakeLists.txt b/src/Math/CMakeLists.txt index 7061162bb..fa34cabed 100644 --- a/src/Math/CMakeLists.txt +++ b/src/Math/CMakeLists.txt @@ -1,27 +1,28 @@ add_subdirectory(Lapack) if(${MODULE_MATH_NR}) - add_subdirectory(Nr) + add_subdirectory(Nr) endif() set(RasrMath_SOURCES - AcousticalAnalyticFunctions.cc - AnalyticFunctionFactory.cc - EigenvalueProblem.cc - FastFourierTransform.cc - Module.cc - PiecewiseLinearFunction.cc - Random.cc - CudaDataStructure.cc -) + AcousticalAnalyticFunctions.cc + AnalyticFunctionFactory.cc + EigenvalueProblem.cc + FastFourierTransform.cc + Module.cc + PiecewiseLinearFunction.cc + Random.cc + CudaDataStructure.cc) if(${MODULE_CUDA}) - list(APPEND RasrMath_SOURCES CudaMatrixKernels.cu) + list(APPEND RasrMath_SOURCES CudaMatrixKernels.cu) endif() if(${MODULE_SIGNAL_PLP}) - list(APPEND RasrMath_SOURCES LevinsonLse.cc) + list(APPEND RasrMath_SOURCES LevinsonLse.cc) endif() add_library(RasrMath STATIC ${RasrMath_SOURCES}) -target_link_libraries(RasrMath INTERFACE RasrMathNr RasrMathLapack RasrCore) \ No newline at end of file +target_compile_options(RasrMath PRIVATE "-fexceptions") + +target_link_libraries(RasrMath INTERFACE RasrMathNr RasrMathLapack RasrCore) diff --git a/src/Mc/CMakeLists.txt b/src/Mc/CMakeLists.txt index c0447f917..16d91446c 100644 --- a/src/Mc/CMakeLists.txt +++ b/src/Mc/CMakeLists.txt @@ -1 +1 @@ -add_library(RasrMc STATIC Component.cc) \ No newline at end of file +add_library(RasrMc STATIC Component.cc) diff --git a/src/Mm/CMakeLists.txt b/src/Mm/CMakeLists.txt index d5f176fd6..79a76d75b 100644 --- a/src/Mm/CMakeLists.txt +++ b/src/Mm/CMakeLists.txt @@ -1,85 +1,70 @@ set(RasrMm_SOURCES - AbstractMixtureSetEstimator.cc - CombinedFeatureScorer.cc - CovarianceFeatureScorerElement.cc - CovarianceWeightedFeatureScorerElement.cc - Feature.cc - GaussDensity.cc - GaussDensityEstimator.cc - GaussDiagonalMaximumFeatureScorer.cc - IntelCodeGenerator.cc - IntelOptimization.cc - Mixture.cc - MixtureEstimator.cc - MixtureFeatureScorerElement.cc - MixtureSet.cc - MixtureSetBuilder.cc - MixtureSetEstimator.cc - MixtureSetLoader.cc - MixtureSetReader.cc - MixtureSetSplitter.cc - MixtureSetTopology.cc - Module.cc - StatePosteriorFeatureScorer.cc - SimdFeatureScorer.cc - SSE2CodeGenerator.cc - Utilities.cc -) + AbstractMixtureSetEstimator.cc + CombinedFeatureScorer.cc + CovarianceFeatureScorerElement.cc + CovarianceWeightedFeatureScorerElement.cc + Feature.cc + GaussDensity.cc + GaussDensityEstimator.cc + GaussDiagonalMaximumFeatureScorer.cc + IntelCodeGenerator.cc + IntelOptimization.cc + Mixture.cc + MixtureEstimator.cc + MixtureFeatureScorerElement.cc + MixtureSet.cc + MixtureSetBuilder.cc + MixtureSetEstimator.cc + MixtureSetLoader.cc + MixtureSetReader.cc + MixtureSetSplitter.cc + MixtureSetTopology.cc + Module.cc + StatePosteriorFeatureScorer.cc + SimdFeatureScorer.cc + SSE2CodeGenerator.cc + Utilities.cc) if(${MODULE_MM_DT}) - list(APPEND RasrMm_SOURCES - ConvertGaussDensityEstimator.cc - ConvertMixtureEstimator.cc - ConvertMixtureSetEstimator.cc - DiscriminativeGaussDensityEstimator.cc - DiscriminativeMixtureEstimator.cc - DiscriminativeMixtureSetEstimator.cc - EbwDiscriminativeGaussDensityEstimator.cc - EbwDiscriminativeMixtureEstimator.cc - EbwDiscriminativeMixtureSetEstimator.cc - ISmoothingGaussDensityEstimator.cc - ISmoothingMixtureEstimator.cc - ISmoothingMixtureSetEstimator.cc - IterationConstants.cc - RpropOptimization.cc - RpropDiscriminativeGaussDensityEstimator.cc - RpropDiscriminativeMixtureEstimator.cc - RpropDiscriminativeMixtureSetEstimator.cc - ) + list( + APPEND + RasrMm_SOURCES + ConvertGaussDensityEstimator.cc + ConvertMixtureEstimator.cc + ConvertMixtureSetEstimator.cc + DiscriminativeGaussDensityEstimator.cc + DiscriminativeMixtureEstimator.cc + DiscriminativeMixtureSetEstimator.cc + EbwDiscriminativeGaussDensityEstimator.cc + EbwDiscriminativeMixtureEstimator.cc + EbwDiscriminativeMixtureSetEstimator.cc + ISmoothingGaussDensityEstimator.cc + ISmoothingMixtureEstimator.cc + ISmoothingMixtureSetEstimator.cc + IterationConstants.cc + RpropOptimization.cc + RpropDiscriminativeGaussDensityEstimator.cc + RpropDiscriminativeMixtureEstimator.cc + RpropDiscriminativeMixtureSetEstimator.cc) endif() if(${MODULE_MM_BATCH}) - list(APPEND RasrMm_SOURCES - BatchFeatureScorer.cc - DensityClustering.cc - ) + list(APPEND RasrMm_SOURCES BatchFeatureScorer.cc DensityClustering.cc) endif() if(${MODULE_ADAPT_ADVANCED}) - list(APPEND RasrMm_SOURCES - BandMllrAdaptation.cc - SemiTiedAdaptation.cc - ) + list(APPEND RasrMm_SOURCES BandMllrAdaptation.cc SemiTiedAdaptation.cc) endif() if(${MODULE_ADAPT_MLLR}) - list(APPEND RasrMm_SOURCES - MllrAdaptation.cc - ) + list(APPEND RasrMm_SOURCES MllrAdaptation.cc) endif() if(${MODULE_ADAPT_CMLLR}) - list(APPEND RasrMm_SOURCES - AffineFeatureTransformAccumulator.cc - ) + list(APPEND RasrMm_SOURCES AffineFeatureTransformAccumulator.cc) endif() add_library(RasrMm STATIC ${RasrMm_SOURCES}) -target_link_libraries(RasrMm INTERFACE - RasrMath - RasrMathLapack - RasrFsa - RasrCore - RasrMc -) +target_link_libraries(RasrMm INTERFACE RasrMath RasrMathLapack RasrFsa RasrCore + RasrMc) if(${MODULE_MM_BATCH}) - target_compile_options(RasrMm PRIVATE "-msse2") + target_compile_options(RasrMm PRIVATE "-msse2") endif() diff --git a/src/Nn/CMakeLists.txt b/src/Nn/CMakeLists.txt index d649203c6..512a3fed7 100644 --- a/src/Nn/CMakeLists.txt +++ b/src/Nn/CMakeLists.txt @@ -1,82 +1,75 @@ -set(RasrNn_SOURCES - Module.cc -) +set(RasrNn_SOURCES Module.cc) -if (${MODULE_NN}) - list(APPEND RasrNn_SOURCES - ActivationLayer.cc - Activations.cc - AllophoneStateFsaExporter.cc - BatchEstimator.cc - BatchFeatureScorer.cc - BufferedAlignedFeatureProcessor.cc - BufferedFeatureExtractor.cc - BufferedSegmentFeatureProcessor.cc - ClassLabelWrapper.cc - Criterion.cc - CtcCriterion.cc - Estimator.cc - FeatureScorer.cc - FeedForwardTrainer.cc - GradientCheck.cc - LinearAndActivationLayer.cc - LinearLayer.cc - LookupLayer.cc - MeanNormalizedSgdEstimator.cc - NetworkTopology.cc - NeuralNetwork.cc - NeuralNetworkForwardNode.cc - NeuralNetworkLayer.cc - NeuralNetworkTrainer.cc - OperationLayer.cc - PoolingLayer.cc - PreprocessingLayer.cc - Prior.cc - Regularizer.cc - RpropEstimator.cc - Statistics.cc - TrainerFeatureScorer.cc - ) -endif () -if (${MODULE_NN_SEQUENCE_TRAINING}) - list(APPEND RasrNn_SOURCES - EmissionLatticeRescorer.cc - LatticeAccumulators.cc - SegmentwiseNnTrainer.cc - MmiSegmentwiseNnTrainer.cc - MeSegmentwiseNnTrainer.cc - SharedNeuralNetwork.cc - ) -endif () -if (${MODULE_PYTHON}) - list(APPEND RasrNn_SOURCES - PythonFeatureScorer.cc - PythonTrainer.cc - PythonControl.cc - PythonLayer.cc - ) -endif () -if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - list(APPEND RasrNn_SOURCES LabelScorer.cc) - if (${MODULE_TENSORFLOW}) - list(APPEND RasrNn_SOURCES TFLabelScorer.cc) - endif () -endif () +if(${MODULE_NN}) + list( + APPEND + RasrNn_SOURCES + ActivationLayer.cc + Activations.cc + AllophoneStateFsaExporter.cc + BatchEstimator.cc + BatchFeatureScorer.cc + BufferedAlignedFeatureProcessor.cc + BufferedFeatureExtractor.cc + BufferedSegmentFeatureProcessor.cc + ClassLabelWrapper.cc + Criterion.cc + CtcCriterion.cc + Estimator.cc + FeatureScorer.cc + FeedForwardTrainer.cc + GradientCheck.cc + LinearAndActivationLayer.cc + LinearLayer.cc + LookupLayer.cc + MeanNormalizedSgdEstimator.cc + NetworkTopology.cc + NeuralNetwork.cc + NeuralNetworkForwardNode.cc + NeuralNetworkLayer.cc + NeuralNetworkTrainer.cc + OperationLayer.cc + PoolingLayer.cc + PreprocessingLayer.cc + Prior.cc + Regularizer.cc + RpropEstimator.cc + Statistics.cc + TrainerFeatureScorer.cc) +endif() +if(${MODULE_NN_SEQUENCE_TRAINING}) + list( + APPEND + RasrNn_SOURCES + EmissionLatticeRescorer.cc + LatticeAccumulators.cc + SegmentwiseNnTrainer.cc + MmiSegmentwiseNnTrainer.cc + MeSegmentwiseNnTrainer.cc + SharedNeuralNetwork.cc) +endif() +if(${MODULE_PYTHON}) + list(APPEND RasrNn_SOURCES PythonFeatureScorer.cc PythonTrainer.cc + PythonControl.cc PythonLayer.cc) +endif() +if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + list(APPEND RasrNn_SOURCES LabelScorer.cc) + if(${MODULE_TENSORFLOW}) + list(APPEND RasrNn_SOURCES TFLabelScorer.cc) + endif() +endif() add_library(RasrNn STATIC ${RasrNn_SOURCES}) -target_link_libraries(RasrNn INTERFACE - RasrCore - RasrMath - RasrMathLapack - RasrFlow - RasrSignal -) +target_link_libraries(RasrNn INTERFACE RasrCore RasrMath RasrMathLapack + RasrFlow RasrSignal) -if (${MODULE_PYTHON}) - add_python_dependencies(RasrNn) -endif () +target_compile_options(RasrNn PRIVATE "-fexceptions") -if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH} AND ${MODULE_TENSORFLOW}) - add_tf_dependencies(RasrNn) -endif () +if(${MODULE_PYTHON}) + add_python_dependencies(RasrNn) +endif() + +if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH} AND ${MODULE_TENSORFLOW}) + add_tf_dependencies(RasrNn) +endif() diff --git a/src/Onnx/CMakeLists.txt b/src/Onnx/CMakeLists.txt index b9d1e4a57..c0fa5d0d6 100644 --- a/src/Onnx/CMakeLists.txt +++ b/src/Onnx/CMakeLists.txt @@ -1,12 +1,7 @@ -set(RasrOnnx_SOURCES - Session.cc - IOSpecification.cc - Module.cc - OnnxFeatureScorer.cc - OnnxForwardNode.cc - Value.cc -) +set(RasrOnnx_SOURCES Session.cc IOSpecification.cc Module.cc + OnnxFeatureScorer.cc OnnxForwardNode.cc Value.cc) add_library(RasrOnnx STATIC ${RasrOnnx_SOURCES}) -target_link_libraries(RasrOnnx INTERFACE RasrCore) \ No newline at end of file +add_onnx_dependencies(RasrOnnx) +target_link_libraries(RasrOnnx INTERFACE RasrCore) diff --git a/src/OpenFst/CMakeLists.txt b/src/OpenFst/CMakeLists.txt index f9fa196f6..3e0e8a47e 100644 --- a/src/OpenFst/CMakeLists.txt +++ b/src/OpenFst/CMakeLists.txt @@ -1,14 +1,5 @@ -set(RasrOpenFst_SOURCES - Input.cc - Module.cc - Output.cc - SymbolTable.cc -) +set(RasrOpenFst_SOURCES Input.cc Module.cc Output.cc SymbolTable.cc) add_library(RasrOpenFst STATIC ${RasrOpenFst_SOURCES}) -target_link_libraries(RasrOpenFst INTERFACE - RasrBliss - RasrFsa - RasrCore -) \ No newline at end of file +target_link_libraries(RasrOpenFst INTERFACE RasrBliss RasrFsa RasrCore) diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index 1002be25c..b41244701 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -1,9 +1,5 @@ -set(RasrPython_SOURCES - Init.cc - Numpy.cc - Utilities.cc -) +set(RasrPython_SOURCES Init.cc Numpy.cc Utilities.cc) add_library(RasrPython STATIC ${RasrPython_SOURCES}) add_python_dependencies(RasrPython) -target_compile_options(RasrPython PRIVATE "-fexceptions") \ No newline at end of file +target_compile_options(RasrPython PRIVATE "-fexceptions") diff --git a/src/Search/CMakeLists.txt b/src/Search/CMakeLists.txt index 68192d967..795085226 100644 --- a/src/Search/CMakeLists.txt +++ b/src/Search/CMakeLists.txt @@ -1,40 +1,32 @@ -if (${MODULE_SEARCH_WFST}) - add_subdirectory(Wfst) -endif () -if (${MODULE_ADVANCED_TREE_SEARCH}) - add_subdirectory(AdvancedTreeSearch) -endif () -if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - add_subdirectory(GenericSeq2SeqTreeSearch) -endif () +if(${MODULE_SEARCH_WFST}) + add_subdirectory(Wfst) +endif() +if(${MODULE_ADVANCED_TREE_SEARCH}) + add_subdirectory(AdvancedTreeSearch) +endif() +if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + add_subdirectory(GenericSeq2SeqTreeSearch) +endif() set(RasrSearch_SOURCES - Aligner.cc - LatticeHandler.cc - LanguageModelLookahead.cc - Module.cc - Search.cc - StateTree.cc - StateTreeIo.cc - WordConditionedTreeSearch.cc -) + Aligner.cc + LatticeHandler.cc + LanguageModelLookahead.cc + Module.cc + Search.cc + StateTree.cc + StateTreeIo.cc + WordConditionedTreeSearch.cc) -if (${MODULE_SEARCH_MBR}) - list(APPEND RasrSearch_SOURCES - MinimumBayesRiskSearch.cc - MinimumBayesRiskAStarSearch.cc - MinimumBayesRiskNBestListSearch.cc - MinimumBayesRiskSearchUtil.cc - ) -endif () -if (${MODULE_SEARCH_LINEAR}) - list(APPEND RasrSearch_SOURCES LinearSearch.cc) -endif () +if(${MODULE_SEARCH_MBR}) + list(APPEND RasrSearch_SOURCES MinimumBayesRiskSearch.cc + MinimumBayesRiskAStarSearch.cc MinimumBayesRiskNBestListSearch.cc + MinimumBayesRiskSearchUtil.cc) +endif() +if(${MODULE_SEARCH_LINEAR}) + list(APPEND RasrSearch_SOURCES LinearSearch.cc) +endif() add_library(RasrSearch STATIC ${RasrSearch_SOURCES}) -target_link_libraries(RasrSearch INTERFACE - RasrBliss - RasrFsa - RasrCore -) \ No newline at end of file +target_link_libraries(RasrSearch INTERFACE RasrBliss RasrFsa RasrCore) diff --git a/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt b/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt index 09a6b1f80..9c0d40f46 100644 --- a/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt +++ b/src/Search/GenericSeq2SeqTreeSearch/CMakeLists.txt @@ -1,6 +1,6 @@ set(RasrGenericSeq2SeqTreeSearch_SOURCES - Seq2SeqAligner.cc Seq2SeqTreeSearch.cc + Seq2SeqAligner.cc ) add_library(RasrGenericSeq2SeqTreeSearch STATIC ${RasrGenericSeq2SeqTreeSearch_SOURCES}) @@ -10,3 +10,6 @@ target_link_libraries(RasrGenericSeq2SeqTreeSearch INTERFACE RasrFsa RasrCore ) +target_compile_options(RasrGenericSeq2SeqTreeSearch PRIVATE + "-Wno-sign-compare -Winline --param max-inline-insns-auto=10000 --param max-inline-insns-single=10000 --param large-function-growth=25000 --param inline-unit-growth=400" +) diff --git a/src/Search/Wfst/CMakeLists.txt b/src/Search/Wfst/CMakeLists.txt index b873c07da..8ba8644e6 100644 --- a/src/Search/Wfst/CMakeLists.txt +++ b/src/Search/Wfst/CMakeLists.txt @@ -30,7 +30,7 @@ set(RasrSearchWfst_SOURCES WordEnd.cc ) -add_library(RasrSearchWfst STATIC ${SearchWfst_SOURCES}) +add_library(RasrSearchWfst STATIC ${RasrSearchWfst_SOURCES}) target_compile_options(RasrSearchWfst PRIVATE "-Wno-sign-compare") diff --git a/src/Signal/CMakeLists.txt b/src/Signal/CMakeLists.txt index 18220ee8f..073dd632a 100644 --- a/src/Signal/CMakeLists.txt +++ b/src/Signal/CMakeLists.txt @@ -1,111 +1,93 @@ set(RasrSignal_SOURCES - CosineTransform.cc - DcDetection.cc - SilenceNormalization.cc - Delay.cc - Delimiter.cc - EigenTransform.cc - FramePrediction.cc - FastFourierTransform.cc - Filterbank.cc - Module.cc - Mrasta.cc - Normalization.cc - Preemphasis.cc - RepeatingFramePrediction.cc - Regression.cc - ScatterEstimator.cc - ScatterTransform.cc - SegmentClustering.cc - SegmentEstimator.cc - TempoRAlPattern.cc - VectorSequenceAggregation.cc - VectorSequenceConcatenation.cc - VectorResize.cc - Window.cc - WindowBuffer.cc - WindowFunction.cc -) + CosineTransform.cc + DcDetection.cc + SilenceNormalization.cc + Delay.cc + Delimiter.cc + EigenTransform.cc + FramePrediction.cc + FastFourierTransform.cc + Filterbank.cc + Module.cc + Mrasta.cc + Normalization.cc + Preemphasis.cc + RepeatingFramePrediction.cc + Regression.cc + ScatterEstimator.cc + ScatterTransform.cc + SegmentClustering.cc + SegmentEstimator.cc + TempoRAlPattern.cc + VectorSequenceAggregation.cc + VectorSequenceConcatenation.cc + VectorResize.cc + Window.cc + WindowBuffer.cc + WindowFunction.cc) -if (${MODULE_SIGNAL_GAMMATONE}) - list(APPEND RasrSignal_SOURCES - GammaTone.cc - SpectralIntegration.cc - TemporalIntegration.cc - TimeWindowBuffer.cc - ) -endif () +if(${MODULE_SIGNAL_GAMMATONE}) + list(APPEND RasrSignal_SOURCES GammaTone.cc SpectralIntegration.cc + TemporalIntegration.cc TimeWindowBuffer.cc) +endif() -if (${MODULE_SIGNAL_VTLN}) - list(APPEND RasrSignal_SOURCES - LikelihoodFunction.cc - BayesClassification.cc - AprioriProbability.cc - ) -endif () +if(${MODULE_SIGNAL_VTLN}) + list(APPEND RasrSignal_SOURCES LikelihoodFunction.cc BayesClassification.cc + AprioriProbability.cc) +endif() -if (${MODULE_SIGNAL_VOICEDNESS}) - list(APPEND RasrSignal_SOURCES - CrossCorrelation.cc - PeakDetection.cc - ) -endif () +if(${MODULE_SIGNAL_VOICEDNESS}) + list(APPEND RasrSignal_SOURCES CrossCorrelation.cc PeakDetection.cc) +endif() -if (${MODULE_SIGNAL_PLP}) - list(APPEND RasrSignal_SOURCES - ArEstimator.cc - VectorTransform.cc - AutoregressionToCepstrum.cc - AutoregressionToSpectrum.cc - ) -endif () +if(${MODULE_SIGNAL_PLP}) + list(APPEND RasrSignal_SOURCES ArEstimator.cc VectorTransform.cc + AutoregressionToCepstrum.cc AutoregressionToSpectrum.cc) +endif() -if (${MODULE_SIGNAL_ADVANCED}) - list(APPEND RasrSignal_SOURCES - ArxEstimator.cc - Convolution.cc - FastHartleyTransform.cc - Formant.cc - FrameInterpolation.cc - GenericWarping.cc - HarmonicSum.cc - Histogram.cc - HistogramNormalization.cc - LinearFilter.cc - LinearWarping.cc - Lpc.cc - MeanEstimator.cc - NthOrderFeatures.cc - PolinomialVectorInterpolation.cc - QuantileEqualization.cc - SampleNormalization.cc - SegmentwiseFormantExtraction.cc - SilenceDetection.cc - Warping.cc - ) -endif () +if(${MODULE_SIGNAL_ADVANCED}) + list( + APPEND + RasrSignal_SOURCES + ArxEstimator.cc + Convolution.cc + FastHartleyTransform.cc + Formant.cc + FrameInterpolation.cc + GenericWarping.cc + HarmonicSum.cc + Histogram.cc + HistogramNormalization.cc + LinearFilter.cc + LinearWarping.cc + Lpc.cc + MeanEstimator.cc + NthOrderFeatures.cc + PolinomialVectorInterpolation.cc + QuantileEqualization.cc + SampleNormalization.cc + SegmentwiseFormantExtraction.cc + SilenceDetection.cc + Warping.cc) +endif() -if (${MODULE_SIGNAL_ADVANCED_NR}) - list(APPEND RasrSignal_SOURCES - AllPolesPowerSpectrum.cc - KaiserWindowFunction.cc - RandomVector.cc - WindowingFirFilter.cc - ) -endif () +if(${MODULE_SIGNAL_ADVANCED_NR}) + list(APPEND RasrSignal_SOURCES AllPolesPowerSpectrum.cc + KaiserWindowFunction.cc RandomVector.cc WindowingFirFilter.cc) +endif() add_library(RasrSignal STATIC ${RasrSignal_SOURCES}) -target_link_libraries(RasrSignal INTERFACE - RasrFlow - RasrBliss - RasrMm - RasrMath - RasrMathLapack - RasrMc - RasrCore -) +target_link_libraries( + RasrSignal + INTERFACE RasrFlow + RasrBliss + RasrMm + RasrMath + RasrMathLapack + RasrMc + RasrCore) -if (${MODULE_SIGNAL_ADVANCED_NR}) - target_link_libraries(RasrSignal INTERFACE RasrMathNr) -endif () +if(${MODULE_SIGNAL_ADVANCED_NR}) + target_link_libraries(RasrSignal INTERFACE RasrMathNr) +endif() diff --git a/src/Speech/CMakeLists.txt b/src/Speech/CMakeLists.txt index ed681a423..aadf62728 100644 --- a/src/Speech/CMakeLists.txt +++ b/src/Speech/CMakeLists.txt @@ -1,177 +1,154 @@ set(Speech_SOURCES - AcousticModelTrainer.cc - AlignerModelAcceptor.cc - AligningFeatureExtractor.cc - Alignment.cc - AlignmentNode.cc - AlignmentWithLinearSegmentation.cc - AllophoneStateGraphBuilder.cc - AverageFeatureScorerActivation.cc - CorpusProcessor.cc - CorpusVisitor.cc - CovarianceEstimator.cc - DataExtractor.cc - DataSource.cc - DelayedRecognizer.cc - Feature.cc - FeatureScorer.cc - FeatureScorerNode.cc - FsaCache.cc - LabelingFeatureExtractor.cc - MixtureSetTrainer.cc - ModelCombination.cc - Module.cc - Recognizer.cc - ScatterMatricesEstimator.cc - TextDependentSequenceFiltering.cc - TextIndependentMixtureSetTrainer.cc -) + AcousticModelTrainer.cc + AlignerModelAcceptor.cc + AligningFeatureExtractor.cc + Alignment.cc + AlignmentNode.cc + AlignmentWithLinearSegmentation.cc + AllophoneStateGraphBuilder.cc + AverageFeatureScorerActivation.cc + CorpusProcessor.cc + CorpusVisitor.cc + CovarianceEstimator.cc + DataExtractor.cc + DataSource.cc + DelayedRecognizer.cc + Feature.cc + FeatureScorer.cc + FeatureScorerNode.cc + FsaCache.cc + LabelingFeatureExtractor.cc + MixtureSetTrainer.cc + ModelCombination.cc + Module.cc + Recognizer.cc + ScatterMatricesEstimator.cc + TextDependentSequenceFiltering.cc + TextIndependentMixtureSetTrainer.cc) if(${MODULE_SPEECH_LATTICE_ALIGNMENT}) - list(APPEND Speech_SOURCES - PhonemeSequenceAlignmentGenerator.cc - SegmentwiseAlignmentGenerator.cc - SegmentwiseFeatureExtractor.cc - ) -endif () - -if (${MODULE_SPEECH_DT}) - list(APPEND Speech_SOURCES - AbstractSegmentwiseTrainer.cc - AccuracyFsaBuilder.cc - AcousticSegmentwiseTrainer.cc - Confidences.cc - DiscriminativeMixtureSetTrainer.cc - EbwDiscriminativeMixtureSetTrainer.cc - LatticeExtractor.cc - LatticeSetExtractor.cc - LatticeSetProcessor.cc - PruningLatticeSetNode.cc - SegmentwiseGmmTrainer.cc - WordLatticeExtractor.cc - ) -endif () - -if (${MODULE_SPEECH_DT_ADVANCED}) - list(APPEND Speech_SOURCES - AdvancedAccuracyFsaBuilder.cc - AdvancedLatticeExtractor.cc - AuxiliarySegmentwiseTrainer.cc - ClusterMixtureSetTrainer.cc - AdvancedLatticeSetProcessor.cc - NBestListExtractor.cc - RpropDiscriminativeMixtureSetTrainer.cc - ) -endif () - -if (${MODULE_FLF_EXT}) - list(APPEND Speech_SOURCES AlignedFeatureCache.cc) -endif () - -if (${MODULE_SPEECH_LATTICE_FLOW_NODES}) - list(APPEND Speech_SOURCES - AlignmentFromLattice.cc - LatticeNodes.cc - LatticeArcAccumulator.cc - ) -endif () - -if (${MODULE_SPEECH_ALIGNMENT_FLOW_NODES}) - list(APPEND Speech_SOURCES - AlignmentGeneratorNode.cc - AlignmentTransformNode.cc - SegmentNode.cc - ) -endif () - -if (${MODULE_ADAPT_MLLR}) - list(APPEND Speech_SOURCES - ModelTransformEstimator.cc - FeatureShiftAdaptor.cc - ) -endif () - -if (${MODULE_ADAPT_CMLLR}) - list(APPEND Speech_SOURCES - AffineFeatureTransformEstimator.cc - KeyedEstimator.cc - ) -endif () - -if (${MODULE_CART}) - list(APPEND Speech_SOURCES - DecisionTreeTrainer.cc - ) -endif () - -if (${MODULE_SPEECH_LATTICE_RESCORING}) - list(APPEND Speech_SOURCES - LatticeRescorerAutomaton.cc - LatticeRescorerNodes.cc - StatePosteriorFeatureScorerNode.cc - ) -endif () - -if (${MODULE_SIGNAL_ADVANCED}) - list(APPEND Speech_SOURCES - HistogramEstimator.cc - MeanEstimator.cc - ) -endif () - -if (${MODULE_SEARCH_MBR}) - list(APPEND Speech_SOURCES - MinimumBayesRiskSearch.cc - ) -endif () + list(APPEND Speech_SOURCES PhonemeSequenceAlignmentGenerator.cc + SegmentwiseAlignmentGenerator.cc SegmentwiseFeatureExtractor.cc) +endif() + +if(${MODULE_SPEECH_DT}) + list( + APPEND + Speech_SOURCES + AbstractSegmentwiseTrainer.cc + AccuracyFsaBuilder.cc + AcousticSegmentwiseTrainer.cc + Confidences.cc + DiscriminativeMixtureSetTrainer.cc + EbwDiscriminativeMixtureSetTrainer.cc + LatticeExtractor.cc + LatticeSetExtractor.cc + LatticeSetProcessor.cc + PruningLatticeSetNode.cc + SegmentwiseGmmTrainer.cc + WordLatticeExtractor.cc) +endif() + +if(${MODULE_SPEECH_DT_ADVANCED}) + list( + APPEND + Speech_SOURCES + AdvancedAccuracyFsaBuilder.cc + AdvancedLatticeExtractor.cc + AuxiliarySegmentwiseTrainer.cc + ClusterMixtureSetTrainer.cc + AdvancedLatticeSetProcessor.cc + NBestListExtractor.cc + RpropDiscriminativeMixtureSetTrainer.cc) +endif() + +if(${MODULE_FLF_EXT}) + list(APPEND Speech_SOURCES AlignedFeatureCache.cc) +endif() + +if(${MODULE_SPEECH_LATTICE_FLOW_NODES}) + list(APPEND Speech_SOURCES AlignmentFromLattice.cc LatticeNodes.cc + LatticeArcAccumulator.cc) +endif() + +if(${MODULE_SPEECH_ALIGNMENT_FLOW_NODES}) + list(APPEND Speech_SOURCES AlignmentGeneratorNode.cc + AlignmentTransformNode.cc SegmentNode.cc) +endif() + +if(${MODULE_ADAPT_MLLR}) + list(APPEND Speech_SOURCES ModelTransformEstimator.cc FeatureShiftAdaptor.cc) +endif() + +if(${MODULE_ADAPT_CMLLR}) + list(APPEND Speech_SOURCES AffineFeatureTransformEstimator.cc + KeyedEstimator.cc) +endif() + +if(${MODULE_CART}) + list(APPEND Speech_SOURCES DecisionTreeTrainer.cc) +endif() + +if(${MODULE_SPEECH_LATTICE_RESCORING}) + list(APPEND Speech_SOURCES LatticeRescorerAutomaton.cc + LatticeRescorerNodes.cc StatePosteriorFeatureScorerNode.cc) +endif() + +if(${MODULE_SIGNAL_ADVANCED}) + list(APPEND Speech_SOURCES HistogramEstimator.cc MeanEstimator.cc) +endif() + +if(${MODULE_SEARCH_MBR}) + list(APPEND Speech_SOURCES MinimumBayesRiskSearch.cc) +endif() add_library(RasrSpeech STATIC ${Speech_SOURCES}) -target_link_libraries(RasrSpeech INTERFACE - RasrLm - RasrAm - RasrMm - RasrMc - RasrSearch - RasrBliss - RasrFlow - RasrFsa - RasrCore - RasrLattice - RasrMath - RasrMathLapack -) - -if (${MODULE_CART}) - target_link_libraries(RasrSpeech INTERFACE RasrCart) -endif () - -if (${MODULE_MATH_NR}) - target_link_libraries(RasrSpeech INTERFACE RasrMathNr) -endif () - -if (${MODULE_NN_SEQUENCE_TRAINING}) - target_link_libraries(RasrSpeech INTERFACE RasrNn) -endif () - -if (${MODULE_SEARCH_WFST}) - target_link_libraries(RasrSpeech INTERFACE RasrSearchWfst RasrOpenFst) -endif () - -if (${MODULE_ADVANCED_TREE_SEARCH}) - target_link_libraries(RasrSpeech INTERFACE RasrAdvancedTreeSearch) -endif () - -if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - target_link_libraries(RasrSpeech INTERFACE RasrGenericSeq2SeqTreeSearch) -endif () - -if (${MODULE_PYTHON}) - target_link_libraries(RasrSpeech INTERFACE RasrPython) - add_python_dependencies(RasrSpeech) -endif () - -if (${MODULE_TENSORFLOW}) - add_tf_dependencies(RasrSpeech) - target_link_libraries(RasrSpeech INTERFACE RasrTensorflow) -endif () \ No newline at end of file +target_link_libraries( + RasrSpeech + INTERFACE RasrLm + RasrAm + RasrMm + RasrMc + RasrSearch + RasrBliss + RasrFlow + RasrFsa + RasrCore + RasrLattice + RasrMath + RasrMathLapack) + +if(${MODULE_CART}) + target_link_libraries(RasrSpeech INTERFACE RasrCart) +endif() + +if(${MODULE_MATH_NR}) + target_link_libraries(RasrSpeech INTERFACE RasrMathNr) +endif() + +if(${MODULE_NN_SEQUENCE_TRAINING}) + target_link_libraries(RasrSpeech INTERFACE RasrNn) +endif() + +if(${MODULE_SEARCH_WFST}) + target_link_libraries(RasrSpeech INTERFACE RasrSearchWfst RasrOpenFst) +endif() + +if(${MODULE_ADVANCED_TREE_SEARCH}) + target_link_libraries(RasrSpeech INTERFACE RasrAdvancedTreeSearch) +endif() + +if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(RasrSpeech INTERFACE RasrGenericSeq2SeqTreeSearch) +endif() + +if(${MODULE_PYTHON}) + target_link_libraries(RasrSpeech INTERFACE RasrPython) + add_python_dependencies(RasrSpeech) +endif() + +if(${MODULE_TENSORFLOW}) + add_tf_dependencies(RasrSpeech) + target_link_libraries(RasrSpeech INTERFACE RasrTensorflow) +endif() diff --git a/src/Tensorflow/CMakeLists.txt b/src/Tensorflow/CMakeLists.txt index a909143b4..bf9eb5213 100644 --- a/src/Tensorflow/CMakeLists.txt +++ b/src/Tensorflow/CMakeLists.txt @@ -1,16 +1,15 @@ set(RasrTensorflow_SOURCES - Graph.cc - GraphLoader.cc - MetaGraphLoader.cc - Module.cc - Session.cc - Tensor.cc - TensorflowForwardNode.cc - TensorMap.cc - VanillaGraphLoader.cc -) + Graph.cc + GraphLoader.cc + MetaGraphLoader.cc + Module.cc + Session.cc + Tensor.cc + TensorflowForwardNode.cc + TensorMap.cc + VanillaGraphLoader.cc) add_library(RasrTensorflow STATIC ${RasrTensorflow_SOURCES}) target_link_libraries(RasrTensorflow INTERFACE RasrCore) -add_tf_dependencies(RasrTensorflow) \ No newline at end of file +add_tf_dependencies(RasrTensorflow) diff --git a/src/Test/CMakeLists.txt b/src/Test/CMakeLists.txt index 711fb1a40..ba9d5e500 100644 --- a/src/Test/CMakeLists.txt +++ b/src/Test/CMakeLists.txt @@ -1,120 +1,116 @@ -set(RasrTest_SOURCES - Registry.cc - Lexicon.cc - File.cc -) +set(RasrTest_SOURCES Registry.cc Lexicon.cc File.cc) add_library(RasrTest ${RasrTest_SOURCES}) set(test_SOURCES - UnitTester.cc - Bliss_SegmentOrdering.cc - Core_StringUtilities.cc - Core_Thread.cc - Core_ThreadPool.cc - Fsa_Sssp4SpecialSymbols.cc - Math_Utilities.cc - Math_Blas.cc - Math_FastVectorOperations.cc - Math_CudaVector.cc - Math_CudaMatrix.cc - Math_FastMatrix.cc - Test_File.cc - Test_Lexicon.cc -) - -if (${MODULE_NN}) - list(APPEND test_SOURCES - Nn_NetworkTopology.cc - Nn_BufferedFeatureExtractor.cc - Nn_BufferedAlignedFeatureProcessor.cc - Nn_ClassLabelWrapper.cc - Nn_FeedForwardCrossEntropyTrainer.cc - Nn_LinearAndActivationLayer.cc - Nn_LinearLayer.cc - Nn_NeuralNetwork.cc - Nn_NeuralNetworkLayer.cc - Nn_NeuralNetworkTrainer.cc - Nn_PreprocessingLayer.cc - Nn_Statistics.cc - ) -endif () - -if (${MODULE_OPENMP}) - list(APPEND test_SOURCES Math_MultithreadingHelper.cc) -endif () - -if (${MODULE_TBB}) - list(APPEND test_SOURCES Core_Tbb.cc) -endif () + UnitTester.cc + Bliss_SegmentOrdering.cc + Core_StringUtilities.cc + Core_Thread.cc + Core_ThreadPool.cc + Fsa_Sssp4SpecialSymbols.cc + Math_Utilities.cc + Math_Blas.cc + Math_FastVectorOperations.cc + Math_CudaVector.cc + Math_CudaMatrix.cc + Math_FastMatrix.cc + Test_File.cc + Test_Lexicon.cc) + +if(${MODULE_NN}) + list( + APPEND + test_SOURCES + Nn_NetworkTopology.cc + Nn_BufferedFeatureExtractor.cc + Nn_BufferedAlignedFeatureProcessor.cc + Nn_ClassLabelWrapper.cc + Nn_FeedForwardCrossEntropyTrainer.cc + Nn_LinearAndActivationLayer.cc + Nn_LinearLayer.cc + Nn_NeuralNetwork.cc + Nn_NeuralNetworkLayer.cc + Nn_NeuralNetworkTrainer.cc + Nn_PreprocessingLayer.cc + Nn_Statistics.cc) +endif() + +if(${MODULE_OPENMP}) + list(APPEND test_SOURCES Math_MultithreadingHelper.cc) +endif() + +if(${MODULE_TBB}) + list(APPEND test_SOURCES Core_Tbb.cc) +endif() add_executable(unit-test ${test_SOURCES}) add_install_executable(unit-test) -target_link_libraries(unit-test PRIVATE - RasrTest - RasrBliss - RasrFsa - RasrCore - RasrSpeech - RasrSearch - RasrLattice - RasrAm - RasrLm - RasrMc - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack -) - -if (${MODULE_FLF}) - target_link_libraries(unit-test PRIVATE RasrFlf) -endif () - -if (${MODULE_FLF_CORE}) - target_link_libraries(unit-test PRIVATE RasrFlfCore) -endif () - -if (${MODULE_FLF_EXT}) - target_link_libraries(unit-test PRIVATE RasrFlfExt) -endif () - -if (${MODULE_ADVANCED_TREE_SEARCH}) - target_link_libraries(unit-test PRIVATE RasrAdvancedTreeSearch) -endif () - -if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - target_link_libraries(unit-test PRIVATE RasrGenericSeq2SeqTreeSearch) -endif () - -if (${MODULE_PYTHON}) - target_link_libraries(unit-test PRIVATE RasrPython) - add_python_dependencies(unit-test) -endif () - -if (${MODULE_NN}) - target_link_libraries(unit-test PRIVATE RasrNn) -endif () - -if (${MODULE_CART}) - target_link_libraries(unit-test PRIVATE RasrCart) -endif () - -if (${MODULE_MATH_NR}) - target_link_libraries(unit-test PRIVATE RasrMathNr) -endif () - -if (${MODULE_SEARCH_WFST}) - target_link_libraries(unit-test PRIVATE RasrSearchWfst) -endif () - -if (${MODULE_OPENFST}) - target_link_libraries(unit-test PRIVATE RasrOpenFst) -endif () - -if (${MODULE_TENSORFLOW}) - target_link_libraries(unit-test PRIVATE RasrTensorflow) - add_tf_dependencies(unit-test) -endif () +target_link_libraries( + unit-test + PRIVATE RasrTest + RasrBliss + RasrFsa + RasrCore + RasrSpeech + RasrSearch + RasrLattice + RasrAm + RasrLm + RasrMc + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack) + +if(${MODULE_FLF}) + target_link_libraries(unit-test PRIVATE RasrFlf) +endif() + +if(${MODULE_FLF_CORE}) + target_link_libraries(unit-test PRIVATE RasrFlfCore) +endif() + +if(${MODULE_FLF_EXT}) + target_link_libraries(unit-test PRIVATE RasrFlfExt) +endif() + +if(${MODULE_ADVANCED_TREE_SEARCH}) + target_link_libraries(unit-test PRIVATE RasrAdvancedTreeSearch) +endif() + +if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(unit-test PRIVATE RasrGenericSeq2SeqTreeSearch) +endif() + +if(${MODULE_PYTHON}) + target_link_libraries(unit-test PRIVATE RasrPython) + add_python_dependencies(unit-test) +endif() + +if(${MODULE_NN}) + target_link_libraries(unit-test PRIVATE RasrNn) +endif() + +if(${MODULE_CART}) + target_link_libraries(unit-test PRIVATE RasrCart) +endif() + +if(${MODULE_MATH_NR}) + target_link_libraries(unit-test PRIVATE RasrMathNr) +endif() + +if(${MODULE_SEARCH_WFST}) + target_link_libraries(unit-test PRIVATE RasrSearchWfst) +endif() + +if(${MODULE_OPENFST}) + target_link_libraries(unit-test PRIVATE RasrOpenFst) +endif() + +if(${MODULE_TENSORFLOW}) + target_link_libraries(unit-test PRIVATE RasrTensorflow) + add_tf_dependencies(unit-test) +endif() diff --git a/src/Tools/AcousticModelTrainer/CMakeLists.txt b/src/Tools/AcousticModelTrainer/CMakeLists.txt index 6896c1f68..249b5d880 100644 --- a/src/Tools/AcousticModelTrainer/CMakeLists.txt +++ b/src/Tools/AcousticModelTrainer/CMakeLists.txt @@ -1,63 +1,64 @@ add_executable(acoustic-model-trainer AcousticModelTrainer.cc) add_install_executable(acoustic-model-trainer) -target_link_libraries(acoustic-model-trainer PRIVATE - RasrSpeech - RasrFlow - RasrAm - RasrMm - RasrLm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrMath - RasrMathLapack - RasrCore - RasrFsa - ${SEARCH_LIBS} -) +target_link_libraries( + acoustic-model-trainer + PRIVATE RasrSpeech + RasrFlow + RasrAm + RasrMm + RasrLm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrMath + RasrMathLapack + RasrCore + RasrFsa + ${SEARCH_LIBS}) add_executable(allophone-tool AllophoneTool.cc) add_install_executable(allophone-tool) -target_link_libraries(allophone-tool PRIVATE - RasrAm - RasrMm - RasrBliss - RasrFsa - RasrMc - RasrCore - RasrMathLapack -) - -if (${MODULE_CART}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrCart) - target_link_libraries(allophone-tool PRIVATE RasrCart) -endif () - -if (${MODULE_FLF_CORE}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrFlfCore) - target_link_libraries(allophone-tool PRIVATE RasrFlfCore) -endif () - -if (${MODULE_MATH_NR}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrMathNr) - target_link_libraries(allophone-tool PRIVATE RasrMathNr) -endif () - -if (${MODULE_ONNX}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrOnnx) -endif () - -if (${MODULE_PYTHON}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrPython) - add_python_dependencies(acoustic-model-trainer) -endif () - -if (${MODULE_NN}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrNn) -endif () - -if (${MODULE_TENSORFLOW}) - add_tf_dependencies(acoustic-model-trainer) - target_link_libraries(acoustic-model-trainer PRIVATE RasrTensorflow) -endif () +target_link_libraries( + allophone-tool + PRIVATE RasrAm + RasrMm + RasrBliss + RasrFsa + RasrMc + RasrCore + RasrMathLapack) + +if(${MODULE_CART}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrCart) + target_link_libraries(allophone-tool PRIVATE RasrCart) +endif() + +if(${MODULE_FLF_CORE}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrFlfCore) + target_link_libraries(allophone-tool PRIVATE RasrFlfCore) +endif() + +if(${MODULE_MATH_NR}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrMathNr) + target_link_libraries(allophone-tool PRIVATE RasrMathNr) +endif() + +if(${MODULE_ONNX}) + add_onnx_dependencies(acoustic-model-trainer) + target_link_libraries(acoustic-model-trainer PRIVATE RasrOnnx) +endif() + +if(${MODULE_PYTHON}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrPython) + add_python_dependencies(acoustic-model-trainer) +endif() + +if(${MODULE_NN}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrNn) +endif() + +if(${MODULE_TENSORFLOW}) + add_tf_dependencies(acoustic-model-trainer) + target_link_libraries(acoustic-model-trainer PRIVATE RasrTensorflow) +endif() diff --git a/src/Tools/Aligner/CMakeLists.txt b/src/Tools/Aligner/CMakeLists.txt index 0fd358bf8..8db54f88d 100644 --- a/src/Tools/Aligner/CMakeLists.txt +++ b/src/Tools/Aligner/CMakeLists.txt @@ -1,14 +1,13 @@ set(aligner_SOURCES - Aligner.cc - AlignAutomaton.cc - SimpleAlignAutomaton.cc - ZeroOrderAlignAutomaton.cc - Common.cc - ConditionalLexicon.cc - ConditionalLexiconPlain.cc - ConditionalLexiconSri.cc -) + Aligner.cc + AlignAutomaton.cc + SimpleAlignAutomaton.cc + ZeroOrderAlignAutomaton.cc + Common.cc + ConditionalLexicon.cc + ConditionalLexiconPlain.cc + ConditionalLexiconSri.cc) add_executable(aligner ${ALIGNER_SOURCES}) add_install_executable(aligner) -target_link_libraries(aligner PRIVATE RasrFsa RasrCore) \ No newline at end of file +target_link_libraries(aligner PRIVATE RasrFsa RasrCore) diff --git a/src/Tools/Archiver/CMakeLists.txt b/src/Tools/Archiver/CMakeLists.txt index 808cc67ff..d3d9d6602 100644 --- a/src/Tools/Archiver/CMakeLists.txt +++ b/src/Tools/Archiver/CMakeLists.txt @@ -1,50 +1,50 @@ add_executable(archiver Archiver.cc) add_install_executable(archiver) -target_link_libraries(archiver PRIVATE - RasrSpeech - RasrSearch - RasrAdvancedTreeSearch - RasrLattice - RasrLm - RasrFlf - RasrFlfCore - RasrMc - RasrAm - RasrMm - RasrCart - RasrSignal - RasrBliss - RasrMath - RasrMathLapack - RasrMathNr - RasrCore - RasrFlow - RasrFsa -) +target_link_libraries( + archiver + PRIVATE RasrSpeech + RasrSearch + RasrAdvancedTreeSearch + RasrLattice + RasrLm + RasrFlf + RasrFlfCore + RasrMc + RasrAm + RasrMm + RasrCart + RasrSignal + RasrBliss + RasrMath + RasrMathLapack + RasrMathNr + RasrCore + RasrFlow + RasrFsa) -if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - target_link_libraries(archiver PRIVATE RasrGenericSeq2SeqTreeSearch) -endif () +if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(archiver PRIVATE RasrGenericSeq2SeqTreeSearch) +endif() -if (${MODULE_PYTHON}) - target_link_libraries(archiver PRIVATE RasrPython) - add_python_dependencies(archiver) -endif () +if(${MODULE_PYTHON}) + target_link_libraries(archiver PRIVATE RasrPython) + add_python_dependencies(archiver) +endif() -if (${MODULE_NN}) - target_link_libraries(archiver PRIVATE RasrNn) -endif () +if(${MODULE_NN}) + target_link_libraries(archiver PRIVATE RasrNn) +endif() -if (${MODULE_SEARCH_WFST}) - target_link_libraries(archiver PRIVATE RasrSearchWfst) -endif () +if(${MODULE_SEARCH_WFST}) + target_link_libraries(archiver PRIVATE RasrSearchWfst) +endif() -if (${MODULE_OPENFST}) - target_link_libraries(archiver PRIVATE RasrOpenFst) -endif () +if(${MODULE_OPENFST}) + target_link_libraries(archiver PRIVATE RasrOpenFst) +endif() -if (${MODULE_LM_TFRNN}) - target_link_libraries(archiver PRIVATE RasrTensorflow) - add_tf_dependencies(archiver) -endif () +if(${MODULE_LM_TFRNN}) + target_link_libraries(archiver PRIVATE RasrTensorflow) + add_tf_dependencies(archiver) +endif() diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt index b3ae547ec..cd6449792 100644 --- a/src/Tools/CMakeLists.txt +++ b/src/Tools/CMakeLists.txt @@ -1,3 +1,3 @@ foreach(TOOL ${TOOLS}) - add_subdirectory(${TOOL}) -endforeach () \ No newline at end of file + add_subdirectory(${TOOL}) +endforeach() diff --git a/src/Tools/CorpusStatistics/CMakeLists.txt b/src/Tools/CorpusStatistics/CMakeLists.txt index c36703a35..8c70bf651 100644 --- a/src/Tools/CorpusStatistics/CMakeLists.txt +++ b/src/Tools/CorpusStatistics/CMakeLists.txt @@ -1,43 +1,43 @@ add_executable(costa Costa.cc) add_install_executable(costa) -target_link_libraries(costa PRIVATE - RasrLm - RasrMc - RasrBliss - RasrFsa - RasrFlfCore - RasrAudio - RasrSignal - RasrSpeech - RasrAm - RasrMm - RasrFlow - RasrCore - RasrMath - RasrMathLapack - RasrLattice - ${SEARCH_LIBS} -) +target_link_libraries( + costa + PRIVATE RasrLm + RasrMc + RasrBliss + RasrFsa + RasrFlfCore + RasrAudio + RasrSignal + RasrSpeech + RasrAm + RasrMm + RasrFlow + RasrCore + RasrMath + RasrMathLapack + RasrLattice + ${SEARCH_LIBS}) -if (${MODULE_CART}) - target_link_libraries(costa PRIVATE RasrCart) -endif () +if(${MODULE_CART}) + target_link_libraries(costa PRIVATE RasrCart) +endif() -if (${MODULE_MATH_NR}) - target_link_libraries(costa PRIVATE RasrMathNr) -endif () +if(${MODULE_MATH_NR}) + target_link_libraries(costa PRIVATE RasrMathNr) +endif() -if (${MODULE_PYTHON}) - target_link_libraries(costa PRIVATE RasrPython) - add_python_dependencies(costa) -endif () +if(${MODULE_PYTHON}) + target_link_libraries(costa PRIVATE RasrPython) + add_python_dependencies(costa) +endif() -if (${MODULE_NN}) - target_link_libraries(costa PRIVATE RasrNn) -endif () +if(${MODULE_NN}) + target_link_libraries(costa PRIVATE RasrNn) +endif() -if (${MODULE_TENSORFLOW}) - add_tf_dependencies(costa) - target_link_libraries(costa PRIVATE RasrTensorflow) -endif () +if(${MODULE_TENSORFLOW}) + add_tf_dependencies(costa) + target_link_libraries(costa PRIVATE RasrTensorflow) +endif() diff --git a/src/Tools/FeatureExtraction/CMakeLists.txt b/src/Tools/FeatureExtraction/CMakeLists.txt index c5e4f523c..ab87df577 100644 --- a/src/Tools/FeatureExtraction/CMakeLists.txt +++ b/src/Tools/FeatureExtraction/CMakeLists.txt @@ -1,46 +1,46 @@ add_executable(feature-extraction FeatureExtraction.cc FeatureExtractor.cc) add_install_executable(feature-extraction) -target_link_libraries(feature-extraction PRIVATE - RasrSpeech - RasrLattice - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - RasrCore - RasrFsa - ${SEARCH_LIBS} -) +target_link_libraries( + feature-extraction + PRIVATE RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrFsa + ${SEARCH_LIBS}) -if (${MODULE_CART}) - target_link_libraries(feature-extraction PRIVATE RasrCart) -endif () +if(${MODULE_CART}) + target_link_libraries(feature-extraction PRIVATE RasrCart) +endif() -if (${MODULE_FLF_CORE}) - target_link_libraries(feature-extraction PRIVATE RasrFlfCore) -endif () +if(${MODULE_FLF_CORE}) + target_link_libraries(feature-extraction PRIVATE RasrFlfCore) +endif() -if (${MODULE_MATH_NR}) - target_link_libraries(feature-extraction PRIVATE RasrMathNr) -endif () +if(${MODULE_MATH_NR}) + target_link_libraries(feature-extraction PRIVATE RasrMathNr) +endif() -if (${MODULE_PYTHON}) - target_link_libraries(feature-extraction PRIVATE RasrPython) - add_python_dependencies(feature-extraction) -endif () +if(${MODULE_PYTHON}) + target_link_libraries(feature-extraction PRIVATE RasrPython) + add_python_dependencies(feature-extraction) +endif() -if (${MODULE_NN}) - target_link_libraries(feature-extraction PRIVATE RasrNn) -endif () +if(${MODULE_NN}) + target_link_libraries(feature-extraction PRIVATE RasrNn) +endif() -if (${MODULE_TENSORFLOW}) - target_link_libraries(feature-extraction PRIVATE RasrTensorflow) - add_tf_dependencies(feature-extraction) -endif () +if(${MODULE_TENSORFLOW}) + target_link_libraries(feature-extraction PRIVATE RasrTensorflow) + add_tf_dependencies(feature-extraction) +endif() diff --git a/src/Tools/FeatureStatistics/CMakeLists.txt b/src/Tools/FeatureStatistics/CMakeLists.txt index 649154922..651b7f93e 100644 --- a/src/Tools/FeatureStatistics/CMakeLists.txt +++ b/src/Tools/FeatureStatistics/CMakeLists.txt @@ -1,46 +1,45 @@ add_executable(feature-statistics FeatureStatistics.cc) add_install_executable(feature-statistics) -target_link_libraries(feature-statistics PRIVATE - RasrSpeech - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrCore - RasrFsa -) - -if (${MODULE_CART}) - target_link_libraries(feature-statistics PRIVATE RasrCart) -endif () - -if (${MODULE_FLF_CORE}) - target_link_libraries(feature-statistics PRIVATE RasrFlfCore) -endif () - -if (${MODULE_MATH_NR}) - target_link_libraries(feature-statistics PRIVATE RasrMathNr) -endif () - -if (${MODULE_PYTHON}) - target_link_libraries(feature-statistics PRIVATE RasrPython) - add_python_dependencies(feature-statistics) -endif () - -if (${MODULE_NN}) - target_link_libraries(feature-statistics PRIVATE RasrNn) -endif () - -if (${MODULE_TENSORFLOW}) - target_link_libraries(feature-statistics PRIVATE RasrTensorflow) - add_tf_dependencies(feature-statistics) -endif () - +target_link_libraries( + feature-statistics + PRIVATE RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrCore + RasrFsa) + +if(${MODULE_CART}) + target_link_libraries(feature-statistics PRIVATE RasrCart) +endif() + +if(${MODULE_FLF_CORE}) + target_link_libraries(feature-statistics PRIVATE RasrFlfCore) +endif() + +if(${MODULE_MATH_NR}) + target_link_libraries(feature-statistics PRIVATE RasrMathNr) +endif() + +if(${MODULE_PYTHON}) + target_link_libraries(feature-statistics PRIVATE RasrPython) + add_python_dependencies(feature-statistics) +endif() + +if(${MODULE_NN}) + target_link_libraries(feature-statistics PRIVATE RasrNn) +endif() + +if(${MODULE_TENSORFLOW}) + target_link_libraries(feature-statistics PRIVATE RasrTensorflow) + add_tf_dependencies(feature-statistics) +endif() diff --git a/src/Tools/Flf/CMakeLists.txt b/src/Tools/Flf/CMakeLists.txt index 372ab9505..4d21cbe8f 100644 --- a/src/Tools/Flf/CMakeLists.txt +++ b/src/Tools/Flf/CMakeLists.txt @@ -1,54 +1,52 @@ add_executable(flf-tool FlfTool.cc) - -target_link_libraries(flf-tool PRIVATE - RasrFlf - RasrFlfCore - RasrSpeech - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrCore - RasrFsa - ${SEARCH_LIBS} - RasrLattice -) - -if (${MODULE_FLF_EXT}) - target_link_libraries(flf-tool PRIVATE RasrFlfExt) -endif () - -target_link_libraries(flf-tool PRIVATE - RasrSignal - RasrFlow - RasrMath - RasrMathLapack -) - -if (${MODULE_CART}) - target_link_libraries(flf-tool PRIVATE RasrCart) -endif () - -if (${MODULE_MATH_NR}) - target_link_libraries(flf-tool PRIVATE RasrMathNr) -endif () - -if (${MODULE_PYTHON}) - target_link_libraries(flf-tool PRIVATE RasrPython) - add_python_dependencies(flf-tool) -endif () - -if (${MODULE_NN}) - target_link_libraries(flf-tool PRIVATE RasrNn) -endif () - -if (${MODULE_ONNX}) - target_link_libraries(flf-tool PRIVATE RasrOnnx) -endif () - -if (${MODULE_TENSORFLOW}) - target_link_libraries(flf-tool PRIVATE RasrTensorflow) - add_tf_dependencies(flf-tool) -endif () +add_install_executable(flf-tool) + +target_link_libraries( + flf-tool + PRIVATE RasrFlf + RasrFlfCore + RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrCore + RasrFsa + ${SEARCH_LIBS} + RasrLattice) + +if(${MODULE_FLF_EXT}) + target_link_libraries(flf-tool PRIVATE RasrFlfExt) +endif() + +target_link_libraries(flf-tool PRIVATE RasrSignal RasrFlow RasrMath + RasrMathLapack) + +if(${MODULE_CART}) + target_link_libraries(flf-tool PRIVATE RasrCart) +endif() + +if(${MODULE_MATH_NR}) + target_link_libraries(flf-tool PRIVATE RasrMathNr) +endif() + +if(${MODULE_PYTHON}) + target_link_libraries(flf-tool PRIVATE RasrPython) + add_python_dependencies(flf-tool) +endif() + +if(${MODULE_NN}) + target_link_libraries(flf-tool PRIVATE RasrNn) +endif() + +if(${MODULE_ONNX}) + add_onnx_dependencies(flf-tool) + target_link_libraries(flf-tool PRIVATE RasrOnnx) +endif() + +if(${MODULE_TENSORFLOW}) + target_link_libraries(flf-tool PRIVATE RasrTensorflow) + add_tf_dependencies(flf-tool) +endif() diff --git a/src/Tools/Fsa/CMakeLists.txt b/src/Tools/Fsa/CMakeLists.txt index 1bae04362..5e72e586e 100644 --- a/src/Tools/Fsa/CMakeLists.txt +++ b/src/Tools/Fsa/CMakeLists.txt @@ -3,6 +3,6 @@ add_install_executable(fsa) target_link_libraries(fsa PRIVATE RasrFsa RasrCore) -if (${MODULE_OPENFST}) - target_link_libraries(fsa PRIVATE RasrOpenFst) -endif () \ No newline at end of file +if(${MODULE_OPENFST}) + target_link_libraries(fsa PRIVATE RasrOpenFst) +endif() diff --git a/src/Tools/LatticeProcessor/CMakeLists.txt b/src/Tools/LatticeProcessor/CMakeLists.txt index 80897e674..9e93381eb 100644 --- a/src/Tools/LatticeProcessor/CMakeLists.txt +++ b/src/Tools/LatticeProcessor/CMakeLists.txt @@ -1,43 +1,43 @@ add_executable(lattice-processor LatticeProcessor.cc) add_install_executable(lattice-processor) -target_link_libraries(lattice-processor PRIVATE - RasrSpeech - RasrLattice - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - RasrCore - RasrFsa - RasrFlfCore - ${SEARCH_LIBS} -) +target_link_libraries( + lattice-processor + PRIVATE RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrFsa + RasrFlfCore + ${SEARCH_LIBS}) -if (${MODULE_CART}) - target_link_libraries(lattice-processor PRIVATE RasrCart) -endif () +if(${MODULE_CART}) + target_link_libraries(lattice-processor PRIVATE RasrCart) +endif() -if (${MODULE_MATH_NR}) - target_link_libraries(lattice-processor PRIVATE RasrMathNr) -endif () +if(${MODULE_MATH_NR}) + target_link_libraries(lattice-processor PRIVATE RasrMathNr) +endif() -if (${MODULE_PYTHON}) - target_link_libraries(lattice-processor PRIVATE RasrPython) - add_python_dependencies(lattice-processor) -endif () +if(${MODULE_PYTHON}) + target_link_libraries(lattice-processor PRIVATE RasrPython) + add_python_dependencies(lattice-processor) +endif() -if (${MODULE_NN}) - target_link_libraries(lattice-processor PRIVATE RasrNn) -endif () +if(${MODULE_NN}) + target_link_libraries(lattice-processor PRIVATE RasrNn) +endif() -if (${MODULE_TENSORFLOW}) - target_link_libraries(lattice-processor PRIVATE RasrTensorflow) - add_tf_dependencies(lattice-processor) -endif () +if(${MODULE_TENSORFLOW}) + target_link_libraries(lattice-processor PRIVATE RasrTensorflow) + add_tf_dependencies(lattice-processor) +endif() diff --git a/src/Tools/Lm/CMakeLists.txt b/src/Tools/Lm/CMakeLists.txt index ec1d660c1..4383d6588 100644 --- a/src/Tools/Lm/CMakeLists.txt +++ b/src/Tools/Lm/CMakeLists.txt @@ -1,45 +1,44 @@ add_executable(lm-util LmUtilityTool.cc) add_install_executable(lm-util) -target_link_libraries(lm-util PRIVATE - RasrFlf - RasrFlfCore - RasrSpeech - RasrAm - RasrMc - RasrBliss - RasrNn - RasrMm - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrLattice - RasrFsa - RasrLm - RasrCore -) +target_link_libraries( + lm-util + PRIVATE RasrFlf + RasrFlfCore + RasrSpeech + RasrAm + RasrMc + RasrBliss + RasrNn + RasrMm + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrLattice + RasrFsa + RasrLm + RasrCore) -if (${MODULE_FLF_EXT}) - target_link_libraries(lm-util PRIVATE RasrFlfExt) -endif () +if(${MODULE_FLF_EXT}) + target_link_libraries(lm-util PRIVATE RasrFlfExt) +endif() -if (${MODULE_CART}) - target_link_libraries(lm-util PRIVATE RasrCart) -endif () +if(${MODULE_CART}) + target_link_libraries(lm-util PRIVATE RasrCart) +endif() -if (${MODULE_MATH_NR}) - target_link_libraries(lm-util PRIVATE RasrMathNr) -endif () +if(${MODULE_MATH_NR}) + target_link_libraries(lm-util PRIVATE RasrMathNr) +endif() -if (${MODULE_PYTHON}) - target_link_libraries(lm-util PRIVATE RasrPython) - add_python_dependencies(lm-util) -endif () - -if (${MODULE_TENSORFLOW}) - target_link_libraries(lm-util PRIVATE RasrTensorflow) - add_tf_dependencies(lm-util) -endif () +if(${MODULE_PYTHON}) + target_link_libraries(lm-util PRIVATE RasrPython) + add_python_dependencies(lm-util) +endif() +if(${MODULE_TENSORFLOW}) + target_link_libraries(lm-util PRIVATE RasrTensorflow) + add_tf_dependencies(lm-util) +endif() diff --git a/src/Tools/Math/CMakeLists.txt b/src/Tools/Math/CMakeLists.txt index ab50eceee..f04a4e8e6 100644 --- a/src/Tools/Math/CMakeLists.txt +++ b/src/Tools/Math/CMakeLists.txt @@ -1,9 +1,5 @@ add_executable(matrix-tool MatrixTool.cc) add_install_executable(matrix-tool) -target_link_libraries(matrix-tool PRIVATE - RasrMath - RasrMathNr - RasrMathLapack - RasrCore -) \ No newline at end of file +target_link_libraries(matrix-tool PRIVATE RasrMath RasrMathNr RasrMathLapack + RasrCore) diff --git a/src/Tools/NnTrainer/CMakeLists.txt b/src/Tools/NnTrainer/CMakeLists.txt index d82577681..4a1291075 100644 --- a/src/Tools/NnTrainer/CMakeLists.txt +++ b/src/Tools/NnTrainer/CMakeLists.txt @@ -1,42 +1,44 @@ add_executable(nn-trainer NnTrainer.cc) add_install_executable(nn-trainer) -target_link_libraries(nn-trainer PRIVATE - RasrAm - RasrAudio - RasrBliss - RasrFlow - RasrLm - RasrMathLapack - RasrMath - RasrMc - RasrMm - RasrSignal - RasrSpeech - ${SEARCH_LIBS} - RasrNn - RasrFsa - RasrCore -) +target_link_libraries( + nn-trainer + PRIVATE RasrAm + RasrAudio + RasrBliss + RasrFlow + RasrLm + RasrMathLapack + RasrMath + RasrMc + RasrMm + RasrSignal + RasrSpeech + ${SEARCH_LIBS} + RasrNn + RasrFsa + RasrCore) -if (${MODULE_CART}) - target_link_libraries(nn-trainer PRIVATE RasrCart) -endif () +target_compile_options(nn-trainer PRIVATE "-fexceptions") -if (${MODULE_FLF_CORE}) - target_link_libraries(nn-trainer PRIVATE RasrFlfCore) -endif () +if(${MODULE_CART}) + target_link_libraries(nn-trainer PRIVATE RasrCart) +endif() -if (${MODULE_MATH_NR}) - target_link_libraries(nn-trainer PRIVATE RasrMathNr) -endif () +if(${MODULE_FLF_CORE}) + target_link_libraries(nn-trainer PRIVATE RasrFlfCore) +endif() -if (${MODULE_PYTHON}) - target_link_libraries(nn-trainer PRIVATE RasrPython) - add_python_dependencies(nn-trainer) -endif () +if(${MODULE_MATH_NR}) + target_link_libraries(nn-trainer PRIVATE RasrMathNr) +endif() -if (${MODULE_TENSORFLOW}) - target_link_libraries(nn-trainer PRIVATE RasrTensorflow) - add_tf_dependencies(nn-trainer) -endif () \ No newline at end of file +if(${MODULE_PYTHON}) + target_link_libraries(nn-trainer PRIVATE RasrPython) + add_python_dependencies(nn-trainer) +endif() + +if(${MODULE_TENSORFLOW}) + target_link_libraries(nn-trainer PRIVATE RasrTensorflow) + add_tf_dependencies(nn-trainer) +endif() diff --git a/src/Tools/SpeechRecognizer/CMakeLists.txt b/src/Tools/SpeechRecognizer/CMakeLists.txt index ece73ed8c..acfe2016c 100644 --- a/src/Tools/SpeechRecognizer/CMakeLists.txt +++ b/src/Tools/SpeechRecognizer/CMakeLists.txt @@ -2,59 +2,63 @@ add_executable(speech-recognizer SpeechRecognizer.cc) add_install_executable(speech-recognizer) set(SpeechRecognizer_LIBRARIES - RasrSpeech - RasrLattice - RasrAm - RasrLm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrCore - RasrFsa -) - -if (${MODULE_CART}) - list(APPEND SpeechRecognizer_LIBRARIES RasrCart) -endif () - -if (${MODULE_FLF_CORE}) - list(APPEND SpeechRecognizer_LIBRARIES RasrFlfCore) -endif () - -if (${MODULE_MATH_NR}) - list(APPEND SpeechRecognizer_LIBRARIES RasrMathNr) -endif () - -if (${MODULE_SEARCH_WFST}) - list(APPEND SpeechRecognizer_LIBRARIES RasrSearchWfst) -endif () - -if (${MODULE_PYTHON}) - list(APPEND SpeechRecognizer_LIBRARIES RasrPython) -endif () - -if (${MODULE_ONNX}) - list(APPEND SpeechRecognizer_LIBRARIES RasrOnnx) -endif () - -if (${MODULE_NN}) - list(APPEND SpeechRecognizer_LIBRARIES RasrNn) -endif () - -if (${MODULE_NN}) - list(APPEND SpeechRecognizer_LIBRARIES RasrTensorflow) -endif () + RasrSpeech + RasrLattice + RasrAm + RasrLm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrCore + RasrFsa) + +if(${MODULE_CART}) + list(APPEND SpeechRecognizer_LIBRARIES RasrCart) +endif() + +if(${MODULE_FLF_CORE}) + list(APPEND SpeechRecognizer_LIBRARIES RasrFlfCore) +endif() + +if(${MODULE_MATH_NR}) + list(APPEND SpeechRecognizer_LIBRARIES RasrMathNr) +endif() + +if(${MODULE_SEARCH_WFST}) + list(APPEND SpeechRecognizer_LIBRARIES RasrSearchWfst) +endif() + +if(${MODULE_PYTHON}) + list(APPEND SpeechRecognizer_LIBRARIES RasrPython) +endif() + +if(${MODULE_ONNX}) + list(APPEND SpeechRecognizer_LIBRARIES RasrOnnx) +endif() + +if(${MODULE_NN}) + list(APPEND SpeechRecognizer_LIBRARIES RasrNn) +endif() + +if(${MODULE_TENSORFLOW}) + list(APPEND SpeechRecognizer_LIBRARIES RasrTensorflow) +endif() target_link_libraries(speech-recognizer PRIVATE ${SpeechRecognizer_LIBRARIES}) -if (${MODULE_SEARCH_WFST}) - add_executable(fsa-search-builder FsaSearchBuilder.cc) - add_install_executable(fsa-search-builder) - target_link_libraries(fsa-search-builder PRIVATE ${SpeechRecognizer_LIBRARIES}) -endif () \ No newline at end of file +if(${MODULE_ONNX}) + add_onnx_dependencies(speech-recognizer) +endif() + +if(${MODULE_SEARCH_WFST}) + add_executable(fsa-search-builder FsaSearchBuilder.cc) + add_install_executable(fsa-search-builder) + target_link_libraries(fsa-search-builder + PRIVATE ${SpeechRecognizer_LIBRARIES}) +endif() From f9a48be74cbf870943565e8b6a117578a5c521fd Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 15 Mar 2024 13:32:40 +0100 Subject: [PATCH 09/13] Add check executables --- CMakeLists.txt | 42 +-- cmake_resources/ConfigurationTypes.cmake | 12 +- cmake_resources/Modules.cmake | 78 +++-- cmake_resources/Onnx.cmake | 8 +- cmake_resources/Python.cmake | 7 +- cmake_resources/Tensorflow.cmake | 80 +++-- src/Am/CMakeLists.txt | 63 ++-- src/Audio/CMakeLists.txt | 33 +- src/Bliss/CMakeLists.txt | 55 ++-- src/CMakeLists.txt | 48 +-- src/Cart/CMakeLists.txt | 19 +- src/Core/CMakeLists.txt | 99 +++--- src/Flf/CMakeLists.txt | 156 ++++----- src/Flf/FlfCore/CMakeLists.txt | 5 +- src/Flow/CMakeLists.txt | 53 ++-- src/Fsa/CMakeLists.txt | 72 +++-- src/Lattice/CMakeLists.txt | 84 ++--- src/Lm/CMakeLists.txt | 146 ++++----- src/Math/CMakeLists.txt | 38 ++- src/Math/Lapack/CMakeLists.txt | 5 +- src/Math/Nr/CMakeLists.txt | 5 +- src/Mm/CMakeLists.txt | 129 ++++---- src/Nn/CMakeLists.txt | 133 ++++---- src/Onnx/CMakeLists.txt | 6 +- src/OpenFst/CMakeLists.txt | 3 + src/Python/CMakeLists.txt | 5 + src/Search/CMakeLists.txt | 55 ++-- src/Search/Wfst/CMakeLists.txt | 6 + src/Signal/CMakeLists.txt | 165 +++++----- src/Speech/CMakeLists.txt | 299 +++++++++--------- src/Tensorflow/CMakeLists.txt | 22 +- src/Test/CMakeLists.txt | 212 ++++++------- src/Tools/AcousticModelTrainer/CMakeLists.txt | 100 +++--- src/Tools/Aligner/CMakeLists.txt | 16 +- src/Tools/Archiver/CMakeLists.txt | 80 ++--- src/Tools/CMakeLists.txt | 6 +- src/Tools/CorpusStatistics/CMakeLists.txt | 68 ++-- src/Tools/FeatureExtraction/CMakeLists.txt | 72 ++--- src/Tools/FeatureStatistics/CMakeLists.txt | 70 ++-- src/Tools/Flf/CMakeLists.txt | 92 +++--- src/Tools/Fsa/CMakeLists.txt | 6 +- src/Tools/LatticeProcessor/CMakeLists.txt | 68 ++-- src/Tools/Lm/CMakeLists.txt | 70 ++-- src/Tools/Math/CMakeLists.txt | 2 +- src/Tools/NnTrainer/CMakeLists.txt | 66 ++-- src/Tools/SpeechRecognizer/CMakeLists.txt | 96 +++--- 46 files changed, 1517 insertions(+), 1438 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e006d1f75..bcf029057 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,37 +5,41 @@ include(cmake_resources/ConfigurationTypes.cmake) include(cmake_resources/Modules.cmake) include(cmake_resources/UniversalSettings.cmake) -if(${MODULE_PYTHON}) - include(cmake_resources/Python.cmake) -endif() +if (${MODULE_PYTHON}) + include(cmake_resources/Python.cmake) +endif () -if(${MODULE_TENSORFLOW}) - include(cmake_resources/Tensorflow.cmake) -endif() +if (${MODULE_TENSORFLOW}) + include(cmake_resources/Tensorflow.cmake) +endif () + +if (${MODULE_ONNX}) + include(cmake_resources/Onnx.cmake) +endif () string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME) string(TOLOWER ${CMAKE_BUILD_TYPE} BUILD_TYPE) set(ARCH_DESCRIPTION - "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_TYPE}") + "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_TYPE}") set(CMAKE_INSTALL_PREFIX - "${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH_DESCRIPTION}/") + "${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH_DESCRIPTION}/") function(add_install_executable EXECUTABLE_NAME) - install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION .) - set_target_properties( - ${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME - "${EXECUTABLE_NAME}.${ARCH_DESCRIPTION}") + install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION .) + set_target_properties( + ${EXECUTABLE_NAME} PROPERTIES OUTPUT_NAME + "${EXECUTABLE_NAME}.${ARCH_DESCRIPTION}") endfunction() add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc - COMMAND - ${CMAKE_COMMAND} -E copy - ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.release - ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.release) + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc + COMMAND + ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.release + ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.release) add_custom_target(SourceVersion - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc) + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc) add_subdirectory(src/) diff --git a/cmake_resources/ConfigurationTypes.cmake b/cmake_resources/ConfigurationTypes.cmake index 4060c7b95..2ddc4300e 100644 --- a/cmake_resources/ConfigurationTypes.cmake +++ b/cmake_resources/ConfigurationTypes.cmake @@ -1,12 +1,10 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "standard" "debug" - "release") + "release") -if(NOT CMAKE_BUILD_TYPE) - message(STATUS "Setting build type to 'standard' as none was specified.") - set(CMAKE_BUILD_TYPE - standard - CACHE STRING "Choose the type of build." FORCE) -endif() +if (NOT CMAKE_BUILD_TYPE) + message(STATUS "Setting build type to 'standard' as none was specified.") + set(CMAKE_BUILD_TYPE standard CACHE STRING "Choose the type of build." FORCE) +endif () set(CMAKE_C_FLAGS_STANDARD "-O2") set(CMAKE_CXX_FLAGS_STANDARD "-O2") diff --git a/cmake_resources/Modules.cmake b/cmake_resources/Modules.cmake index 5771f3f61..687ef03b0 100644 --- a/cmake_resources/Modules.cmake +++ b/cmake_resources/Modules.cmake @@ -1,25 +1,23 @@ function(add_module_option MODULE_NAME DEFAULT_VALUE) - option(${MODULE_NAME} "Enable module ${MODULE_NAME}" ${DEFAULT_VALUE}) - if(${MODULE_NAME}) - add_compile_definitions(${MODULE_NAME}) - message(STATUS "Module ${MODULE_NAME} is enabled") - else() - message(STATUS "Module ${MODULE_NAME} disabled") - endif() + option(${MODULE_NAME} "Enable module ${MODULE_NAME}" ${DEFAULT_VALUE}) + if (${MODULE_NAME}) + add_compile_definitions(${MODULE_NAME}) + message(STATUS "Module ${MODULE_NAME} is enabled") + else () + message(STATUS "Module ${MODULE_NAME} disabled") + endif () endfunction() set(TOOLS "") function(add_tool_option TOOL_NAME DEFAULT_VALUE) - option(${TOOL_NAME} "Enable tool ${TOOL_NAME}" ${DEFAULT_VALUE}) - if(${TOOL_NAME}) - set(TOOLS - ${TOOLS} ${TOOL_NAME} - PARENT_SCOPE) - message(STATUS "Tool ${TOOL_NAME} is enabled") - else() - message(STATUS "Tool ${TOOL_NAME} is disabled") - endif() + option(${TOOL_NAME} "Enable tool ${TOOL_NAME}" ${DEFAULT_VALUE}) + if (${TOOL_NAME}) + set(TOOLS ${TOOLS} ${TOOL_NAME} PARENT_SCOPE) + message(STATUS "Tool ${TOOL_NAME} is enabled") + else () + message(STATUS "Tool ${TOOL_NAME} is disabled") + endif () endfunction() # ****** Adaptation ****** @@ -114,7 +112,7 @@ add_module_option(MODULE_CUDA OFF) add_module_option(MODULE_TENSORFLOW ON) # ****** ONNX integration ****** -add_module_option(MODULE_ONNX OFF) +add_module_option(MODULE_ONNX ON) # ****** Tools ****** add_tool_option(AcousticModelTrainer ON) @@ -127,31 +125,31 @@ add_tool_option(Lm ON) add_tool_option(SpeechRecognizer ON) add_tool_option(Xml ON) -if(${MODULE_CART}) - add_tool_option(Cart ON) -endif() +if (${MODULE_CART}) + add_tool_option(Cart ON) +endif () -if(${MODULE_MM_DT} - AND ${MODULE_LATTICE_DT} - AND ${MODULE_SPEECH_DT}) - add_tool_option(LatticeProcessor ON) -endif() +if (${MODULE_MM_DT} + AND ${MODULE_LATTICE_DT} + AND ${MODULE_SPEECH_DT}) + add_tool_option(LatticeProcessor ON) +endif () -if(${MODULE_FLF}) - add_tool_option(Flf ON) -endif() +if (${MODULE_FLF}) + add_tool_option(Flf ON) +endif () -if(${MODULE_NN}) - add_tool_option(NnTrainer ON) -endif() +if (${MODULE_NN}) + add_tool_option(NnTrainer ON) +endif () set(SEARCH_LIBS RasrSearch) -if(${MODULE_SEARCH_WFST}) - list(APPEND SEARCH_LIBS RasrSearchWfst RasrOpenFst) -endif() -if(${MODULE_ADVANCED_TREE_SEARCH}) - list(APPEND SEARCH_LIBS RasrAdvancedTreeSearch) -endif() -if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - list(APPEND SEARCH_LIBS RasrGenericSeq2SeqTreeSearch) -endif() +if (${MODULE_SEARCH_WFST}) + list(APPEND SEARCH_LIBS RasrSearchWfst RasrOpenFst) +endif () +if (${MODULE_ADVANCED_TREE_SEARCH}) + list(APPEND SEARCH_LIBS RasrAdvancedTreeSearch) +endif () +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + list(APPEND SEARCH_LIBS RasrGenericSeq2SeqTreeSearch) +endif () diff --git a/cmake_resources/Onnx.cmake b/cmake_resources/Onnx.cmake index e28e8abf8..ba9f8c568 100644 --- a/cmake_resources/Onnx.cmake +++ b/cmake_resources/Onnx.cmake @@ -1,9 +1,9 @@ set(onnx_INCLUDE_DIR "/opt/thirdparty/usr/include") -find_library(onnxruntime_LIBRARY onnxruntime PATHS "/opt/thirdparty/usr/lib") +find_library(onnxruntime_LIBRARY onnxruntime REQUIRED HINTS "/opt/thirdparty/usr/lib") function(add_onnx_dependencies TARGET) - target_compile_options(${TARGET} PUBLIC "-fexceptions") - target_include_directories(${TARGET} PUBLIC ${onnx_INCLUDE_DIR}) - target_link_libraries(${TARGET} PUBLIC ${onnxruntime_LIBRARY}) + target_compile_options(${TARGET} PUBLIC "-fexceptions") + target_include_directories(${TARGET} PUBLIC ${onnx_INCLUDE_DIR}) + target_link_libraries(${TARGET} PUBLIC ${onnxruntime_LIBRARY}) endfunction() diff --git a/cmake_resources/Python.cmake b/cmake_resources/Python.cmake index 9c48b1c74..edb4740ce 100644 --- a/cmake_resources/Python.cmake +++ b/cmake_resources/Python.cmake @@ -1,8 +1,7 @@ find_package(Python3 REQUIRED COMPONENTS Development NumPy) function(add_python_dependencies TARGET) - target_compile_definitions(${TARGET} PUBLIC ${Python3_DEFINITIONS}) - target_include_directories(${TARGET} PUBLIC ${Python3_INCLUDE_DIRS} - ${Python3_NumPy_INCLUDE_DIRS}) - target_link_libraries(${TARGET} PUBLIC ${Python3_LIBRARIES}) + target_compile_definitions(${TARGET} PUBLIC ${Python3_DEFINITIONS}) + target_include_directories(${TARGET} PUBLIC ${Python3_INCLUDE_DIRS} ${Python3_NumPy_INCLUDE_DIRS}) + target_link_libraries(${TARGET} PUBLIC ${Python3_LIBRARIES}) endfunction() diff --git a/cmake_resources/Tensorflow.cmake b/cmake_resources/Tensorflow.cmake index 01de86766..f66d79f94 100644 --- a/cmake_resources/Tensorflow.cmake +++ b/cmake_resources/Tensorflow.cmake @@ -2,60 +2,58 @@ find_package(Python3 REQUIRED COMPONENTS Interpreter) # Get the TensorFlow include directory by executing a Python command execute_process( - COMMAND "${Python3_EXECUTABLE}" -c - "import tensorflow as tf; print(tf.sysconfig.get_include())" - RESULT_VARIABLE _tensorflow_include_res - OUTPUT_VARIABLE Tensorflow_INCLUDE_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) + COMMAND "${Python3_EXECUTABLE}" -c + "import tensorflow as tf; print(tf.sysconfig.get_include())" + RESULT_VARIABLE _tensorflow_include_res + OUTPUT_VARIABLE Tensorflow_INCLUDE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process( - COMMAND "${Python3_EXECUTABLE}" -c - "import tensorflow as tf; print(tf.sysconfig.get_lib())" - RESULT_VARIABLE _tensorflow_lib_res - OUTPUT_VARIABLE Tensorflow_LIB_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) + COMMAND "${Python3_EXECUTABLE}" -c + "import tensorflow as tf; print(tf.sysconfig.get_lib())" + RESULT_VARIABLE _tensorflow_lib_res + OUTPUT_VARIABLE Tensorflow_LIB_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) # Check if we got the include directory -if(NOT _tensorflow_include_res EQUAL "0") - message(FATAL_ERROR "Failed to get TensorFlow include directory") -endif() +if (NOT _tensorflow_include_res EQUAL "0") + message(FATAL_ERROR "Failed to get TensorFlow include directory") +endif () # Output the found directory for debugging purposes message(STATUS "Tensorflow include directory: ${Tensorflow_INCLUDE_DIR}") find_library( - Tensorflow_CC - NAMES tensorflow_cc - HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow - PATH_SUFFIXES lib REQUIRED) + Tensorflow_CC + NAMES tensorflow_cc + HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow + PATH_SUFFIXES lib REQUIRED) find_library( - Tensorflow_FRAMEWORK - NAMES tensorflow_framework - HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow - PATH_SUFFIXES lib REQUIRED) - -if(Tensorflow_CC) - message(STATUS "Tensorflow CC library found at ${Tensorflow_CC}") -else() - message(FATAL_ERROR "Tensorflow CC library not found") -endif() - -if(Tensorflow_FRAMEWORK) - message( - STATUS "Tensorflow Framework library found at ${Tensorflow_FRAMEWORK}") -else() - message(FATAL_ERROR "TensorFlow Framework library not found") -endif() + Tensorflow_FRAMEWORK + NAMES tensorflow_framework + HINTS ${Tensorflow_LIB_DIR} /usr/local/lib/tensorflow + PATH_SUFFIXES lib REQUIRED) + +if (Tensorflow_CC) + message(STATUS "Tensorflow CC library found at ${Tensorflow_CC}") +else () + message(FATAL_ERROR "Tensorflow CC library not found") +endif () + +if (Tensorflow_FRAMEWORK) + message( + STATUS "Tensorflow Framework library found at ${Tensorflow_FRAMEWORK}") +else () + message(FATAL_ERROR "TensorFlow Framework library not found") +endif () find_package(OpenSSL REQUIRED) function(add_tf_dependencies TARGET) - target_compile_options(${TARGET} PUBLIC "-fexceptions") - target_include_directories(${TARGET} PUBLIC ${Tensorflow_INCLUDE_DIR}) - target_link_options(${TARGET} PUBLIC "LINKER:--no-as-needed" - "LINKER:--allow-multiple-definition") - target_link_libraries(${TARGET} PUBLIC OpenSSL::Crypto) - target_link_libraries(${TARGET} PUBLIC ${Tensorflow_CC} - ${Tensorflow_FRAMEWORK}) + target_compile_options(${TARGET} PUBLIC "-fexceptions") + target_include_directories(${TARGET} PUBLIC ${Tensorflow_INCLUDE_DIR}) + target_link_options(${TARGET} PUBLIC "LINKER:--no-as-needed" "LINKER:--allow-multiple-definition") + target_link_libraries(${TARGET} PUBLIC OpenSSL::Crypto) + target_link_libraries(${TARGET} PUBLIC ${Tensorflow_CC} ${Tensorflow_FRAMEWORK}) endfunction() diff --git a/src/Am/CMakeLists.txt b/src/Am/CMakeLists.txt index f0ff43fcf..b508a4196 100644 --- a/src/Am/CMakeLists.txt +++ b/src/Am/CMakeLists.txt @@ -1,39 +1,42 @@ set(Am_SOURCES - AcousticModel.cc - AcousticModelAdaptor.cc - ClassicAcousticModel.cc - ClassicHmmTopologySet.cc - ClassicStateModel.cc - ClassicStateTying.cc - ClassicTransducerBuilder.cc - Module.cc - TransitionModel.cc - Utilities.cc) + AcousticModel.cc + AcousticModelAdaptor.cc + ClassicAcousticModel.cc + ClassicHmmTopologySet.cc + ClassicStateModel.cc + ClassicStateTying.cc + ClassicTransducerBuilder.cc + Module.cc + TransitionModel.cc + Utilities.cc) -if(${MODULE_CART}) - list(APPEND Am_SOURCES DecisionTreeStateTying.cc ClassicDecisionTree.cc) -endif() +if (${MODULE_CART}) + list(APPEND Am_SOURCES DecisionTreeStateTying.cc ClassicDecisionTree.cc) +endif () -if(${MODULE_ADAPT_MLLR}) - list(APPEND Am_SOURCES AdaptedAcousticModel.cc AdaptationTree.cc) -endif() +if (${MODULE_ADAPT_MLLR}) + list(APPEND Am_SOURCES AdaptedAcousticModel.cc AdaptationTree.cc) +endif () add_library(RasrAm ${Am_SOURCES}) target_link_libraries( - RasrAm - INTERFACE RasrMm - RasrBliss - RasrFsa - RasrCore - RasrMc - RasrMath - RasrMathLapack) + RasrAm + INTERFACE RasrMm + RasrBliss + RasrFsa + RasrCore + RasrMc + RasrMath + RasrMathLapack) -if(${MODULE_CART}) - target_link_libraries(RasrAm INTERFACE RasrCart) -endif() +if (${MODULE_CART}) + target_link_libraries(RasrAm INTERFACE RasrCart) +endif () -if(${MODULE_MATH_NR}) - target_link_libraries(RasrAm INTERFACE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(RasrAm INTERFACE RasrMathNr) +endif () + +add_executable(check-am check.cc) +target_link_libraries(check-am PRIVATE RasrAm) diff --git a/src/Audio/CMakeLists.txt b/src/Audio/CMakeLists.txt index d07803eb9..e818582a9 100644 --- a/src/Audio/CMakeLists.txt +++ b/src/Audio/CMakeLists.txt @@ -1,25 +1,28 @@ set(Audio_SOURCES Module.cc Node.cc) -if(${MODULE_AUDIO_FFMPEG}) - list(APPEND Audio_SOURCES Ffmpeg.cc) -endif() +if (${MODULE_AUDIO_FFMPEG}) + list(APPEND Audio_SOURCES Ffmpeg.cc) +endif () -if(${MODULE_AUDIO_FLAC}) - list(APPEND Audio_SOURCES Flac.cc flac/FlacDecoder.cc) -endif() +if (${MODULE_AUDIO_FLAC}) + list(APPEND Audio_SOURCES Flac.cc flac/FlacDecoder.cc) +endif () -if(${SYSTEM_NAME} STREQUAL "linux" AND ${MODULE_AUDIO_OSS}) - list(APPEND Audio_SOURCES Oss.cc) -endif() +if (${SYSTEM_NAME} STREQUAL "linux" AND ${MODULE_AUDIO_OSS}) + list(APPEND Audio_SOURCES Oss.cc) +endif () -if(${MODULE_AUDIO_RAW}) - list(APPEND Audio_SOURCES Raw.cc) -endif() +if (${MODULE_AUDIO_RAW}) + list(APPEND Audio_SOURCES Raw.cc) +endif () -if(${MODULE_AUDIO_WAV_SYSTEM}) - list(APPEND Audio_SOURCES Wav.cc) -endif() +if (${MODULE_AUDIO_WAV_SYSTEM}) + list(APPEND Audio_SOURCES Wav.cc) +endif () add_library(RasrAudio STATIC ${Audio_SOURCES}) target_link_libraries(RasrAudio INTERFACE RasrFlow RasrCore) + +add_executable(check-audio check.cc) +target_link_libraries(check-audio PRIVATE RasrAudio) \ No newline at end of file diff --git a/src/Bliss/CMakeLists.txt b/src/Bliss/CMakeLists.txt index caf7cd572..adf12c649 100644 --- a/src/Bliss/CMakeLists.txt +++ b/src/Bliss/CMakeLists.txt @@ -1,34 +1,37 @@ set(Bliss_SOURCES - CorpusDescription.cc - CorpusKey.cc - CorpusParser.cc - CorpusStatistics.cc - EditDistance.cc - Evaluation.cc - Fsa.cc - Lexicon.cc - LexiconParser.cc - Orthography.cc - Phoneme.cc - Phonology.cc - PrefixTree.cc - SegmentOrdering.cc - Symbol.cc - Unknown.cc) + CorpusDescription.cc + CorpusKey.cc + CorpusParser.cc + CorpusStatistics.cc + EditDistance.cc + Evaluation.cc + Fsa.cc + Lexicon.cc + LexiconParser.cc + Orthography.cc + Phoneme.cc + Phonology.cc + PrefixTree.cc + SegmentOrdering.cc + Symbol.cc + Unknown.cc) -if(${MODULE_THEANO_INTERFACE}) - list(APPEND Bliss_SOURCES TheanoCommunicator.cc - TheanoSegmentOrderingVisitor.cc) -endif() +if (${MODULE_THEANO_INTERFACE}) + list(APPEND Bliss_SOURCES TheanoCommunicator.cc + TheanoSegmentOrderingVisitor.cc) +endif () -if(${MODULE_PYTHON}) - list(APPEND Bliss_SOURCES PythonSegmentOrdering.cc) -endif() +if (${MODULE_PYTHON}) + list(APPEND Bliss_SOURCES PythonSegmentOrdering.cc) +endif () add_library(RasrBliss ${Bliss_SOURCES}) target_link_libraries(RasrBliss INTERFACE RasrFsa RasrMath RasrCore) -if(${MODULE_PYTHON}) - add_python_dependencies(RasrBliss) -endif() +if (${MODULE_PYTHON}) + add_python_dependencies(RasrBliss) +endif () + +add_executable(check-bliss check.cc) +target_link_libraries(check-bliss PRIVATE RasrBliss) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 26911f7e0..2c38fc28d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,34 +14,34 @@ add_subdirectory(Signal) add_subdirectory(Speech) add_subdirectory(Tools) -if(${MODULE_CART}) - add_subdirectory(Cart) -endif() +if (${MODULE_CART}) + add_subdirectory(Cart) +endif () -if(${MODULE_FLF}) - add_subdirectory(Flf) -endif() +if (${MODULE_FLF}) + add_subdirectory(Flf) +endif () -if(${MODULE_OPENFST}) - add_subdirectory(OpenFst) -endif() +if (${MODULE_OPENFST}) + add_subdirectory(OpenFst) +endif () -if(${MODULE_NN}) - add_subdirectory(Nn) -endif() +if (${MODULE_NN}) + add_subdirectory(Nn) +endif () -if(${MODULE_ONNX}) - add_subdirectory(Onnx) -endif() +if (${MODULE_ONNX}) + add_subdirectory(Onnx) +endif () -if(${MODULE_PYTHON}) - add_subdirectory(Python) -endif() +if (${MODULE_PYTHON}) + add_subdirectory(Python) +endif () -if(${MODULE_TENSORFLOW}) - add_subdirectory(Tensorflow) -endif() +if (${MODULE_TENSORFLOW}) + add_subdirectory(Tensorflow) +endif () -if(${MODULE_TEST}) - add_subdirectory(Test) -endif() +if (${MODULE_TEST}) + add_subdirectory(Test) +endif () diff --git a/src/Cart/CMakeLists.txt b/src/Cart/CMakeLists.txt index c0a79b114..8bf04f207 100644 --- a/src/Cart/CMakeLists.txt +++ b/src/Cart/CMakeLists.txt @@ -1,13 +1,16 @@ set(Cart_SOURCES - Conditions.cc - Properties.cc - Example.cc - BinaryTree.cc - DecisionTree.cc - Cluster.cc - DecisionTreeTrainer.cc - Parser.cc) + Conditions.cc + Properties.cc + Example.cc + BinaryTree.cc + DecisionTree.cc + Cluster.cc + DecisionTreeTrainer.cc + Parser.cc) add_library(RasrCart STATIC ${Cart_SOURCES}) target_link_libraries(RasrCart INTERFACE RasrCore) + +add_executable(check-cart check.cc) +target_link_libraries(check-cart PRIVATE RasrCart) \ No newline at end of file diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt index d207ce110..d02d9344e 100644 --- a/src/Core/CMakeLists.txt +++ b/src/Core/CMakeLists.txt @@ -1,59 +1,62 @@ set(Core_SOURCES - Application.cc - Archive.cc - ArithmeticExpressionParser.cc - Assertions.cc - BinaryStream.cc - BinaryTree.cc - BundleArchive.cc - CacheManager.cc - Channel.cc - Choice.cc - CodeGenerator.cc - Component.cc - CompressedStream.cc - Configuration.cc - Debug.cc - Dependency.cc - Description.cc - Directory.cc - DirectoryArchive.cc - FileArchive.cc - FormatSet.cc - IoUtilities.cc - MappedArchive.cc - MemoryInfo.cc - MD5.cc - MurmurHash.cc - Parameter.cc - ProgressIndicator.cc - ReferenceCounting.cc - ResourceUsageInfo.cc - Statistics.cc - StringExpression.cc - StringUtilities.cc - TextStream.cc - Tokenizer.cc - Types.cc - Unicode.cc - Utility.cc - Version.cc - XmlBuilder.cc - XmlBuilder2.cc - XmlParser.cc - XmlStream.cc) + Application.cc + Archive.cc + ArithmeticExpressionParser.cc + Assertions.cc + BinaryStream.cc + BinaryTree.cc + BundleArchive.cc + CacheManager.cc + Channel.cc + Choice.cc + CodeGenerator.cc + Component.cc + CompressedStream.cc + Configuration.cc + Debug.cc + Dependency.cc + Description.cc + Directory.cc + DirectoryArchive.cc + FileArchive.cc + FormatSet.cc + IoUtilities.cc + MappedArchive.cc + MemoryInfo.cc + MD5.cc + MurmurHash.cc + Parameter.cc + ProgressIndicator.cc + ReferenceCounting.cc + ResourceUsageInfo.cc + Statistics.cc + StringExpression.cc + StringUtilities.cc + TextStream.cc + Tokenizer.cc + Types.cc + Unicode.cc + Utility.cc + Version.cc + XmlBuilder.cc + XmlBuilder2.cc + XmlParser.cc + XmlStream.cc) find_package(BISON REQUIRED) bison_target( - ArithmeticExpressionParser - ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.yy - ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.cc - DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.hh - COMPILE_FLAGS "-d") + ArithmeticExpressionParser + ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.yy + ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.cc + DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/ArithmeticExpressionParser.hh + COMPILE_FLAGS "-d") list(APPEND Core_SOURCES ${BISON_ArithmeticExpressionParser_OUTPUTS}) add_library(RasrCore STATIC ${Core_SOURCES}) add_dependencies(RasrCore SourceVersion) target_compile_options(RasrCore PRIVATE "-fexceptions") + +add_executable(check-core check.cc) +target_link_libraries(check-core PRIVATE RasrCore) \ No newline at end of file diff --git a/src/Flf/CMakeLists.txt b/src/Flf/CMakeLists.txt index 59adc4806..1805e0400 100644 --- a/src/Flf/CMakeLists.txt +++ b/src/Flf/CMakeLists.txt @@ -1,87 +1,91 @@ add_subdirectory(FlfCore) -if(${MODULE_FLF_EXT}) - add_subdirectory(FlfExt) -endif() +if (${MODULE_FLF_EXT}) + add_subdirectory(FlfExt) +endif () set(Flf_SOURCES - Archive.cc - Best.cc - Cache.cc - CenterFrameConfusionNetworkBuilder.cc - Combination.cc - Compose.cc - Concatenate.cc - ConfusionNetwork.cc - ConfusionNetworkCombination.cc - ConfusionNetworkIo.cc - CorpusProcessor.cc - Copy.cc - Convert.cc - Draw.cc - Determinize.cc - EpsilonRemoval.cc - Evaluate.cc - Filter.cc - Formattings.cc - FlfIo.cc - FwdBwd.cc - GammaCorrection.cc - HtkSlfIo.cc - Info.cc - Io.cc - LanguageModel.cc - LatticeAdaptor.cc - LatticeHandler.cc - Lexicon.cc - LocalCostDecoder.cc - Map.cc - Miscellaneous.cc - Module.cc - NBest.cc - Network.cc - NodeFactory.cc - NonWordFilter.cc - PivotArcConfusionNetworkBuilder.cc - Processor.cc - Prune.cc - PushForwardRescoring.cc - Recognizer.cc - IncrementalRecognizer.cc - Rescore.cc - RescoreLm.cc - RescoreInternal.cc - Rescale.cc - Segment.cc - SegmentwiseSpeechProcessor.cc - StateClusterConfusionNetworkBuilder.cc - TimeAlignment.cc - TimeframeConfusionNetwork.cc - TimeframeConfusionNetworkBuilder.cc - TimeframeConfusionNetworkCombination.cc - TimeframeConfusionNetworkIo.cc - TimeframeError.cc - Traceback.cc - Union.cc) + Archive.cc + Best.cc + Cache.cc + CenterFrameConfusionNetworkBuilder.cc + Combination.cc + Compose.cc + Concatenate.cc + ConfusionNetwork.cc + ConfusionNetworkCombination.cc + ConfusionNetworkIo.cc + CorpusProcessor.cc + Copy.cc + Convert.cc + Draw.cc + Determinize.cc + EpsilonRemoval.cc + Evaluate.cc + Filter.cc + Formattings.cc + FlfIo.cc + FwdBwd.cc + GammaCorrection.cc + HtkSlfIo.cc + Info.cc + Io.cc + LanguageModel.cc + LatticeAdaptor.cc + LatticeHandler.cc + Lexicon.cc + LocalCostDecoder.cc + Map.cc + Miscellaneous.cc + Module.cc + NBest.cc + Network.cc + NodeFactory.cc + NonWordFilter.cc + PivotArcConfusionNetworkBuilder.cc + Processor.cc + Prune.cc + PushForwardRescoring.cc + Recognizer.cc + IncrementalRecognizer.cc + Rescore.cc + RescoreLm.cc + RescoreInternal.cc + Rescale.cc + Segment.cc + SegmentwiseSpeechProcessor.cc + StateClusterConfusionNetworkBuilder.cc + TimeAlignment.cc + TimeframeConfusionNetwork.cc + TimeframeConfusionNetworkBuilder.cc + TimeframeConfusionNetworkCombination.cc + TimeframeConfusionNetworkIo.cc + TimeframeError.cc + Traceback.cc + Union.cc) add_library(RasrFlf STATIC ${Flf_SOURCES}) target_link_libraries(RasrFlf INTERFACE RasrFlfCore) -if(${MODULE_FLF_EXT}) - target_link_libraries(RasrFlf INTERFACE RasrFlfExt) -endif() +if (${MODULE_FLF_EXT}) + target_link_libraries(RasrFlf INTERFACE RasrFlfExt) +endif () target_link_libraries( - RasrFlf - INTERFACE RasrSpeech - RasrLattice - RasrLm - RasrAm - RasrMm - RasrMc - RasrCart - RasrBliss - RasrFlow - RasrFsa - RasrCore) + RasrFlf + INTERFACE RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrCart + RasrBliss + RasrFlow + RasrFsa + RasrCore +) + +add_executable(check-flf check.cc) +target_link_libraries(check-flf PRIVATE RasrFlf) \ No newline at end of file diff --git a/src/Flf/FlfCore/CMakeLists.txt b/src/Flf/FlfCore/CMakeLists.txt index 4c4987b77..0b81da36c 100644 --- a/src/Flf/FlfCore/CMakeLists.txt +++ b/src/Flf/FlfCore/CMakeLists.txt @@ -14,4 +14,7 @@ set(FlfCore_SOURCES add_library(RasrFlfCore STATIC ${FlfCore_SOURCES}) -target_link_libraries(RasrFlfCore INTERFACE RasrFsa RasrCore) \ No newline at end of file +target_link_libraries(RasrFlfCore INTERFACE RasrFsa RasrCore) + +add_executable(check-flf-core check.cc) +target_link_libraries(check-flf-core PRIVATE RasrFlfCore) \ No newline at end of file diff --git a/src/Flow/CMakeLists.txt b/src/Flow/CMakeLists.txt index 909414a5e..dcedd6a15 100644 --- a/src/Flow/CMakeLists.txt +++ b/src/Flow/CMakeLists.txt @@ -1,30 +1,33 @@ set(Flow_SOURCES - AbstractNode.cc - Aggregate.cc - Attributes.cc - Cache.cc - Cutter.cc - CorpusKeyMap.cc - Data.cc - DataAdaptor.cc - Datatype.cc - Demo.cc - Dump.cc - Link.cc - Module.cc - Network.cc - NetworkParser.cc - Node.cc - Registry.cc - Repeater.cc - SequenceFilter.cc - WarpTimeFilter.cc - StringExpressionNode.cc - Synchronization.cc - Timestamp.cc - Vector.cc - VectorTextInput.cc) + AbstractNode.cc + Aggregate.cc + Attributes.cc + Cache.cc + Cutter.cc + CorpusKeyMap.cc + Data.cc + DataAdaptor.cc + Datatype.cc + Demo.cc + Dump.cc + Link.cc + Module.cc + Network.cc + NetworkParser.cc + Node.cc + Registry.cc + Repeater.cc + SequenceFilter.cc + WarpTimeFilter.cc + StringExpressionNode.cc + Synchronization.cc + Timestamp.cc + Vector.cc + VectorTextInput.cc) add_library(RasrFlow STATIC ${Flow_SOURCES}) target_link_libraries(RasrFlow INTERFACE RasrCore) + +add_executable(check-flow check.cc) +target_link_libraries(check-flow PRIVATE RasrFlow) diff --git a/src/Fsa/CMakeLists.txt b/src/Fsa/CMakeLists.txt index 3a9926d98..292f8e460 100644 --- a/src/Fsa/CMakeLists.txt +++ b/src/Fsa/CMakeLists.txt @@ -1,39 +1,43 @@ set(Fsa_SOURCES - Accessible.cc - Alphabet.cc - AlphabetUtility.cc - AlphabetXml.cc - Archive.cc - Arithmetic.cc - Basic.cc - Best.cc - Cache.cc - Compose.cc - Determinize.cc - Input.cc - Levenshtein.cc - Linear.cc - Minimize.cc - Output.cc - Packed.cc - Permute.cc - Properties.cc - Project.cc - Prune.cc - Random.cc - Resources.cc - Rational.cc - RemoveEpsilons.cc - Semiring.cc - Semiring64.cc - Sort.cc - Sssp.cc - Sssp4SpecialSymbols.cc - Static.cc - Storage.cc - Types.cc - Utility.cc) + Accessible.cc + Alphabet.cc + AlphabetUtility.cc + AlphabetXml.cc + Archive.cc + Arithmetic.cc + Basic.cc + Best.cc + Cache.cc + Compose.cc + Determinize.cc + Input.cc + Levenshtein.cc + Linear.cc + Minimize.cc + Output.cc + Packed.cc + Permute.cc + Properties.cc + Project.cc + Prune.cc + Random.cc + Resources.cc + Rational.cc + RemoveEpsilons.cc + Semiring.cc + Semiring64.cc + Sort.cc + Sssp.cc + Sssp4SpecialSymbols.cc + Static.cc + Storage.cc + Types.cc + Utility.cc) add_library(RasrFsa STATIC ${Fsa_SOURCES}) target_link_libraries(RasrFsa INTERFACE RasrCore) + +# check.cc code is broken +# add_executable(check-fsa check.cc) +# target_link_libraries(check-fsa PRIVATE RasrFsa) \ No newline at end of file diff --git a/src/Lattice/CMakeLists.txt b/src/Lattice/CMakeLists.txt index b57513b4e..a42aa29ad 100644 --- a/src/Lattice/CMakeLists.txt +++ b/src/Lattice/CMakeLists.txt @@ -1,49 +1,53 @@ set(Lattice_SOURCES Archive.cc Basic.cc Lattice.cc LatticeAdaptor.cc - Morphism.cc Utilities.cc) + Morphism.cc Utilities.cc) -if(${MODULE_LATTICE_BASIC}) - list(APPEND Lattice_SOURCES Cache.cc Static.cc Compose.cc) -endif() +if (${MODULE_LATTICE_BASIC}) + list(APPEND Lattice_SOURCES Cache.cc Static.cc Compose.cc) +endif () -if(${MODULE_LATTICE_DT}) - list( - APPEND - Lattice_SOURCES - Accuracy.cc - Arithmetic.cc - Best.cc - Merge.cc - Posterior.cc - Rational.cc - RemoveEpsilons.cc - SmoothedAccuracy.cc - SmoothingFunction.cc - TimeframeError.cc) -endif() +if (${MODULE_LATTICE_DT}) + list( + APPEND + Lattice_SOURCES + Accuracy.cc + Arithmetic.cc + Best.cc + Merge.cc + Posterior.cc + Rational.cc + RemoveEpsilons.cc + SmoothedAccuracy.cc + SmoothingFunction.cc + TimeframeError.cc) +endif () -if(${MODULE_LATTICE_HTK}) - list(APPEND Lattice_SOURCES HtkReader.cc HtkWriter.cc) -endif() +if (${MODULE_LATTICE_HTK}) + list(APPEND Lattice_SOURCES HtkReader.cc HtkWriter.cc) +endif () add_library(RasrLattice STATIC ${Lattice_SOURCES}) target_link_libraries( - RasrLattice - INTERFACE RasrSpeech - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrFsa - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - RasrCore - RasrCart) + RasrLattice + INTERFACE RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrFsa + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrCart) -if(${MODULE_MATH_NR}) - target_link_libraries(RasrLattice INTERFACE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(RasrLattice INTERFACE RasrMathNr) +endif () + +# check.cc code is broken +# add_executable(check-lattice check.cc) +# target_link_libraries(check-lattice PRIVATE RasrLattice) \ No newline at end of file diff --git a/src/Lm/CMakeLists.txt b/src/Lm/CMakeLists.txt index 577daab41..f35b9c4e9 100644 --- a/src/Lm/CMakeLists.txt +++ b/src/Lm/CMakeLists.txt @@ -1,83 +1,87 @@ set(Lm_SOURCES - AbstractNNLanguageModel.cc - BackingOff.cc - ClassLm.cc - CombineLm.cc - Compose.cc - CorpusStatistics.cc - IndexMap.cc - LanguageModel.cc - Module.cc - NNHistoryManager.cc - ReverseArpaLm.cc - ScaledLanguageModel.cc - WordlistInterface.cc) + AbstractNNLanguageModel.cc + BackingOff.cc + ClassLm.cc + CombineLm.cc + Compose.cc + CorpusStatistics.cc + IndexMap.cc + LanguageModel.cc + Module.cc + NNHistoryManager.cc + ReverseArpaLm.cc + ScaledLanguageModel.cc + WordlistInterface.cc) -if(${MODULE_LM_ARPA}) - list(APPEND Lm_SOURCES ArpaLm.cc) -endif() +if (${MODULE_LM_ARPA}) + list(APPEND Lm_SOURCES ArpaLm.cc) +endif () -if(${MODULE_LM_FSA}) - list(APPEND Lm_SOURCES FsaLm.cc CheatingSegmentLm.cc) -endif() +if (${MODULE_LM_FSA}) + list(APPEND Lm_SOURCES FsaLm.cc CheatingSegmentLm.cc) +endif () -if(${MODULE_LM_ZEROGRAM}) - list(APPEND Lm_SOURCES Zerogram.cc) -endif() +if (${MODULE_LM_ZEROGRAM}) + list(APPEND Lm_SOURCES Zerogram.cc) +endif () -if(${MODULE_LM_FFNN}) - list(APPEND Lm_SOURCES FFNeuralNetworkLanguageModel.cc) -endif() +if (${MODULE_LM_FFNN}) + list(APPEND Lm_SOURCES FFNeuralNetworkLanguageModel.cc) +endif () -if(${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) - list( - APPEND - Lm_SOURCES - BlasNceSoftmaxAdapter.cc - CompressedVector.cc - FixedQuantizationCompressedVectorFactory.cc - LstmStateManager.cc - NceSoftmaxAdapter.cc - PassthroughSoftmaxAdapter.cc - QuantizedBlasNceSoftmaxAdapter.cc - QuantizedCompressedVectorFactory.cc - ReducedPrecisionCompressedVectorFactory.cc - TransformerStateManager.cc - TFRecurrentLanguageModel.cc) -endif() +if (${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) + list( + APPEND + Lm_SOURCES + BlasNceSoftmaxAdapter.cc + CompressedVector.cc + FixedQuantizationCompressedVectorFactory.cc + LstmStateManager.cc + NceSoftmaxAdapter.cc + PassthroughSoftmaxAdapter.cc + QuantizedBlasNceSoftmaxAdapter.cc + QuantizedCompressedVectorFactory.cc + ReducedPrecisionCompressedVectorFactory.cc + TransformerStateManager.cc + TFRecurrentLanguageModel.cc) +endif () add_library(RasrLm STATIC ${Lm_SOURCES}) target_compile_options(RasrLm PRIVATE "-fexceptions") target_link_libraries( - RasrLm - INTERFACE RasrFlf - RasrFlfCore - RasrSpeech - RasrAm - RasrMc - RasrBliss - RasrNn - RasrMm - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrLattice - RasrFsa - RasrCore) -if(${MODULE_CART}) - target_link_libraries(RasrLm INTERFACE RasrCart) -endif() -if(${MODULE_MATH_NR}) - target_link_libraries(RasrLm INTERFACE RasrMathNr) -endif() -if(${MODULE_PYTHON}) - target_link_libraries(RasrLm INTERFACE RasrPython) -endif() -if(${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) - target_link_libraries(RasrLm INTERFACE RasrTensorflow) - add_tf_dependencies(RasrLm) -endif() + RasrLm + INTERFACE RasrFlf + RasrFlfCore + RasrSpeech + RasrAm + RasrMc + RasrBliss + RasrNn + RasrMm + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrLattice + RasrFsa + RasrCore) +if (${MODULE_CART}) + target_link_libraries(RasrLm INTERFACE RasrCart) +endif () +if (${MODULE_MATH_NR}) + target_link_libraries(RasrLm INTERFACE RasrMathNr) +endif () +if (${MODULE_PYTHON}) + target_link_libraries(RasrLm INTERFACE RasrPython) +endif () +if (${MODULE_TENSORFLOW} AND ${MODULE_LM_TFRNN}) + target_link_libraries(RasrLm INTERFACE RasrTensorflow) + add_tf_dependencies(RasrLm) +endif () + +# check.cc code is broken +# add_executable(check-lm check.cc) +# target_link_libraries(check-lm PRIVATE RasrLm) \ No newline at end of file diff --git a/src/Math/CMakeLists.txt b/src/Math/CMakeLists.txt index fa34cabed..cf464a5eb 100644 --- a/src/Math/CMakeLists.txt +++ b/src/Math/CMakeLists.txt @@ -1,28 +1,32 @@ add_subdirectory(Lapack) -if(${MODULE_MATH_NR}) - add_subdirectory(Nr) -endif() +if (${MODULE_MATH_NR}) + add_subdirectory(Nr) +endif () set(RasrMath_SOURCES - AcousticalAnalyticFunctions.cc - AnalyticFunctionFactory.cc - EigenvalueProblem.cc - FastFourierTransform.cc - Module.cc - PiecewiseLinearFunction.cc - Random.cc - CudaDataStructure.cc) + AcousticalAnalyticFunctions.cc + AnalyticFunctionFactory.cc + EigenvalueProblem.cc + FastFourierTransform.cc + Module.cc + PiecewiseLinearFunction.cc + Random.cc + CudaDataStructure.cc) -if(${MODULE_CUDA}) - list(APPEND RasrMath_SOURCES CudaMatrixKernels.cu) -endif() +if (${MODULE_CUDA}) + list(APPEND RasrMath_SOURCES CudaMatrixKernels.cu) +endif () -if(${MODULE_SIGNAL_PLP}) - list(APPEND RasrMath_SOURCES LevinsonLse.cc) -endif() +if (${MODULE_SIGNAL_PLP}) + list(APPEND RasrMath_SOURCES LevinsonLse.cc) +endif () add_library(RasrMath STATIC ${RasrMath_SOURCES}) target_compile_options(RasrMath PRIVATE "-fexceptions") target_link_libraries(RasrMath INTERFACE RasrMathNr RasrMathLapack RasrCore) + +# check.cc code is broken +# add_executable(check-math check.cc) +# target_link_libraries(check-math PRIVATE RasrMath) \ No newline at end of file diff --git a/src/Math/Lapack/CMakeLists.txt b/src/Math/Lapack/CMakeLists.txt index 9d95ba27f..75dee37be 100644 --- a/src/Math/Lapack/CMakeLists.txt +++ b/src/Math/Lapack/CMakeLists.txt @@ -6,4 +6,7 @@ set(RasrMathLapack_SOURCES add_library(RasrMathLapack STATIC ${RasrMathLapack_SOURCES}) -target_link_libraries(RasrMathLapack INTERFACE RasrCore) \ No newline at end of file +target_link_libraries(RasrMathLapack INTERFACE RasrCore) + +add_executable(check-math-lapack check.cc) +target_link_libraries(check-math-lapack PRIVATE RasrMathLapack) \ No newline at end of file diff --git a/src/Math/Nr/CMakeLists.txt b/src/Math/Nr/CMakeLists.txt index cc3caa8db..da00d1ccb 100644 --- a/src/Math/Nr/CMakeLists.txt +++ b/src/Math/Nr/CMakeLists.txt @@ -12,4 +12,7 @@ set(RasrMathNr_SOURCES add_library(RasrMathNr STATIC ${RasrMathNr_SOURCES}) -target_link_libraries(RasrMathNr INTERFACE RasrCore) \ No newline at end of file +target_link_libraries(RasrMathNr INTERFACE RasrCore) + +add_executable(check-math-nr check.cc) +target_link_libraries(check-math-nr PRIVATE RasrMathNr) \ No newline at end of file diff --git a/src/Mm/CMakeLists.txt b/src/Mm/CMakeLists.txt index 79a76d75b..9eeb47e1e 100644 --- a/src/Mm/CMakeLists.txt +++ b/src/Mm/CMakeLists.txt @@ -1,70 +1,73 @@ set(RasrMm_SOURCES - AbstractMixtureSetEstimator.cc - CombinedFeatureScorer.cc - CovarianceFeatureScorerElement.cc - CovarianceWeightedFeatureScorerElement.cc - Feature.cc - GaussDensity.cc - GaussDensityEstimator.cc - GaussDiagonalMaximumFeatureScorer.cc - IntelCodeGenerator.cc - IntelOptimization.cc - Mixture.cc - MixtureEstimator.cc - MixtureFeatureScorerElement.cc - MixtureSet.cc - MixtureSetBuilder.cc - MixtureSetEstimator.cc - MixtureSetLoader.cc - MixtureSetReader.cc - MixtureSetSplitter.cc - MixtureSetTopology.cc - Module.cc - StatePosteriorFeatureScorer.cc - SimdFeatureScorer.cc - SSE2CodeGenerator.cc - Utilities.cc) + AbstractMixtureSetEstimator.cc + CombinedFeatureScorer.cc + CovarianceFeatureScorerElement.cc + CovarianceWeightedFeatureScorerElement.cc + Feature.cc + GaussDensity.cc + GaussDensityEstimator.cc + GaussDiagonalMaximumFeatureScorer.cc + IntelCodeGenerator.cc + IntelOptimization.cc + Mixture.cc + MixtureEstimator.cc + MixtureFeatureScorerElement.cc + MixtureSet.cc + MixtureSetBuilder.cc + MixtureSetEstimator.cc + MixtureSetLoader.cc + MixtureSetReader.cc + MixtureSetSplitter.cc + MixtureSetTopology.cc + Module.cc + StatePosteriorFeatureScorer.cc + SimdFeatureScorer.cc + SSE2CodeGenerator.cc + Utilities.cc) -if(${MODULE_MM_DT}) - list( - APPEND - RasrMm_SOURCES - ConvertGaussDensityEstimator.cc - ConvertMixtureEstimator.cc - ConvertMixtureSetEstimator.cc - DiscriminativeGaussDensityEstimator.cc - DiscriminativeMixtureEstimator.cc - DiscriminativeMixtureSetEstimator.cc - EbwDiscriminativeGaussDensityEstimator.cc - EbwDiscriminativeMixtureEstimator.cc - EbwDiscriminativeMixtureSetEstimator.cc - ISmoothingGaussDensityEstimator.cc - ISmoothingMixtureEstimator.cc - ISmoothingMixtureSetEstimator.cc - IterationConstants.cc - RpropOptimization.cc - RpropDiscriminativeGaussDensityEstimator.cc - RpropDiscriminativeMixtureEstimator.cc - RpropDiscriminativeMixtureSetEstimator.cc) -endif() -if(${MODULE_MM_BATCH}) - list(APPEND RasrMm_SOURCES BatchFeatureScorer.cc DensityClustering.cc) -endif() -if(${MODULE_ADAPT_ADVANCED}) - list(APPEND RasrMm_SOURCES BandMllrAdaptation.cc SemiTiedAdaptation.cc) -endif() -if(${MODULE_ADAPT_MLLR}) - list(APPEND RasrMm_SOURCES MllrAdaptation.cc) -endif() -if(${MODULE_ADAPT_CMLLR}) - list(APPEND RasrMm_SOURCES AffineFeatureTransformAccumulator.cc) -endif() +if (${MODULE_MM_DT}) + list( + APPEND + RasrMm_SOURCES + ConvertGaussDensityEstimator.cc + ConvertMixtureEstimator.cc + ConvertMixtureSetEstimator.cc + DiscriminativeGaussDensityEstimator.cc + DiscriminativeMixtureEstimator.cc + DiscriminativeMixtureSetEstimator.cc + EbwDiscriminativeGaussDensityEstimator.cc + EbwDiscriminativeMixtureEstimator.cc + EbwDiscriminativeMixtureSetEstimator.cc + ISmoothingGaussDensityEstimator.cc + ISmoothingMixtureEstimator.cc + ISmoothingMixtureSetEstimator.cc + IterationConstants.cc + RpropOptimization.cc + RpropDiscriminativeGaussDensityEstimator.cc + RpropDiscriminativeMixtureEstimator.cc + RpropDiscriminativeMixtureSetEstimator.cc) +endif () +if (${MODULE_MM_BATCH}) + list(APPEND RasrMm_SOURCES BatchFeatureScorer.cc DensityClustering.cc) +endif () +if (${MODULE_ADAPT_ADVANCED}) + list(APPEND RasrMm_SOURCES BandMllrAdaptation.cc SemiTiedAdaptation.cc) +endif () +if (${MODULE_ADAPT_MLLR}) + list(APPEND RasrMm_SOURCES MllrAdaptation.cc) +endif () +if (${MODULE_ADAPT_CMLLR}) + list(APPEND RasrMm_SOURCES AffineFeatureTransformAccumulator.cc) +endif () add_library(RasrMm STATIC ${RasrMm_SOURCES}) target_link_libraries(RasrMm INTERFACE RasrMath RasrMathLapack RasrFsa RasrCore - RasrMc) + RasrMc) -if(${MODULE_MM_BATCH}) - target_compile_options(RasrMm PRIVATE "-msse2") -endif() +if (${MODULE_MM_BATCH}) + target_compile_options(RasrMm PRIVATE "-msse2") +endif () + +add_executable(check-mm check.cc) +target_link_libraries(check-mm PRIVATE RasrMm) \ No newline at end of file diff --git a/src/Nn/CMakeLists.txt b/src/Nn/CMakeLists.txt index 512a3fed7..21dc6a83b 100644 --- a/src/Nn/CMakeLists.txt +++ b/src/Nn/CMakeLists.txt @@ -1,75 +1,78 @@ set(RasrNn_SOURCES Module.cc) -if(${MODULE_NN}) - list( - APPEND - RasrNn_SOURCES - ActivationLayer.cc - Activations.cc - AllophoneStateFsaExporter.cc - BatchEstimator.cc - BatchFeatureScorer.cc - BufferedAlignedFeatureProcessor.cc - BufferedFeatureExtractor.cc - BufferedSegmentFeatureProcessor.cc - ClassLabelWrapper.cc - Criterion.cc - CtcCriterion.cc - Estimator.cc - FeatureScorer.cc - FeedForwardTrainer.cc - GradientCheck.cc - LinearAndActivationLayer.cc - LinearLayer.cc - LookupLayer.cc - MeanNormalizedSgdEstimator.cc - NetworkTopology.cc - NeuralNetwork.cc - NeuralNetworkForwardNode.cc - NeuralNetworkLayer.cc - NeuralNetworkTrainer.cc - OperationLayer.cc - PoolingLayer.cc - PreprocessingLayer.cc - Prior.cc - Regularizer.cc - RpropEstimator.cc - Statistics.cc - TrainerFeatureScorer.cc) -endif() -if(${MODULE_NN_SEQUENCE_TRAINING}) - list( - APPEND - RasrNn_SOURCES - EmissionLatticeRescorer.cc - LatticeAccumulators.cc - SegmentwiseNnTrainer.cc - MmiSegmentwiseNnTrainer.cc - MeSegmentwiseNnTrainer.cc - SharedNeuralNetwork.cc) -endif() -if(${MODULE_PYTHON}) - list(APPEND RasrNn_SOURCES PythonFeatureScorer.cc PythonTrainer.cc - PythonControl.cc PythonLayer.cc) -endif() -if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - list(APPEND RasrNn_SOURCES LabelScorer.cc) - if(${MODULE_TENSORFLOW}) - list(APPEND RasrNn_SOURCES TFLabelScorer.cc) - endif() -endif() +if (${MODULE_NN}) + list( + APPEND + RasrNn_SOURCES + ActivationLayer.cc + Activations.cc + AllophoneStateFsaExporter.cc + BatchEstimator.cc + BatchFeatureScorer.cc + BufferedAlignedFeatureProcessor.cc + BufferedFeatureExtractor.cc + BufferedSegmentFeatureProcessor.cc + ClassLabelWrapper.cc + Criterion.cc + CtcCriterion.cc + Estimator.cc + FeatureScorer.cc + FeedForwardTrainer.cc + GradientCheck.cc + LinearAndActivationLayer.cc + LinearLayer.cc + LookupLayer.cc + MeanNormalizedSgdEstimator.cc + NetworkTopology.cc + NeuralNetwork.cc + NeuralNetworkForwardNode.cc + NeuralNetworkLayer.cc + NeuralNetworkTrainer.cc + OperationLayer.cc + PoolingLayer.cc + PreprocessingLayer.cc + Prior.cc + Regularizer.cc + RpropEstimator.cc + Statistics.cc + TrainerFeatureScorer.cc) +endif () +if (${MODULE_NN_SEQUENCE_TRAINING}) + list( + APPEND + RasrNn_SOURCES + EmissionLatticeRescorer.cc + LatticeAccumulators.cc + SegmentwiseNnTrainer.cc + MmiSegmentwiseNnTrainer.cc + MeSegmentwiseNnTrainer.cc + SharedNeuralNetwork.cc) +endif () +if (${MODULE_PYTHON}) + list(APPEND RasrNn_SOURCES PythonFeatureScorer.cc PythonTrainer.cc + PythonControl.cc PythonLayer.cc) +endif () +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + list(APPEND RasrNn_SOURCES LabelScorer.cc) + if (${MODULE_TENSORFLOW}) + list(APPEND RasrNn_SOURCES TFLabelScorer.cc) + endif () +endif () add_library(RasrNn STATIC ${RasrNn_SOURCES}) target_link_libraries(RasrNn INTERFACE RasrCore RasrMath RasrMathLapack - RasrFlow RasrSignal) + RasrFlow RasrSignal RasrSpeech) target_compile_options(RasrNn PRIVATE "-fexceptions") -if(${MODULE_PYTHON}) - add_python_dependencies(RasrNn) -endif() +if (${MODULE_PYTHON}) + add_python_dependencies(RasrNn) +endif () -if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH} AND ${MODULE_TENSORFLOW}) - add_tf_dependencies(RasrNn) -endif() +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH} AND ${MODULE_TENSORFLOW}) + add_tf_dependencies(RasrNn) +endif () + +add_executable(check-nn check.cc) +target_link_libraries(check-nn PRIVATE RasrNn) \ No newline at end of file diff --git a/src/Onnx/CMakeLists.txt b/src/Onnx/CMakeLists.txt index c0fa5d0d6..0b6fa8130 100644 --- a/src/Onnx/CMakeLists.txt +++ b/src/Onnx/CMakeLists.txt @@ -1,7 +1,11 @@ set(RasrOnnx_SOURCES Session.cc IOSpecification.cc Module.cc - OnnxFeatureScorer.cc OnnxForwardNode.cc Value.cc) + OnnxFeatureScorer.cc OnnxForwardNode.cc Value.cc) add_library(RasrOnnx STATIC ${RasrOnnx_SOURCES}) add_onnx_dependencies(RasrOnnx) target_link_libraries(RasrOnnx INTERFACE RasrCore) + +add_executable(check-onnx check.cc) +target_link_libraries(check-onnx PRIVATE RasrOnnx) +add_onnx_dependencies(check-onnx) \ No newline at end of file diff --git a/src/OpenFst/CMakeLists.txt b/src/OpenFst/CMakeLists.txt index 3e0e8a47e..a227d93ed 100644 --- a/src/OpenFst/CMakeLists.txt +++ b/src/OpenFst/CMakeLists.txt @@ -3,3 +3,6 @@ set(RasrOpenFst_SOURCES Input.cc Module.cc Output.cc SymbolTable.cc) add_library(RasrOpenFst STATIC ${RasrOpenFst_SOURCES}) target_link_libraries(RasrOpenFst INTERFACE RasrBliss RasrFsa RasrCore) + +add_executable(check-openfst check.cc) +target_link_libraries(check-openfst PRIVATE RasrOpenFst) \ No newline at end of file diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index b41244701..e92c4c5e7 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -1,5 +1,10 @@ set(RasrPython_SOURCES Init.cc Numpy.cc Utilities.cc) add_library(RasrPython STATIC ${RasrPython_SOURCES}) +target_link_libraries(RasrPython INTERFACE RasrCore) add_python_dependencies(RasrPython) target_compile_options(RasrPython PRIVATE "-fexceptions") + +add_executable(check-python check.cc) +target_link_libraries(check-python PRIVATE RasrPython) +add_python_dependencies(check-python) \ No newline at end of file diff --git a/src/Search/CMakeLists.txt b/src/Search/CMakeLists.txt index 795085226..32d53f25c 100644 --- a/src/Search/CMakeLists.txt +++ b/src/Search/CMakeLists.txt @@ -1,32 +1,35 @@ -if(${MODULE_SEARCH_WFST}) - add_subdirectory(Wfst) -endif() -if(${MODULE_ADVANCED_TREE_SEARCH}) - add_subdirectory(AdvancedTreeSearch) -endif() -if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - add_subdirectory(GenericSeq2SeqTreeSearch) -endif() +if (${MODULE_SEARCH_WFST}) + add_subdirectory(Wfst) +endif () +if (${MODULE_ADVANCED_TREE_SEARCH}) + add_subdirectory(AdvancedTreeSearch) +endif () +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + add_subdirectory(GenericSeq2SeqTreeSearch) +endif () set(RasrSearch_SOURCES - Aligner.cc - LatticeHandler.cc - LanguageModelLookahead.cc - Module.cc - Search.cc - StateTree.cc - StateTreeIo.cc - WordConditionedTreeSearch.cc) + Aligner.cc + LatticeHandler.cc + LanguageModelLookahead.cc + Module.cc + Search.cc + StateTree.cc + StateTreeIo.cc + WordConditionedTreeSearch.cc) -if(${MODULE_SEARCH_MBR}) - list(APPEND RasrSearch_SOURCES MinimumBayesRiskSearch.cc - MinimumBayesRiskAStarSearch.cc MinimumBayesRiskNBestListSearch.cc - MinimumBayesRiskSearchUtil.cc) -endif() -if(${MODULE_SEARCH_LINEAR}) - list(APPEND RasrSearch_SOURCES LinearSearch.cc) -endif() +if (${MODULE_SEARCH_MBR}) + list(APPEND RasrSearch_SOURCES MinimumBayesRiskSearch.cc + MinimumBayesRiskAStarSearch.cc MinimumBayesRiskNBestListSearch.cc + MinimumBayesRiskSearchUtil.cc) +endif () +if (${MODULE_SEARCH_LINEAR}) + list(APPEND RasrSearch_SOURCES LinearSearch.cc) +endif () add_library(RasrSearch STATIC ${RasrSearch_SOURCES}) -target_link_libraries(RasrSearch INTERFACE RasrBliss RasrFsa RasrCore) +target_link_libraries(RasrSearch INTERFACE RasrBliss RasrFsa RasrCore RasrLattice) + +add_executable(check-search check.cc) +target_link_libraries(check-search PRIVATE RasrSearch) \ No newline at end of file diff --git a/src/Search/Wfst/CMakeLists.txt b/src/Search/Wfst/CMakeLists.txt index 8ba8644e6..6db270502 100644 --- a/src/Search/Wfst/CMakeLists.txt +++ b/src/Search/Wfst/CMakeLists.txt @@ -49,3 +49,9 @@ target_link_libraries(RasrSearchWfst INTERFACE RasrMc RasrCore ) + +add_executable(check-search-wfst check.cc) +target_link_libraries(check-search-wfst PRIVATE RasrSearchWfst) + +add_executable(check-search-wfst-ctrans check_ctrans.cc) +target_link_libraries(check-search-wfst-ctrans PRIVATE RasrSearchWfst) \ No newline at end of file diff --git a/src/Signal/CMakeLists.txt b/src/Signal/CMakeLists.txt index 073dd632a..ef45e1a84 100644 --- a/src/Signal/CMakeLists.txt +++ b/src/Signal/CMakeLists.txt @@ -1,93 +1,96 @@ set(RasrSignal_SOURCES - CosineTransform.cc - DcDetection.cc - SilenceNormalization.cc - Delay.cc - Delimiter.cc - EigenTransform.cc - FramePrediction.cc - FastFourierTransform.cc - Filterbank.cc - Module.cc - Mrasta.cc - Normalization.cc - Preemphasis.cc - RepeatingFramePrediction.cc - Regression.cc - ScatterEstimator.cc - ScatterTransform.cc - SegmentClustering.cc - SegmentEstimator.cc - TempoRAlPattern.cc - VectorSequenceAggregation.cc - VectorSequenceConcatenation.cc - VectorResize.cc - Window.cc - WindowBuffer.cc - WindowFunction.cc) + CosineTransform.cc + DcDetection.cc + SilenceNormalization.cc + Delay.cc + Delimiter.cc + EigenTransform.cc + FramePrediction.cc + FastFourierTransform.cc + Filterbank.cc + Module.cc + Mrasta.cc + Normalization.cc + Preemphasis.cc + RepeatingFramePrediction.cc + Regression.cc + ScatterEstimator.cc + ScatterTransform.cc + SegmentClustering.cc + SegmentEstimator.cc + TempoRAlPattern.cc + VectorSequenceAggregation.cc + VectorSequenceConcatenation.cc + VectorResize.cc + Window.cc + WindowBuffer.cc + WindowFunction.cc) -if(${MODULE_SIGNAL_GAMMATONE}) - list(APPEND RasrSignal_SOURCES GammaTone.cc SpectralIntegration.cc - TemporalIntegration.cc TimeWindowBuffer.cc) -endif() +if (${MODULE_SIGNAL_GAMMATONE}) + list(APPEND RasrSignal_SOURCES GammaTone.cc SpectralIntegration.cc + TemporalIntegration.cc TimeWindowBuffer.cc) +endif () -if(${MODULE_SIGNAL_VTLN}) - list(APPEND RasrSignal_SOURCES LikelihoodFunction.cc BayesClassification.cc - AprioriProbability.cc) -endif() +if (${MODULE_SIGNAL_VTLN}) + list(APPEND RasrSignal_SOURCES LikelihoodFunction.cc BayesClassification.cc + AprioriProbability.cc) +endif () -if(${MODULE_SIGNAL_VOICEDNESS}) - list(APPEND RasrSignal_SOURCES CrossCorrelation.cc PeakDetection.cc) -endif() +if (${MODULE_SIGNAL_VOICEDNESS}) + list(APPEND RasrSignal_SOURCES CrossCorrelation.cc PeakDetection.cc) +endif () -if(${MODULE_SIGNAL_PLP}) - list(APPEND RasrSignal_SOURCES ArEstimator.cc VectorTransform.cc - AutoregressionToCepstrum.cc AutoregressionToSpectrum.cc) -endif() +if (${MODULE_SIGNAL_PLP}) + list(APPEND RasrSignal_SOURCES ArEstimator.cc VectorTransform.cc + AutoregressionToCepstrum.cc AutoregressionToSpectrum.cc) +endif () -if(${MODULE_SIGNAL_ADVANCED}) - list( - APPEND - RasrSignal_SOURCES - ArxEstimator.cc - Convolution.cc - FastHartleyTransform.cc - Formant.cc - FrameInterpolation.cc - GenericWarping.cc - HarmonicSum.cc - Histogram.cc - HistogramNormalization.cc - LinearFilter.cc - LinearWarping.cc - Lpc.cc - MeanEstimator.cc - NthOrderFeatures.cc - PolinomialVectorInterpolation.cc - QuantileEqualization.cc - SampleNormalization.cc - SegmentwiseFormantExtraction.cc - SilenceDetection.cc - Warping.cc) -endif() +if (${MODULE_SIGNAL_ADVANCED}) + list( + APPEND + RasrSignal_SOURCES + ArxEstimator.cc + Convolution.cc + FastHartleyTransform.cc + Formant.cc + FrameInterpolation.cc + GenericWarping.cc + HarmonicSum.cc + Histogram.cc + HistogramNormalization.cc + LinearFilter.cc + LinearWarping.cc + Lpc.cc + MeanEstimator.cc + NthOrderFeatures.cc + PolinomialVectorInterpolation.cc + QuantileEqualization.cc + SampleNormalization.cc + SegmentwiseFormantExtraction.cc + SilenceDetection.cc + Warping.cc) +endif () -if(${MODULE_SIGNAL_ADVANCED_NR}) - list(APPEND RasrSignal_SOURCES AllPolesPowerSpectrum.cc - KaiserWindowFunction.cc RandomVector.cc WindowingFirFilter.cc) -endif() +if (${MODULE_SIGNAL_ADVANCED_NR}) + list(APPEND RasrSignal_SOURCES AllPolesPowerSpectrum.cc + KaiserWindowFunction.cc RandomVector.cc WindowingFirFilter.cc) +endif () add_library(RasrSignal STATIC ${RasrSignal_SOURCES}) target_link_libraries( - RasrSignal - INTERFACE RasrFlow - RasrBliss - RasrMm - RasrMath - RasrMathLapack - RasrMc - RasrCore) + RasrSignal + INTERFACE RasrFlow + RasrBliss + RasrMm + RasrMath + RasrMathLapack + RasrMc + RasrCore) -if(${MODULE_SIGNAL_ADVANCED_NR}) - target_link_libraries(RasrSignal INTERFACE RasrMathNr) -endif() +if (${MODULE_SIGNAL_ADVANCED_NR}) + target_link_libraries(RasrSignal INTERFACE RasrMathNr) +endif () + +add_executable(check-signal check.cc) +target_link_libraries(check-signal PRIVATE RasrSignal) \ No newline at end of file diff --git a/src/Speech/CMakeLists.txt b/src/Speech/CMakeLists.txt index aadf62728..a7185e31f 100644 --- a/src/Speech/CMakeLists.txt +++ b/src/Speech/CMakeLists.txt @@ -1,154 +1,155 @@ set(Speech_SOURCES - AcousticModelTrainer.cc - AlignerModelAcceptor.cc - AligningFeatureExtractor.cc - Alignment.cc - AlignmentNode.cc - AlignmentWithLinearSegmentation.cc - AllophoneStateGraphBuilder.cc - AverageFeatureScorerActivation.cc - CorpusProcessor.cc - CorpusVisitor.cc - CovarianceEstimator.cc - DataExtractor.cc - DataSource.cc - DelayedRecognizer.cc - Feature.cc - FeatureScorer.cc - FeatureScorerNode.cc - FsaCache.cc - LabelingFeatureExtractor.cc - MixtureSetTrainer.cc - ModelCombination.cc - Module.cc - Recognizer.cc - ScatterMatricesEstimator.cc - TextDependentSequenceFiltering.cc - TextIndependentMixtureSetTrainer.cc) - -if(${MODULE_SPEECH_LATTICE_ALIGNMENT}) - list(APPEND Speech_SOURCES PhonemeSequenceAlignmentGenerator.cc - SegmentwiseAlignmentGenerator.cc SegmentwiseFeatureExtractor.cc) -endif() - -if(${MODULE_SPEECH_DT}) - list( - APPEND - Speech_SOURCES - AbstractSegmentwiseTrainer.cc - AccuracyFsaBuilder.cc - AcousticSegmentwiseTrainer.cc - Confidences.cc - DiscriminativeMixtureSetTrainer.cc - EbwDiscriminativeMixtureSetTrainer.cc - LatticeExtractor.cc - LatticeSetExtractor.cc - LatticeSetProcessor.cc - PruningLatticeSetNode.cc - SegmentwiseGmmTrainer.cc - WordLatticeExtractor.cc) -endif() - -if(${MODULE_SPEECH_DT_ADVANCED}) - list( - APPEND - Speech_SOURCES - AdvancedAccuracyFsaBuilder.cc - AdvancedLatticeExtractor.cc - AuxiliarySegmentwiseTrainer.cc - ClusterMixtureSetTrainer.cc - AdvancedLatticeSetProcessor.cc - NBestListExtractor.cc - RpropDiscriminativeMixtureSetTrainer.cc) -endif() - -if(${MODULE_FLF_EXT}) - list(APPEND Speech_SOURCES AlignedFeatureCache.cc) -endif() - -if(${MODULE_SPEECH_LATTICE_FLOW_NODES}) - list(APPEND Speech_SOURCES AlignmentFromLattice.cc LatticeNodes.cc - LatticeArcAccumulator.cc) -endif() - -if(${MODULE_SPEECH_ALIGNMENT_FLOW_NODES}) - list(APPEND Speech_SOURCES AlignmentGeneratorNode.cc - AlignmentTransformNode.cc SegmentNode.cc) -endif() - -if(${MODULE_ADAPT_MLLR}) - list(APPEND Speech_SOURCES ModelTransformEstimator.cc FeatureShiftAdaptor.cc) -endif() - -if(${MODULE_ADAPT_CMLLR}) - list(APPEND Speech_SOURCES AffineFeatureTransformEstimator.cc - KeyedEstimator.cc) -endif() - -if(${MODULE_CART}) - list(APPEND Speech_SOURCES DecisionTreeTrainer.cc) -endif() - -if(${MODULE_SPEECH_LATTICE_RESCORING}) - list(APPEND Speech_SOURCES LatticeRescorerAutomaton.cc - LatticeRescorerNodes.cc StatePosteriorFeatureScorerNode.cc) -endif() - -if(${MODULE_SIGNAL_ADVANCED}) - list(APPEND Speech_SOURCES HistogramEstimator.cc MeanEstimator.cc) -endif() - -if(${MODULE_SEARCH_MBR}) - list(APPEND Speech_SOURCES MinimumBayesRiskSearch.cc) -endif() + AcousticModelTrainer.cc + AlignerModelAcceptor.cc + AligningFeatureExtractor.cc + Alignment.cc + AlignmentNode.cc + AlignmentWithLinearSegmentation.cc + AllophoneStateGraphBuilder.cc + AverageFeatureScorerActivation.cc + CorpusProcessor.cc + CorpusVisitor.cc + CovarianceEstimator.cc + DataExtractor.cc + DataSource.cc + DelayedRecognizer.cc + Feature.cc + FeatureScorer.cc + FeatureScorerNode.cc + FsaCache.cc + LabelingFeatureExtractor.cc + MixtureSetTrainer.cc + ModelCombination.cc + Module.cc + Recognizer.cc + ScatterMatricesEstimator.cc + TextDependentSequenceFiltering.cc + TextIndependentMixtureSetTrainer.cc) + +if (${MODULE_SPEECH_LATTICE_ALIGNMENT}) + list(APPEND Speech_SOURCES PhonemeSequenceAlignmentGenerator.cc + SegmentwiseAlignmentGenerator.cc SegmentwiseFeatureExtractor.cc) +endif () + +if (${MODULE_SPEECH_DT}) + list( + APPEND + Speech_SOURCES + AbstractSegmentwiseTrainer.cc + AccuracyFsaBuilder.cc + AcousticSegmentwiseTrainer.cc + Confidences.cc + DiscriminativeMixtureSetTrainer.cc + EbwDiscriminativeMixtureSetTrainer.cc + LatticeExtractor.cc + LatticeSetExtractor.cc + LatticeSetProcessor.cc + PruningLatticeSetNode.cc + SegmentwiseGmmTrainer.cc + WordLatticeExtractor.cc) +endif () + +if (${MODULE_SPEECH_DT_ADVANCED}) + list( + APPEND + Speech_SOURCES + AdvancedAccuracyFsaBuilder.cc + AdvancedLatticeExtractor.cc + AuxiliarySegmentwiseTrainer.cc + ClusterMixtureSetTrainer.cc + AdvancedLatticeSetProcessor.cc + NBestListExtractor.cc + RpropDiscriminativeMixtureSetTrainer.cc) +endif () + +if (${MODULE_FLF_EXT}) + list(APPEND Speech_SOURCES AlignedFeatureCache.cc) +endif () + +if (${MODULE_SPEECH_LATTICE_FLOW_NODES}) + list(APPEND Speech_SOURCES AlignmentFromLattice.cc LatticeNodes.cc + LatticeArcAccumulator.cc) +endif () + +if (${MODULE_SPEECH_ALIGNMENT_FLOW_NODES}) + list(APPEND Speech_SOURCES AlignmentGeneratorNode.cc + AlignmentTransformNode.cc SegmentNode.cc) +endif () + +if (${MODULE_ADAPT_MLLR}) + list(APPEND Speech_SOURCES ModelTransformEstimator.cc FeatureShiftAdaptor.cc) +endif () + +if (${MODULE_ADAPT_CMLLR}) + list(APPEND Speech_SOURCES AffineFeatureTransformEstimator.cc + KeyedEstimator.cc) +endif () + +if (${MODULE_CART}) + list(APPEND Speech_SOURCES DecisionTreeTrainer.cc) +endif () + +if (${MODULE_SPEECH_LATTICE_RESCORING}) + list(APPEND Speech_SOURCES LatticeRescorerAutomaton.cc + LatticeRescorerNodes.cc StatePosteriorFeatureScorerNode.cc) +endif () + +if (${MODULE_SIGNAL_ADVANCED}) + list(APPEND Speech_SOURCES HistogramEstimator.cc MeanEstimator.cc) +endif () + +if (${MODULE_SEARCH_MBR}) + list(APPEND Speech_SOURCES MinimumBayesRiskSearch.cc) +endif () add_library(RasrSpeech STATIC ${Speech_SOURCES}) target_link_libraries( - RasrSpeech - INTERFACE RasrLm - RasrAm - RasrMm - RasrMc - RasrSearch - RasrBliss - RasrFlow - RasrFsa - RasrCore - RasrLattice - RasrMath - RasrMathLapack) - -if(${MODULE_CART}) - target_link_libraries(RasrSpeech INTERFACE RasrCart) -endif() - -if(${MODULE_MATH_NR}) - target_link_libraries(RasrSpeech INTERFACE RasrMathNr) -endif() - -if(${MODULE_NN_SEQUENCE_TRAINING}) - target_link_libraries(RasrSpeech INTERFACE RasrNn) -endif() - -if(${MODULE_SEARCH_WFST}) - target_link_libraries(RasrSpeech INTERFACE RasrSearchWfst RasrOpenFst) -endif() - -if(${MODULE_ADVANCED_TREE_SEARCH}) - target_link_libraries(RasrSpeech INTERFACE RasrAdvancedTreeSearch) -endif() - -if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - target_link_libraries(RasrSpeech INTERFACE RasrGenericSeq2SeqTreeSearch) -endif() - -if(${MODULE_PYTHON}) - target_link_libraries(RasrSpeech INTERFACE RasrPython) - add_python_dependencies(RasrSpeech) -endif() - -if(${MODULE_TENSORFLOW}) - add_tf_dependencies(RasrSpeech) - target_link_libraries(RasrSpeech INTERFACE RasrTensorflow) -endif() + RasrSpeech + INTERFACE + RasrLm + RasrAm + RasrMm + RasrMc + RasrNn + RasrSearch + RasrBliss + RasrFlow + RasrFsa + RasrCore + RasrLattice + RasrMath + RasrMathLapack) + +if (${MODULE_CART}) + target_link_libraries(RasrSpeech INTERFACE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(RasrSpeech INTERFACE RasrMathNr) +endif () + +if (${MODULE_SEARCH_WFST}) + target_link_libraries(RasrSpeech INTERFACE RasrSearchWfst RasrOpenFst) +endif () + +if (${MODULE_ADVANCED_TREE_SEARCH}) + target_link_libraries(RasrSpeech INTERFACE RasrAdvancedTreeSearch) +endif () + +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(RasrSpeech INTERFACE RasrGenericSeq2SeqTreeSearch) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(RasrSpeech INTERFACE RasrPython) + add_python_dependencies(RasrSpeech) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(RasrSpeech INTERFACE RasrTensorflow) + add_tf_dependencies(RasrSpeech) +endif () + +add_executable(check-speech check.cc) +target_link_libraries(check-speech PRIVATE RasrSpeech) \ No newline at end of file diff --git a/src/Tensorflow/CMakeLists.txt b/src/Tensorflow/CMakeLists.txt index bf9eb5213..90d5b1440 100644 --- a/src/Tensorflow/CMakeLists.txt +++ b/src/Tensorflow/CMakeLists.txt @@ -1,15 +1,19 @@ set(RasrTensorflow_SOURCES - Graph.cc - GraphLoader.cc - MetaGraphLoader.cc - Module.cc - Session.cc - Tensor.cc - TensorflowForwardNode.cc - TensorMap.cc - VanillaGraphLoader.cc) + Graph.cc + GraphLoader.cc + MetaGraphLoader.cc + Module.cc + Session.cc + Tensor.cc + TensorflowForwardNode.cc + TensorMap.cc + VanillaGraphLoader.cc) add_library(RasrTensorflow STATIC ${RasrTensorflow_SOURCES}) target_link_libraries(RasrTensorflow INTERFACE RasrCore) add_tf_dependencies(RasrTensorflow) + +add_executable(check-tensorflow check.cc) +target_link_libraries(check-tensorflow PRIVATE RasrTensorflow) +add_tf_dependencies(check-tensorflow) \ No newline at end of file diff --git a/src/Test/CMakeLists.txt b/src/Test/CMakeLists.txt index ba9d5e500..f341831c1 100644 --- a/src/Test/CMakeLists.txt +++ b/src/Test/CMakeLists.txt @@ -3,114 +3,114 @@ set(RasrTest_SOURCES Registry.cc Lexicon.cc File.cc) add_library(RasrTest ${RasrTest_SOURCES}) set(test_SOURCES - UnitTester.cc - Bliss_SegmentOrdering.cc - Core_StringUtilities.cc - Core_Thread.cc - Core_ThreadPool.cc - Fsa_Sssp4SpecialSymbols.cc - Math_Utilities.cc - Math_Blas.cc - Math_FastVectorOperations.cc - Math_CudaVector.cc - Math_CudaMatrix.cc - Math_FastMatrix.cc - Test_File.cc - Test_Lexicon.cc) - -if(${MODULE_NN}) - list( - APPEND - test_SOURCES - Nn_NetworkTopology.cc - Nn_BufferedFeatureExtractor.cc - Nn_BufferedAlignedFeatureProcessor.cc - Nn_ClassLabelWrapper.cc - Nn_FeedForwardCrossEntropyTrainer.cc - Nn_LinearAndActivationLayer.cc - Nn_LinearLayer.cc - Nn_NeuralNetwork.cc - Nn_NeuralNetworkLayer.cc - Nn_NeuralNetworkTrainer.cc - Nn_PreprocessingLayer.cc - Nn_Statistics.cc) -endif() - -if(${MODULE_OPENMP}) - list(APPEND test_SOURCES Math_MultithreadingHelper.cc) -endif() - -if(${MODULE_TBB}) - list(APPEND test_SOURCES Core_Tbb.cc) -endif() + UnitTester.cc + Bliss_SegmentOrdering.cc + Core_StringUtilities.cc + Core_Thread.cc + Core_ThreadPool.cc + Fsa_Sssp4SpecialSymbols.cc + Math_Utilities.cc + Math_Blas.cc + Math_FastVectorOperations.cc + Math_CudaVector.cc + Math_CudaMatrix.cc + Math_FastMatrix.cc + Test_File.cc + Test_Lexicon.cc) + +if (${MODULE_NN}) + list( + APPEND + test_SOURCES + Nn_NetworkTopology.cc + Nn_BufferedFeatureExtractor.cc + Nn_BufferedAlignedFeatureProcessor.cc + Nn_ClassLabelWrapper.cc + Nn_FeedForwardCrossEntropyTrainer.cc + Nn_LinearAndActivationLayer.cc + Nn_LinearLayer.cc + Nn_NeuralNetwork.cc + Nn_NeuralNetworkLayer.cc + Nn_NeuralNetworkTrainer.cc + Nn_PreprocessingLayer.cc + Nn_Statistics.cc) +endif () + +if (${MODULE_OPENMP}) + list(APPEND test_SOURCES Math_MultithreadingHelper.cc) +endif () + +if (${MODULE_TBB}) + list(APPEND test_SOURCES Core_Tbb.cc) +endif () add_executable(unit-test ${test_SOURCES}) add_install_executable(unit-test) target_link_libraries( - unit-test - PRIVATE RasrTest - RasrBliss - RasrFsa - RasrCore - RasrSpeech - RasrSearch - RasrLattice - RasrAm - RasrLm - RasrMc - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack) - -if(${MODULE_FLF}) - target_link_libraries(unit-test PRIVATE RasrFlf) -endif() - -if(${MODULE_FLF_CORE}) - target_link_libraries(unit-test PRIVATE RasrFlfCore) -endif() - -if(${MODULE_FLF_EXT}) - target_link_libraries(unit-test PRIVATE RasrFlfExt) -endif() - -if(${MODULE_ADVANCED_TREE_SEARCH}) - target_link_libraries(unit-test PRIVATE RasrAdvancedTreeSearch) -endif() - -if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - target_link_libraries(unit-test PRIVATE RasrGenericSeq2SeqTreeSearch) -endif() - -if(${MODULE_PYTHON}) - target_link_libraries(unit-test PRIVATE RasrPython) - add_python_dependencies(unit-test) -endif() - -if(${MODULE_NN}) - target_link_libraries(unit-test PRIVATE RasrNn) -endif() - -if(${MODULE_CART}) - target_link_libraries(unit-test PRIVATE RasrCart) -endif() - -if(${MODULE_MATH_NR}) - target_link_libraries(unit-test PRIVATE RasrMathNr) -endif() - -if(${MODULE_SEARCH_WFST}) - target_link_libraries(unit-test PRIVATE RasrSearchWfst) -endif() - -if(${MODULE_OPENFST}) - target_link_libraries(unit-test PRIVATE RasrOpenFst) -endif() - -if(${MODULE_TENSORFLOW}) - target_link_libraries(unit-test PRIVATE RasrTensorflow) - add_tf_dependencies(unit-test) -endif() + unit-test + PRIVATE RasrTest + RasrBliss + RasrFsa + RasrCore + RasrSpeech + RasrSearch + RasrLattice + RasrAm + RasrLm + RasrMc + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack) + +if (${MODULE_FLF}) + target_link_libraries(unit-test PRIVATE RasrFlf) +endif () + +if (${MODULE_FLF_CORE}) + target_link_libraries(unit-test PRIVATE RasrFlfCore) +endif () + +if (${MODULE_FLF_EXT}) + target_link_libraries(unit-test PRIVATE RasrFlfExt) +endif () + +if (${MODULE_ADVANCED_TREE_SEARCH}) + target_link_libraries(unit-test PRIVATE RasrAdvancedTreeSearch) +endif () + +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(unit-test PRIVATE RasrGenericSeq2SeqTreeSearch) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(unit-test PRIVATE RasrPython) + add_python_dependencies(unit-test) +endif () + +if (${MODULE_NN}) + target_link_libraries(unit-test PRIVATE RasrNn) +endif () + +if (${MODULE_CART}) + target_link_libraries(unit-test PRIVATE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(unit-test PRIVATE RasrMathNr) +endif () + +if (${MODULE_SEARCH_WFST}) + target_link_libraries(unit-test PRIVATE RasrSearchWfst) +endif () + +if (${MODULE_OPENFST}) + target_link_libraries(unit-test PRIVATE RasrOpenFst) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(unit-test PRIVATE RasrTensorflow) + add_tf_dependencies(unit-test) +endif () diff --git a/src/Tools/AcousticModelTrainer/CMakeLists.txt b/src/Tools/AcousticModelTrainer/CMakeLists.txt index 249b5d880..9a96f1b30 100644 --- a/src/Tools/AcousticModelTrainer/CMakeLists.txt +++ b/src/Tools/AcousticModelTrainer/CMakeLists.txt @@ -1,64 +1,64 @@ add_executable(acoustic-model-trainer AcousticModelTrainer.cc) add_install_executable(acoustic-model-trainer) target_link_libraries( - acoustic-model-trainer - PRIVATE RasrSpeech - RasrFlow - RasrAm - RasrMm - RasrLm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrMath - RasrMathLapack - RasrCore - RasrFsa - ${SEARCH_LIBS}) + acoustic-model-trainer + PRIVATE RasrSpeech + RasrFlow + RasrAm + RasrMm + RasrLm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrMath + RasrMathLapack + RasrCore + RasrFsa + ${SEARCH_LIBS}) add_executable(allophone-tool AllophoneTool.cc) add_install_executable(allophone-tool) target_link_libraries( - allophone-tool - PRIVATE RasrAm - RasrMm - RasrBliss - RasrFsa - RasrMc - RasrCore - RasrMathLapack) + allophone-tool + PRIVATE RasrAm + RasrMm + RasrBliss + RasrFsa + RasrMc + RasrCore + RasrMathLapack) -if(${MODULE_CART}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrCart) - target_link_libraries(allophone-tool PRIVATE RasrCart) -endif() +if (${MODULE_CART}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrCart) + target_link_libraries(allophone-tool PRIVATE RasrCart) +endif () -if(${MODULE_FLF_CORE}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrFlfCore) - target_link_libraries(allophone-tool PRIVATE RasrFlfCore) -endif() +if (${MODULE_FLF_CORE}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrFlfCore) + target_link_libraries(allophone-tool PRIVATE RasrFlfCore) +endif () -if(${MODULE_MATH_NR}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrMathNr) - target_link_libraries(allophone-tool PRIVATE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrMathNr) + target_link_libraries(allophone-tool PRIVATE RasrMathNr) +endif () -if(${MODULE_ONNX}) - add_onnx_dependencies(acoustic-model-trainer) - target_link_libraries(acoustic-model-trainer PRIVATE RasrOnnx) -endif() +if (${MODULE_ONNX}) + add_onnx_dependencies(acoustic-model-trainer) + target_link_libraries(acoustic-model-trainer PRIVATE RasrOnnx) +endif () -if(${MODULE_PYTHON}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrPython) - add_python_dependencies(acoustic-model-trainer) -endif() +if (${MODULE_PYTHON}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrPython) + add_python_dependencies(acoustic-model-trainer) +endif () -if(${MODULE_NN}) - target_link_libraries(acoustic-model-trainer PRIVATE RasrNn) -endif() +if (${MODULE_NN}) + target_link_libraries(acoustic-model-trainer PRIVATE RasrNn) +endif () -if(${MODULE_TENSORFLOW}) - add_tf_dependencies(acoustic-model-trainer) - target_link_libraries(acoustic-model-trainer PRIVATE RasrTensorflow) -endif() +if (${MODULE_TENSORFLOW}) + add_tf_dependencies(acoustic-model-trainer) + target_link_libraries(acoustic-model-trainer PRIVATE RasrTensorflow) +endif () diff --git a/src/Tools/Aligner/CMakeLists.txt b/src/Tools/Aligner/CMakeLists.txt index 8db54f88d..3a0b290c6 100644 --- a/src/Tools/Aligner/CMakeLists.txt +++ b/src/Tools/Aligner/CMakeLists.txt @@ -1,12 +1,12 @@ set(aligner_SOURCES - Aligner.cc - AlignAutomaton.cc - SimpleAlignAutomaton.cc - ZeroOrderAlignAutomaton.cc - Common.cc - ConditionalLexicon.cc - ConditionalLexiconPlain.cc - ConditionalLexiconSri.cc) + Aligner.cc + AlignAutomaton.cc + SimpleAlignAutomaton.cc + ZeroOrderAlignAutomaton.cc + Common.cc + ConditionalLexicon.cc + ConditionalLexiconPlain.cc + ConditionalLexiconSri.cc) add_executable(aligner ${ALIGNER_SOURCES}) add_install_executable(aligner) diff --git a/src/Tools/Archiver/CMakeLists.txt b/src/Tools/Archiver/CMakeLists.txt index d3d9d6602..18cf8933b 100644 --- a/src/Tools/Archiver/CMakeLists.txt +++ b/src/Tools/Archiver/CMakeLists.txt @@ -2,49 +2,49 @@ add_executable(archiver Archiver.cc) add_install_executable(archiver) target_link_libraries( - archiver - PRIVATE RasrSpeech - RasrSearch - RasrAdvancedTreeSearch - RasrLattice - RasrLm - RasrFlf - RasrFlfCore - RasrMc - RasrAm - RasrMm - RasrCart - RasrSignal - RasrBliss - RasrMath - RasrMathLapack - RasrMathNr - RasrCore - RasrFlow - RasrFsa) + archiver + PRIVATE RasrSpeech + RasrSearch + RasrAdvancedTreeSearch + RasrLattice + RasrLm + RasrFlf + RasrFlfCore + RasrMc + RasrAm + RasrMm + RasrCart + RasrSignal + RasrBliss + RasrMath + RasrMathLapack + RasrMathNr + RasrCore + RasrFlow + RasrFsa) -if(${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) - target_link_libraries(archiver PRIVATE RasrGenericSeq2SeqTreeSearch) -endif() +if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH}) + target_link_libraries(archiver PRIVATE RasrGenericSeq2SeqTreeSearch) +endif () -if(${MODULE_PYTHON}) - target_link_libraries(archiver PRIVATE RasrPython) - add_python_dependencies(archiver) -endif() +if (${MODULE_PYTHON}) + target_link_libraries(archiver PRIVATE RasrPython) + add_python_dependencies(archiver) +endif () -if(${MODULE_NN}) - target_link_libraries(archiver PRIVATE RasrNn) -endif() +if (${MODULE_NN}) + target_link_libraries(archiver PRIVATE RasrNn) +endif () -if(${MODULE_SEARCH_WFST}) - target_link_libraries(archiver PRIVATE RasrSearchWfst) -endif() +if (${MODULE_SEARCH_WFST}) + target_link_libraries(archiver PRIVATE RasrSearchWfst) +endif () -if(${MODULE_OPENFST}) - target_link_libraries(archiver PRIVATE RasrOpenFst) -endif() +if (${MODULE_OPENFST}) + target_link_libraries(archiver PRIVATE RasrOpenFst) +endif () -if(${MODULE_LM_TFRNN}) - target_link_libraries(archiver PRIVATE RasrTensorflow) - add_tf_dependencies(archiver) -endif() +if (${MODULE_LM_TFRNN}) + target_link_libraries(archiver PRIVATE RasrTensorflow) + add_tf_dependencies(archiver) +endif () diff --git a/src/Tools/CMakeLists.txt b/src/Tools/CMakeLists.txt index cd6449792..3b1580f8a 100644 --- a/src/Tools/CMakeLists.txt +++ b/src/Tools/CMakeLists.txt @@ -1,3 +1,3 @@ -foreach(TOOL ${TOOLS}) - add_subdirectory(${TOOL}) -endforeach() +foreach (TOOL ${TOOLS}) + add_subdirectory(${TOOL}) +endforeach () diff --git a/src/Tools/CorpusStatistics/CMakeLists.txt b/src/Tools/CorpusStatistics/CMakeLists.txt index 8c70bf651..3d57ff5bd 100644 --- a/src/Tools/CorpusStatistics/CMakeLists.txt +++ b/src/Tools/CorpusStatistics/CMakeLists.txt @@ -2,42 +2,42 @@ add_executable(costa Costa.cc) add_install_executable(costa) target_link_libraries( - costa - PRIVATE RasrLm - RasrMc - RasrBliss - RasrFsa - RasrFlfCore - RasrAudio - RasrSignal - RasrSpeech - RasrAm - RasrMm - RasrFlow - RasrCore - RasrMath - RasrMathLapack - RasrLattice - ${SEARCH_LIBS}) + costa + PRIVATE RasrLm + RasrMc + RasrBliss + RasrFsa + RasrFlfCore + RasrAudio + RasrSignal + RasrSpeech + RasrAm + RasrMm + RasrFlow + RasrCore + RasrMath + RasrMathLapack + RasrLattice + ${SEARCH_LIBS}) -if(${MODULE_CART}) - target_link_libraries(costa PRIVATE RasrCart) -endif() +if (${MODULE_CART}) + target_link_libraries(costa PRIVATE RasrCart) +endif () -if(${MODULE_MATH_NR}) - target_link_libraries(costa PRIVATE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(costa PRIVATE RasrMathNr) +endif () -if(${MODULE_PYTHON}) - target_link_libraries(costa PRIVATE RasrPython) - add_python_dependencies(costa) -endif() +if (${MODULE_PYTHON}) + target_link_libraries(costa PRIVATE RasrPython) + add_python_dependencies(costa) +endif () -if(${MODULE_NN}) - target_link_libraries(costa PRIVATE RasrNn) -endif() +if (${MODULE_NN}) + target_link_libraries(costa PRIVATE RasrNn) +endif () -if(${MODULE_TENSORFLOW}) - add_tf_dependencies(costa) - target_link_libraries(costa PRIVATE RasrTensorflow) -endif() +if (${MODULE_TENSORFLOW}) + add_tf_dependencies(costa) + target_link_libraries(costa PRIVATE RasrTensorflow) +endif () diff --git a/src/Tools/FeatureExtraction/CMakeLists.txt b/src/Tools/FeatureExtraction/CMakeLists.txt index ab87df577..0978aa7c0 100644 --- a/src/Tools/FeatureExtraction/CMakeLists.txt +++ b/src/Tools/FeatureExtraction/CMakeLists.txt @@ -2,45 +2,45 @@ add_executable(feature-extraction FeatureExtraction.cc FeatureExtractor.cc) add_install_executable(feature-extraction) target_link_libraries( - feature-extraction - PRIVATE RasrSpeech - RasrLattice - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - RasrCore - RasrFsa - ${SEARCH_LIBS}) + feature-extraction + PRIVATE RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrFsa + ${SEARCH_LIBS}) -if(${MODULE_CART}) - target_link_libraries(feature-extraction PRIVATE RasrCart) -endif() +if (${MODULE_CART}) + target_link_libraries(feature-extraction PRIVATE RasrCart) +endif () -if(${MODULE_FLF_CORE}) - target_link_libraries(feature-extraction PRIVATE RasrFlfCore) -endif() +if (${MODULE_FLF_CORE}) + target_link_libraries(feature-extraction PRIVATE RasrFlfCore) +endif () -if(${MODULE_MATH_NR}) - target_link_libraries(feature-extraction PRIVATE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(feature-extraction PRIVATE RasrMathNr) +endif () -if(${MODULE_PYTHON}) - target_link_libraries(feature-extraction PRIVATE RasrPython) - add_python_dependencies(feature-extraction) -endif() +if (${MODULE_PYTHON}) + target_link_libraries(feature-extraction PRIVATE RasrPython) + add_python_dependencies(feature-extraction) +endif () -if(${MODULE_NN}) - target_link_libraries(feature-extraction PRIVATE RasrNn) -endif() +if (${MODULE_NN}) + target_link_libraries(feature-extraction PRIVATE RasrNn) +endif () -if(${MODULE_TENSORFLOW}) - target_link_libraries(feature-extraction PRIVATE RasrTensorflow) - add_tf_dependencies(feature-extraction) -endif() +if (${MODULE_TENSORFLOW}) + target_link_libraries(feature-extraction PRIVATE RasrTensorflow) + add_tf_dependencies(feature-extraction) +endif () diff --git a/src/Tools/FeatureStatistics/CMakeLists.txt b/src/Tools/FeatureStatistics/CMakeLists.txt index 651b7f93e..6f2283357 100644 --- a/src/Tools/FeatureStatistics/CMakeLists.txt +++ b/src/Tools/FeatureStatistics/CMakeLists.txt @@ -2,44 +2,44 @@ add_executable(feature-statistics FeatureStatistics.cc) add_install_executable(feature-statistics) target_link_libraries( - feature-statistics - PRIVATE RasrSpeech - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrCore - RasrFsa) + feature-statistics + PRIVATE RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrCore + RasrFsa) -if(${MODULE_CART}) - target_link_libraries(feature-statistics PRIVATE RasrCart) -endif() +if (${MODULE_CART}) + target_link_libraries(feature-statistics PRIVATE RasrCart) +endif () -if(${MODULE_FLF_CORE}) - target_link_libraries(feature-statistics PRIVATE RasrFlfCore) -endif() +if (${MODULE_FLF_CORE}) + target_link_libraries(feature-statistics PRIVATE RasrFlfCore) +endif () -if(${MODULE_MATH_NR}) - target_link_libraries(feature-statistics PRIVATE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(feature-statistics PRIVATE RasrMathNr) +endif () -if(${MODULE_PYTHON}) - target_link_libraries(feature-statistics PRIVATE RasrPython) - add_python_dependencies(feature-statistics) -endif() +if (${MODULE_PYTHON}) + target_link_libraries(feature-statistics PRIVATE RasrPython) + add_python_dependencies(feature-statistics) +endif () -if(${MODULE_NN}) - target_link_libraries(feature-statistics PRIVATE RasrNn) -endif() +if (${MODULE_NN}) + target_link_libraries(feature-statistics PRIVATE RasrNn) +endif () -if(${MODULE_TENSORFLOW}) - target_link_libraries(feature-statistics PRIVATE RasrTensorflow) - add_tf_dependencies(feature-statistics) -endif() +if (${MODULE_TENSORFLOW}) + target_link_libraries(feature-statistics PRIVATE RasrTensorflow) + add_tf_dependencies(feature-statistics) +endif () diff --git a/src/Tools/Flf/CMakeLists.txt b/src/Tools/Flf/CMakeLists.txt index 4d21cbe8f..51b44d948 100644 --- a/src/Tools/Flf/CMakeLists.txt +++ b/src/Tools/Flf/CMakeLists.txt @@ -2,51 +2,51 @@ add_executable(flf-tool FlfTool.cc) add_install_executable(flf-tool) target_link_libraries( - flf-tool - PRIVATE RasrFlf - RasrFlfCore - RasrSpeech - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrCore - RasrFsa - ${SEARCH_LIBS} - RasrLattice) - -if(${MODULE_FLF_EXT}) - target_link_libraries(flf-tool PRIVATE RasrFlfExt) -endif() + flf-tool + PRIVATE RasrFlf + RasrFlfCore + RasrSpeech + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrCore + RasrFsa + ${SEARCH_LIBS} + RasrLattice) + +if (${MODULE_FLF_EXT}) + target_link_libraries(flf-tool PRIVATE RasrFlfExt) +endif () target_link_libraries(flf-tool PRIVATE RasrSignal RasrFlow RasrMath - RasrMathLapack) - -if(${MODULE_CART}) - target_link_libraries(flf-tool PRIVATE RasrCart) -endif() - -if(${MODULE_MATH_NR}) - target_link_libraries(flf-tool PRIVATE RasrMathNr) -endif() - -if(${MODULE_PYTHON}) - target_link_libraries(flf-tool PRIVATE RasrPython) - add_python_dependencies(flf-tool) -endif() - -if(${MODULE_NN}) - target_link_libraries(flf-tool PRIVATE RasrNn) -endif() - -if(${MODULE_ONNX}) - add_onnx_dependencies(flf-tool) - target_link_libraries(flf-tool PRIVATE RasrOnnx) -endif() - -if(${MODULE_TENSORFLOW}) - target_link_libraries(flf-tool PRIVATE RasrTensorflow) - add_tf_dependencies(flf-tool) -endif() + RasrMathLapack) + +if (${MODULE_CART}) + target_link_libraries(flf-tool PRIVATE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(flf-tool PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(flf-tool PRIVATE RasrPython) + add_python_dependencies(flf-tool) +endif () + +if (${MODULE_NN}) + target_link_libraries(flf-tool PRIVATE RasrNn) +endif () + +if (${MODULE_ONNX}) + add_onnx_dependencies(flf-tool) + target_link_libraries(flf-tool PRIVATE RasrOnnx) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(flf-tool PRIVATE RasrTensorflow) + add_tf_dependencies(flf-tool) +endif () diff --git a/src/Tools/Fsa/CMakeLists.txt b/src/Tools/Fsa/CMakeLists.txt index 5e72e586e..8e64d4e29 100644 --- a/src/Tools/Fsa/CMakeLists.txt +++ b/src/Tools/Fsa/CMakeLists.txt @@ -3,6 +3,6 @@ add_install_executable(fsa) target_link_libraries(fsa PRIVATE RasrFsa RasrCore) -if(${MODULE_OPENFST}) - target_link_libraries(fsa PRIVATE RasrOpenFst) -endif() +if (${MODULE_OPENFST}) + target_link_libraries(fsa PRIVATE RasrOpenFst) +endif () diff --git a/src/Tools/LatticeProcessor/CMakeLists.txt b/src/Tools/LatticeProcessor/CMakeLists.txt index 9e93381eb..fdd647322 100644 --- a/src/Tools/LatticeProcessor/CMakeLists.txt +++ b/src/Tools/LatticeProcessor/CMakeLists.txt @@ -2,42 +2,42 @@ add_executable(lattice-processor LatticeProcessor.cc) add_install_executable(lattice-processor) target_link_libraries( - lattice-processor - PRIVATE RasrSpeech - RasrLattice - RasrLm - RasrAm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - RasrCore - RasrFsa - RasrFlfCore - ${SEARCH_LIBS}) + lattice-processor + PRIVATE RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + RasrCore + RasrFsa + RasrFlfCore + ${SEARCH_LIBS}) -if(${MODULE_CART}) - target_link_libraries(lattice-processor PRIVATE RasrCart) -endif() +if (${MODULE_CART}) + target_link_libraries(lattice-processor PRIVATE RasrCart) +endif () -if(${MODULE_MATH_NR}) - target_link_libraries(lattice-processor PRIVATE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(lattice-processor PRIVATE RasrMathNr) +endif () -if(${MODULE_PYTHON}) - target_link_libraries(lattice-processor PRIVATE RasrPython) - add_python_dependencies(lattice-processor) -endif() +if (${MODULE_PYTHON}) + target_link_libraries(lattice-processor PRIVATE RasrPython) + add_python_dependencies(lattice-processor) +endif () -if(${MODULE_NN}) - target_link_libraries(lattice-processor PRIVATE RasrNn) -endif() +if (${MODULE_NN}) + target_link_libraries(lattice-processor PRIVATE RasrNn) +endif () -if(${MODULE_TENSORFLOW}) - target_link_libraries(lattice-processor PRIVATE RasrTensorflow) - add_tf_dependencies(lattice-processor) -endif() +if (${MODULE_TENSORFLOW}) + target_link_libraries(lattice-processor PRIVATE RasrTensorflow) + add_tf_dependencies(lattice-processor) +endif () diff --git a/src/Tools/Lm/CMakeLists.txt b/src/Tools/Lm/CMakeLists.txt index 4383d6588..c854787df 100644 --- a/src/Tools/Lm/CMakeLists.txt +++ b/src/Tools/Lm/CMakeLists.txt @@ -2,43 +2,43 @@ add_executable(lm-util LmUtilityTool.cc) add_install_executable(lm-util) target_link_libraries( - lm-util - PRIVATE RasrFlf - RasrFlfCore - RasrSpeech - RasrAm - RasrMc - RasrBliss - RasrNn - RasrMm - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrLattice - RasrFsa - RasrLm - RasrCore) + lm-util + PRIVATE RasrFlf + RasrFlfCore + RasrSpeech + RasrAm + RasrMc + RasrBliss + RasrNn + RasrMm + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrLattice + RasrFsa + RasrLm + RasrCore) -if(${MODULE_FLF_EXT}) - target_link_libraries(lm-util PRIVATE RasrFlfExt) -endif() +if (${MODULE_FLF_EXT}) + target_link_libraries(lm-util PRIVATE RasrFlfExt) +endif () -if(${MODULE_CART}) - target_link_libraries(lm-util PRIVATE RasrCart) -endif() +if (${MODULE_CART}) + target_link_libraries(lm-util PRIVATE RasrCart) +endif () -if(${MODULE_MATH_NR}) - target_link_libraries(lm-util PRIVATE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(lm-util PRIVATE RasrMathNr) +endif () -if(${MODULE_PYTHON}) - target_link_libraries(lm-util PRIVATE RasrPython) - add_python_dependencies(lm-util) -endif() +if (${MODULE_PYTHON}) + target_link_libraries(lm-util PRIVATE RasrPython) + add_python_dependencies(lm-util) +endif () -if(${MODULE_TENSORFLOW}) - target_link_libraries(lm-util PRIVATE RasrTensorflow) - add_tf_dependencies(lm-util) -endif() +if (${MODULE_TENSORFLOW}) + target_link_libraries(lm-util PRIVATE RasrTensorflow) + add_tf_dependencies(lm-util) +endif () diff --git a/src/Tools/Math/CMakeLists.txt b/src/Tools/Math/CMakeLists.txt index f04a4e8e6..0b7f17465 100644 --- a/src/Tools/Math/CMakeLists.txt +++ b/src/Tools/Math/CMakeLists.txt @@ -2,4 +2,4 @@ add_executable(matrix-tool MatrixTool.cc) add_install_executable(matrix-tool) target_link_libraries(matrix-tool PRIVATE RasrMath RasrMathNr RasrMathLapack - RasrCore) + RasrCore) diff --git a/src/Tools/NnTrainer/CMakeLists.txt b/src/Tools/NnTrainer/CMakeLists.txt index 4a1291075..92f568491 100644 --- a/src/Tools/NnTrainer/CMakeLists.txt +++ b/src/Tools/NnTrainer/CMakeLists.txt @@ -2,43 +2,43 @@ add_executable(nn-trainer NnTrainer.cc) add_install_executable(nn-trainer) target_link_libraries( - nn-trainer - PRIVATE RasrAm - RasrAudio - RasrBliss - RasrFlow - RasrLm - RasrMathLapack - RasrMath - RasrMc - RasrMm - RasrSignal - RasrSpeech - ${SEARCH_LIBS} - RasrNn - RasrFsa - RasrCore) + nn-trainer + PRIVATE RasrAm + RasrAudio + RasrBliss + RasrFlow + RasrLm + RasrMathLapack + RasrMath + RasrMc + RasrMm + RasrSignal + RasrSpeech + ${SEARCH_LIBS} + RasrNn + RasrFsa + RasrCore) target_compile_options(nn-trainer PRIVATE "-fexceptions") -if(${MODULE_CART}) - target_link_libraries(nn-trainer PRIVATE RasrCart) -endif() +if (${MODULE_CART}) + target_link_libraries(nn-trainer PRIVATE RasrCart) +endif () -if(${MODULE_FLF_CORE}) - target_link_libraries(nn-trainer PRIVATE RasrFlfCore) -endif() +if (${MODULE_FLF_CORE}) + target_link_libraries(nn-trainer PRIVATE RasrFlfCore) +endif () -if(${MODULE_MATH_NR}) - target_link_libraries(nn-trainer PRIVATE RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + target_link_libraries(nn-trainer PRIVATE RasrMathNr) +endif () -if(${MODULE_PYTHON}) - target_link_libraries(nn-trainer PRIVATE RasrPython) - add_python_dependencies(nn-trainer) -endif() +if (${MODULE_PYTHON}) + target_link_libraries(nn-trainer PRIVATE RasrPython) + add_python_dependencies(nn-trainer) +endif () -if(${MODULE_TENSORFLOW}) - target_link_libraries(nn-trainer PRIVATE RasrTensorflow) - add_tf_dependencies(nn-trainer) -endif() +if (${MODULE_TENSORFLOW}) + target_link_libraries(nn-trainer PRIVATE RasrTensorflow) + add_tf_dependencies(nn-trainer) +endif () diff --git a/src/Tools/SpeechRecognizer/CMakeLists.txt b/src/Tools/SpeechRecognizer/CMakeLists.txt index acfe2016c..44f157260 100644 --- a/src/Tools/SpeechRecognizer/CMakeLists.txt +++ b/src/Tools/SpeechRecognizer/CMakeLists.txt @@ -2,63 +2,63 @@ add_executable(speech-recognizer SpeechRecognizer.cc) add_install_executable(speech-recognizer) set(SpeechRecognizer_LIBRARIES - RasrSpeech - RasrLattice - RasrAm - RasrLm - RasrMm - RasrMc - RasrBliss - RasrAudio - RasrSignal - RasrFlow - RasrMath - RasrMathLapack - ${SEARCH_LIBS} - RasrCore - RasrFsa) + RasrSpeech + RasrLattice + RasrAm + RasrLm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrSignal + RasrFlow + RasrMath + RasrMathLapack + ${SEARCH_LIBS} + RasrCore + RasrFsa) -if(${MODULE_CART}) - list(APPEND SpeechRecognizer_LIBRARIES RasrCart) -endif() +if (${MODULE_CART}) + list(APPEND SpeechRecognizer_LIBRARIES RasrCart) +endif () -if(${MODULE_FLF_CORE}) - list(APPEND SpeechRecognizer_LIBRARIES RasrFlfCore) -endif() +if (${MODULE_FLF_CORE}) + list(APPEND SpeechRecognizer_LIBRARIES RasrFlfCore) +endif () -if(${MODULE_MATH_NR}) - list(APPEND SpeechRecognizer_LIBRARIES RasrMathNr) -endif() +if (${MODULE_MATH_NR}) + list(APPEND SpeechRecognizer_LIBRARIES RasrMathNr) +endif () -if(${MODULE_SEARCH_WFST}) - list(APPEND SpeechRecognizer_LIBRARIES RasrSearchWfst) -endif() +if (${MODULE_SEARCH_WFST}) + list(APPEND SpeechRecognizer_LIBRARIES RasrSearchWfst) +endif () -if(${MODULE_PYTHON}) - list(APPEND SpeechRecognizer_LIBRARIES RasrPython) -endif() +if (${MODULE_PYTHON}) + list(APPEND SpeechRecognizer_LIBRARIES RasrPython) +endif () -if(${MODULE_ONNX}) - list(APPEND SpeechRecognizer_LIBRARIES RasrOnnx) -endif() +if (${MODULE_ONNX}) + list(APPEND SpeechRecognizer_LIBRARIES RasrOnnx) +endif () -if(${MODULE_NN}) - list(APPEND SpeechRecognizer_LIBRARIES RasrNn) -endif() +if (${MODULE_NN}) + list(APPEND SpeechRecognizer_LIBRARIES RasrNn) +endif () -if(${MODULE_TENSORFLOW}) - list(APPEND SpeechRecognizer_LIBRARIES RasrTensorflow) -endif() +if (${MODULE_TENSORFLOW}) + list(APPEND SpeechRecognizer_LIBRARIES RasrTensorflow) +endif () target_link_libraries(speech-recognizer PRIVATE ${SpeechRecognizer_LIBRARIES}) -if(${MODULE_ONNX}) - add_onnx_dependencies(speech-recognizer) -endif() +if (${MODULE_ONNX}) + add_onnx_dependencies(speech-recognizer) +endif () -if(${MODULE_SEARCH_WFST}) - add_executable(fsa-search-builder FsaSearchBuilder.cc) - add_install_executable(fsa-search-builder) - target_link_libraries(fsa-search-builder - PRIVATE ${SpeechRecognizer_LIBRARIES}) -endif() +if (${MODULE_SEARCH_WFST}) + add_executable(fsa-search-builder FsaSearchBuilder.cc) + add_install_executable(fsa-search-builder) + target_link_libraries(fsa-search-builder + PRIVATE ${SpeechRecognizer_LIBRARIES}) +endif () From cf08cecf7d5a1afa892c0a396245da992845fd45 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 15 Mar 2024 13:33:29 +0100 Subject: [PATCH 10/13] Extend UniversalSettings to allow varying compilers/architectures. --- cmake_resources/UniversalSettings.cmake | 108 +++++++++++++----------- 1 file changed, 58 insertions(+), 50 deletions(-) diff --git a/cmake_resources/UniversalSettings.cmake b/cmake_resources/UniversalSettings.cmake index d2e6437a9..995624611 100644 --- a/cmake_resources/UniversalSettings.cmake +++ b/cmake_resources/UniversalSettings.cmake @@ -4,30 +4,41 @@ add_compile_definitions(CMAKE_DISABLE_MODULES_HH) add_compile_definitions(_GNU_SOURCE) add_compile_options( - -pipe - -funsigned-char - -fno-exceptions - -Wno-unknown-pragmas - -Wall - -Wno-long-long - -Wno-deprecated - -fno-strict-aliasing - -ffast-math - -msse3) + -pipe + -funsigned-char + -fno-exceptions + -Wno-unknown-pragmas + -Wall + -Wno-long-long + -Wno-deprecated + -fno-strict-aliasing + -ffast-math) -if(NOT DEFINED MARCH) - set(MARCH - "native" - CACHE STRING "Default target architecture") -endif() +if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "linux-x86_64") + add_compile_options(-msse3) +endif () + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + message(STATUS "Using GCC compiler") +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + message(STATUS "Using Clang compiler") + add_compile_definitions(_GLIBCXX_PERMIT_BACKWARD_HASH) + add_compile_options(-D__float128=void) # hack: http://llvm.org/bugs/show_bug.cgi?id=13530 +else () + message(WARNING "Compiler might not be supported. Use at your own risk") +endif () + +if (NOT DEFINED MARCH) + set(MARCH "native" CACHE STRING "Default target architecture") +endif () include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-march=${MARCH}" COMPILER_SUPPORTS_MARCH) -if(COMPILER_SUPPORTS_MARCH) - add_compile_options("-march=${MARCH}") - message(STATUS "Using -march=${MARCH}") -else() - message(STATUS "Architecture -march=${MARCH} is not supported") -endif() +if (COMPILER_SUPPORTS_MARCH) + add_compile_options("-march=${MARCH}") + message(STATUS "Using -march=${MARCH}") +else () + message(STATUS "Architecture -march=${MARCH} is not supported") +endif () find_package(LibXml2 REQUIRED) find_package(Threads REQUIRED) @@ -36,41 +47,38 @@ find_package(LAPACK REQUIRED) find_library(LIB_RT rt REQUIRED) -link_libraries(LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads LAPACK::LAPACK - ${LIB_RT}) +link_libraries(LibXml2::LibXml2 ZLIB::ZLIB Threads::Threads LAPACK::LAPACK ${LIB_RT}) include_directories(${LIBXML2_INCLUDE_DIR}) include_directories(${CMAKE_SOURCE_DIR}/src) -if(${MODULE_AUDIO_FFMPEG}) - find_package(PkgConfig REQUIRED) - pkg_check_modules(AVFORMAT REQUIRED IMPORTED_TARGET libavformat) - pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample) - pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec) - pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil) +if (${MODULE_AUDIO_FFMPEG}) + find_package(PkgConfig REQUIRED) + pkg_check_modules(AVFORMAT REQUIRED IMPORTED_TARGET libavformat) + pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample) + pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec) + pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil) - include_directories(${AVFORMAT_INCLUDE_DIRS} ${SWRESAMPLE_INCLUDE_DIRS} - ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS}) - link_libraries(PkgConfig::AVFORMAT PkgConfig::SWRESAMPLE PkgConfig::AVCODEC - PkgConfig::AVUTIL) -endif() + include_directories(${AVFORMAT_INCLUDE_DIRS} ${SWRESAMPLE_INCLUDE_DIRS} ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS}) + link_libraries(PkgConfig::AVFORMAT PkgConfig::SWRESAMPLE PkgConfig::AVCODEC PkgConfig::AVUTIL) +endif () -if(${MODULE_OPENMP}) - find_package(OpenMP REQUIRED) - add_compile_options(OpenMP_CXX_FLAGS) - include_directories(OpenMP_CXX_INCLUDE_DIRS) - link_libraries(OpenMP::OpenMP_CXX) -endif() +if (${MODULE_OPENMP}) + find_package(OpenMP REQUIRED) + add_compile_options(OpenMP_CXX_FLAGS) + include_directories(OpenMP_CXX_INCLUDE_DIRS) + link_libraries(OpenMP::OpenMP_CXX) +endif () -if(${MODULE_CUDA}) - enable_language(CUDA) - set(CMAKE_CUDA_ARCHITECTURES 61;75;86;89) -endif() +if (${MODULE_CUDA}) + enable_language(CUDA) + set(CMAKE_CUDA_ARCHITECTURES 61;75;86;89) +endif () -if(${MODULE_AUDIO_FLAC}) - link_libraries(FLAC) -endif() +if (${MODULE_AUDIO_FLAC}) + link_libraries(FLAC) +endif () -if(${MODULE_AUDIO_WAV_SYSTEM}) - link_libraries(sndfile) -endif() +if (${MODULE_AUDIO_WAV_SYSTEM}) + link_libraries(sndfile) +endif () From 2f8df6a35ca8825c7b640c2db6c4a68a41827d3e Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 15 Mar 2024 13:41:22 +0100 Subject: [PATCH 11/13] Rename UniversalSettings to GeneralCompileOptions --- CMakeLists.txt | 2 +- .../{UniversalSettings.cmake => GeneralCompileOptions.cmake} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename cmake_resources/{UniversalSettings.cmake => GeneralCompileOptions.cmake} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcf029057..46db9c02a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(RASR) include(cmake_resources/ConfigurationTypes.cmake) include(cmake_resources/Modules.cmake) -include(cmake_resources/UniversalSettings.cmake) +include(cmake_resources/GeneralCompileOptions.cmake) if (${MODULE_PYTHON}) include(cmake_resources/Python.cmake) diff --git a/cmake_resources/UniversalSettings.cmake b/cmake_resources/GeneralCompileOptions.cmake similarity index 100% rename from cmake_resources/UniversalSettings.cmake rename to cmake_resources/GeneralCompileOptions.cmake From f6d1d36d7235551cc8cff66b31c2c9d063a2f5f1 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Fri, 15 Mar 2024 14:39:59 +0100 Subject: [PATCH 12/13] Minor formatting --- src/Audio/CMakeLists.txt | 2 +- src/Bliss/CMakeLists.txt | 2 +- src/Cart/CMakeLists.txt | 2 +- src/Core/CMakeLists.txt | 2 +- src/Flf/CMakeLists.txt | 5 ++--- src/Flf/FlfCore/CMakeLists.txt | 2 +- src/Flf/FlfExt/CMakeLists.txt | 2 +- src/Fsa/CMakeLists.txt | 2 +- src/Lattice/CMakeLists.txt | 2 +- src/Lm/CMakeLists.txt | 2 +- src/Math/CMakeLists.txt | 2 +- src/Math/Lapack/CMakeLists.txt | 2 +- src/Math/Nr/CMakeLists.txt | 2 +- src/Mm/CMakeLists.txt | 2 +- src/Nn/CMakeLists.txt | 2 +- src/Onnx/CMakeLists.txt | 2 +- src/OpenFst/CMakeLists.txt | 2 +- src/Python/CMakeLists.txt | 2 +- src/Search/AdvancedTreeSearch/CMakeLists.txt | 2 +- src/Search/CMakeLists.txt | 2 +- src/Search/Wfst/CMakeLists.txt | 2 +- src/Signal/CMakeLists.txt | 2 +- src/Speech/CMakeLists.txt | 2 +- src/Tensorflow/CMakeLists.txt | 2 +- 24 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/Audio/CMakeLists.txt b/src/Audio/CMakeLists.txt index e818582a9..7adf5ee47 100644 --- a/src/Audio/CMakeLists.txt +++ b/src/Audio/CMakeLists.txt @@ -25,4 +25,4 @@ add_library(RasrAudio STATIC ${Audio_SOURCES}) target_link_libraries(RasrAudio INTERFACE RasrFlow RasrCore) add_executable(check-audio check.cc) -target_link_libraries(check-audio PRIVATE RasrAudio) \ No newline at end of file +target_link_libraries(check-audio PRIVATE RasrAudio) diff --git a/src/Bliss/CMakeLists.txt b/src/Bliss/CMakeLists.txt index adf12c649..62cde38df 100644 --- a/src/Bliss/CMakeLists.txt +++ b/src/Bliss/CMakeLists.txt @@ -34,4 +34,4 @@ if (${MODULE_PYTHON}) endif () add_executable(check-bliss check.cc) -target_link_libraries(check-bliss PRIVATE RasrBliss) \ No newline at end of file +target_link_libraries(check-bliss PRIVATE RasrBliss) diff --git a/src/Cart/CMakeLists.txt b/src/Cart/CMakeLists.txt index 8bf04f207..3e96b34a8 100644 --- a/src/Cart/CMakeLists.txt +++ b/src/Cart/CMakeLists.txt @@ -13,4 +13,4 @@ add_library(RasrCart STATIC ${Cart_SOURCES}) target_link_libraries(RasrCart INTERFACE RasrCore) add_executable(check-cart check.cc) -target_link_libraries(check-cart PRIVATE RasrCart) \ No newline at end of file +target_link_libraries(check-cart PRIVATE RasrCart) diff --git a/src/Core/CMakeLists.txt b/src/Core/CMakeLists.txt index d02d9344e..143d42ebc 100644 --- a/src/Core/CMakeLists.txt +++ b/src/Core/CMakeLists.txt @@ -59,4 +59,4 @@ add_dependencies(RasrCore SourceVersion) target_compile_options(RasrCore PRIVATE "-fexceptions") add_executable(check-core check.cc) -target_link_libraries(check-core PRIVATE RasrCore) \ No newline at end of file +target_link_libraries(check-core PRIVATE RasrCore) diff --git a/src/Flf/CMakeLists.txt b/src/Flf/CMakeLists.txt index 1805e0400..7359c888c 100644 --- a/src/Flf/CMakeLists.txt +++ b/src/Flf/CMakeLists.txt @@ -84,8 +84,7 @@ target_link_libraries( RasrBliss RasrFlow RasrFsa - RasrCore -) + RasrCore) add_executable(check-flf check.cc) -target_link_libraries(check-flf PRIVATE RasrFlf) \ No newline at end of file +target_link_libraries(check-flf PRIVATE RasrFlf) diff --git a/src/Flf/FlfCore/CMakeLists.txt b/src/Flf/FlfCore/CMakeLists.txt index 0b81da36c..1a4342384 100644 --- a/src/Flf/FlfCore/CMakeLists.txt +++ b/src/Flf/FlfCore/CMakeLists.txt @@ -17,4 +17,4 @@ add_library(RasrFlfCore STATIC ${FlfCore_SOURCES}) target_link_libraries(RasrFlfCore INTERFACE RasrFsa RasrCore) add_executable(check-flf-core check.cc) -target_link_libraries(check-flf-core PRIVATE RasrFlfCore) \ No newline at end of file +target_link_libraries(check-flf-core PRIVATE RasrFlfCore) diff --git a/src/Flf/FlfExt/CMakeLists.txt b/src/Flf/FlfExt/CMakeLists.txt index 457c3cea6..21c887e2d 100644 --- a/src/Flf/FlfExt/CMakeLists.txt +++ b/src/Flf/FlfExt/CMakeLists.txt @@ -6,4 +6,4 @@ set(FlfExt_SOURCES ) add_library(RasrFlfExt STATIC ${FlfExt_SOURCES}) -target_link_libraries(RasrFlfExt INTERFACE RasrFlf RasrFsa RasrCore) \ No newline at end of file +target_link_libraries(RasrFlfExt INTERFACE RasrFlf RasrFsa RasrCore) diff --git a/src/Fsa/CMakeLists.txt b/src/Fsa/CMakeLists.txt index 292f8e460..d4b26f824 100644 --- a/src/Fsa/CMakeLists.txt +++ b/src/Fsa/CMakeLists.txt @@ -40,4 +40,4 @@ target_link_libraries(RasrFsa INTERFACE RasrCore) # check.cc code is broken # add_executable(check-fsa check.cc) -# target_link_libraries(check-fsa PRIVATE RasrFsa) \ No newline at end of file +# target_link_libraries(check-fsa PRIVATE RasrFsa) diff --git a/src/Lattice/CMakeLists.txt b/src/Lattice/CMakeLists.txt index a42aa29ad..b35772d1e 100644 --- a/src/Lattice/CMakeLists.txt +++ b/src/Lattice/CMakeLists.txt @@ -50,4 +50,4 @@ endif () # check.cc code is broken # add_executable(check-lattice check.cc) -# target_link_libraries(check-lattice PRIVATE RasrLattice) \ No newline at end of file +# target_link_libraries(check-lattice PRIVATE RasrLattice) diff --git a/src/Lm/CMakeLists.txt b/src/Lm/CMakeLists.txt index f35b9c4e9..028553e8e 100644 --- a/src/Lm/CMakeLists.txt +++ b/src/Lm/CMakeLists.txt @@ -84,4 +84,4 @@ endif () # check.cc code is broken # add_executable(check-lm check.cc) -# target_link_libraries(check-lm PRIVATE RasrLm) \ No newline at end of file +# target_link_libraries(check-lm PRIVATE RasrLm) diff --git a/src/Math/CMakeLists.txt b/src/Math/CMakeLists.txt index cf464a5eb..e21a211cf 100644 --- a/src/Math/CMakeLists.txt +++ b/src/Math/CMakeLists.txt @@ -29,4 +29,4 @@ target_link_libraries(RasrMath INTERFACE RasrMathNr RasrMathLapack RasrCore) # check.cc code is broken # add_executable(check-math check.cc) -# target_link_libraries(check-math PRIVATE RasrMath) \ No newline at end of file +# target_link_libraries(check-math PRIVATE RasrMath) diff --git a/src/Math/Lapack/CMakeLists.txt b/src/Math/Lapack/CMakeLists.txt index 75dee37be..4627d6637 100644 --- a/src/Math/Lapack/CMakeLists.txt +++ b/src/Math/Lapack/CMakeLists.txt @@ -9,4 +9,4 @@ add_library(RasrMathLapack STATIC ${RasrMathLapack_SOURCES}) target_link_libraries(RasrMathLapack INTERFACE RasrCore) add_executable(check-math-lapack check.cc) -target_link_libraries(check-math-lapack PRIVATE RasrMathLapack) \ No newline at end of file +target_link_libraries(check-math-lapack PRIVATE RasrMathLapack) diff --git a/src/Math/Nr/CMakeLists.txt b/src/Math/Nr/CMakeLists.txt index da00d1ccb..f43127567 100644 --- a/src/Math/Nr/CMakeLists.txt +++ b/src/Math/Nr/CMakeLists.txt @@ -15,4 +15,4 @@ add_library(RasrMathNr STATIC ${RasrMathNr_SOURCES}) target_link_libraries(RasrMathNr INTERFACE RasrCore) add_executable(check-math-nr check.cc) -target_link_libraries(check-math-nr PRIVATE RasrMathNr) \ No newline at end of file +target_link_libraries(check-math-nr PRIVATE RasrMathNr) diff --git a/src/Mm/CMakeLists.txt b/src/Mm/CMakeLists.txt index 9eeb47e1e..e337ee0e7 100644 --- a/src/Mm/CMakeLists.txt +++ b/src/Mm/CMakeLists.txt @@ -70,4 +70,4 @@ if (${MODULE_MM_BATCH}) endif () add_executable(check-mm check.cc) -target_link_libraries(check-mm PRIVATE RasrMm) \ No newline at end of file +target_link_libraries(check-mm PRIVATE RasrMm) diff --git a/src/Nn/CMakeLists.txt b/src/Nn/CMakeLists.txt index 21dc6a83b..7fc44a7f3 100644 --- a/src/Nn/CMakeLists.txt +++ b/src/Nn/CMakeLists.txt @@ -75,4 +75,4 @@ if (${MODULE_GENERIC_SEQ2SEQ_TREE_SEARCH} AND ${MODULE_TENSORFLOW}) endif () add_executable(check-nn check.cc) -target_link_libraries(check-nn PRIVATE RasrNn) \ No newline at end of file +target_link_libraries(check-nn PRIVATE RasrNn) diff --git a/src/Onnx/CMakeLists.txt b/src/Onnx/CMakeLists.txt index 0b6fa8130..cbfd71a46 100644 --- a/src/Onnx/CMakeLists.txt +++ b/src/Onnx/CMakeLists.txt @@ -8,4 +8,4 @@ target_link_libraries(RasrOnnx INTERFACE RasrCore) add_executable(check-onnx check.cc) target_link_libraries(check-onnx PRIVATE RasrOnnx) -add_onnx_dependencies(check-onnx) \ No newline at end of file +add_onnx_dependencies(check-onnx) diff --git a/src/OpenFst/CMakeLists.txt b/src/OpenFst/CMakeLists.txt index a227d93ed..ebe2c69af 100644 --- a/src/OpenFst/CMakeLists.txt +++ b/src/OpenFst/CMakeLists.txt @@ -5,4 +5,4 @@ add_library(RasrOpenFst STATIC ${RasrOpenFst_SOURCES}) target_link_libraries(RasrOpenFst INTERFACE RasrBliss RasrFsa RasrCore) add_executable(check-openfst check.cc) -target_link_libraries(check-openfst PRIVATE RasrOpenFst) \ No newline at end of file +target_link_libraries(check-openfst PRIVATE RasrOpenFst) diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index e92c4c5e7..2ba0fc670 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -7,4 +7,4 @@ target_compile_options(RasrPython PRIVATE "-fexceptions") add_executable(check-python check.cc) target_link_libraries(check-python PRIVATE RasrPython) -add_python_dependencies(check-python) \ No newline at end of file +add_python_dependencies(check-python) diff --git a/src/Search/AdvancedTreeSearch/CMakeLists.txt b/src/Search/AdvancedTreeSearch/CMakeLists.txt index 36dbfc882..30dc088e6 100644 --- a/src/Search/AdvancedTreeSearch/CMakeLists.txt +++ b/src/Search/AdvancedTreeSearch/CMakeLists.txt @@ -27,4 +27,4 @@ target_link_libraries(RasrAdvancedTreeSearch INTERFACE target_compile_options(RasrAdvancedTreeSearch PRIVATE "-Wno-sign-compare -Winline --param max-inline-insns-auto=10000 --param max-inline-insns-single=10000 --param large-function-growth=25000 --param inline-unit-growth=400" -) \ No newline at end of file +) diff --git a/src/Search/CMakeLists.txt b/src/Search/CMakeLists.txt index 32d53f25c..39182b0e3 100644 --- a/src/Search/CMakeLists.txt +++ b/src/Search/CMakeLists.txt @@ -32,4 +32,4 @@ add_library(RasrSearch STATIC ${RasrSearch_SOURCES}) target_link_libraries(RasrSearch INTERFACE RasrBliss RasrFsa RasrCore RasrLattice) add_executable(check-search check.cc) -target_link_libraries(check-search PRIVATE RasrSearch) \ No newline at end of file +target_link_libraries(check-search PRIVATE RasrSearch) diff --git a/src/Search/Wfst/CMakeLists.txt b/src/Search/Wfst/CMakeLists.txt index 6db270502..0e3214af4 100644 --- a/src/Search/Wfst/CMakeLists.txt +++ b/src/Search/Wfst/CMakeLists.txt @@ -54,4 +54,4 @@ add_executable(check-search-wfst check.cc) target_link_libraries(check-search-wfst PRIVATE RasrSearchWfst) add_executable(check-search-wfst-ctrans check_ctrans.cc) -target_link_libraries(check-search-wfst-ctrans PRIVATE RasrSearchWfst) \ No newline at end of file +target_link_libraries(check-search-wfst-ctrans PRIVATE RasrSearchWfst) diff --git a/src/Signal/CMakeLists.txt b/src/Signal/CMakeLists.txt index ef45e1a84..2a5d0c021 100644 --- a/src/Signal/CMakeLists.txt +++ b/src/Signal/CMakeLists.txt @@ -93,4 +93,4 @@ if (${MODULE_SIGNAL_ADVANCED_NR}) endif () add_executable(check-signal check.cc) -target_link_libraries(check-signal PRIVATE RasrSignal) \ No newline at end of file +target_link_libraries(check-signal PRIVATE RasrSignal) diff --git a/src/Speech/CMakeLists.txt b/src/Speech/CMakeLists.txt index a7185e31f..6c1cc5937 100644 --- a/src/Speech/CMakeLists.txt +++ b/src/Speech/CMakeLists.txt @@ -152,4 +152,4 @@ if (${MODULE_TENSORFLOW}) endif () add_executable(check-speech check.cc) -target_link_libraries(check-speech PRIVATE RasrSpeech) \ No newline at end of file +target_link_libraries(check-speech PRIVATE RasrSpeech) diff --git a/src/Tensorflow/CMakeLists.txt b/src/Tensorflow/CMakeLists.txt index 90d5b1440..ee56302a1 100644 --- a/src/Tensorflow/CMakeLists.txt +++ b/src/Tensorflow/CMakeLists.txt @@ -16,4 +16,4 @@ add_tf_dependencies(RasrTensorflow) add_executable(check-tensorflow check.cc) target_link_libraries(check-tensorflow PRIVATE RasrTensorflow) -add_tf_dependencies(check-tensorflow) \ No newline at end of file +add_tf_dependencies(check-tensorflow) From 193c05768e2739767dc553d8789e75c3fb0985bd Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Mon, 2 Sep 2024 18:17:05 +0200 Subject: [PATCH 13/13] Add pybind library compilation --- CMakeLists.txt | 5 ++ cmake_resources/GeneralCompileOptions.cmake | 1 + cmake_resources/Modules.cmake | 1 + cmake_resources/Tensorflow.cmake | 2 + src/Python/CMakeLists.txt | 13 +++-- src/Tools/LibRASR/CMakeLists.txt | 63 +++++++++++++++++++++ src/Tools/LibRASR/LibRASR.cc | 2 + 7 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 src/Tools/LibRASR/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 46db9c02a..a84e4d443 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ set(ARCH_DESCRIPTION "${SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}-${BUILD_TYPE}") set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/arch/${ARCH_DESCRIPTION}/") +set(INSTALL_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib/${ARCH_DESCRIPTION}") function(add_install_executable EXECUTABLE_NAME) install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION .) @@ -31,6 +32,10 @@ function(add_install_executable EXECUTABLE_NAME) "${EXECUTABLE_NAME}.${ARCH_DESCRIPTION}") endfunction() +function(add_install_library LIBRARY_NAME) + install(TARGETS ${LIBRARY_NAME} LIBRARY DESTINATION ${INSTALL_LIB_DIR}) +endfunction() + add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/SourceVersion.cc COMMAND diff --git a/cmake_resources/GeneralCompileOptions.cmake b/cmake_resources/GeneralCompileOptions.cmake index 995624611..29cc46af3 100644 --- a/cmake_resources/GeneralCompileOptions.cmake +++ b/cmake_resources/GeneralCompileOptions.cmake @@ -4,6 +4,7 @@ add_compile_definitions(CMAKE_DISABLE_MODULES_HH) add_compile_definitions(_GNU_SOURCE) add_compile_options( + -fPIC -pipe -funsigned-char -fno-exceptions diff --git a/cmake_resources/Modules.cmake b/cmake_resources/Modules.cmake index 687ef03b0..25ffbbbcb 100644 --- a/cmake_resources/Modules.cmake +++ b/cmake_resources/Modules.cmake @@ -121,6 +121,7 @@ add_tool_option(CorpusStatistics ON) add_tool_option(FeatureExtraction ON) add_tool_option(FeatureStatistics ON) add_tool_option(Fsa ON) +add_tool_option(LibRASR ON) add_tool_option(Lm ON) add_tool_option(SpeechRecognizer ON) add_tool_option(Xml ON) diff --git a/cmake_resources/Tensorflow.cmake b/cmake_resources/Tensorflow.cmake index f66d79f94..9533a7ca1 100644 --- a/cmake_resources/Tensorflow.cmake +++ b/cmake_resources/Tensorflow.cmake @@ -23,6 +23,8 @@ endif () # Output the found directory for debugging purposes message(STATUS "Tensorflow include directory: ${Tensorflow_INCLUDE_DIR}") +set(CMAKE_FIND_LIBRARY_SUFFIXES .so .so.1 .so.2) + find_library( Tensorflow_CC NAMES tensorflow_cc diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index 2ba0fc670..455c36cc9 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -1,10 +1,11 @@ -set(RasrPython_SOURCES Init.cc Numpy.cc Utilities.cc) +set(RasrPython_SOURCES + AllophoneStateFsaBuilder.cc + Configuration.cc + Init.cc + Numpy.cc + Utilities.cc +) add_library(RasrPython STATIC ${RasrPython_SOURCES}) -target_link_libraries(RasrPython INTERFACE RasrCore) add_python_dependencies(RasrPython) target_compile_options(RasrPython PRIVATE "-fexceptions") - -add_executable(check-python check.cc) -target_link_libraries(check-python PRIVATE RasrPython) -add_python_dependencies(check-python) diff --git a/src/Tools/LibRASR/CMakeLists.txt b/src/Tools/LibRASR/CMakeLists.txt new file mode 100644 index 000000000..705aa09a9 --- /dev/null +++ b/src/Tools/LibRASR/CMakeLists.txt @@ -0,0 +1,63 @@ +find_package(pybind11 REQUIRED) + +set(librasr_SOURCES + LibRASR.cc +) + +if (${MODULE_PYTHON}) + list(APPEND librasr_SOURCES PybindModule.cc) +endif () + +pybind11_add_module(librasr PybindModule.cc LibRASR.cc) + +target_link_libraries(librasr PRIVATE + RasrFlf + RasrFlfCore + RasrSpeech + RasrLattice + RasrLm + RasrAm + RasrMm + RasrMc + RasrBliss + RasrAudio + RasrCore + RasrFsa + RasrFlow + RasrSignal + RasrMath + RasrMathLapack +) + +add_install_library(librasr) + +if (${MODULE_FLF_EXT}) + target_link_libraries(librasr PRIVATE RasrFlfExt) +endif () + +if (${MODULE_CART}) + target_link_libraries(librasr PRIVATE RasrCart) +endif () + +if (${MODULE_MATH_NR}) + target_link_libraries(librasr PRIVATE RasrMathNr) +endif () + +if (${MODULE_PYTHON}) + target_link_libraries(librasr PRIVATE RasrPython) + add_python_dependencies(librasr) +endif () + +if (${MODULE_NN}) + target_link_libraries(librasr PRIVATE RasrNn) +endif () + +if (${MODULE_ONNX}) + target_link_libraries(librasr PRIVATE RasrOnnx) + add_onnx_dependencies(librasr) +endif () + +if (${MODULE_TENSORFLOW}) + target_link_libraries(librasr PRIVATE RasrTensorflow) + add_tf_dependencies(librasr) +endif () diff --git a/src/Tools/LibRASR/LibRASR.cc b/src/Tools/LibRASR/LibRASR.cc index ee676611b..94c1be53a 100644 --- a/src/Tools/LibRASR/LibRASR.cc +++ b/src/Tools/LibRASR/LibRASR.cc @@ -7,7 +7,9 @@ #include #include #include +#ifndef CMAKE_DISABLE_MODULES_HH #include +#endif #include #include #ifdef MODULE_NN