Skip to content

Instantly share code, notes, and snippets.

@ayuthmang
Last active March 13, 2019 06:24
Show Gist options
  • Save ayuthmang/81c498019d52290121ce7b18c09a2ec0 to your computer and use it in GitHub Desktop.
Save ayuthmang/81c498019d52290121ce7b18c09a2ec0 to your computer and use it in GitHub Desktop.
Build teletgraf from source code on macOS Mojave 10.14.3

Hello World

14:47:03 in telegraf on ξ‚  master via 🐹 v1.12 on 🐳 v18.09.2
➜ go get -d github.com/influxdata/telegraf
14:51:04 in telegraf on ξ‚  master via 🐹 v1.12 on 🐳 v18.09.2
➜ clear
14:51:10 in telegraf on ξ‚  master via 🐹 v1.12 on 🐳 v18.09.2
➜ make
dep ensure -vendor-only
go build -ldflags "-L/usr/local/opt/openblas/lib -X main.commit=96ded740 -X main.branch=master -X main.commit=96ded740 -X main.branch=master" ./cmd/telegraf
# github.com/influxdata/telegraf/cmd/telegraf
flag provided but not defined: -L/usr/local/opt/openblas/lib
usage: link [options] main.o
-B note
add an ELF NT_GNU_BUILD_ID note when using ELF
-D address
set data segment address (default -1)
-E entry
set entry symbol name
-H type
set header type
-I linker
use linker as ELF dynamic linker
-L directory
add specified directory to library path
-R quantum
set address rounding quantum (default -1)
-T address
set text segment address (default -1)
-V print version and exit
-X definition
add string value definition of the form importpath.name=value
-a disassemble output
-buildid id
record id as Go toolchain build id
-buildmode mode
set build mode
-c dump call graph
-compressdwarf
compress DWARF if possible (default true)
-cpuprofile file
write cpu profile to file
-d disable dynamic executable
-debugtramp int
debug trampolines
-dumpdep
dump symbol dependency graph
-extar string
archive program for buildmode=c-archive
-extld linker
use linker when linking in external mode
-extldflags flags
pass flags to external linker
-f ignore version mismatch
-g disable go package data checks
-h halt on error
-importcfg file
read import configuration from file
-installsuffix suffix
set package directory suffix
-k symbol
set field tracking symbol
-libgcc string
compiler support lib for internal linking; use "none" to disable
-linkmode mode
set link mode
-linkshared
link against installed Go shared libraries
-memprofile file
write memory profile to file
-memprofilerate rate
set runtime.MemProfileRate to rate
-msan
enable MSan interface
-n dump symbol table
-o file
write output to file
-pluginpath string
full path name for plugin
-r path
set the ELF dynamic linker search path to dir1:dir2:...
-race
enable race detector
-s disable symbol table
-tmpdir directory
use directory for temporary files
-u reject unsafe packages
-v print link trace
-w disable DWARF generation
make[1]: *** [telegraf] Error 2
make: *** [all] Error 2
14:52:02 in telegraf on ξ‚  master via 🐹 v1.12 on 🐳 v18.09.2 took 50s
➜ go build -ldflags "-L /usr/local/opt/openblas/lib -X main.commit=96ded740 -X main.branch=master -X main.commit=96ded740 -X main.branch=master" ./cmd/telegraf
14:59:04 in telegraf on ξ‚  master via 🐹 v1.12 on 🐳 v18.09.2 took 3s
➜ ls -al
total 222368
drwxr-xr-x 36 ayuth staff 1152 Mar 13 14:51 .
drwxr-xr-x 3 ayuth staff 96 Mar 13 14:04 ..
drwxr-xr-x 3 ayuth staff 96 Mar 13 14:04 .circleci
drwxr-xr-x 14 ayuth staff 448 Mar 13 14:59 .git
-rw-r--r-- 1 ayuth staff 124 Mar 13 14:04 .gitattributes
drwxr-xr-x 4 ayuth staff 128 Mar 13 14:04 .github
-rw-r--r-- 1 ayuth staff 52 Mar 13 14:04 .gitignore
-rw-r--r-- 1 ayuth staff 165761 Mar 13 14:04 CHANGELOG.md
-rw-r--r-- 1 ayuth staff 1783 Mar 13 14:04 CONTRIBUTING.md
-rw-r--r-- 1 ayuth staff 45777 Mar 13 14:04 Gopkg.lock
-rw-r--r-- 1 ayuth staff 5214 Mar 13 14:04 Gopkg.toml
-rw-r--r-- 1 ayuth staff 1088 Mar 13 14:04 LICENSE
-rw-r--r-- 1 ayuth staff 3727 Mar 13 14:04 Makefile
-rw-r--r-- 1 ayuth staff 15791 Mar 13 14:04 README.md
-rw-r--r-- 1 ayuth staff 2735 Mar 13 14:04 accumulator.go
drwxr-xr-x 7 ayuth staff 224 Mar 13 14:04 agent
-rw-r--r-- 1 ayuth staff 689 Mar 13 14:04 aggregator.go
-rw-r--r-- 1 ayuth staff 1272 Mar 13 14:04 appveyor.yml
drwxr-xr-x 3 ayuth staff 96 Mar 13 14:04 cmd
-rw-r--r-- 1 ayuth staff 2051 Mar 13 14:04 docker-compose.yml
drwxr-xr-x 17 ayuth staff 544 Mar 13 14:04 docs
drwxr-xr-x 5 ayuth staff 160 Mar 13 14:04 etc
drwxr-xr-x 4 ayuth staff 128 Mar 13 14:04 filter
-rw-r--r-- 1 ayuth staff 609 Mar 13 14:04 input.go
drwxr-xr-x 12 ayuth staff 384 Mar 13 14:04 internal
drwxr-xr-x 4 ayuth staff 128 Mar 13 14:04 logger
drwxr-xr-x 8 ayuth staff 256 Mar 13 14:04 metric
-rw-r--r-- 1 ayuth staff 1447 Mar 13 14:04 metric.go
-rw-r--r-- 1 ayuth staff 897 Mar 13 14:04 output.go
drwxr-xr-x 8 ayuth staff 256 Mar 13 14:04 plugins
-rw-r--r-- 1 ayuth staff 294 Mar 13 14:04 processor.go
drwxr-xr-x 15 ayuth staff 480 Mar 13 14:04 scripts
drwxr-xr-x 6 ayuth staff 192 Mar 13 14:04 selfstat
-rwxr-xr-x 1 ayuth staff 105469800 Mar 13 14:59 telegraf
drwxr-xr-x 9 ayuth staff 288 Mar 13 14:04 testutil
drwxr-xr-x 11 ayuth staff 352 Mar 13 14:51 vendor
15:00:20 in telegraf on ξ‚  master via 🐹 v1.12 on 🐳 v18.09.2
➜
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment