EdgexFoundry源码安装详解**
这里只是详细说明一下官方文档上的源码安装步骤。
github上的源码链接 我用的是centos7
第一步:
安装golang环境
可参考:https://www.cnblogs.com/mrblue/p/8891789.html
下载go(我的当前目录是/data/work)
$wget https://studygolang.com/dl/golang/go1.10.1.linux-amd64.tar.gz
$tar -xvf go1.10.1.linux-amd64.tar.gz
设置环境变量
$vim /etc/profile
添加
export GOROOT=/data/work/go
export GOPATH=/data/work/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
保存
esc
:wq
使其生效
source /etc/profile
安装完golang环境以后,根据官方文档向下走
pkg-config
go get github.com/rjeczalik/pkgconfig/cmd/pkg-config
安装zeromq
可去官网下载源码包,下面是我分享的
链接: https://pan.baidu.com/s/1YbRJZBJQZErtl55lRZUbWg 提取码: 2hfy
然后进行安装:
执行脚本:./autogen.sh
sudo ./configure
make && make install
安装完成以后,请睁开你的双眼看清,make install以后安装目录是安装在了什么地方。,看看pkgconfig文件安装到了什么路径,因为后面你可能不知道下一步的配置
pkg-config
The necessary file will need to be added to the PKG_CONFIG_PATH environment variable.
On Linux, add this line to your local profile:
export PKG_CONFIG_PATH=/usr/local/Cellar/zeromq/4.2.5/lib/pkgconfig/
之后就可以拉取源码了,拉取不下来的直接去github上下载也可
建议步骤:
第一步,首先在我们刚刚配置的golang环境里/data/work/gopath下面建立三个文件夹。
mkdir src bin pkg
然后进入src建立文件夹
mkdir github.com
进入到github.com文件夹以后就可以拉取源码了
git clone git@github.com:edgexfoundry/edgex-go.git
cd edgex-go
make build
注:拉取下来的源码或者自己下载上传的请把文件名改成edgex-go。
To start EdgeX:
make run
全篇结束。