Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octo4a needs apk add cmake also #11

Closed
kdobrev opened this issue Jan 12, 2024 · 7 comments
Closed

Octo4a needs apk add cmake also #11

kdobrev opened this issue Jan 12, 2024 · 7 comments

Comments

@kdobrev
Copy link

kdobrev commented Jan 12, 2024

Hi,
I just installed a new octoprint on a phone and nhe first plug in I tried to install was bgcode, but it failed.

I checked the log and it appears I have previosly also added cmake.

Please add to the description of the plugin that

apk add cmake

is also needed.
Thank you.

@jneilliii
Copy link
Owner

How/where do you run that command? I've never used octo4a.

@ruedli
Copy link

ruedli commented Mar 2, 2024

I think I run into this as well.

I have migrated from running on Pi (using octopi) to on proxmox in a VM.
I am very happy on the performance of this compaired to Pi4, but:

All my other plugins installed well (more than 40) , but BGcode fails to compile.

All 3 environments worked OK, but failed to install this "one" plugin (i.e. BGCODE)

I first mention the output on a clean scripted container (between >>>>>>>> and <<<<<<)
And next after installing cmake. The last goed "slightly" better, but still errors out.

So: in a clean buld environemnt (restored from a Pi backup) I get this when adding the plugin: (message continues after the <<<<<<<<<<<< line)

Installing plugin "BGCode" from https://github.com/jneilliii/OctoPrint-BGCode/archive/master.zip...
/opt/octoprint/bin/python3 -m pip --disable-pip-version-check install file:///tmp/tmpps3fm8gu/OctoPrint-BGCode-master.zip --no-cache-dir
Processing /tmp/tmpps3fm8gu/OctoPrint-BGCode-master.zip
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting pybgcode@ https://github.com/jneilliii/libbgcode/archive/refs/tags/0.2.0.zip (from BGCode==0.2.0)
Downloading https://github.com/jneilliii/libbgcode/archive/refs/tags/0.2.0.zip

  • 474.1 kB 7.4 MB/s 0:00:00
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Installing backend dependencies: started
    Installing backend dependencies: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [93 lines of output]
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- 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
-- Building the dependencies with preset python-module
-- build dir = /tmp/pip-install-oodqq8vv/pybgcode_9b77c4829a0449d08c85e2daab589f42/deps/build-python-module
CMake Error at /tmp/pip-install-oodqq8vv/pybgcode_9b77c4829a0449d08c85e2daab589f42/deps/autobuild.cmake:72 (message):
Dependency build failed with output:

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

CMake Error: Problem with archive_write_header(): Can't create
'boost-1.82.0/libs/graph_parallel'

CMake Error: Current file: boost-1.82.0/libs/graph_parallel/

CMake Error: Problem extracting tar:
/tmp/pip-install-oodqq8vv/pybgcode_9b77c4829a0449d08c85e2daab589f42/deps/.pkg_cache/Boost/boost-1.82.0.zip

CMake Error at dep_Boost-stamp/extract-dep_Boost.cmake:40 (message):

Extract of
'/tmp/pip-install-oodqq8vv/pybgcode_9b77c4829a0449d08c85e2daab589f42/deps/.pkg_cache/Boost/boost-1.82.0.zip'
failed

gmake[2]: *** [CMakeFiles/dep_Boost.dir/build.make:101:
dep_Boost-prefix/src/dep_Boost-stamp/dep_Boost-download] Error 1

gmake[1]: *** [CMakeFiles/Makefile2:90: CMakeFiles/dep_Boost.dir/all] Error
2

gmake: *** [Makefile:136: all] Error 2

Call Stack (most recent call first):
/tmp/pip-install-oodqq8vv/pybgcode_9b77c4829a0449d08c85e2daab589f42/CMakeLists.txt:27 (include)

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "/opt/octoprint/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/opt/octoprint/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/opt/octoprint/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/tmp/pip-build-env-7orve9h3/overlay/lib/python3.9/site-packages/py_build_cmake/build.py", line 67, in build_wheel
whl_name = self.build_wheel_in_dir(wheel_directory, tmp_build_dir,
File "/tmp/pip-build-env-7orve9h3/overlay/lib/python3.9/site-packages/py_build_cmake/build.py", line 248, in build_wheel_in_dir
self.do_native_cross_cmake_build(paths, cfg, pkg_info)
File "/tmp/pip-build-env-7orve9h3/overlay/lib/python3.9/site-packages/py_build_cmake/build.py", line 333, in do_native_cross_cmake_build
self.run_cmake(paths.source_dir, paths.staging_dir, cmake_cfg,
File "/tmp/pip-build-env-7orve9h3/overlay/lib/python3.9/site-packages/py_build_cmake/build.py", line 510, in run_cmake
cmaker.configure()
File "/tmp/pip-build-env-7orve9h3/overlay/lib/python3.9/site-packages/py_build_cmake/cmake.py", line 154, in configure
self.run(cmd, cwd=cwd, check=True, env=env)
File "/tmp/pip-build-env-7orve9h3/overlay/lib/python3.9/site-packages/py_build_cmake/cmake.py", line 68, in run
return self.runner.run(*args, **kwargs)
File "/tmp/pip-build-env-7orve9h3/overlay/lib/python3.9/site-packages/py_build_cmake/cmd_runner.py", line 25, in run
return sp_run(*args, **kwargs)
File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '-S', '/tmp/pip-install-oodqq8vv/pybgcode_9b77c4829a0449d08c85e2daab589f42/pybgcode', '-B', '/tmp/pip-install-oodqq8vv/pybgcode_9b77c4829a0449d08c85e2daab589f42/.py-build-cmake_cache/cp39-cp39-linux_x86_64', '-D', 'PY_BUILD_CMAKE_PACKAGE_VERSION:STRING=0.2.0', '-D', 'PY_BUILD_CMAKE_PACKAGE_NAME:STRING=pybgcode', '-D', 'PY_BUILD_CMAKE_MODULE_NAME:STRING=pybgcode', '-D', 'Python3_EXECUTABLE:FILEPATH=/opt/octoprint/bin/python3', '-D', 'Python3_ROOT_DIR:PATH=/opt/octoprint', '-D', 'Python3_FIND_REGISTRY=NEVER', '-D', 'Python3_FIND_STRATEGY=LOCATION', '-D', 'PyBGCode_LINK_SYSTEM_LIBBGCODE=off', '-D', 'CMAKE_BUILD_TYPE:STRING=Release']' returned non-zero exit status 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Error!
Could not parse output from pip, see plugin_pluginmanager_console.log for generated output
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

message continues her:
So... I did a apt install cmake and now I got this (slightly better) result.
But WHAT am I missing.

Installing plugin...
Installing plugin "BGCode" from https://github.com/jneilliii/OctoPrint-BGCode/archive/master.zip...
/opt/octoprint/bin/python3 -m pip --disable-pip-version-check install file:///tmp/tmpe7v03yj1/OctoPrint-BGCode-master.zip --no-cache-dir
Processing /tmp/tmpe7v03yj1/OctoPrint-BGCode-master.zip
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting pybgcode@ https://github.com/jneilliii/libbgcode/archive/refs/tags/0.2.0.zip (from BGCode==0.2.0)
Downloading https://github.com/jneilliii/libbgcode/archive/refs/tags/0.2.0.zip

  • 474.1 kB 7.4 MB/s 0:00:00
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [199 lines of output]
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- 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
-- Building the dependencies with preset python-module
-- build dir = /tmp/pip-install-e97uf5jd/pybgcode_b1e56e28e261401585001da3f2c34aeb/deps/build-python-module
CMake Warning at ../deps/autobuild.cmake:48 (message):
CMake presets are not supported with this version of CMake. Building all
dependency packages!
Call Stack (most recent call first):
../CMakeLists.txt:27 (include)

CMake Error at ../deps/autobuild.cmake:72 (message):
Dependency build failed with output:

CMake Warning:

Manually-specified variables were not used by the project:

CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_COMPILER
CMAKE_C_FLAGS
CMAKE_C_FLAGS_RELEASE
CMAKE_DEBUG_POSTFIX

Checking patch CMakeLists.txt...

Applied patch CMakeLists.txt cleanly.

CMake Warning:

Manually-specified variables were not used by the project:

CMAKE_CXX_COMPILER
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_RELEASE
CMAKE_DEBUG_POSTFIX

CMake Warning:

Manually-specified variables were not used by the project:

CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_COMPILER
CMAKE_C_FLAGS
CMAKE_C_FLAGS_RELEASE
CMAKE_DEBUG_POSTFIX

CMake Warning:

Manually-specified variables were not used by the project:

CMAKE_CXX_COMPILER
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_RELEASE
CMAKE_DEBUG_POSTFIX

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

cmake -E tar: warning: unknown warning

CMake Error: Problem with archive_write_header(): Can't create
'boost-1.82.0/libs/icl/doc/html'

CMake Error: Current file: boost-1.82.0/libs/icl/doc/html/

CMake Error: Problem extracting tar:
/tmp/pip-install-e97uf5jd/pybgcode_b1e56e28e261401585001da3f2c34aeb/deps/build-python-module/downloads/Boost/boost-1.82.0.zip

CMake Error at dep_Boost-stamp/extract-dep_Boost.cmake:33 (message):

error: extract of
'/tmp/pip-install-e97uf5jd/pybgcode_b1e56e28e261401585001da3f2c34aeb/deps/build-python-module/downloads/Boost/boost-1.82.0.zip'
failed

gmake[2]: *** [CMakeFiles/dep_Boost.dir/build.make:112:
dep_Boost-prefix/src/dep_Boost-stamp/dep_Boost-download] Error 1

gmake[1]: *** [CMakeFiles/Makefile2:211: CMakeFiles/dep_Boost.dir/all]
Error 2

gmake: *** [Makefile:149: all] Error 2

Call Stack (most recent call first):
../CMakeLists.txt:27 (include)

-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-e97uf5jd/pybgcode_b1e56e28e261401585001da3f2c34aeb/.py-build-cmake_cache/cp39-cp39-linux_x86_64/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "/opt/octoprint/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/opt/octoprint/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/opt/octoprint/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/tmp/pip-build-env-0vdphpb6/overlay/lib/python3.9/site-packages/py_build_cmake/build.py", line 67, in build_wheel
whl_name = self.build_wheel_in_dir(wheel_directory, tmp_build_dir,
File "/tmp/pip-build-env-0vdphpb6/overlay/lib/python3.9/site-packages/py_build_cmake/build.py", line 248, in build_wheel_in_dir
self.do_native_cross_cmake_build(paths, cfg, pkg_info)
File "/tmp/pip-build-env-0vdphpb6/overlay/lib/python3.9/site-packages/py_build_cmake/build.py", line 333, in do_native_cross_cmake_build
self.run_cmake(paths.source_dir, paths.staging_dir, cmake_cfg,
File "/tmp/pip-build-env-0vdphpb6/overlay/lib/python3.9/site-packages/py_build_cmake/build.py", line 510, in run_cmake
cmaker.configure()
File "/tmp/pip-build-env-0vdphpb6/overlay/lib/python3.9/site-packages/py_build_cmake/cmake.py", line 154, in configure
self.run(cmd, cwd=cwd, check=True, env=env)
File "/tmp/pip-build-env-0vdphpb6/overlay/lib/python3.9/site-packages/py_build_cmake/cmake.py", line 68, in run
return self.runner.run(*args, **kwargs)
File "/tmp/pip-build-env-0vdphpb6/overlay/lib/python3.9/site-packages/py_build_cmake/cmd_runner.py", line 25, in run
return sp_run(*args, **kwargs)
File "/usr/lib/python3.9/subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '-S', '/tmp/pip-install-e97uf5jd/pybgcode_b1e56e28e261401585001da3f2c34aeb/pybgcode', '-B', '/tmp/pip-install-e97uf5jd/pybgcode_b1e56e28e261401585001da3f2c34aeb/.py-build-cmake_cache/cp39-cp39-linux_x86_64', '-D', 'PY_BUILD_CMAKE_PACKAGE_VERSION:STRING=0.2.0', '-D', 'PY_BUILD_CMAKE_PACKAGE_NAME:STRING=pybgcode', '-D', 'PY_BUILD_CMAKE_MODULE_NAME:STRING=pybgcode', '-D', 'Python3_EXECUTABLE:FILEPATH=/opt/octoprint/bin/python3', '-D', 'Python3_ROOT_DIR:PATH=/opt/octoprint', '-D', 'Python3_FIND_REGISTRY=NEVER', '-D', 'Python3_FIND_STRATEGY=LOCATION', '-D', 'PyBGCode_LINK_SYSTEM_LIBBGCODE=off', '-D', 'CMAKE_BUILD_TYPE:STRING=Release']' returned non-zero exit status 1.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
Error!
Could not parse output from pip, see plugin_pluginmanager_console.log for generated output
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

@jneilliii
Copy link
Owner

well, apparently this guy has patched the cmake for octo4a compatibility.

https://github.com/kdobrev/libbgcode/tree/master

In either case, I'd recommend you guys look at the building instructions for potential missing dependencies/requirements for your OS.

https://github.com/prusa3d/libbgcode/blob/main/doc/building.md

@jneilliii
Copy link
Owner

I've merged those changes into my fork of libbgcode and the latest updates from the upstream repo and am testing on pi4 now to make sure it's still working.

@jneilliii
Copy link
Owner

still works on pi 4 as expected.

@jneilliii
Copy link
Owner

updated octo4a instructions in readme and about to merge the changes to the plugin repository. @ruedli I think you issue is different.

@ruedli
Copy link

ruedli commented Mar 14, 2024

Just for anyone that runs into this when installing it on ubuntu on proxmox: I figured out what I was missing.

I started with mentioned Proxmox VM from Dietpi: I tried with a VM script based on dietpi: see https://dietpi.com/docs/software/printing/#octoprint

You can select octoprint directly from the dietpi-software and recover from an octoprint backup.

While this configured all my plugins for octoprint, not BGCODE.

In oreder to install I had to (from root):
apt install git
apt install zlib1g
apt install zlib1g-dev
apt install build-essential

I also installed (but these seemed to be installed already):
apt install cmake
apt install gcc

Further I adapted .bashrc in both /root and /home/dietpi and included a line:
export CXX=/usr/bin/gcc

The dietpi documentation suggests that you could instead configure /etc/bashrc.d/dietpi-octoprint.sh but I did not verify this.

The vm on my n100 processor is incredibly fast compared to running on a Pi4. Besides that it can run other softwere: my homeassistant (with mqtt server and node-red from which you can interact with the printer) and pihole with (recursive dns), run in containers and there is space for additional windows 11 and ubuntu vm's.

Impressive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants