mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2024-12-25 15:09:05 +01:00
Remove -lganglia ldflag and check dl lib
This commit is contained in:
parent
3ade75490c
commit
842395682c
@ -2,7 +2,7 @@ package sinks
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -DGM_PROTOCOL_GUARD
|
||||
#cgo LDFLAGS: -L. -lganglia -Wl,--unresolved-symbols=ignore-in-object-files
|
||||
#cgo LDFLAGS: -L. -Wl,--unresolved-symbols=ignore-in-object-files
|
||||
#include <stdlib.h>
|
||||
|
||||
// This is a copy&paste snippet of ganglia.h (BSD-3 license)
|
||||
@ -71,6 +71,7 @@ import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
|
||||
cclog "github.com/ClusterCockpit/cc-metric-collector/internal/ccLogger"
|
||||
lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
|
||||
"github.com/NVIDIA/go-nvml/pkg/dl"
|
||||
)
|
||||
@ -120,7 +121,7 @@ func (s *LibgangliaSink) Init(config json.RawMessage) error {
|
||||
if len(config) > 0 {
|
||||
err = json.Unmarshal(config, &s.config)
|
||||
if err != nil {
|
||||
fmt.Println(s.name, "Error reading config for", s.name, ":", err.Error())
|
||||
cclog.ComponentError(s.name, "Error reading config:", err.Error())
|
||||
return err
|
||||
}
|
||||
}
|
||||
@ -128,6 +129,10 @@ func (s *LibgangliaSink) Init(config json.RawMessage) error {
|
||||
if lib == nil {
|
||||
return fmt.Errorf("error instantiating DynamicLibrary for %s", s.config.GangliaLib)
|
||||
}
|
||||
err = lib.Open()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error opening %s: %v", s.config.GangliaLib, err)
|
||||
}
|
||||
|
||||
// Set up cache for the C strings
|
||||
s.cstrCache = make(map[string]*C.char)
|
||||
|
Loading…
Reference in New Issue
Block a user