Skip to content

Commit 2c3e072

Browse files
authored
Merge pull request #1 from kaldi-asr/master
Sync
2 parents a9d0c2f + 701f131 commit 2c3e072

File tree

2 files changed

+50
-4
lines changed

2 files changed

+50
-4
lines changed

CMakeLists.txt

+34-4
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,25 @@ if(CONDA_ROOT)
2020

2121
endif()
2222

23-
include(third_party/get_third_party)
23+
option(BuildForFedora "Build for Fedora. Means that everything is build with Border tools" NO)
24+
25+
if(BuildForFedora)
26+
27+
# You also need to install sudo dnf install lapack-devel openfst-devel
28+
set(CMAKE_CXX_STANDARD 17)
29+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
30+
set(CMAKE_CXX_EXTENSIONS OFF)
31+
32+
#find_package(PkgConfig REQUIRED)
33+
34+
#pkg_check_modules(FST REQUIRED fst)
35+
36+
else()
37+
include(third_party/get_third_party)
38+
39+
include(cmake/third_party/openfst.cmake)
40+
endif()
2441

25-
include(cmake/third_party/openfst.cmake)
2642

2743
find_package(PythonInterp)
2844
if(NOT PYTHON_EXECUTABLE)
@@ -43,8 +59,11 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE}
4359
)
4460
unset(IS_LIB_SHARE)
4561

46-
set(CMAKE_CXX_STANDARD 14)
47-
set(CMAKE_CXX_EXTENSIONS OFF)
62+
if(BuildForFedora)
63+
else()
64+
set(CMAKE_CXX_STANDARD 14)
65+
set(CMAKE_CXX_EXTENSIONS OFF)
66+
endif()
4867
set(CMAKE_INSTALL_MESSAGE LAZY) # hide "-- Up-to-date: ..."
4968
if(BUILD_SHARED_LIBS)
5069
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -228,8 +247,19 @@ endif()
228247
# PATHS "${CMAKE_CURRENT_SOURCE_DIR}/tools/openfst/include"
229248
# REQUIRED)
230249

250+
if(BuildForFedora)
251+
# Version used used by Fedora 41 is 1.83
252+
# TODO: Detect the right version and put it here.
253+
add_definitions(-DOPENFST_VER=18300)
254+
# link_directories(/usr/lib64)
255+
# include_directories(/usr/include/fst)
256+
endif()
257+
231258
link_libraries(fst)
232259

260+
261+
262+
233263
# add all native libraries
234264
add_subdirectory(src/base) # NOTE, we need to patch the target with version from outside
235265
set_property(TARGET kaldi-base PROPERTY COMPILE_DEFINITIONS "KALDI_VERSION=\"${KALDI_VERSION}\"")

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ Development pattern for contributors
5252
Platform specific notes
5353
-----------------------
5454

55+
### Fedora 41 (and later)
56+
57+
In order to build it on Fedora 41 using the libraries that are provided by the distro, you need to install the development libraries and dependencies with
58+
59+
```
60+
sudo dnf install lapack-devel openfst-devel
61+
```
62+
63+
then build the package as follows:
64+
65+
```
66+
cmake -S ./ -Bbuild/Release -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DBuildForFedora=ON
67+
cmake --build /home/gerhard/workspace/kaldi/build/Release
68+
```
69+
70+
5571
### PowerPC 64bits little-endian (ppc64le)
5672

5773
- Kaldi is expected to work out of the box in RHEL >= 7 and Ubuntu >= 16.04 with

0 commit comments

Comments
 (0)