Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Errors in zmq recipe #2706

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

Open
yves-surrel opened this issue Nov 21, 2022 · 8 comments
Open

Errors in zmq recipe #2706

yves-surrel opened this issue Nov 21, 2022 · 8 comments
Labels

Comments

@yves-surrel
Copy link

Versions

  • Python: 3.9
  • OS: MacOS 11.7
  • Buildozer: 1.4.0

Description

1-
Get error when issuing buildozer -v android debug. As it does not seem to be related to buildozer but to the recipe, I post the issue here.

In file included from src/mtrie.cpp:32:
./src/generic_mtrie_impl.hpp:52:46: error: ISO C++ requires the name after '::~' to be found in the same scope as the name before '::~' [-Werror,-Wdtor-name]
template <typename T> zmq::generic_mtrie_t<T>::~generic_mtrie_t ()
                      ~~~~~~~~~~~~~~~~~~~~~~~^~
                                             ::generic_mtrie_t

After fixing that one (see below), I get:

  STDOUT:
Making install in doc
make[2]: warning: -jN forced in submake: disabling jobserver mode.
make[2]: Nothing to be done for `install-exec-am'.
make[2]: warning: -jN forced in submake: disabling jobserver mode.
 config/install-sh -c -d '/Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/install/include'
 config/install-sh -c -d '/Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/install/lib/pkgconfig'
 config/install-sh -c -d '/Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/install/lib'
mkdir: /Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/install: File exists
mkdir: /Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/install: Not a directory
mkdir: /Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/install: File exists
mkdir: /Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/install/lib: Not a directory
mkdir: /Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/install: Not a directory

buildozer.spec

Command:

buildozer -v android debug

Spec file:

requirements = pyzmq
  1. Fix of 1st error

By editing <PROJET_DIR>/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/src/generic_mtrie_impl.hpp, changing line

template <typename T> zmq::generic_mtrie_t<T>::~generic_mtrie_t ()

to

template <typename T> zmq::generic_mtrie_t<T>::~generic_mtrie_t<T> ()
  1. Fix of 2nd error

By deleting file /Users/yves/buildozer_dps/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq/INSTALL (I thought Unix was case-sensitive...?)

@kuzeyron
Copy link
Contributor

Is this still a problem?

@emendir
Copy link

emendir commented Jan 25, 2025

Currently libzmq has different issues:
#3070

@emendir
Copy link

emendir commented Jan 26, 2025

Currently libzmq has different issues: #3070

Sorry, I'm wrong, those other issues arise from pyzmq, not libzmq.

Copy link

github-actions bot commented Mar 7, 2025

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@github-actions github-actions bot closed this as completed Mar 7, 2025
@yves-surrel
Copy link
Author

FYI, I have been using for a couple of month the following recipe, without getting any error:

from pythonforandroid.recipe import Recipe
from pythonforandroid.logger import shprint
from pythonforandroid.util import current_directory
from os.path import join
import sh
import os

class LibZMQRecipe(Recipe):
    version = '4.3.5'
    url = 'https://github.com/zeromq/libzmq/releases/download/v{version}/zeromq-{version}.zip'
    depends = []
    built_libraries = {'libzmq.so': 'src/.libs'}
    need_stl_shared = True

    def build_arch(self, arch):
        env = self.get_recipe_env(arch)
        env['LDFLAGS'] = env.get('LDFLAGS', '') + ' -latomic' + ' -lc++_shared'

        # Set the CC and CXX environment variables to the NDK toolchain compilers
        ndk_dir = self.ctx.ndk_dir

        env['CXXFLAGS'] = env.get('CXXFLAGS', '') + ' -mno-outline-atomics'

        curdir = self.get_build_dir(arch.arch)
        prefix = join(curdir, "install")

        with current_directory(curdir):
            shprint(
                sh.Command('sh'), './configure',
                '--host={}'.format(arch.command_prefix),
                '--without-docs',
                '--prefix={}'.format(prefix),
                '--with-libsodium=no',
                '--disable-libunwind',
                '--disable-Werror',
                _env=env
            )
            shprint(sh.make, _env=env)

            # Remove the INSTALL file to prevent errors
            install_file_path = join(curdir, 'INSTALL')
            if os.path.exists(install_file_path):
                os.remove(install_file_path)
                
            shprint(sh.make, 'install', _env=env)

recipe = LibZMQRecipe()

@github-actions github-actions bot reopened this Mar 7, 2025
@emendir
Copy link

emendir commented Mar 13, 2025

FYI, I have been using for a couple of month the following recipe, without getting any error:

@yves-surrel Are you using it in combination with pyzmq? I can't get the latter to work #3070

@yves-surrel
Copy link
Author

Yes, pyzmq is in my requirements statement in bulldozer.spec.

My recipe is working OK on my MacBook Pro Sequoia.

@emendir
Copy link

emendir commented Apr 25, 2025

FYI, I have been using for a couple of month the following recipe, without getting any error:

I can't get this recipe to work on Ubuntu 24 using the buildozer docker container. This is the output I get.

  CC       external/unity/unity.o
  CXX      tests/libtestutil_a-testutil.o
  CXX      tests/libtestutil_a-testutil_monitoring.o
  CXX      tests/libtestutil_a-testutil_security.o
  CXX      tests/libtestutil_a-testutil_unity.o
  AR       external/unity/libunity.a
  AR       tests/libtestutil.a
  CXXLD    src/libzmq.la
ld: error: unable to find library -lbsd
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:4122: src/libzmq.la] Error 1
make[1]: Leaving directory '/home/user/hostcwd/.buildozer/android/platform/build-arm64-v8a/build/other_builds/libzmq/arm64-v8a__ndk_target_21/libzmq'
make: *** [Makefile:8439: all-recursive] Error 1


  STDERR:

# Command failed: ('/usr/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=nfsApk', '--bootstrap=sdl2', '--requirements=python3,kivy,kivymd,libzmq', '--arch=arm64-v8a', '--copy-libs', '--color=always', '--storage-dir=/home/user/hostcwd/.buildozer/android/platform/build-arm64-v8a', '--ndk-api=21', '--ignore-setup-py', '--debug')
# Error code: 1
# ENVIRONMENT:
#     PATH = '/home/user/.buildozer/android/platform/apache-ant-1.9.4/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
#     HOSTNAME = 'b8b833d86edf'
#     USER = 'user'
#     HOME_DIR = '/home/user'
#     WORK_DIR = '/home/user/hostcwd'
#     SRC_DIR = '/home/user/src'
#     LANG = 'en_US.UTF-8'
#     LANGUAGE = 'en_US.UTF-8'
#     LC_ALL = 'en_US.UTF-8'
#     HOME = '/home/user'
#     PACKAGES_PATH = '/home/user/.buildozer/android/packages'
#     ANDROIDSDK = '/home/user/.buildozer/android/platform/android-sdk'
#     ANDROIDNDK = '/home/user/.buildozer/android/platform/android-ndk-r25b'
#     ANDROIDAPI = '31'
#     ANDROIDMINAPI = '21'
# 
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2

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

No branches or pull requests

3 participants