OpenCC

From LemonWiki共筆
Revision as of 15:36, 15 July 2019 by Planetoid (talk | contribs) (Created page with "Install [https://github.com/BYVoid/OpenCC OpenCC] on Centos7. OpenCC is the project for "conversion between Traditional and Simplified Chinese". == Installation == Install [h...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Install OpenCC on Centos7. OpenCC is the project for "conversion between Traditional and Simplified Chinese".

Installation

Install OpenCC on Centos7

  1. git clone https://github.com/BYVoid/OpenCC.git --depth 1
  2. Install GCC from repository sudo yum -y install gcc[1]
    • Verify the version of gcc because gcc 4.6 is required. gcc --version
  3. Install CMake from repository sudo yum -y install cmake
  4. Install Make from repository sudo yum -y install make
  5. Install Doxygen from repository sudo yum -y install doxygen
  6. cd OpenCC
  7. make
  8. sudo make install

Verify the installation

  1. Input opencc --version. And the expected result are as the following:
Open Chinese Convert (OpenCC) Command Line Tool
Version: 1.0.5

Troubleshootings

cmake: command not found

Error message:

$ make
mkdir -p build/rel
(cd build/rel; cmake \
-DBUILD_DOCUMENTATION:BOOL=ON \
-DENABLE_GTEST:BOOL=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
../..)
/bin/sh: line 1: cmake: command not found
make: *** [build] Error 127

Solution:

  1. Install GCC from repository sudo yum -y install gcc
    • Verify the version of gcc because gcc 4.6 is required. gcc --version

Doxygen is needed to build the documentation

Error message:

$ make
mkdir -p build/rel
(cd build/rel; cmake \
-DBUILD_DOCUMENTATION:BOOL=ON \
-DENABLE_GTEST:BOOL=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
../..)
-- The CXX compiler identification is GNU 4.8.5
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)
CMake Error at doc/CMakeLists.txt:4 (message):
  Doxygen is needed to build the documentation.  Please install it correctly


-- Configuring incomplete, errors occurred!
See also "/home/user/build/rel/CMakeFiles/CMakeOutput.log".
make: *** [build] Error 1

Solution:

  1. Install Doxygen from repository sudo yum -y install doxygen

opencc: error while loading shared libraries: libopencc.so.2: cannot open shared object file: No such file or directory

Error message:

$ opencc --version
opencc: error while loading shared libraries: libopencc.so.2: cannot open shared object file: No such file or directory

Solution:

  1. Keyin: sudo ln -s /usr/lib/libopencc.so.2 /usr/lib64/libopencc.so.2[2]


References