Skip to content

Unable to compile hls model #643

@Sam-Nielsen-Dot

Description

@Sam-Nielsen-Dot

When I try to run the first tutorial notebook from hls4ml-tutorial

The code stops at the hls_model.compile() line and shows the error

Writing HLS project
Done
build_lib.sh: line 14: g++: command not found
build_lib.sh: line 15: g++: command not found
build_lib.sh: line 16: g++: command not found
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Input In [13], in <cell line: 1>()
----> 1 hls_model.compile()
      2 X_test = np.ascontiguousarray(X_test)
      3 y_hls = hls_model.predict(X_test)

File ~/anaconda3/envs/hls4ml-tutorial/lib/python3.8/site-packages/hls4ml/model/hls_model.py:546, in HLSModel.compile(self)
    544         dlclose_func.restype = ctypes.c_int
    545         dlclose_func(self._top_function_lib._handle)
--> 546     self._top_function_lib = ctypes.cdll.LoadLibrary(lib_name)
    547 finally:
    548     os.chdir(curr_dir)

File ~/anaconda3/envs/hls4ml-tutorial/lib/python3.8/ctypes/__init__.py:451, in LibraryLoader.LoadLibrary(self, name)
    450 def LoadLibrary(self, name):
--> 451     return self._dlltype(name)

File ~/anaconda3/envs/hls4ml-tutorial/lib/python3.8/ctypes/__init__.py:373, in CDLL.__init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    370 self._FuncPtr = _FuncPtr
    372 if handle is None:
--> 373     self._handle = _dlopen(self._name, mode)
    374 else:
    375     self._handle = handle

OSError: firmware/myproject-478C5A15.so: cannot open shared object file: No such file or directory

This same error occurs when I try to run any of the other tutorial notebooks or compile a HLS4ML model in any other piece of code

Furthermore,

when I try to just build the model without compiling it I get the error message

Project myproject_prj does not exist. Rerun "hls4ml build -p my-hls-test".

Do you know how to rectify this?

Thankyou

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions