-
Notifications
You must be signed in to change notification settings - Fork 119
开发环境搭建
Chatopera Language Understanding Service
https://github.com/chatopera/clause
- JDK, Node.js, gcc, Maven3
- thrift
- jsoncpp
- libevent
- Eigen3
- Alibaba ASR Documentation
- gflags
- protobuf
- gtest
- glog
- gperftools
- thrift
- rocketmq
Check out thirdparty
for more.
You will need:
- Ubuntu 16.04 (*required)
- CMake 3.1+ installed
- If you prefer to code in a great IDE, I highly recommend VSCode. It is fully compatible with this project.
Take some efforts to install dependencies, these dependencies are split into two level: System level and User level.
-
System Level softwares are installed with
apt-get install
or installed to/usr/local
, these softwares are shared between users. You should be very careful when dealing with system level softwares, it may block other people. -
User Level softwares are installed inside the project source directory which is
YOUR_GIT_REPO/include
,YOUR_GIT_REPO/lib
andYOUR_GIT_REPO/share
usually.
So, when bringing up a new development environment with a bare machine, it should better install System Level Softwares by one person just once. Following developers just install User Level Softwares.
Note, to install the softwares successfully, you need sudo
authority without password, or you are using root
.
Enable sudo
without password in Ubuntu.
sudo visudo
## Add this line
YOUR_ACCOUNT ALL=NOPASSWD: ALL
./admin/install-3rd/system.sh
It would take ~3 hrs, this script would execute every command in cmake/system
in order.
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
It would take ~3 hrs, this script would execute every command in cmake/user
in order.
You can install each components manually, find the scrips in cmake/install
, the software has dependencies with others, consider you would want to install openpose
which depends on opencv
and caffe
, first, execute ./005.opencv.sh
, then execute 006.caffe.sh
, at last run 007.opencv.sh
, the priority is defined in the prefix of script name.
# build
mkdir -p build/debug
cd build/debug
cmake ../..
make
There are three empty folders: lib
, bin
, and include
. Those are populated by make install
.
The rest should be obvious: src
is the sources.
Now we can build this project, and below we show three separate ways to do so.
-
src/MODULE
— C++ code that ultimately compiles into a library or binary -
src/MODULE/**_test.cpp
- C++ code to test each component. -
bin/
,lib
,include
are all empty directories, until themake install
install the project artifacts there.
Currently, we use Astyle as code formatter to keep algin code, the style guide is set in .astylerc
.
Run code formatter.
./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
It is a great habit to keep code style following the Google C++ Style Guide standard.
Check out src/sample as a template or skeleton.
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/