@@ -34,6 +34,15 @@ export CGO_LDFLAGS_ALLOW="-Wl,-rpath.*"
3434
3535### Building a component
3636
37+ * You need to have the MQ client libraries installed first.
38+ * Set up an environment for compiling Go programs
39+ ```
40+ export GOPATH=~/go (or wherever you want to put it)
41+ export GOROOT=/usr/lib/golang (or wherever you have installed it)
42+ mkdir -p $GOPATH/src
43+ cd $GOPATH/src
44+ ```
45+
3746* Change directory to your go path. (` cd $GOPATH ` )
3847* Use git to get a copy of this repository into a new directory in the workspace:
3948
@@ -48,15 +57,21 @@ git clone https://github.com/ibm-messaging/mq-metric-samples.git src/github.com/
4857dep ensure
4958```
5059
51- * Compile the sample program you wish to use. See the README in each directory for more information.
60+ * From the root of your GOPATH you can then compile the code. For example,
61+
62+ ```
63+ cd $GOPATH
64+ export CGO_LDFLAGS_ALLOW='-Wl,-rpath.*'
65+ go build -o bin/mq_prometheus src/github.com/ibm-messaging/mq-metric-samples/cmd/mq_prometheus/*.go
66+ ```
5267
5368At this point, you should have a compiled copy of the code in ` $GOPATH/bin ` . Each
5469monitor agent directory also has sample scripts, configuration files etc to help
5570with getting the agent running in your specific environment.
5671
5772## Using a Docker container to build the programs
5873You can use the ` buildMonitors.sh ` script in this directory to build a Docker container that
59- in turn will build the binary programs and copy them to a local directory. That script also
74+ in turn will build all the binary programs and copy them to a local directory. That script also
6075sets some extra version-related flags that will be shown when the program starts.
6176
6277## More information
0 commit comments