O2 build fails on ONNXRuntime

Dear all,

I am trying to build O2 via the command:

aliBuild build O2Physics --defaults o2

on MacBook Air (M1, 2020) with MacOS Big Sur (Version 11.5.2) but it fails during the ONNXRuntime compilation with an error:


Adding flags for Mac builds
– Found PythonInterp: /opt/homebrew/opt/python@3.9/bin/python3.9 (found suitable version “3.9.9”, minimum required is “3.5”)
CMake Error at /opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version “3.5”)
Call Stack (most recent call first):
/opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/opt/homebrew/Cellar/cmake/3.22.0/share/cmake/Modules/FindPythonLibs.cmake:310 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:549 (find_package)

I put the whole log file on CERNBox.
I would be very grateful if you have any suggestions.

Thank you very much in advance!

Klaudia

Do you actually need ONNXRuntime? If not, can you try to disable it with --disable ONNXRuntime?

@eulisse thank you for your suggestion.

I do not need ONNXRuntime, so I disabled it with what you recommended, but it ended with another error:

-- !!! Using new O2 targets. That's a good thing.
CMake Error at CMakeLists.txt:41 (find_package):
  Could not find a package configuration file provided by
  "ONNXRuntime::ONNXRuntime" with any of the following names:

    ONNXRuntime::ONNXRuntimeConfig.cmake
    onnxruntime::onnxruntime-config.cmake

  Add the installation prefix of "ONNXRuntime::ONNXRuntime" to
  CMAKE_PREFIX_PATH or set "ONNXRuntime::ONNXRuntime_DIR" to a directory
  containing one of the above files.  If "ONNXRuntime::ONNXRuntime" provides
  a separate development package or SDK, be sure it has been installed.

Log file can be found at CERNBox.

We probably need to make ONNXRuntime optional. I just did:

to do it.

I upgraded master branch after changes were merged and built O2Physics again via:
aliBuild build O2Physics --defaults o2 --disable ONNXRuntime

It was successful now, thank you very much for your prompt help!

Hello, same problem when building O2Physics in Mac OS Monterey on a M1, but the fix didn’t work (apparently): O2 built successfully with the --disable ONNXRuntime option, but when building O2Physics it complains, see the attached log:

log.txt (10.7 KB)

Did I miss something?

Thanks, cheers
Antonio

Yes, I have the same issue since some tasks using ONNX have been implemented in O2Physics.
I know it is a kind of “silly” solution, but for now I just excluded files with ONNX (in my O2Physics fork).