0. 环境
ubuntu-22.10-beta-desktop-amd64.iso
gcc 12.2.0
g++ 12.2.0
make 4.3
cmake 3.24.2
git 2.37.2
openssl 3.0.5
(centos 7 64下,默认gcc版本4.8.5比较低,需要升级,openssl 1.0.3好像也比较低)
1. 编译 neuron
参考:https://github.com/emqx/neuron
window 10 共享 D:\share_ubuntu 给 VM ubuntu /mnt/hgfs
https://www.jb51.net/article/255000.htm
git clone https://github.com/emqx/neuron
cd neuron
git submodule update --init
默认 extern/uthash目录中是空的,执行 git submodule update 后,会自动下载该子模块
/mnt/hgfs目录中neuron
参照工程中的 Install-dependencies.md ,依次安装依赖 openssl zlog jansson nng jwt MQTT-C googletest sqlite (对照上图),主要是生成一些动态库、静态库、头文件等
cd neuron
mkdir build && cd build
cmake .. && make
编译成功后会生成 neuron
下载dashboard (网页)
wget https://github.com/emqx/neuron-dashboard/releases/download/2.2.3/neuron-dashboard.zip
压缩文件中,即dist目录,直接解压放在neuron所在的目录中即可(对照上图)
运行
./neuron -d --disable_auth --config_dir ./config --plugin_dir ./plugins
日志在 logs 目录中
plugins目录,config目录
web ui : http://127.0.0.1:7000/ 默认账户密码 admin 0000
2. 遇到的问题
cmake neuron时,47行,configure_file命令,依赖子模块uthash中的头文件路径,有问题,要把其中的 include 改成 src ,否则报找不到该文件 (可能是uthash之前版本中是include吧)
报错内容,make时,all warnings being treated as errors
注释掉如下内容