Yocto: create recipe for SciKit-learn - python-3.x

I'm attempting to create a recipe for SciKit-Learn from pypi. But it seems that python3 setup.py build is unable to find NumPy, even though i know i have it on the build host (both with pip3 install numpy and bitbake python3-numpy-native).
Right now i have the following in my recipe:
DESCRIPTION = "python3-scikit-learn"
SECTION = "devel/python"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://PKG-INFO;md5=4a2bb4f4ec2b68ec46d5d1be3371b2c7"
PR = "r0"
SRCNAME = "scikit-learn"
SRC_URI="https://files.pythonhosted.org/packages/1e/ce/9d8c88e68af0a5b5c5d78d8d2b7bcadfd45e1d6afc863ccb9aee30765b06/scikit-learn-0.21.3.tar.gz"
SRC_URI[md5sum] = "d7bb030fea8d503d897a0dc8c50b9241"
SRC_URI[sha256sum] = "eb9b8ebf59eddd8b96366428238ab27d05a19e89c5516ce294abc35cea75d003"
S = "${WORKDIR}/${SRCNAME}-${PV}"
inherit setuptools3
This kind of recipe works for other python packages that aren't in openembedded yet, like joblib which i did get to install with this exact method.
I can see when i run bitbake python3-scikit-learn -c devshell and running python3 there, i am unable to import numpy as it is missing from the path that the devshell python3 is looking (which is in /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/)
I've tried copy-paste the build host numpy package folder manually to this directory but then this error occours:
Log data follows:
| DEBUG: Executing shell function do_compile
| C compiler: aarch64-poky-linux-gcc -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot -Wno-unused-result -Wsign-compare -DNDEBUG -g -O3 -Wall -O2 -pipe -g -feliminate-unused-debug-types -O2 -pipe -g -feliminate-unused-debug-types -O2 -pipe -g -feliminate-unused-debug-types -fPIC
|
| compile options: '-c'
| extra options: '-fopenmp'
| aarch64-poky-linux-gcc: test_openmp.c
| aarch64-poky-linux-gcc -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now objects/test_openmp.o -o test_openmp -fopenmp
| Partial import of sklearn during the build process.
| /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'project_urls'
| warnings.warn(msg)
| /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'python_requires'
| warnings.warn(msg)
| /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'install_requires'
| warnings.warn(msg)
| Traceback (most recent call last):
| File "setup.py", line 291, in <module>
| setup_package()
| File "setup.py", line 287, in setup_package
| setup(**metadata)
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/numpy/distutils/core.py", line 137, in setup
| config = configuration()
| File "setup.py", line 174, in configuration
| config.add_subpackage('sklearn')
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/numpy/distutils/misc_util.py", line 1035, in add_subpackage
| caller_level = 2)
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/numpy/distutils/misc_util.py", line 1004, in get_subpackage
| caller_level = caller_level + 1)
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/numpy/distutils/misc_util.py", line 941, in _get_configuration_from_setup_py
| config = setup_module.configuration(*args)
| File "sklearn/setup.py", line 76, in configuration
| maybe_cythonize_extensions(top_path, config)
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/scikit-learn-0.21.3/sklearn/_build_utils/__init__.py", line 42, in maybe_cythonize_extensions
| with_openmp = check_openmp_support()
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/scikit-learn-0.21.3/sklearn/_build_utils/openmp_helpers.py", line 100, in check_openmp_support
| output = subprocess.check_output('./test_openmp')
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 395, in check_output
| **kwargs).stdout
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 472, in run
| with Popen(*popenargs, **kwargs) as process:
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 775, in __init__
| restore_signals, start_new_session)
| File "/home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/recipe-sysroot-native/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
| raise child_exception_type(errno_num, err_msg, err_filename)
| OSError: [Errno 8] Exec format error: './test_openmp'
| ERROR: 'python3 setup.py build ' execution failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/yoctouser/build/tmp/work/aarch64-poky-linux/python3-scikit-learn/0.21.3-r0/temp/log.do_compile.605)
Anyone have an idea on how to fix this?

Related

gdal_config_error: [Errno 2] No such file or directory: 'gdal-config'

I'm running Django rest api with the django 3.2 on GCPUbuntu 20.04.5 LTS (GNU/Linux 5.15.0-1025-gcp x86_64). I'm getting an error when i run my docker containers. I need to use GDAL in one of my project modules. I'm pasting log from one the the containers my-api-webserver. There are 2 other containers running worker and scheduler servers which display the same errors.
gdal_config_error: [Errno 2] No such file or directory: 'gdal-config'
The following is the detailed trace :
my-api-webserver | error: subprocess-exited-with-error
my-api-webserver |
my-api-webserver | × python setup.py egg_info did not run successfully.
my-api-webserver | │ exit code: 1
my-api-webserver | ╰─> [125 lines of output]
my-api-webserver | running egg_info
my-api-webserver | creating /tmp/pip-pip-egg-info-2zpklao8/GDAL.egg-info
my-api-webserver | writing /tmp/pip-pip-egg-info-2zpklao8/GDAL.egg-info/PKG-INFO
my-api-webserver | writing dependency_links to /tmp/pip-pip-egg-info-2zpklao8/GDAL.egg-info/dependency_links.txt
my-api-webserver | writing requirements to /tmp/pip-pip-egg-info-2zpklao8/GDAL.egg-info/requires.txt
my-api-webserver | writing top-level names to /tmp/pip-pip-egg-info-2zpklao8/GDAL.egg-info/top_level.txt
my-api-webserver | writing manifest file '/tmp/pip-pip-egg-info-2zpklao8/GDAL.egg-info/SOURCES.txt'
my-api-webserver | Traceback (most recent call last):
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 121, in fetch_config
my-api-webserver | p = subprocess.Popen([command, args], stdout=subprocess.PIPE)
my-api-webserver | File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__
my-api-webserver | self._execute_child(args, executable, preexec_fn, close_fds,
my-api-webserver | File "/usr/local/lib/python3.8/subprocess.py", line 1704, in _execute_child
my-api-webserver | raise child_exception_type(errno_num, err_msg, err_filename)
my-api-webserver | FileNotFoundError: [Errno 2] No such file or directory: '../../apps/gdal-config'
my-api-webserver |
my-api-webserver | During handling of the above exception, another exception occurred:
my-api-webserver |
my-api-webserver | Traceback (most recent call last):
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 205, in get_gdal_config
my-api-webserver | return fetch_config(option, gdal_config=self.gdal_config)
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 124, in fetch_config
my-api-webserver | raise gdal_config_error(e)
my-api-webserver | __main__.gdal_config_error: [Errno 2] No such file or directory: '../../apps/gdal-config'
my-api-webserver |
my-api-webserver | During handling of the above exception, another exception occurred:
my-api-webserver |
my-api-webserver | Traceback (most recent call last):
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 121, in fetch_config
my-api-webserver | p = subprocess.Popen([command, args], stdout=subprocess.PIPE)
my-api-webserver | File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__
my-api-webserver | self._execute_child(args, executable, preexec_fn, close_fds,
my-api-webserver | File "/usr/local/lib/python3.8/subprocess.py", line 1704, in _execute_child
my-api-webserver | raise child_exception_type(errno_num, err_msg, err_filename)
my-api-webserver | FileNotFoundError: [Errno 2] No such file or directory: 'gdal-config'
my-api-webserver |
my-api-webserver | During handling of the above exception, another exception occurred:
my-api-webserver |
my-api-webserver | Traceback (most recent call last):
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 212, in get_gdal_config
my-api-webserver | return fetch_config(option)
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 124, in fetch_config
my-api-webserver | raise gdal_config_error(e)
my-api-webserver | __main__.gdal_config_error: [Errno 2] No such file or directory: 'gdal-config'
my-api-webserver |
my-api-webserver | During handling of the above exception, another exception occurred:
my-api-webserver |
my-api-webserver | Traceback (most recent call last):
my-api-webserver | File "<string>", line 2, in <module>
my-api-webserver | File "<pip-setuptools-caller>", line 34, in <module>
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 414, in <module>
my-api-webserver | setup(**setup_kwargs)
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 87, in setup
my-api-webserver | return distutils.core.setup(**attrs)
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
my-api-webserver | return run_commands(dist)
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
my-api-webserver | dist.run_commands()
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
my-api-webserver | self.run_command(cmd)
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 1208, in run_command
my-api-webserver | super().run_command(command)
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
my-api-webserver | cmd_obj.run()
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 308, in run
my-api-webserver | self.find_sources()
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 316, in find_sources
my-api-webserver | mm.run()
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 560, in run
my-api-webserver | self.add_defaults()
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 597, in add_defaults
my-api-webserver | sdist.add_defaults(self)
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/command/sdist.py", line 106, in add_defaults
my-api-webserver | super().add_defaults()
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/command/sdist.py", line 252, in add_defaults
my-api-webserver | self._add_defaults_ext()
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
my-api-webserver | build_ext = self.get_finalized_command('build_ext')
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 305, in get_finalized_command
my-api-webserver | cmd_obj.ensure_finalized()
my-api-webserver | File "/usr/local/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
my-api-webserver | self.finalize_options()
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 275, in finalize_options
my-api-webserver | self.gdaldir = self.get_gdal_config('prefix')
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 218, in get_gdal_config
my-api-webserver | raise gdal_config_error(traceback_string + '\n' + msg)
my-api-webserver | __main__.gdal_config_error: Traceback (most recent call last):
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 121, in fetch_config
my-api-webserver | p = subprocess.Popen([command, args], stdout=subprocess.PIPE)
my-api-webserver | File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__
my-api-webserver | self._execute_child(args, executable, preexec_fn, close_fds,
my-api-webserver | File "/usr/local/lib/python3.8/subprocess.py", line 1704, in _execute_child
my-api-webserver | raise child_exception_type(errno_num, err_msg, err_filename)
my-api-webserver | FileNotFoundError: [Errno 2] No such file or directory: '../../apps/gdal-config'
my-api-webserver |
my-api-webserver | During handling of the above exception, another exception occurred:
my-api-webserver |
my-api-webserver | Traceback (most recent call last):
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 205, in get_gdal_config
my-api-webserver | return fetch_config(option, gdal_config=self.gdal_config)
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 124, in fetch_config
my-api-webserver | raise gdal_config_error(e)
my-api-webserver | gdal_config_error: [Errno 2] No such file or directory: '../../apps/gdal-config'
my-api-webserver |
my-api-webserver | During handling of the above exception, another exception occurred:
my-api-webserver |
my-api-webserver | Traceback (most recent call last):
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 121, in fetch_config
my-api-webserver | p = subprocess.Popen([command, args], stdout=subprocess.PIPE)
my-api-webserver | File "/usr/local/lib/python3.8/subprocess.py", line 858, in __init__
my-api-webserver | self._execute_child(args, executable, preexec_fn, close_fds,
my-api-webserver | File "/usr/local/lib/python3.8/subprocess.py", line 1704, in _execute_child
my-api-webserver | raise child_exception_type(errno_num, err_msg, err_filename)
my-api-webserver | FileNotFoundError: [Errno 2] No such file or directory: 'gdal-config'
my-api-webserver |
my-api-webserver | During handling of the above exception, another exception occurred:
my-api-webserver |
my-api-webserver | Traceback (most recent call last):
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 212, in get_gdal_config
my-api-webserver | return fetch_config(option)
my-api-webserver | File "/tmp/pip-install-am7iveqp/gdal_636d6d66a9b14d6e9183a48706abd53e/setup.py", line 124, in fetch_config
my-api-webserver | raise gdal_config_error(e)
my-api-webserver | gdal_config_error: [Errno 2] No such file or directory: 'gdal-config'
my-api-webserver |
my-api-webserver | Could not find gdal-config. Make sure you have installed the GDAL native library and development headers.
my-api-webserver | [end of output]
my-api-webserver |
my-api-webserver | note: This error originates from a subprocess, and is likely not a problem with pip.
my-api-webserver | error: metadata-generation-failed
my-api-webserver |
my-api-webserver | × Encountered error while generating package metadata.
my-api-webserver | ╰─> See above for output.
my-api-webserver |
my-api-webserver | note: This is an issue with the package mentioned above, not pip.
my-api-webserver | hint: See above for details.
This is my docker file :
FROM python:3.8.14
RUN apt-get -y update && apt-get -y upgrade && apt-get install -y ffmpeg && apt install libgdal-dev --upgrade
RUN export CPLUS_INCLUDE_PATH=/usr/include/gdal
RUN export C_INCLUDE_PATH=/usr/include/gdal
COPY wait-for-it.sh /wait-for-it.sh
# Copy any files over
COPY entrypoint.sh /entrypoint.sh
# Copy any files over
COPY bootstrap_development_data.sh /bootstrap_development_data.sh
# Change permissions
RUN chmod +x /entrypoint.sh
RUN chmod +x /bootstrap_development_data.sh
RUN chmod +x /wait-for-it.sh
RUN groupadd -r docker && useradd -r -g docker earthling
RUN chown -R earthling /root/
ENTRYPOINT ["/entrypoint.sh"]
COPY requirements.txt /requirements.txt
RUN pip3 install --upgrade pip setuptools wheel
RUN pip3 install -r /requirements.txt
RUN yes | pip uninstall django-rq-scheduler
RUN yes | pip install -U django-rq-scheduler
VOLUME ["/opt/my-api"]
EXPOSE 80
CMD ["python", "manage.py", "runserver", "0.0.0.0:80"]
I have separately also done the following :
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install gdal-bin --upgrade
sudo apt remove gdal-bin
sudo apt install libgdal-dev --upgrade
sudo apt remove libgdal-dev
After the above, when i run :
gdal-config --version
Result : 3.3.2
This is my requirements.txt
aioredis==1.3.1
appdirs==1.4.4
asgiref==3.5.2
async-timeout==4.0.2
attrs==22.1.0
autobahn==22.7.1
Automat==20.2.0
bandit==1.7.4
babel==2.11.0
beautifulsoup4==4.11.1
boto3==1.26.41
botocore==1.29.41
certifi==2022.9.14
cffi==1.15.1
channels==3.0.5
channels-redis==3.4.1
chardet==5.0.0
click==8.1.3
colorama==0.4.5
colormath==3.0.0
constantly==15.1.0
coverage==6.4.4
croniter==1.3.7
cryptography==38.0.1
daphne==3.0.2
decorator==5.1.1
Django==3.2
django-amazon-ses==4.0.1
django-extra-views==0.14.0
django-appconf==1.0.5
django-cursor-pagination==0.2.0
django-extensions==3.2.1
django-imagekit==4.1.0
django-media-fixtures-next==1.0.1
django-model-utils==4.2.0
django-modeltranslation==0.18.4
django-nose==1.4.7
django-ordered-model==3.6
django-positions==0.6.0
django-proxy==1.2.1
django-redis==5.2.0
django-replicated==2.7
django-rq==2.5.1
django-rq-scheduler==2022.9
django-storages==1.13.1
django-utils-six==2.0
djangorestframework==3.13.1
django-widget-tweaks==1.4.12
django-haystack==3.2.1
django-treebeard==4.5.1
django-tables2==2.4.1
django-extensions==3.2.1
django-phone-verify==2.0.1
dparse==0.6.0
easy-thumbnails==2.8.4
Faker==12.0.1
feedparser==6.0.10
ffmpy==0.3.0
filelock==3.8.0
funcy==1.17
factory-boy>=3.2,<3.3
gitdb==4.0.9
GitPython==3.1.27
halo==0.0.31
hiredis==2.0.0
hyperlink==21.0.0
idna==3.4
incremental==21.3.0
jmespath==1.0.1
langdetect==1.0.9
log-symbols==0.0.14
mixer==7.2.2
msgpack==1.0.4
mysqlclient==2.1.1
natsort==8.2.0
networkx==2.8.6
nose==1.3.7
nose-exclude==0.5.0
numpy==1.23.3
onesignal-sdk==2.0.0
opencv-python==4.6.0.66
packaging==21.3
pathtools==0.1.2
pbr==5.10.0
pilkit==2.0
Pillow==9.2.0
pinocchio==0.4.3
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
PyJWT==2.4.0
pyOpenSSL==22.0.0
pyparsing==3.0.9
pytest-cov>=2.12,<3.1
python-dateutil==2.8.2
python-dotenv==0.21.0
python-magic==0.4.27
pytz==2022.2.1
PyYAML==6.0
purl==1.6
redis==4.3.4
requests==2.28.1
requests-file==1.5.1
rest-framework-generic-relations==2.1.0
rq==1.11.0
rq-scheduler==0.11.0
s3transfer==0.6.0
safety==2.1.1
sentry-sdk==1.9.8
service-identity==21.1.0
sgmllib3k==1.0.0
shutilwhich==1.1.0
six==1.16.0
smmap==5.0.0
soupsieve==2.3.2.post1
spectra==0.0.11
spinners==0.0.24
sqlparse==0.4.2
stevedore==4.0.0
stripe==4.1.0
sorl-thumbnail==12.9.0
termcolor==2.0.1
text-unidecode==1.3
tox>=3.23,<3.26
tldextract==3.3.1
toml==0.10.2
txaio==22.2.1
typing_extensions==4.3.0
uritools==4.0.0
url-normalize==1.4.3
urlextract==1.6.0
urllib3==1.26.12
watchdog==2.1.9
webpreview==1.7.2
whitenoise==6.2.0
zipp==3.8.1
zope.interface==5.4.0
django-cacheops==6.1.0
onesignal==0.1.3
onesignal-client==0.0.2
isort>=5.9,<5.11
flake8>=6.0.0
django-environ==0.9.0
mock==4.0.3
GDAL==3.3.2
setuptools==57.5.0
#commerce packages - development
# Excluding package already included above)
Werkzeug>=1.0,<2.1
django-debug-toolbar>=2.2,<3.6
psycopg2-binary>=2.8,<2.10
#Social-commerce packages - sandbox
Whoosh>=2.7,<2.8
pysolr==3.9.0
uWSGI>=2.0.19,<2.1
# Linting
flake8-debugger==4.1.2
# Helpers
pyprof2calltree>=1.4,<1.5
ipdb>=0.13,<0.14
ipython>=7.12,<9
# Country data
pycountry
#cli-based
colorlog==6.7.0
halo==0.0.31
requests==2.28.1
click==8.1.3
Help appreciated !

ninja: build stopped: subcommand failed when building llvm10 on Fedora 35

I have been trying to build llvm10 from source. I downloaded the source from llvm's github and have been trying for the past few days to complete the build but each and everytime towards the end of the ninja process, the error pops up -ninja: build stopped: subcommand failed
I am using the following commands to build:
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/llvm -DLLVM_ENABLE_PROJECTS=clang -DLLVM_LIBDIR_SUFFIX=64 -DLLVM_TARGETS_TO_BUILD="AMDGPU" -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_PARALLEL_LINK_JOBS=1
Since multiple of my attempts failed, I also tried running by setting the parallel jobs to 1 as many threads recommended. Also did ninja -j1 but none of this helps.
I remember having done this successfully on Fedora 34, so, I reinstalled Fedora 34, but, it too gives me the same error.
This is the portion where the error pops up:
[1/17] Building CXX object utils/bench.../benchmark.dir/benchmark_register.cc.o
FAILED: utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o
/bin/c++ -DHAVE_POSIX_REGEX -DHAVE_STD_REGEX -DHAVE_STEADY_CLOCK -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/build/utils/benchmark/src -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src -I/usr/include/libxml2 -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/build/include -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/include -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/include -I/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/../include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++11 -Wall -Wextra -Wshadow -pedantic -pedantic-errors -Wfloat-equal -fstrict-aliasing -fno-exceptions -Wstrict-aliasing -O3 -DNDEBUG -std=c++14 -MD -MT utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o -MF utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o.d -o utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o -c /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.cc
In file included from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.cc:15:
/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h: In function ‘void AddRange(std::vector<T>*, T, T, int)’:
/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h:17:30: error: ‘numeric_limits’ is not a member of ‘std’
17 | static const T kmax = std::numeric_limits<T>::max();
| ^~~~~~~~~~~~~~
/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h:17:46: error: expected primary-expression before ‘>’ token
17 | static const T kmax = std::numeric_limits<T>::max();
| ^
/home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h:17:49: error: ‘::max’ has not been declared; did you mean ‘std::max’?
17 | static const T kmax = std::numeric_limits<T>::max();
| ^~~
| std::max
In file included from /usr/include/c++/11/algorithm:62,
from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/include/benchmark/benchmark.h:175,
from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/internal_macros.h:4,
from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/check.h:8,
from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.h:6,
from /home/test/Desktop/llvm-project-llvmorg-10.0.0/llvm/utils/benchmark/src/benchmark_register.cc:15:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
3467 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
ninja: build stopped: subcommand failed.
Any help is appreciated.
The header include was missed at that time. You may want to add it by yourself (https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1) or use newer version of LLVM ;)

Can't install mgba python module

I installed mgba (which works) by activating the use of python, I tried to import the mgba module but it does not exist, I also checked where my modules are stored, so I went to the folder /src/platform/python and made: python3 setup.py install.
Unfortunately I get this error:
running install
running bdist_egg
running egg_info
writing mgba.egg-info/PKG-INFO
writing dependency_links to mgba.egg-info/dependency_links.txt
writing requirements to mgba.egg-info/requires.txt
writing top-level names to mgba.egg-info/top_level.txt
reading manifest file 'mgba.egg-info/SOURCES.txt'
writing manifest file 'mgba.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-aarch64/egg
running install_lib
running build_py
running build_ext
generating cffi module 'build/temp.linux-aarch64-3.7/mgba._pylib.c'
already up-to-date
building 'mgba._pylib' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/usr/include/python3.7m -c build/temp.linux-aarch64-3.7/mgba._pylib.c -o build/temp.linux-aarch64-3.7/build/temp.linux-aarch64-3.7/mgba._pylib.o -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/home/pi/build/src/platform/python/..
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/usr/include/python3.7m -c /home/pi/build/src/platform/python/vfs-py.c -o build/temp.linux-aarch64-3.7/home/pi/build/src/platform/python/vfs-py.o -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/home/pi/build/src/platform/python/..
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/usr/include/python3.7m -c /home/pi/build/src/platform/python/core.c -o build/temp.linux-aarch64-3.7/home/pi/build/src/platform/python/core.o -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/home/pi/build/src/platform/python/..
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/usr/include/python3.7m -c /home/pi/build/src/platform/python/log.c -o build/temp.linux-aarch64-3.7/home/pi/build/src/platform/python/log.o -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/home/pi/build/src/platform/python/..
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/usr/include/python3.7m -c /home/pi/build/src/platform/python/sio.c -o build/temp.linux-aarch64-3.7/home/pi/build/src/platform/python/sio.o -I/home/pi/build/src/platform/python/../../../include -I/home/pi/build/src/platform/python/../.. -I/home/pi/build/src/platform/python/..
Traceback (most recent call last):
File "setup.py", line 33, in <module>
"Topic :: System :: Emulators"
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 24, in run
self.build()
File "/usr/lib/python3.7/distutils/command/install_lib.py", line 109, in build
self.run_command('build_ext')
File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/home/pi/.local/lib/python3.7/site-packages/cffi/setuptools_ext.py", line 144, in run
base_class.run(self)
File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 78, in run
_build_ext.run(self)
File "/home/pi/.local/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "/usr/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/home/pi/.local/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "/usr/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 199, in build_extension
_build_ext.build_extension(self, ext)
File "/usr/lib/python3.7/distutils/command/build_ext.py", line 559, in build_extension
target_lang=language)
File "/usr/lib/python3.7/distutils/ccompiler.py", line 717, in link_shared_object
extra_preargs, extra_postargs, build_temp, target_lang)
File "/usr/lib/python3.7/distutils/unixccompiler.py", line 170, in link
libraries)
File "/usr/lib/python3.7/distutils/ccompiler.py", line 1092, in gen_lib_options
opt = compiler.runtime_library_dir_option(dir)
File "/usr/lib/python3.7/distutils/unixccompiler.py", line 264, in runtime_library_dir_option
return "-Wl,--enable-new-dtags,-R" + dir
TypeError: can only concatenate str (not "NoneType") to str
Do you have any idea what it is due to ? I have correctly compiled mgba and the module, and there was no error on it. Moreover I don't see where the error comes from

Yocto How to stop cmake to look in a native sysroot path for linking?

I'm trying to add dlib python module into my image so far this is the recipe i'm working on...
# python3-dlib_19.21.1.bb
SUMMARY = "A toolkit for making real world machine learning and data analysis applications"
HOMEPAGE = "https://pypi.python.org/pypi/dlib"
PYPI_PACKAGE = "dlib"
LICENSE = "Boost-Software"
SRC_URI[md5sum] = "1e7e357d7d54e86267ef60f606cb40e1"
LIC_FILES_CHKSUM = "file://dlib/LICENSE.txt;md5=2c7a3fa82e66676005cd4ee2608fd7d2 \
file://dlib/external/libpng/LICENSE;md5=243135ddedf702158f9170807cbcfb66 \
file://dlib/external/pybind11/LICENSE;md5=beb87117af69fd10fbf9fb14c22a2e62 \
file://python_examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt;md5=064f53ab40ea2b6a4bba1324149e4fde \
"
DEPENDS = "cmake-native"
inherit pypi setuptools3
but when do_compile() ran i got the following error message:
| [100%] Building CXX object CMakeFiles/_dlib_pybind11.dir/src/line.cpp.o
| [100%] Linking CXX shared module build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/build/lib.linux-x86_64-3.8/_dlib_pybind11.cpython-38-aarch64-linux-gnu.so
| build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/8.3.0/ld: build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/libsqlite3.so: error adding symbols: file in wrong format
| collect2: error: ld returned 1 exit status
| CMakeFiles/_dlib_pybind11.dir/build.make:445: recipe for target 'build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/build/lib.linux-x86_64-3.8/_dlib_pybind11.cpython-38-aarch64-linux-gnu.so' failed
| make[2]: *** [build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/build/lib.linux-x86_64-3.8/_dlib_pybind11.cpython-38-aarch64-linux-gnu.so] Error 1
| CMakeFiles/Makefile2:116: recipe for target 'CMakeFiles/_dlib_pybind11.dir/all' failed
| make[1]: *** [CMakeFiles/_dlib_pybind11.dir/all] Error 2
| Makefile:83: recipe for target 'all' failed
| make: *** [all] Error 2
| Traceback (most recent call last):
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/dlib-19.21.1/setup.py", line 223, in <module>
| setup(
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup
| return distutils.core.setup(**attrs)
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/python3.8/distutils/core.py", line 148, in setup
| dist.run_commands()
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
| self.run_command(cmd)
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
| cmd_obj.run()
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/python3.8/distutils/command/build.py", line 135, in run
| self.run_command(cmd_name)
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
| self.distribution.run_command(command)
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
| cmd_obj.run()
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/dlib-19.21.1/setup.py", line 135, in run
| self.build_extension(ext)
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/dlib-19.21.1/setup.py", line 175, in build_extension
| subprocess.check_call(cmake_build, cwd=build_folder)
| File "build_dunfell/tmp/work/aarch64-poky-linux/python3-dlib/19.21.1-r0/recipe-sysroot-native/usr/lib/python3.8/subprocess.py", line 364, in check_call
| raise CalledProcessError(retcode, cmd)
| subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j8']' returned non-zero exit status 2.
| WARNING: exit code 1 from a shell command.
|
it looks like the problem occurs when cmake is trying to link the shared object _dlib_pybind11.cpython-38-aarch64-linux-gnu.so. Linker complains with the following error
adding symbols: file in wrong format
i think the linker is mixing target objects with native ones, but i'm not used to cmake so i don't know how to stop it to use the path of recipe-sysroot-native and use my target sysroot, if i remove cmake-native and use only DEPENDS="cmake", setup.py fails because it can not find cmake at all...
hope you can help me or give me any idea that i can try.
BR,
Update 1
just as #Nayfe pointed out dlib/setup.py has an --set option to pass CMAKE config variables, below is a recipe that already worked for me, i can import dlib without problems.
SUMMARY = "A toolkit for making real world machine learning and data analysis applications"
HOMEPAGE = "https://pypi.python.org/pypi/dlib"
PYPI_PACKAGE = "dlib"
LICENSE = "Boost-Software"
SRC_URI[md5sum] = "1e7e357d7d54e86267ef60f606cb40e1"
LIC_FILES_CHKSUM = "file://dlib/LICENSE.txt;md5=2c7a3fa82e66676005cd4ee2608fd7d2 \
file://dlib/external/libpng/LICENSE;md5=243135ddedf702158f9170807cbcfb66 \
file://dlib/external/pybind11/LICENSE;md5=beb87117af69fd10fbf9fb14c22a2e62 \
file://python_examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt;md5=064f53ab40ea2b6a4bba1324149e4fde \
"
DEPENDS = "sqlite3 "
inherit pypi cmake setuptools3
INSANE_SKIP_${PN} = "already-stripped"
DISTUTILS_BUILD_ARGS_append = " \
--set CMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
"
Maybe recipe can be optimized but the following works
python3-dlib_19.21.bb
SUMMARY = "A toolkit for making real world machine learning and data analysis applications"
HOMEPAGE = "http://dlib.net/"
SECTION = "devel/python"
LICENSE = "BSL-1.0"
LIC_FILES_CHKSUM = "file://dlib/LICENSE.txt;md5=2c7a3fa82e66676005cd4ee2608fd7d2"
DEPENDS = "sqlite3"
SRC_URI = "git://github.com/davisking/dlib"
SRCREV = "9117bd784328d9ac40ffa1f9cf487633a8a715d7"
S = "${WORKDIR}/git"
DISTUTILS_BUILD_ARGS_append = " \
--set CMAKE_INSTALL_PREFIX:PATH=${prefix} \
--set CMAKE_INSTALL_BINDIR:PATH=${#os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \
--set CMAKE_INSTALL_SBINDIR:PATH=${#os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \
--set CMAKE_INSTALL_LIBEXECDIR:PATH=${#os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \
--set CMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
--set CMAKE_INSTALL_SHAREDSTATEDIR:PATH=${#os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix') + '/')} \
--set CMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
--set CMAKE_INSTALL_LIBDIR:PATH=${#os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \
--set CMAKE_INSTALL_INCLUDEDIR:PATH=${#os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \
--set CMAKE_INSTALL_DATAROOTDIR:PATH=${#os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \
--set PYTHON_EXECUTABLE:PATH=${PYTHON} \
--set Python_EXECUTABLE:PATH=${PYTHON} \
--set Python3_EXECUTABLE:PATH=${PYTHON} \
--set LIB_SUFFIX=${#d.getVar('baselib').replace('lib', '')} \
--set CMAKE_INSTALL_SO_NO_EXE=0 \
--set CMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
--set CMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
--set CMAKE_LIBRARY_OUTPUT_DIRECTORY=${B} \
"
do_configure() {
distutils3_do_configure
}
do_compile() {
distutils3_do_compile
}
do_install() {
distutils3_do_install
}
inherit cmake setuptools3 python3native
INSANE_SKIP_${PN} = "already-stripped"
RDEPENDS_${PN} += "python3-core"

undefined symbol uregex_setText_64 sqlite icu extension

I'm trying to compile ICU sqlite extension.
System: Ubuntu 19.04
src: sqlite-src-3310100.zip
action history:
unzip sqlte-src-3310100.zip
mkdir bld
cd bld
CFLAGS="-O3" ../sqlte-src-3310100/configure && make -j8
# compilation successfull without errors except some warnings
gcc --shared -fPIC -O3 -licui18n -licudata -licuuc -I ./ -I ../src/ext/icu/ -o libSqliteIcu.so ../src/ext/icu/icu.c
# there is no errors
sudo cp libSqliteIcu.so /usr/lib/
Trying to load:
import sqlite3
conn = sqlite3.connect("database.sqlite") # или :memory: чтобы сохранить в RAM
cur = conn.cursor()
conn.enable_load_extension(True)
conn.load_extension('libSqliteIcu')
Error appears:
------------------------------------------------------
OperationalError Traceback (most recent call last)
<ipython-input-67-d5ebe36b8718> in <module>
3 cur = conn.cursor()
4 conn.enable_load_extension(True)
----> 5 conn.load_extension('libSqliteIcu')
OperationalError: /lib/libSqliteIcu.so: undefined symbol: uregex_setText_64
Please help.
Problem solved.
Solution:
gcc --shared -fPIC -O3 -o libSqliteIcu.so ../src/ext/icu/icu.c -licui18n -licuuc -licudata -L/usr/local/lib
Details:
pkg-config --libs icu-i18n
returns:
-licui18n -licuuc -licudata -L/usr/local/lib

Resources