-
Notifications
You must be signed in to change notification settings - Fork 119
开发环境搭建
Chatopera Language Understanding Service
https://github.com/chatopera/clause
开发环境需要如下前提条件:
- Ubuntu 16.04 (*必须),编译代码
- 开发编辑器,推荐 VSCode,代码的编辑可以在任何操作系统上
git clone https://github.com/chatopera/clause.git
cd clause # 进入开发根目录
./admin/install-3rd/system.sh # 面向操作系统层面的依赖,每个操作系统只需要执行一次,需要免密码使用sudo命令的支持。
./admin/install-3rd/user.sh # 项目层面的的依赖,每个开发根目录下都执行一次。
以上两个脚本完成了下列依赖的安装:
- CMake, Node.js, gcc
- Boost
- thrift
- jsoncpp
- libevent
- Eigen3
- gflags
- protobuf
- gtest
- glog
- gperftools
- thrift
- activemq
其中,系统层面的依赖安装到/usr/local/
目录中,项目层面的依赖安装在clause/lib
,clause/include
中。查看 thirdparty
获得更多第三方包。
- 设置免密码使用sudo
sudo visudo
## Add this line
YOUR_ACCOUNT ALL=NOPASSWD: ALL
- 关于系统层面依赖的更多介绍
./admin/install-3rd/system.sh
该脚本大约执行 20mins ~ 50mins, 顺序执行cmake/system
里的脚本,一些脚本如下:
script | description | dependencies |
---|---|---|
001.corretto-jdk.sh | install amazon jdk, Default JAVA_HOME=/usr/lib/jvm/java-1.8.0-amazon-corretto
|
None |
001.nodejs.sh | install nodejs | None |
002.maven.sh | install maven3 | jdk |
- 项目层面的依赖
./admin/install-3rd/user.sh
该脚本大约执行30mins,顺序执行 cmake/user
下的脚本。
- 单独安装某一个依赖
也可以单独的对某个依赖进行安装,这时执行cmake/user
或cmake/system
下的脚本。
### 编译
mkdir -p build/debug
cd build/debug
cmake ../..
make
.
├── CMakeLists.txt
├── Doxyfile
├── Doxyfile.sh
├── LICENSE
├── README.md
├── admin
│ ├── dev
│ ├── docker
│ ├── formatter.sh
│ ├── generator.sh
│ ├── install-3rd
│ ├── localrc
│ ├── localrc.sample
│ ├── precompile.sh
│ └── release.sh
├── bin
├── build
│ ├── debug
│ ├── eigen
│ ├── friso
│ ├── googletest
│ ├── gperftools
│ ├── leveldb
│ ├── mysql
│ ├── nlssdk
│ ├── protobuf
│ ├── thrift
│ └── xapian
├── cmake
│ ├── default.cmake
│ ├── miscs
│ ├── modules
│ ├── system
│ └── user
├── docker-compose.yml
├── docs
├── include
├── sample.env
├── share
│ ├── aclocal
│ ├── doc
│ ├── man
│ └── xapian-core
├── src
│ ├── CMakeLists.txt
│ ├── clause
│ ├── distance
│ ├── hat-trie
│ ├── intent
│ ├── jieba
│ ├── lac
│ ├── ner
│ ├── proto
│ ├── redis
│ ├── sample
│ ├── sep
│ ├── sysdicts
│ └── utils
├── thirdparty
│ ├── activemq
│ ├── astyle
│ ├── cmake
│ ├── crfsuite
│ ├── daemontools
│ ├── deprecated
│ ├── eigen.tgz
│ ├── gflags
│ ├── glog
│ ├── googletest
│ ├── gperftools
│ ├── jsoncpp
│ ├── lac
│ ├── leveldb
│ ├── mysql
│ ├── protobuf
│ ├── thrift
│ └── xapian
└── var
├── activemq
├── assets
├── local
├── log
├── mysql
├── redis
└── test
目前,clause使用 Astyle 进行代码格式化, 标准参数在.astylerc
中设置。
Astyle也作为系统层面的依赖进行安装,使用./admin/formatter.sh
对src
目录下的源码进行格式化。
./admin/formatter.sh
cat ./.astylerc # check out settings.
# Find more options
# http://astyle.sourceforge.net/astyle.html#_Usage
--style=google
--indent=spaces=2
--indent-switches
--indent-preprocessor
--break-blocks
--pad-oper
--recursive
--formatted
--suffix=none
代码标准使用 Google C++ Style Guide。
Copyright 2019 北京华夏春松科技有限公司 https://www.chatopera.com. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
北京华夏春松科技有限公司 https://www.chatopera.com/