Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golang: Cannot run in arm64 macOS M1; x86_64 architecture warnings #82

Closed
juancresc opened this issue Feb 26, 2022 · 14 comments
Closed
Assignees

Comments

@juancresc
Copy link

I was able to build tensorflow from source but now I cannot build a golang app that uses TF lib in mac with M1 processor:


bazel build --config opt  //tensorflow/tools/lib_package:libtensorflow -c opt --macos_sdk_version=12.1 --config=opt //tensorflow:libtensorflow.so
sudo cp bazel-bin-tensorflow/libtensorflow* /usr/local/lib/.

make build
mkdir -p dist
# github.com/tensorflow/tensorflow/tensorflow/go
ld: warning: ignoring file /usr/local/lib/libtensorflow.so, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_TFE_ContextListDevices", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextListDevices in _x003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextListDevices)
  "_TFE_ContextOptionsSetAsync", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetAsync in _x003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetAsync)
  "_TFE_ContextOptionsSetConfig", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetConfig in _x003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetConfig)
  "_TFE_DeleteContext", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContext in _x003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions, __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContext )
  "_TFE_DeleteContextOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions in _x003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions)
  "_TFE_DeleteTensorHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteTensorHandle in _x012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteTensorHandle)
  "_TFE_NewContext", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewContext in _x003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions, __cgo_5439f5b57bf2_Cfunc_TFE_NewContext )
  "_TFE_NewContextOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions in _x003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions)
  "_TFE_NewTensorHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewTensorHandle in _x012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewTensorHandle)
  "_TFE_TensorHandleCopyToDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleCopyToDevice in _x012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleCopyToDevice)
  "_TFE_TensorHandleDataType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDataType in _x012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDataType)
  "_TFE_TensorHandleDeviceName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDeviceName in _x012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDeviceName)
  "_TFE_TensorHandleDim", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDim in _x012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDim)
  "_TFE_TensorHandleNumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleNumDims in _x012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleNumDims)
  "_TFE_TensorHandleResolve", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleResolve in _x012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleResolve)
  "_TF_AddControlInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddControlInput in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddControlInput)
  "_TF_AddGradientsWithPrefix", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddGradientsWithPrefix in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddGradientsWithPrefix)
  "_TF_AddInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddInput in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddInputList, __cgo_5439f5b57bf2_Cfunc_TF_AddInput )
  "_TF_AddInputList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddInputList in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddInputList)
  "_TF_AllocateTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AllocateTensor in _x011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AllocateTensor)
  "_TF_CloseSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_CloseSession in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_CloseSession)
  "_TF_DeleteBuffer", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteBuffer in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteBuffer)
  "_TF_DeleteDeviceList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteDeviceList in _x003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteDeviceList)
  "_TF_DeleteGraph", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteGraph in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteGraph)
  "_TF_DeleteImportGraphDefOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteImportGraphDefOptions in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteImportGraphDefOptions)
  "_TF_DeleteLibraryHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteLibraryHandle in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteLibraryHandle)
  "_TF_DeletePRunHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeletePRunHandle in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeletePRunHandle)
  "_TF_DeleteSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteSession in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions, __cgo_5439f5b57bf2_Cfunc_TF_DeleteSession )
  "_TF_DeleteSessionOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions)
  "_TF_DeleteStatus", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteStatus in _x010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteStatus)
  "_TF_DeleteTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteTensor in _x011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteTensor)
  "_TF_DeviceListCount", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListCount in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListCount)
  "_TF_DeviceListMemoryBytes", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListMemoryBytes in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListMemoryBytes)
  "_TF_DeviceListName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListName in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListName)
  "_TF_DeviceListType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListType in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListType)
  "_TF_Dim", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Dim in _x011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Dim)
  "_TF_FinishOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_FinishOperation in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_FinishOperation)
  "_TF_GetCode", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GetCode in _x010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GetCode)
  "_TF_GraphGetTensorNumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorNumDims in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorNumDims)
  "_TF_GraphGetTensorShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorShape in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorShape)
  "_TF_GraphImportGraphDef", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphImportGraphDef in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphImportGraphDef)
  "_TF_GraphNextOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphNextOperation in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphNextOperation)
  "_TF_GraphOperationByName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphOperationByName in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphOperationByName)
  "_TF_GraphToGraphDef", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphToGraphDef in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphToGraphDef)
  "_TF_ImportGraphDefOptionsAddInputMapping", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsAddInputMapping in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsAddInputMapping)
  "_TF_ImportGraphDefOptionsSetDefaultDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice)
  "_TF_ImportGraphDefOptionsSetPrefix", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetPrefix in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetPrefix)
  "_TF_LoadLibrary", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_LoadLibrary in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_LoadLibrary)
  "_TF_LoadSessionFromSavedModel", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_LoadSessionFromSavedModel in _x007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_LoadSessionFromSavedModel)
  "_TF_Message", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Message in _x010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Message)
  "_TF_NewBuffer", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewBuffer in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewBuffer)
  "_TF_NewGraph", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewGraph in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewGraph)
  "_TF_NewImportGraphDefOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewImportGraphDefOptions in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewImportGraphDefOptions)
  "_TF_NewOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewOperation in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewOperation)
  "_TF_NewSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewSession in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewSession, __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions )
  "_TF_NewSessionOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions)
  "_TF_NewStatus", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewStatus in _x010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewStatus)
  "_TF_NumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NumDims in _x011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NumDims)
  "_TF_OperationDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationDevice in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationDevice)
  "_TF_OperationGetAttrBool", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBool in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBool )
  "_TF_OperationGetAttrBoolList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList)
  "_TF_OperationGetAttrFloat", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloat in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloat )
  "_TF_OperationGetAttrFloatList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList)
  "_TF_OperationGetAttrInt", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrInt in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrInt )
  "_TF_OperationGetAttrIntList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList)
  "_TF_OperationGetAttrMetadata", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrMetadata in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrMetadata)
  "_TF_OperationGetAttrShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShape in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShape )
  "_TF_OperationGetAttrShapeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList)
  "_TF_OperationGetAttrString", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrString in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrString, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList )
  "_TF_OperationGetAttrStringList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList)
  "_TF_OperationGetAttrTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensor in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensor )
  "_TF_OperationGetAttrTensorList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList)
  "_TF_OperationGetAttrType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrType in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrType, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList )
  "_TF_OperationGetAttrTypeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList in _x002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList)
  "_TF_OperationInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationInput in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType, __cgo_5439f5b57bf2_Cfunc_TF_OperationInput )
  "_TF_OperationInputType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType)
  "_TF_OperationName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationName in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationName)
  "_TF_OperationNumInputs", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationNumInputs in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationNumInputs)
  "_TF_OperationNumOutputs", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationNumOutputs in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationNumOutputs)
  "_TF_OperationOpType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOpType in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOpType)
  "_TF_OperationOutputConsumers", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputConsumers in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputConsumers)
  "_TF_OperationOutputListLength", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputListLength in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputListLength)
  "_TF_OperationOutputNumConsumers", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputNumConsumers in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputNumConsumers)
  "_TF_OperationOutputType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputType in _x006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputType)
  "_TF_SessionListDevices", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionListDevices in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionListDevices)
  "_TF_SessionPRun", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionPRun in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionPRun, __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup )
  "_TF_SessionPRunSetup", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup)
  "_TF_SessionRun", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionRun in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionRun)
  "_TF_SetAttrBool", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBool in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBool )
  "_TF_SetAttrBoolList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList)
  "_TF_SetAttrFloat", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloat in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloat, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList )
  "_TF_SetAttrFloatList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList)
  "_TF_SetAttrInt", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrInt in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrInt, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList )
  "_TF_SetAttrIntList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList)
  "_TF_SetAttrShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShape in _x004.o
     (maybe you meant: _TF_SetAttrShapeList_Helper, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShape )
  "_TF_SetAttrShapeList", referenced from:
      _TF_SetAttrShapeList_Helper in _x004.o
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList in _x004.o
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper in _x004.o
     (maybe you meant: _TF_SetAttrShapeList_Helper, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList )
  "_TF_SetAttrString", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrString in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrString )
  "_TF_SetAttrStringList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList)
  "_TF_SetAttrTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensor in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensor, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList )
  "_TF_SetAttrTensorList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList)
  "_TF_SetAttrType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrType in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrType )
  "_TF_SetAttrTypeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList)
  "_TF_SetConfig", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetConfig in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetConfig)
  "_TF_SetDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetDevice in _x004.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetDevice)
  "_TF_SetTarget", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetTarget in _x008.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetTarget)
  "_TF_TensorBitcastFrom", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorBitcastFrom in _x011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorBitcastFrom)
  "_TF_TensorByteSize", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorByteSize in _x011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorByteSize)
  "_TF_TensorData", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorData in _x011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorData)
  "_TF_TensorType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorType in _x011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorType)
  "_TF_Version", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Version in _x013.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Version)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [build/binaries] Error 2
It's complaining cause the .so generated file is not for x86_64


@wamuir
Copy link
Contributor

wamuir commented Feb 28, 2022

How are you invoking go build (i.e., what command(s) are run within the Makefile's build rule)? Are you attempting to cross-compile by setting GOARCH to amd64? As you state, your TF shared library is compiled for 64-bit ARM.

@angerson angerson changed the title cannot run in arm64 macOS M1 golang: Cannot run in arm64 macOS M1; x86_64 architecture warnings Feb 28, 2022
@juancresc
Copy link
Author

juancresc commented Feb 28, 2022

@wamuir I removed GOARCH=arm64 and now I get this:

CGO_ENABLED=1 go build 
./executable
dyld[99082]: Library not loaded: @rpath/libtensorflow_framework.2.dylib
  Referenced from: /usr/local/lib/libtensorflow.2.dylib
  Reason: tried: '/usr/local/lib/../_solib_darwin_x86_64/_U_S_Stensorflow_Clibtensorflow.2.7.0.dylib___Utensorflow/libtensorflow_framework.2.dylib' (no such file), '/usr/local/lib/libtensorflow_framework.2.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libtensorflow_framework.2.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libtensorflow_framework.2.dylib' (no such file)
[1]    99082 abort      ./executable

@wamuir
Copy link
Contributor

wamuir commented Mar 2, 2022

This error is due to your build and installation of libtensorflow. There is an open issue for building libtensorflow on M1 at tensorflow/tensorflow/issues/52160 and I see that you have also commented in that issue and requested assistance. As an initial step, and before attempting to use the Go bindings, verify that you can at least compile and successfully run the libtensorflow example program.

@juancresc
Copy link
Author

@wamuir not working :(

# on the tensorflow source code path
export LIBRARY_PATH="${LIBRARY_PATH}::/Users/juan.crescente/Documents/lib/tensorflow/bazel-bin/tensorflow/"

export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Users/juan.crescente/Documents/lib/tensorflow/bazel-bin/tensorflow/"

sudo cp libtensorflow* /usr/local/lib/.

gcc hello_tf.c -ltensorflow -o hello_tf  -L /usr/local/lib 
hello_tf.c:1:1: error: expected identifier or '('
%%writefile hello_tf.c
^
hello_tf.c:3:10: fatal error: 'tensorflow/c/c_api.h' file not found
#include <tensorflow/c/c_api.h>
         ^~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

@juancresc
Copy link
Author

If I copy the x86 files into /usr/local/lib I got a different error:

 go run  
# command-line-arguments
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: ignoring file /usr/local/lib//libtensorflow.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_TFE_ContextListDevices", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextListDevices in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextListDevices)
  "_TFE_ContextOptionsSetAsync", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetAsync in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetAsync)
  "_TFE_ContextOptionsSetConfig", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetConfig in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetConfig)
  "_TFE_DeleteContext", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContext in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContext, __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions )
  "_TFE_DeleteContextOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions)
  "_TFE_DeleteTensorHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteTensorHandle in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteTensorHandle)
  "_TFE_NewContext", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewContext in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions, __cgo_5439f5b57bf2_Cfunc_TFE_NewContext )
  "_TFE_NewContextOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions)
  "_TFE_NewTensorHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewTensorHandle in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewTensorHandle)
  "_TFE_TensorHandleCopyToDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleCopyToDevice in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleCopyToDevice)
  "_TFE_TensorHandleDataType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDataType in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDataType)
  "_TFE_TensorHandleDeviceName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDeviceName in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDeviceName)
  "_TFE_TensorHandleDim", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDim in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDim)
  "_TFE_TensorHandleNumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleNumDims in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleNumDims)
  "_TFE_TensorHandleResolve", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleResolve in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleResolve)
  "_TF_AddControlInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddControlInput in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddControlInput)
  "_TF_AddGradientsWithPrefix", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddGradientsWithPrefix in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddGradientsWithPrefix)
  "_TF_AddInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddInput in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddInputList, __cgo_5439f5b57bf2_Cfunc_TF_AddInput )
  "_TF_AddInputList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddInputList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddInputList)
  "_TF_AllocateTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AllocateTensor in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AllocateTensor)
  "_TF_CloseSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_CloseSession in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_CloseSession)
  "_TF_DeleteBuffer", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteBuffer in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteBuffer)
  "_TF_DeleteDeviceList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteDeviceList in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteDeviceList)
  "_TF_DeleteGraph", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteGraph in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteGraph)
  "_TF_DeleteImportGraphDefOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteImportGraphDefOptions in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteImportGraphDefOptions)
  "_TF_DeleteLibraryHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteLibraryHandle in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteLibraryHandle)
  "_TF_DeletePRunHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeletePRunHandle in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeletePRunHandle)
  "_TF_DeleteSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteSession in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions, __cgo_5439f5b57bf2_Cfunc_TF_DeleteSession )
  "_TF_DeleteSessionOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions)
  "_TF_DeleteStatus", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteStatus in 000009.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteStatus)
  "_TF_DeleteTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteTensor in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteTensor)
  "_TF_DeviceListCount", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListCount in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListCount)
  "_TF_DeviceListMemoryBytes", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListMemoryBytes in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListMemoryBytes)
  "_TF_DeviceListName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListName in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListName)
  "_TF_DeviceListType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListType in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListType)
  "_TF_Dim", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Dim in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Dim)
  "_TF_FinishOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_FinishOperation in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_FinishOperation)
  "_TF_GetCode", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GetCode in 000009.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GetCode)
  "_TF_GraphGetTensorNumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorNumDims in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorNumDims)
  "_TF_GraphGetTensorShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorShape in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorShape)
  "_TF_GraphImportGraphDef", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphImportGraphDef in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphImportGraphDef)
  "_TF_GraphNextOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphNextOperation in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphNextOperation)
  "_TF_GraphOperationByName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphOperationByName in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphOperationByName)
  "_TF_GraphToGraphDef", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphToGraphDef in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphToGraphDef)
  "_TF_ImportGraphDefOptionsAddInputMapping", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsAddInputMapping in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsAddInputMapping)
  "_TF_ImportGraphDefOptionsSetDefaultDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice)
  "_TF_ImportGraphDefOptionsSetPrefix", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetPrefix in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetPrefix)
  "_TF_LoadLibrary", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_LoadLibrary in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_LoadLibrary)
  "_TF_LoadSessionFromSavedModel", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_LoadSessionFromSavedModel in 000006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_LoadSessionFromSavedModel)
  "_TF_Message", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Message in 000009.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Message)
  "_TF_NewBuffer", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewBuffer in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewBuffer)
  "_TF_NewGraph", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewGraph in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewGraph)
  "_TF_NewImportGraphDefOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewImportGraphDefOptions in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewImportGraphDefOptions)
  "_TF_NewOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewOperation in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewOperation)
  "_TF_NewSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewSession in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions, __cgo_5439f5b57bf2_Cfunc_TF_NewSession )
  "_TF_NewSessionOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions)
  "_TF_NewStatus", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewStatus in 000009.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewStatus)
  "_TF_NumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NumDims in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NumDims)
  "_TF_OperationDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationDevice in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationDevice)
  "_TF_OperationGetAttrBool", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBool in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBool )
  "_TF_OperationGetAttrBoolList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList)
  "_TF_OperationGetAttrFloat", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloat in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloat )
  "_TF_OperationGetAttrFloatList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList)
  "_TF_OperationGetAttrInt", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrInt in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrInt, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList )
  "_TF_OperationGetAttrIntList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList)
  "_TF_OperationGetAttrMetadata", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrMetadata in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrMetadata)
  "_TF_OperationGetAttrShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShape in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShape, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList )
  "_TF_OperationGetAttrShapeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList)
  "_TF_OperationGetAttrString", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrString in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrString, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList )
  "_TF_OperationGetAttrStringList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList)
  "_TF_OperationGetAttrTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensor in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensor, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList )
  "_TF_OperationGetAttrTensorList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList)
  "_TF_OperationGetAttrType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrType in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrType )
  "_TF_OperationGetAttrTypeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList)
  "_TF_OperationInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationInput in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType, __cgo_5439f5b57bf2_Cfunc_TF_OperationInput )
  "_TF_OperationInputType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType)
  "_TF_OperationName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationName in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationName)
  "_TF_OperationNumInputs", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationNumInputs in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationNumInputs)
  "_TF_OperationNumOutputs", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationNumOutputs in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationNumOutputs)
  "_TF_OperationOpType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOpType in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOpType)
  "_TF_OperationOutputConsumers", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputConsumers in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputConsumers)
  "_TF_OperationOutputListLength", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputListLength in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputListLength)
  "_TF_OperationOutputNumConsumers", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputNumConsumers in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputNumConsumers)
  "_TF_OperationOutputType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputType in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputType)
  "_TF_SessionListDevices", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionListDevices in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionListDevices)
  "_TF_SessionPRun", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionPRun in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup, __cgo_5439f5b57bf2_Cfunc_TF_SessionPRun )
  "_TF_SessionPRunSetup", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup)
  "_TF_SessionRun", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionRun in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionRun)
  "_TF_SetAttrBool", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBool in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBool )
  "_TF_SetAttrBoolList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList)
  "_TF_SetAttrFloat", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloat in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloat )
  "_TF_SetAttrFloatList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList)
  "_TF_SetAttrInt", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrInt in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrInt )
  "_TF_SetAttrIntList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList)
  "_TF_SetAttrShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShape in 000003.o
     (maybe you meant: _TF_SetAttrShapeList_Helper, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShape )
  "_TF_SetAttrShapeList", referenced from:
      _TF_SetAttrShapeList_Helper in 000003.o
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList in 000003.o
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper in 000003.o
     (maybe you meant: _TF_SetAttrShapeList_Helper, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList )
  "_TF_SetAttrString", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrString in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrString )
  "_TF_SetAttrStringList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList)
  "_TF_SetAttrTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensor in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensor, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList )
  "_TF_SetAttrTensorList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList)
  "_TF_SetAttrType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrType in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrType, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList )
  "_TF_SetAttrTypeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList)
  "_TF_SetConfig", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetConfig in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetConfig)
  "_TF_SetDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetDevice in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetDevice)
  "_TF_SetTarget", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetTarget in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetTarget)
  "_TF_TensorBitcastFrom", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorBitcastFrom in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorBitcastFrom)
  "_TF_TensorByteSize", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorByteSize in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorByteSize)
  "_TF_TensorData", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorData in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorData)
  "_TF_TensorType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorType in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorType)
  "_TF_Version", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Version in 000012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Version)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


@wamuir
Copy link
Contributor

wamuir commented Mar 2, 2022

If I copy the x86 files into /usr/local/lib I got a different error

Let's start here: what are you trying to do?

@juancresc
Copy link
Author

@wamuir in this case, I copied the content of the libs provided here from the tutorial.
https://www.tensorflow.org/install/lang_c#build

But just to make sure I was also following all the steps in the tutorial. In the prev message, I built TF from source and used those files.

@wamuir
Copy link
Contributor

wamuir commented Mar 2, 2022

The binaries that you downloaded are for x86_64, which is a different architecture than that of your system. Presumably, when you built libtensorflow from source you targeted your system's architecture (arm64). You've appeared to mix/intermingle these and likely didn't install them correctly in either case, hence the errors that you are receiving.

Do you agree with this?

@juancresc
Copy link
Author

juancresc commented Mar 2, 2022

@wamuir thanks for the explanation and yes makes sense, but I have also used only the binaries obtained from building from source. Check this. You can see that it is using binaries built from source on my M1 machine:

go run main.go
# command-line-arguments
/usr/local/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1
ld: warning: ignoring file /Users/juan/Documents/lib/tensorflow/bazel-bin/tensorflow/libtensorflow.so, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_TFE_ContextListDevices", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextListDevices in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextListDevices)
  "_TFE_ContextOptionsSetAsync", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetAsync in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetAsync)
  "_TFE_ContextOptionsSetConfig", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetConfig in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_ContextOptionsSetConfig)
  "_TFE_DeleteContext", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContext in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContext, __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions )
  "_TFE_DeleteContextOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteContextOptions)
  "_TFE_DeleteTensorHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_DeleteTensorHandle in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_DeleteTensorHandle)
  "_TFE_NewContext", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewContext in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions, __cgo_5439f5b57bf2_Cfunc_TFE_NewContext )
  "_TFE_NewContextOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewContextOptions)
  "_TFE_NewTensorHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_NewTensorHandle in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_NewTensorHandle)
  "_TFE_TensorHandleCopyToDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleCopyToDevice in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleCopyToDevice)
  "_TFE_TensorHandleDataType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDataType in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDataType)
  "_TFE_TensorHandleDeviceName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDeviceName in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDeviceName)
  "_TFE_TensorHandleDim", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDim in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleDim)
  "_TFE_TensorHandleNumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleNumDims in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleNumDims)
  "_TFE_TensorHandleResolve", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleResolve in 000011.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TFE_TensorHandleResolve)
  "_TF_AddControlInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddControlInput in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddControlInput)
  "_TF_AddGradientsWithPrefix", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddGradientsWithPrefix in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddGradientsWithPrefix)
  "_TF_AddInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddInput in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddInputList, __cgo_5439f5b57bf2_Cfunc_TF_AddInput )
  "_TF_AddInputList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AddInputList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AddInputList)
  "_TF_AllocateTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_AllocateTensor in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_AllocateTensor)
  "_TF_CloseSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_CloseSession in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_CloseSession)
  "_TF_DeleteBuffer", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteBuffer in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteBuffer)
  "_TF_DeleteDeviceList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteDeviceList in 000002.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteDeviceList)
  "_TF_DeleteGraph", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteGraph in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteGraph)
  "_TF_DeleteImportGraphDefOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteImportGraphDefOptions in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteImportGraphDefOptions)
  "_TF_DeleteLibraryHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteLibraryHandle in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteLibraryHandle)
  "_TF_DeletePRunHandle", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeletePRunHandle in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeletePRunHandle)
  "_TF_DeleteSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteSession in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions, __cgo_5439f5b57bf2_Cfunc_TF_DeleteSession )
  "_TF_DeleteSessionOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteSessionOptions)
  "_TF_DeleteStatus", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteStatus in 000009.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteStatus)
  "_TF_DeleteTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeleteTensor in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeleteTensor)
  "_TF_DeviceListCount", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListCount in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListCount)
  "_TF_DeviceListMemoryBytes", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListMemoryBytes in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListMemoryBytes)
  "_TF_DeviceListName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListName in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListName)
  "_TF_DeviceListType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_DeviceListType in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_DeviceListType)
  "_TF_Dim", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Dim in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Dim)
  "_TF_FinishOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_FinishOperation in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_FinishOperation)
  "_TF_GetCode", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GetCode in 000009.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GetCode)
  "_TF_GraphGetTensorNumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorNumDims in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorNumDims)
  "_TF_GraphGetTensorShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorShape in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphGetTensorShape)
  "_TF_GraphImportGraphDef", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphImportGraphDef in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphImportGraphDef)
  "_TF_GraphNextOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphNextOperation in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphNextOperation)
  "_TF_GraphOperationByName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphOperationByName in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphOperationByName)
  "_TF_GraphToGraphDef", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_GraphToGraphDef in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_GraphToGraphDef)
  "_TF_ImportGraphDefOptionsAddInputMapping", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsAddInputMapping in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsAddInputMapping)
  "_TF_ImportGraphDefOptionsSetDefaultDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetDefaultDevice)
  "_TF_ImportGraphDefOptionsSetPrefix", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetPrefix in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_ImportGraphDefOptionsSetPrefix)
  "_TF_LoadLibrary", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_LoadLibrary in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_LoadLibrary)
  "_TF_LoadSessionFromSavedModel", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_LoadSessionFromSavedModel in 000006.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_LoadSessionFromSavedModel)
  "_TF_Message", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Message in 000009.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Message)
  "_TF_NewBuffer", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewBuffer in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewBuffer)
  "_TF_NewGraph", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewGraph in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewGraph)
  "_TF_NewImportGraphDefOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewImportGraphDefOptions in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewImportGraphDefOptions)
  "_TF_NewOperation", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewOperation in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewOperation)
  "_TF_NewSession", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewSession in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions, __cgo_5439f5b57bf2_Cfunc_TF_NewSession )
  "_TF_NewSessionOptions", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewSessionOptions)
  "_TF_NewStatus", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NewStatus in 000009.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NewStatus)
  "_TF_NumDims", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_NumDims in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_NumDims)
  "_TF_OperationDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationDevice in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationDevice)
  "_TF_OperationGetAttrBool", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBool in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBool )
  "_TF_OperationGetAttrBoolList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrBoolList)
  "_TF_OperationGetAttrFloat", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloat in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloat )
  "_TF_OperationGetAttrFloatList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrFloatList)
  "_TF_OperationGetAttrInt", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrInt in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrInt, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList )
  "_TF_OperationGetAttrIntList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrIntList)
  "_TF_OperationGetAttrMetadata", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrMetadata in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrMetadata)
  "_TF_OperationGetAttrShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShape in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShape, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList )
  "_TF_OperationGetAttrShapeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrShapeList)
  "_TF_OperationGetAttrString", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrString in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrString, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList )
  "_TF_OperationGetAttrStringList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrStringList)
  "_TF_OperationGetAttrTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensor in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensor, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList )
  "_TF_OperationGetAttrTensorList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTensorList)
  "_TF_OperationGetAttrType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrType in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList, __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrType )
  "_TF_OperationGetAttrTypeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList in 000001.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationGetAttrTypeList)
  "_TF_OperationInput", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationInput in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType, __cgo_5439f5b57bf2_Cfunc_TF_OperationInput )
  "_TF_OperationInputType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationInputType)
  "_TF_OperationName", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationName in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationName)
  "_TF_OperationNumInputs", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationNumInputs in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationNumInputs)
  "_TF_OperationNumOutputs", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationNumOutputs in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationNumOutputs)
  "_TF_OperationOpType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOpType in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOpType)
  "_TF_OperationOutputConsumers", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputConsumers in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputConsumers)
  "_TF_OperationOutputListLength", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputListLength in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputListLength)
  "_TF_OperationOutputNumConsumers", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputNumConsumers in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputNumConsumers)
  "_TF_OperationOutputType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputType in 000005.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_OperationOutputType)
  "_TF_SessionListDevices", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionListDevices in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionListDevices)
  "_TF_SessionPRun", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionPRun in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup, __cgo_5439f5b57bf2_Cfunc_TF_SessionPRun )
  "_TF_SessionPRunSetup", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionPRunSetup)
  "_TF_SessionRun", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SessionRun in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SessionRun)
  "_TF_SetAttrBool", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBool in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBool )
  "_TF_SetAttrBoolList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrBoolList)
  "_TF_SetAttrFloat", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloat in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloat )
  "_TF_SetAttrFloatList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrFloatList)
  "_TF_SetAttrInt", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrInt in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrInt )
  "_TF_SetAttrIntList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrIntList)
  "_TF_SetAttrShape", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShape in 000003.o
     (maybe you meant: _TF_SetAttrShapeList_Helper, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShape )
  "_TF_SetAttrShapeList", referenced from:
      _TF_SetAttrShapeList_Helper in 000003.o
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList in 000003.o
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper in 000003.o
     (maybe you meant: _TF_SetAttrShapeList_Helper, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList_Helper , __cgo_5439f5b57bf2_Cfunc_TF_SetAttrShapeList )
  "_TF_SetAttrString", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrString in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrString )
  "_TF_SetAttrStringList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrStringList)
  "_TF_SetAttrTensor", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensor in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensor, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList )
  "_TF_SetAttrTensorList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTensorList)
  "_TF_SetAttrType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrType in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrType, __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList )
  "_TF_SetAttrTypeList", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetAttrTypeList)
  "_TF_SetConfig", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetConfig in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetConfig)
  "_TF_SetDevice", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetDevice in 000003.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetDevice)
  "_TF_SetTarget", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_SetTarget in 000007.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_SetTarget)
  "_TF_TensorBitcastFrom", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorBitcastFrom in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorBitcastFrom)
  "_TF_TensorByteSize", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorByteSize in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorByteSize)
  "_TF_TensorData", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorData in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorData)
  "_TF_TensorType", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_TensorType in 000010.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_TensorType)
  "_TF_Version", referenced from:
      __cgo_5439f5b57bf2_Cfunc_TF_Version in 000012.o
     (maybe you meant: __cgo_5439f5b57bf2_Cfunc_TF_Version)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@wamuir
Copy link
Contributor

wamuir commented Mar 2, 2022

Please provide output from running go env

@juancresc
Copy link
Author

@wamuir sure:

go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/juan/Library/Caches/go-build"
GOENV="/Users/juan/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/juan/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/juan/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.6"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/juan/Documents/code/rtb/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7m/mnymf5ss1mz39ygdshyl69n40000gp/T/go-build1471044767=/tmp/go-build -gno-record-gcc-switches -fno-common"

@juancresc
Copy link
Author

I see the point, I need to reinstall go for arm64

@saiteja111997
Copy link

@juancresc Did it work ??

@juancresc
Copy link
Author

@saiteja111997 i mean im running TF in a arm64 M1 mac but i dont remember how the hell i installed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants