-
Ensure that you've followed the steps leading up to this on the README.md, this includes any dependenices. Clone this repository into the
%GOPATH%\src\github.com\edgexfoundry\
directory, usinggit clone https://github.com/edgexfoundry/edgex-go.git %GOPATH%\src\github.com\edgexfoundry\edgex-go
. -
Download & install the TDM-GCC from this URL: http://tdm-gcc.tdragon.net/download
-
Run
go get -v -x github.com/pebbe/zmq4
, expect it to fail due to a missingzmq.h
file. This will create the directory structure needed in order to accomplish the steps below. This step can be skipped, but if skipped the directories in the following steps will have to be manually created. -
Download the release version of ZMQ from AppVeyor builds from zmq: https://ci.appveyor.com/project/zeromq/libzmq. Verify it is a successful build and ensure the platform architecture and VERSION is correct for your system. Ensure the commit that is built matches the version you clone from source in step 3. Example:
Environment: platform=x64, configuration=Release, WITH_LIBSODIUM=ON, ENABLE_CURVE=ON, NO_PR=TRUE
. You can download the zip from the artifacts tab.3.a. Extract the contents of the downloaded zip file anywhere you prefer.
3.b. Copy the
libsodium.dll
andlibzmq-v120-mt-4_x_x.dll
files from step 3 into%GOPATH%\src\github.com\pebbe\zmq4\usr\local\lib
; create all of the directories if you need to. Renamelibzmq-v120-mt-4_x_x.dll
tolibzmq.dll
, so that gcc can link and find-lzmq
. If this is not done, errors like this may occur:C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe:cannot find -lzmq
-
In any directory you prefer, clone the source of ZMQ that matches the version/commit you downloaded from AppVeyor:
git clone https://github.com/zeromq/libzmq.git
. -
Copy over the
include
directory from the source downloaded in step 3 to%GOPATH%\src\github.com\pebbe\zmq4\usr\local\include
, ensuring that any necessary parent directories that don't exist are created. -
Set the following environment variables (run this in PowerShell):
$Env:CGO_CFLAGS="-I$Env:GOPATH\src\github.com\pebbe\zmq4\usr\local\include"
$Env:CGO_LDFLAGS="-L$Env:GOPATH\src\github.com\pebbe\zmq4\usr\local\lib"
After setting those, running go get -v -x github.com/pebbe/zmq4
should succeed. If it fails, it most likely due to the .h
files or dll
s existing in a directory that doesnt match your CGO_
environment variables. It may also fail due to the same error as before (see step 3.b) - try downloading the artifact from a different build on the AppVeyor builds site.
-
Next, navigate to
$Env:GOPATH\src\github.com\edgexfoundry\edgex-go\cmd\core-data
. If you didn't acquire dependencies previously, rungo get -v
to acquire all dependencies. Rungo build -v
. If it complains about not finding zmq.h from auth.go, double check the CGO_ environment variables by runninggo env
. -
There should now be a
core-data.exe
file in your directory. The last step is to ensure that a copy of the DLL'slibsodium.dll
andlibzmq-v120-mt-4_x_x.dll
(yes, this one, not with the rename we did earlier) is in the same directory as your.exe
. -
Run
.\core-data.exe
.
If you get a segfault, try setting
$Env:GOCACHE="off"
and rerun the build command from step 5