Skip to content

Commit

Permalink
Merge pull request #4962 from gerstrong/master
Browse files Browse the repository at this point in the history
Make it buildable under Fedora41 using their board tools
  • Loading branch information
danpovey authored Nov 29, 2024
2 parents 4a8b7f6 + 5ceda8b commit 701f131
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
38 changes: 34 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,25 @@ if(CONDA_ROOT)

endif()

include(third_party/get_third_party)
option(BuildForFedora "Build for Fedora. Means that everything is build with Border tools" NO)

if(BuildForFedora)

# You also need to install sudo dnf install lapack-devel openfst-devel
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

#find_package(PkgConfig REQUIRED)

#pkg_check_modules(FST REQUIRED fst)

else()
include(third_party/get_third_party)

include(cmake/third_party/openfst.cmake)
endif()

include(cmake/third_party/openfst.cmake)

find_package(PythonInterp)
if(NOT PYTHON_EXECUTABLE)
Expand All @@ -43,8 +59,11 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE}
)
unset(IS_LIB_SHARE)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
if(BuildForFedora)
else()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
set(CMAKE_INSTALL_MESSAGE LAZY) # hide "-- Up-to-date: ..."
if(BUILD_SHARED_LIBS)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down Expand Up @@ -228,8 +247,19 @@ endif()
# PATHS "${CMAKE_CURRENT_SOURCE_DIR}/tools/openfst/include"
# REQUIRED)

if(BuildForFedora)
# Version used used by Fedora 41 is 1.83
# TODO: Detect the right version and put it here.
add_definitions(-DOPENFST_VER=18300)
# link_directories(/usr/lib64)
# include_directories(/usr/include/fst)
endif()

link_libraries(fst)




# add all native libraries
add_subdirectory(src/base) # NOTE, we need to patch the target with version from outside
set_property(TARGET kaldi-base PROPERTY COMPILE_DEFINITIONS "KALDI_VERSION=\"${KALDI_VERSION}\"")
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ Development pattern for contributors
Platform specific notes
-----------------------

### Fedora 41 (and later)

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

```
sudo dnf install lapack-devel openfst-devel
```

then build the package as follows:

```
cmake -S ./ -Bbuild/Release -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DBuildForFedora=ON
cmake --build /home/gerhard/workspace/kaldi/build/Release
```


### PowerPC 64bits little-endian (ppc64le)

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

0 comments on commit 701f131

Please sign in to comment.