Accelergy-Project / timeloop-python

Python wrapper for the timeloop project.
MIT License
7 stars 3 forks source link

Installation error #21

Closed kiarashk76 closed 1 month ago

kiarashk76 commented 1 year ago

I'm trying to install the pytimeloop module. I installed the timeloop and set the TIMELOOP_INCLUDE_PATH and TIMELOOP_LIB_PATH but when I'm running the "pip3 install -e ." it will give me the following error:

Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: pyyaml in /home/kiarash/miniconda3/envs/cobra/lib/python3.8/site-packages (from 
pytimeloop==0.0.1) (6.0)
Building wheels for collected packages: pytimeloop
Building editable for pytimeloop (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building editable for pytimeloop (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [140 lines of output]
    running editable_wheel
    creating /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info
    writing /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/PKG-INFO
    writing dependency_links to /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/dependency_links.txt
    writing requirements to /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/requires.txt
    writing top-level names to /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/top_level.txt
    writing manifest file '/tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/SOURCES.txt'
    reading manifest file '/tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file '/tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop.egg-info/SOURCES.txt'
    creating '/tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop-0.0.1.dist-info'
    adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
    creating /tmp/pip-wheel-4ml299j7/tmp6kuymqkg/pytimeloop-0.0.1.dist-info/WHEEL
    running build_py
    running build_ext
    -- The C compiler identification is GNU 8.4.0
    -- The CXX compiler identification is GNU 8.4.0
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Using timeloop includes from: /home/kiarash/cobra/timeloop/include
    -- pybind11 v2.8.0 dev2
    CMake Warning (dev) at /tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/cmake/data/share/cmake-3.24/Modules/CMakeDependentOption.cmake:89 (message):
      Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
      Syntax.  Run "cmake --help-policy CMP0127" for policy details.  Use the
      cmake_policy command to set the policy and suppress this warning.
    Call Stack (most recent call first):
      lib/pybind11/CMakeLists.txt:101 (cmake_dependent_option)
    This warning is for project developers.  Use -Wno-dev to suppress it.

    -- Found PythonInterp: /home/kiarash/miniconda3/envs/cobra/bin/python (found version "3.8.13")
    -- Found PythonLibs: /home/kiarash/miniconda3/envs/cobra/lib/libpython3.8.so
    -- Performing Test HAS_FLTO
    -- Performing Test HAS_FLTO - Success
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /tmp/tmp0uk855y2.build-temp
    [  4%] Building CXX object CMakeFiles/define_gterminate.dir/bindings/gterminate.cpp.o
    [  9%] Linking CXX shared library /tmp/tmprxx_j31b.build-lib/libdefine_gterminate.so
    [  9%] Built target define_gterminate
    [ 14%] Building CXX object CMakeFiles/pytimeloop.dir/src/mapper/coupled-mapper.cpp.o
    [ 19%] Building CXX object CMakeFiles/pytimeloop.dir/src/mapspace/status.cpp.o
    [ 23%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/accelerator.cpp.o
    [ 28%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/bounded-queue-accelerator-pool.cpp.o
    [ 33%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/unbounded-queue-accelerator-pool.cpp.o
    [ 38%] Building CXX object CMakeFiles/pytimeloop.dir/src/model/util.cpp.o
    [ 42%] Linking CXX shared library /tmp/tmprxx_j31b.build-lib/libpytimeloop.so
    [ 42%] Built target pytimeloop
    [ 47%] Building CXX object CMakeFiles/bindings.dir/bindings/accelergy_interface.cpp.o
    [ 52%] Building CXX object CMakeFiles/bindings.dir/bindings/bindings.cpp.o
    [ 57%] Building CXX object CMakeFiles/bindings.dir/bindings/config.cpp.o
    [ 61%] Building CXX object CMakeFiles/bindings.dir/bindings/mapper.cpp.o
    [ 66%] Building CXX object CMakeFiles/bindings.dir/bindings/mapping.cpp.o
    /home/kiarash/cobra/timeloop-python/bindings/mapping.cpp: In function ‘void pytimeloop::mapping_bindings::BindMappingClasses(pybind11::module&)’:
    /home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:24: warning: converting to ‘pybind11::arg’ from initializer list would use explicit constructor ‘constexpr pybind11::arg::arg(const char*)’
               py::arg() = {}, py::arg() = {}, py::arg() = {},
                            ^
    /home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:24: note: in C++11 and above a default constructor can be explicit
    /home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:40: warning: converting to ‘pybind11::arg’ from initializer list would use explicit constructor ‘constexpr pybind11::arg::arg(const char*)’
               py::arg() = {}, py::arg() = {}, py::arg() = {},
                                            ^
    /home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:40: note: in C++11 and above a default constructor can be explicit
    /home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:56: warning: converting to ‘pybind11::arg’ from initializer list would use explicit constructor ‘constexpr pybind11::arg::arg(const char*)’
               py::arg() = {}, py::arg() = {}, py::arg() = {},
                                                            ^
    /home/kiarash/cobra/timeloop-python/bindings/mapping.cpp:53:56: note: in C++11 and above a default constructor can be explicit
    [ 71%] Building CXX object CMakeFiles/bindings.dir/bindings/mapspace.cpp.o
    [ 76%] Building CXX object CMakeFiles/bindings.dir/bindings/model.cpp.o
    [ 80%] Building CXX object CMakeFiles/bindings.dir/bindings/problem.cpp.o
    [ 85%] Building CXX object CMakeFiles/bindings.dir/bindings/search.cpp.o
    [ 90%] Linking CXX shared module /tmp/tmprxx_j31b.build-lib/bindings.cpython-38-x86_64-linux-gnu.so
    [ 90%] Built target bindings
    [ 95%] Building CXX object cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/test-main.cpp.o
    In file included from /home/kiarash/cobra/timeloop-python/cpp_tests/test-main.cpp:10:
    /home/kiarash/cobra/timeloop-python/cpp_tests/test-worker-pool.h: In member function ‘void WorkerPool<Worker>::worker_loop(Worker&&) [with Worker = AddOneWorker]’:
    /home/kiarash/cobra/timeloop-python/cpp_tests/test-worker-pool.h:13:49: warning: ‘*((void*)& task +8)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       Result operator()(Task& task) { return task + 1; }
                                                     ^
    In file included from /home/kiarash/cobra/timeloop-python/include/pytimeloop/mapper/coupled-mapper.h:13,
                     from /home/kiarash/cobra/timeloop-python/cpp_tests/test-mapper.h:10,
                     from /home/kiarash/cobra/timeloop-python/cpp_tests/test-main.cpp:9:
    /home/kiarash/cobra/timeloop-python/include/pytimeloop/utils/worker-pool.h:75:20: note: ‘*((void*)& task +8)’ was declared here
           WithId<Task> task;
                        ^~~~
    /home/kiarash/cobra/timeloop-python/include/pytimeloop/utils/worker-pool.h:75:20: warning: ‘task.WithId<int>::id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    [100%] Linking CXX executable pytimeloop_cpptest
    /usr/bin/ld: CMakeFiles/pytimeloop_cpptest.dir/test-main.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
    //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/build.make:99: recipe for target 'cpp_tests/pytimeloop_cpptest' failed
    make[2]: *** [cpp_tests/pytimeloop_cpptest] Error 1
    CMakeFiles/Makefile2:201: recipe for target 'cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/all' failed
    make[1]: *** [cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/all] Error 2
    Makefile:90: recipe for target 'all' failed
    make: *** [all] Error 2
    /tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    Traceback (most recent call last):
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/editable_wheel.py", line 140, in run
        self._create_wheel_file(bdist_wheel)
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/editable_wheel.py", line 330, in _create_wheel_file
        files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/editable_wheel.py", line 261, in _run_build_commands
        self._run_build_subcommands()
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/editable_wheel.py", line 288, in _run_build_subcommands
        self.run_command(name)
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
        self.distribution.run_command(command)
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 1217, in run_command
        super().run_command(command)
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
        _build_ext.run(self)
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
        self.build_extensions()
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 466, in build_extensions
        self._build_extensions_serial()
      File "/tmp/pip-build-env-ok6b9upz/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 492, in _build_extensions_serial
        self.build_extension(ext)
      File "<string>", line 91, in build_extension
      File "/home/kiarash/miniconda3/envs/cobra/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 2.
    error: Support for editable installs via PEP 660 was recently introduced
    in `setuptools`. If you are seeing this error, please report to:

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

    Meanwhile you can try the legacy behavior by setting an
    environment variable and trying to install again:

    SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
    [end of output]

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

I need pytimeloop for a project I'm working on and I would really appreciate any help.

Thanks

gilbertmike commented 10 months ago

Hi, there has been a good amount of changes and bugfixes committed to PyTimeloop recently. Would you mind trying it again?