TMVA SOFIE: undefined reference to sgemm_

I am trying to convert a pytorch model to C++ code using the example here: https://github.com/root-project/root/blob/master/tutorials/tmva/TMVA_SOFIE_PyTorch.C.

I can not compile the generated hxx file due to “undefined reference to `sgemm_’.” When I run interactively, it shows error: “IncrementalExecutor::executeFunction: symbol ‘sgemm_’ unresolved while linking [cling interface function]!”

The root version I am trying to compile the code with is “6.16/00”. SOFIE is not available in this root, but I sgemm and sgemm are used in the TMVA code. I am working with an ATLAS analysis release so I cannot change packages. Is there any work around?

PyTorchModel.hxx (452.2 KB)

Fix by adding find_package(LAPACK) to cmake file and link LAPACK_LIBRARIES.

You normally need to link your code using SOFIE with BLAS. If you can use openblas is better than standard bias from Netlib since it is faster.

Lorenzo