cair / tmu

Implements the Tsetlin Machine, Coalesced Tsetlin Machine, Convolutional Tsetlin Machine, Regression Tsetlin Machine, and Weighted Tsetlin Machine, with support for continuous features, drop clause, Type III Feedback, focused negative sampling, multi-task classifier, autoencoder, literal budget, and one-vs-one multi-class classifier. TMU is written in Python with wrappers for C and CUDA-based clause evaluation and updating.
https://pypi.org/project/tmu/
MIT License
126 stars 13 forks source link

Build error on Linux Ubuntu using pip3 install -e . #56

Closed olegranmo closed 9 months ago

olegranmo commented 10 months ago

Building editable for tmu (pyproject.toml) ... error error: subprocess-exited-with-error

× Building editable for tmu (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [209 lines of output] generating ./tmu/tmulib.c (already up-to-date) the current directory is '/data/tmp/tmu' running build_ext building 'tmu.tmulib' extension x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/data/tmp/tmu/tmu/lib/include -I/usr/include/python3.10 -c tmu/tmulib.c -o ./tmu/tmulib.o -O3 -mrdrnd tmu/tmulib.c: In function ‘cb_type_i_feedback’: tmu/tmulib.c:891:122: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 891 if (clause_output && cb_number_of_include_actions(ta_state, j, number_of_literals, number_of_state_bits) <= max_included_literals) { ^~ tmu/tmulib.c:893:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 893 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c:907:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 907 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c: In function ‘cb_type_ii_feedback’: tmu/tmulib.c:949:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 949 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c: In function ‘cb_type_iii_feedback’: tmu/tmulib.c:1009:59: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1009 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c:1021:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1021 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c:1031:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1031 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c:1063:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1063 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c: In function ‘cb_initialize_incremental_clause_calculation’: tmu/tmulib.c:1122:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1122 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c:1113:22: warning: variable ‘filter’ set but not used [-Wunused-but-set-variable] 1113 unsigned int filter; ^~ tmu/tmulib.c: In function ‘cb_calculate_clause_outputs_incremental_batch’: tmu/tmulib.c:1214:22: warning: variable ‘filter’ set but not used [-Wunused-but-set-variable] 1214 unsigned int filter; ^~ tmu/tmulib.c: In function ‘cb_calculate_clause_outputs_incremental’: tmu/tmulib.c:1267:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1267 for (int j = 0; j < literal_clause_map_pos[k] - start_pos; ++j) { ^ tmu/tmulib.c:1272:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1272 for (int j = 0; j < literal_clause_map_pos[k] - start_pos; ++j) { ^ tmu/tmulib.c:1281:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1281 for (int k = 0; k < number_of_ta_chunks; ++k) { ^ tmu/tmulib.c:1250:22: warning: variable ‘filter’ set but not used [-Wunused-but-set-variable] 1250 unsigned int filter; ^~ tmu/tmulib.c: In function ‘cb_included_literals’: tmu/tmulib.c:1378:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1378 for (int k = 0; k < number_of_ta_chunks; k++) { ^ tmu/tmulib.c:1383:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1383 for (int k = 0; k < number_of_ta_chunks; k++) { ^ tmu/tmulib.c: In function ‘cb_number_of_include_actions’: tmu/tmulib.c:1408:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1408 for (int k = 0; k < number_of_ta_chunks-1; ++k) { ^ tmu/tmulib.c: In function ‘tmu_produce_autoencoder_example’: tmu/tmulib.c:1484:168: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare] 1484 if ((indptr_col[active_output[target]+1] - indptr_col[active_output[target]] == 0) (indptr_col[active_output[target]+1] - indptr_col[active_output[target]] == number_of_rows)) { ^~ tmu/tmulib.c:1488:57: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1488 for (int k = indptr_row[row]; k < indptr_row[row+1]; ++k) { ^ tmu/tmulib.c:1507:57: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare] 1507 for (int k = indptr_row[row]; k < indptr_row[row+1]; ++k) { ^ tmu/tmulib.c:1522:187: warning: passing argument 5 of ‘bsearch’ from incompatible pointer type [-Wincompatible-pointer-types] 1522 if (bsearch(&row, &indices_col[indptr_col[active_output[target]]], indptr_col[active_output[target]+1] - indptr_col[active_output[target]], sizeof(unsigned int), compareints) == NULL) { ^~~
unsigned int ()(const void , const void *)
  In file included from /usr/include/stdlib.h:833,
                   from /usr/include/python3.10/Python.h:34,
                   from tmu/tmulib.c:57:
  /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:21:24: note: expected ‘__compar_fn_t’ {aka ‘int (*)(const void *, const void *)’} but argument is of type ‘unsigned int (*)(const void *, const void *)’
     21 |          __compar_fn_t __compar)
        |          ~~~~~~~~~~~~~~^~~~~~~~
  tmu/tmulib.c:1523:65: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
   1523 |                                 for (int k = indptr_row[row]; k < indptr_row[row+1]; ++k) {
        |                                                                 ^
  tmu/tmulib.c: In function ‘cbs_type_i_feedback’:
  tmu/tmulib.c:1926:22: warning: unused variable ‘number_of_ta_chunks’ [-Wunused-variable]
   1926 |         unsigned int number_of_ta_chunks = (number_of_literals-1)/32 + 1;
        |                      ^~~~~~~~~~~~~~~~~~~
  x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 ./tmu/tmulib.o -o ./tmu/tmulib.cpython-310-x86_64-linux-gnu.so
  not modified: 'build/tmu/tmulib.c'
  generating build/tmu/tmulib.c
  (already up-to-date)
  running editable_wheel
  creating /tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu.egg-info
  writing /tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu.egg-info/PKG-INFO
  writing dependency_links to /tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu.egg-info/dependency_links.txt
  writing requirements to /tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu.egg-info/requires.txt
  writing top-level names to /tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu.egg-info/top_level.txt
  writing manifest file '/tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu.egg-info/SOURCES.txt'
  reading manifest file '/tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE'
  writing manifest file '/tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu.egg-info/SOURCES.txt'
  creating '/tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu-0.8.1.dist-info'
  creating /tmp/pip-wheel-qzxo5pcv/.tmp-tkyet1l9/tmu-0.8.1.dist-info/WHEEL
  Traceback (most recent call las
      files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 267, in _run_build_commands
      self._configure_build(dist_name, unpacked_wheel, build_lib, tmp_dir)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 217, in _configure_build
      install = dist.reinitialize_command("install", reinit_subcommands=True)
    File "/usr/lib/python3.10/distutils/dist.py", line 938, in reinitialize_command
      command = self.get_command_obj(command_name)
    File "/usr/lib/python3.10/distutils/dist.py", line 858, in get_command_obj
      cmd_obj = self.command_obj[command] = klass(self)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 174, in __init__
      super().__init__(dist)
    File "/usr/lib/python3.10/distutils/cmd.py", line 62, in __init__
      self.initialize_options()
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/command/install.py", line 50, in initialize_options
      orig.install.initialize_options(self)
    File "/usr/lib/python3.10/_distutils_system_mod.py", line 33, in initialize_options
      super().initialize_options()
  TypeError: super(type, obj): obj must be an instance or subtype of type
  /usr/lib/python3.10/distutils/dist.py:985: _DebuggingTips: Problem in editable installation.
  !!

          ********************************************************************************
          An error happened while installing `tmu` in editable mode.

          The following steps are recommended to help debug this problem:

          - Try to install the project normally, without using the editable mode.
            Does the error still persist?
            (If it does, try fixing the problem before attempting the editable mode).
          - If you are using binary extensions, make sure you have all OS-level
            dependencies installed (e.g. compilers, toolchains, binary libraries, ...).
          - Try the latest version of setuptools (maybe the error was already fixed).
          - If you (or your project dependencies) are using any setuptools extension
            or customization, make sure they support the editable mode.

          After following the steps above, if the problem still persists and
          you think this is related to how setuptools handles editable installations,
          please submit a reproducible example
          (see https://stackoverflow.com/help/minimal-reproducible-example) to:

              https://github.com/pypa/setuptools/issues

          See https://setuptools.pypa.io/en/latest/userguide/development_mode.html for details.
          ********************************************************************************

  !!
    cmd_obj.run()
  Traceback (most recent call last):
    File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.10/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 273, in build_editable
      return hook(wheel_directory, config_settings, metadata_directory)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 436, in build_editable
      return self._build_with_temp_dir(
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 76, in <module>
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/dist.py", line 963, in run_command
      super().run_command(command)
    File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 156, in run
      self._create_wheel_file(bdist_wheel)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 345, in _create_wheel_file
      files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 267, in _run_build_commands
      self._configure_build(dist_name, unpacked_wheel, build_lib, tmp_dir)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/command/editable_wheel.py", line 217, in _configure_build
      install = dist.reinitialize_command("install", reinit_subcommands=True)
    File "/usr/lib/python3.10/distutils/dist.py", line 938, in reinitialize_command
      command = self.get_command_obj(command_name)
    File "/usr/lib/python3.10/distutils/dist.py", line 858, in get_command_obj
      cmd_obj = self.command_obj[command] = klass(self)
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 174, in __init__
      super().__init__(dist)
    File "/usr/lib/python3.10/distutils/cmd.py", line 62, in __init__
      self.initialize_options()
    File "/tmp/pip-build-env-5tia0lvc/overlay/local/lib/python3.10/dist-packages/setuptools/command/install.py", line 50, in initialize_options
      orig.install.initialize_options(self)
    File "/usr/lib/python3.10/_distutils_system_mod.py", line 33, in initialize_options
      super().initialize_options()
  TypeError: super(type, obj): obj must be an instance or subtype of type
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building editable for tmu Failed to build tmu ERROR: Could not build wheels for tmu, which is required to install pyproject.toml-based projects

perara commented 10 months ago

Is this fixed?