Detailed description of SRILM configuration in Ubuntu 64-bit System

Source: Internet
Author: User
This article was written by the younger brother YYL to 52nlp. The cpu of the lab machine is intel64-bit, And I installed Ubuntu8.10's 32-bit version, therefore, the SRILM Compilation Method in "Building full records of moses test platform under Ubuntu8.10" is only applicable to 32-bit systems. The younger brother installed Ubuntu9.0464-bit desktop edition, and found that the SRILM Compilation Method Based on my method and other people's writing is not suitable, and there are few articles on SRILM compilation in 64-bit systems, therefore, 52nlp

This article was written by the younger brother YYL to 52nlp. The cpu of the lab machine is intel 64-bit, And I installed Ubuntu8.10's 32-bit version, therefore, the SRILM Compilation Method in "Building full records of moses test platform under Ubuntu8.10" is only applicable to 32-bit systems. The younger brother installed the Ubuntu 9.04 64-bit desktop version, and found that the SRILM Compilation Method Based on my method and other people's writing is not suitable, and there are few articles about SRILM compilation in 64-bit systems, so I wrote this article to 52nlp. Thank you very much!

First, install the dependent software package:
1. c/c ++ compiler: gcc 3.4.3 and later
2. GNU make: a tool for building and managing projects. It explains the commands in Makefile and describes the compilation sequence and rules of all files in the project. This is to control the compilation and installation of SRILM.
3. GNU gawk: The awk programming language of GNU. It is inconvenient and time-consuming to modify, compare, and extract text data using c or passcal. awk can be completed in a short program. Here are some script files in SRILM.
4. GNU gzip: a decompression software written in C language. This is to enable SRILM to process compressed files with the. Z and. GZ suffixes.
5.bzip2: data compression software with higher compression efficiency. This is the compression file that enables srilmto process the suffix .bz2.
6. P7zip: data compression software. This enables SRILM to process compressed 7-zip files.
7. Tcl supports embedded scripting language. It is used for Script Programming and testing. This is for SRILM testing. It is best to install tcl8.x and tcl8.x-dev.
8. csh: A Unix shell. (This is very important. There is a problem in the installation process for a long time, and the reason why csh is not installed is found at last ).

The following describes the installation process)

1. Download The SRILM. tgz compressed package
Link: Workshop. I am using version 1.5.8. The installation directory is/home/user/srilm.

Ii. Modify the Makefile file (under the srilm directory)
1. Find this line: # SRILM =/home/speech/stolcke/project/srilm/devel, and enter the srilm installation path in the other line, SRILM =/home/user/srilm
2. locate this line: MACHINE_TYPE: = $ (shell $ (SRILM)/sbin/machine-type), add # comment out before it, and start another line with the input: MACHINE_TYPE: = i686-m64. This row tells Makefile to see the settings in/home/user/srilm/common/Makefile. machine. i686-m64.
(This is also important because ubuntu9.0.4 is a 64-bit system, which is different from the 32-bit system configuration method .)

3. Tell Makefile about the ubuntu9.0.4 system settings, that is, use the editor to modify the files in the/home/user/srilm/common directory: Makefile. machine. i686-m64
1. Find:
GCC_FLAGS =-march = athlon64-m64-Wreturn-type-Wimplicit
CC = $ (GCC_PATH) gcc $ (GCC_FLAGS)-Wimplicit-int
CXX = $ (GCC_PATH) g ++ $ (GCC_FLAGS)-DINSTANTIATE_TEMPLATES
This is to tell the SRILM system to use compiler (c and c ++), which meets the installation conditions and does not need to be modified.
2. Find:
# Tcl support (standard in Linux)
TCL_INCLUDE =
TCL_LIBRARY =
NO_TCL = 1
This is to tell the installation location of the SRILM function library (TCL) in the system, which meets the installation conditions and does not need to be modified.
3. Find:
GAWK =/usr/bin/awk
Change to: GAWK =/usr/bin/gawk
Note: The installation of these software may vary with systems. You can run the command which is gcc, which is g ++ or which is gawk to find the installation location of the software.

4. Modify Environment Variables
Run sudo gedit/etc/profile.
Find:
If ["$ PS1"]; then
If ["$ BASH"]; then
PS1 = 'U @ h: w $'
If [-f/etc/bash. bashrc]; then
./Etc/bash. bashrc
Fi
Else
If ["'id-U'"-eq 0]; then
PS1 = '#'
Else
PS1 = '$'
Fi
Fi
Fi
Enter: export PATH = "$ PATH:/home/user/srilm/bin/i686-m64:/home/user/srilm/bin" in the next line"

5. Install and test SRILM
1. Compile srilm
Make srilm
2. Test
Cd test
Make all
A lot of things will be displayed on the terminal. If the vast majority are IDENTICAL and the minority is DIFFERS, it indicates success.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.