/usr/bin/ld: cannot find -latlas - compilation

I'm trying to install code which I've successfully installed in the past on a new computer, and am running into problems.
This is on Fedora, using scons. The previous successful installation was on Ubuntu.
When I type scons, it gives the following error:
/usr/bin/ld: cannot find -latlas
I have successfully installed atlas-devel via yum.
If it helps, you'll find below the top level SConstruct File (--- indicates redacted code)
BUILD_LIB_DIR = '#build/lib'
BUILD_INCLUDE_DIR = '#build/include'
BUILD_BIN_DIR = '#build/bin'
import os
default_env = Environment(ENV = os.environ, # use the system $PATH variable
CCFLAGS = ['-pipe', '-Wall'],
CXXFLAGS = ['-std=c++0x'],
CPPPATH = [BUILD_INCLUDE_DIR, '#src/'],
LIBPATH = [BUILD_LIB_DIR],
CPPDEFINES = ['_USE_LCM_'])
default_env.Append(LIBS = [---, 'lapack', 'blas', 'atlas', 'armadillo', 'rt'])
default_env.Alias('install', [BUILD_LIB_DIR, BUILD_INCLUDE_DIR, BUILD_BIN_DIR])
# Create the command-line options along with help text
vars = Variables()
vars.Add(BoolVariable('debug', 'Compile in debug mode with -g and -pg', 0))
vars.Add(EnumVariable('---'))
vars.Add(BoolVariable('log-data', 'Define LOG_DATA in the preprocessor so internal state of modules will be written to log files', 0))
Help(vars.GenerateHelpText(default_env))
debug = ARGUMENTS.get('debug', 0)
log = ARGUMENTS.get('log-data', 0)
if int(debug):
default_env.Append(CCFLAGS = ['-g', '-pg'])
default_env.Append(LINKFLAGS = ['-pg'])
else:
default_env.Append(CCFLAGS = ['-O3'])
if int(log):
default_env.Append(CPPDEFINES = ['LOG_DATA'])
log_env = default_env.Clone();
log_env.Append(LIBS=['global', 'readlog', 'z'])
Export(['default_env', 'log_env', 'BUILD_LIB_DIR', 'BUILD_INCLUDE_DIR', 'BUILD_BIN_DIR', ---])
SConscript(['src/SConscript',
'docs/SConscript'])

It turns out the issue was that atlas puts the libatlas.so in /usr/lib(64)/atlas/...
Thanks to #Dave_Bacher for information on how to deal with this, namely
Add /usr/lib/atlas to the LIBPATH array in your default_env:
LIBPATH = [BUILD_LIB_DIR, /usr/lib/atlas]

Related

use well-known types with cc_proto_library and py_proto_library from protobuf.bzl

I'd like to use google protobuf (master branch) + bazel v4.2.1 to set up communication between C++ and python parts of my program. I've got the following WORKSPACE file:
load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_google_protobuf",
strip_prefix = "protobuf-master",
urls = ["https://github.com/protocolbuffers/protobuf/archive/master.zip"],
)
load("#com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
and the BUILD file:
load("#com_google_protobuf//:protobuf.bzl", "cc_proto_library")
load("#com_google_protobuf//:protobuf.bzl", "py_proto_library")
cc_proto_library(
name = "container_cc_proto",
srcs = ["container.proto"],
visibility = ["//visibility:public"],
deps = ["#com_google_protobuf//:any_proto",],
)
py_proto_library(
name = "container_py_proto",
srcs = ["container.proto"],
visibility = ["//visibility:public"],
deps = ["#com_google_protobuf//:any_proto",],
)
The container.proto tries to include "google/protobuf/any.proto". On my command bazel build //:container_cc_proto I see the following error:
ERROR: /home/*user*/sandbox/bypass/BUILD:31:17: no such target '#com_google_protobuf//:any_proto_genproto': target 'any_proto_genproto' not declared in package '' defined by /home/*some path*/external/com_google_protobuf/BUILD and referenced by '//:container_cc_proto_genproto'
Could anyone please tell me how to include any.proto correctly, or any other known workarounds. Thanks!

Yocto Bitbake fails on ros-image-turtlebot3-core.bb:do_rootfs due to missing rpm

I like to assemble a Linux image for RaspberryPi with ROS2 and Turtlebot3 stuff. Yocto environment is already set up and worked fine until end of last year. Image file was successfully built and started as expected at target system.
My new application needs further dependencies, therefore I pulled latest changes from origin repositories few days ago. Unfortunately, this seem to broke functionality of build system. Own changes not yet applied.
Build process fails at the last stage when rootfs should be created. It claims several rpm would be missing. It turned out they're existing at different location.
Below example is about glibc-localedata-pa-pk-2.31-r0.cortexa7t2hf_neon_vfpv4.rpm but after several tries I noticed that a tons of packages are affected.
Expected: build/BUILD-poky-foxy-dunfell/deploy/rpm/cortexa7t2hf_neon_vfpv4/glibc-localedata-pa-pk-2.31-r0.cortexa7t2hf_neon_vfpv4.rpm
Existing: build/BUILD-poky-foxy-dunfell/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/glibc-locale/2.31-r0/deploy-rpms/cortexa7t2hf_neon_vfpv4/glibc-localedata-pa-pk-2.31-r0.cortexa7t2hf_neon_vfpv4.rpm
Another afftected package:
Expected:
build/BUILD-poky-foxy-dunfell/deploy/rpm/cortexa7t2hf_neon_vfpv4/libatomic1-9.3.0-r0.cortexa7t2hf_neon_vfpv4.rpm
Existing: build/BUILD-poky-foxy-dunfell/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/gcc-runtime/9.3.0-r0/deploy-rpms/cortexa7t2hf_neon_vfpv4/libatomic1-9.3.0-r0.cortexa7t2hf_neon_vfpv4.rpm
Basically rpm are expected to be at build/BUILD-poky-foxy-dunfell/deploy/rpm/cortexa7t2hf_neon_vfpv4/ but they are at build/BUILD-poky-foxy-dunfell/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/XXX/YYY/deploy-rpms/cortexa7t2hf_neon_vfpv4/
Were there any changes in buildsystem or configuration since end of 2020 or any known issues found? Any help would be appreaciated, many thanks in advance!
$ bitbake ros-image-turtlebot3-core -k
Build Configuration:
BB_VERSION = "1.46.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "raspberrypi3"
DISTRO = "poky"
DISTRO_VERSION = "3.1.11"
TUNE_FEATURES = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU = "hard"
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
ROS_DISTRO = "foxy"
ROS_VERSION = "2"
ROS_PYTHON_VERSION = "3"
meta
meta-poky
meta-yocto-bsp = "dunfell:6a7335170ed70263c4b2c55d10fe741c237c2357"
meta-oe
meta-python
meta-perl
meta-networking = "dunfell:c56d6309efc11e9f0f4a549be45a783c73a49ba0"
meta-raspberrypi = "dunfell:59c2d6f7a8b1239bd7b587b9180c2a55f9c695a2"
meta-ros-common
meta-ros2
meta-ros2-foxy
meta-ros-backports-hardknott
meta-ros-backports-gatesgarth = "ros2foxy:638a8b93e7b328fab9ccf2321bea039a93a57dde"
meta-communication
meta-system
meta-usercode = "ros2foxy:886b2fed39384970dc7476a15009765785b52512"
Initialising tasks: 100% |##########################################################################################| Time: 0:00:16
Sstate summary: Wanted 367 Found 365 Missed 2 Current 2770 (99% match, 99% complete)
NOTE: Executing Tasks
ERROR: ros-image-turtlebot3-core-1.0-r0 do_rootfs: Error executing a python function in exec_python_func() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:do_rootfs(d)
0003:
File: '/home/user/ros_target/poky/meta/classes/image.bbclass', lineno: 247, function: do_rootfs
0243: progress_reporter.next_stage()
0244:
0245: # generate rootfs
0246: d.setVarFlag('REPRODUCIBLE_TIMESTAMP_ROOTFS', 'export', '1')
*** 0247: create_rootfs(d, progress_reporter=progress_reporter, logcatcher=logcatcher)
0248:
0249: progress_reporter.finish()
0250:}
0251:do_rootfs[dirs] = "${TOPDIR}"
File: '/home/user/ros_target/poky/meta/lib/oe/rootfs.py', lineno: 975, function: create_rootfs
0971: env_bkp = os.environ.copy()
0972:
0973: img_type = d.getVar('IMAGE_PKGTYPE')
0974: if img_type == "rpm":
*** 0975: RpmRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
0976: elif img_type == "ipk":
0977: OpkgRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
0978: elif img_type == "deb":
0979: DpkgRootfs(d, manifest_dir, progress_reporter, logcatcher).create()
File: '/home/user/ros_target/poky/meta/lib/oe/rootfs.py', lineno: 366, function: __init__
0362: self.manifest = RpmManifest(d, manifest_dir)
0363:
0364: self.pm = RpmPM(d,
0365: d.getVar('IMAGE_ROOTFS'),
*** 0366: self.d.getVar('TARGET_VENDOR')
0367: )
0368:
0369: self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN')
0370: if self.inc_rpm_image_gen != "1":
File: '/home/user/ros_target/poky/meta/lib/oe/package_manager.py', lineno: 765, function: __init__
0761: self.primary_arch = self.d.getVar('MACHINE_ARCH')
0762:
0763: if needfeed:
0764: self.rpm_repo_dir = oe.path.join(self.d.getVar('WORKDIR'), rpm_repo_workdir)
*** 0765: create_packages_dir(self.d, oe.path.join(self.rpm_repo_dir, "rpm"), d.getVar("DEPLOY_DIR_RPM"), "package_write_rpm", filterbydependencies)
0766:
0767: self.saved_packaging_data = self.d.expand('${T}/saved_packaging_data/%s' % self.task_name)
0768: if not os.path.exists(self.d.expand('${T}/saved_packaging_data')):
0769: bb.utils.mkdirhier(self.d.expand('${T}/saved_packaging_data'))
File: '/home/user/ros_target/poky/meta/lib/oe/package_manager.py', lineno: 733, function: create_packages_dir
0729: if destdir not in seendirs:
0730: bb.utils.mkdirhier(destdir)
0731: seendirs.add(destdir)
0732: try:
*** 0733: os.link(l, dest)
0734: except OSError as err:
0735: if err.errno == errno.EXDEV:
0736: bb.utils.copyfile(l, dest)
0737: else:
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/user/ros_target/build/BUILD-poky-foxy-dunfell/deploy/rpm/cortexa7t2hf_neon_vfpv4/glibc-localedata-pa-pk-2.31-r0.cortexa7t2hf_neon_vfpv4.rpm' -> '/home/user/ros_target/build/BUILD-poky-foxy-dunfell/work/raspberrypi3-poky-linux-gnueabi/ros-image-turtlebot3-core/1.0-r0/oe-rootfs-repo/rpm/cortexa7t2hf_neon_vfpv4/glibc-localedata-pa-pk-2.31-r0.cortexa7t2hf_neon_vfpv4.rpm'
ERROR: Logfile of failure stored in: /home/user/ros_target/build/BUILD-poky-foxy-dunfell/work/raspberrypi3-poky-linux-gnueabi/ros-image-turtlebot3-core/1.0-r0/temp/log.do_rootfs.2708
ERROR: Task (/home/user/ros_target/3rdParty/meta-ros/meta-ros-common/recipes-core/images/ros-image-turtlebot3-core.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 9034 tasks of which 9033 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/user/ros_target/3rdParty/meta-ros/meta-ros-common/recipes-core/images/ros-image-turtlebot3-core.bb:do_rootfs
Summary: There were 358 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
Edit:
I tried to make all missing RPM available by symlinks. Since really a lot (but still not all) packages were affected, I created short script for that:
#!/bin/bash
currDir=`pwd`
#find all existing RPM in WORK directory
find build/BUILD-poky-foxy-dunfell/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi -iname "*.rpm" > ${currDir}/tmp_allRpm.log
#find all RPM that are already deployed
cd build/BUILD-poky-foxy-dunfell/deploy/rpm/cortexa7t2hf_neon_vfpv4/
ls -1 *.rpm > ${currDir}/tmp_deployedRpm.log
cd $currDir
#create list of all RPM that are not yet deployed
grep -v -f ${currDir}/tmp_deployedRpm.log ${currDir}/tmp_allRpm.log > ${currDir}/tmp_toBeLinkedRpm.log
#create symlinks
xargs -i ln -s {} build/BUILD-poky-foxy-dunfell/deploy/rpm/cortexa7t2hf_neon_vfpv4/ <${currDir}/tmp_toBeLinkedRpm.log
This seemed to solved the origin issue but lead to further weired errors. So I decided to set up new Yocto/OpenEmbedded environment using my existing config files and recipes. It turned out to be a good decision - after several hours of compilation everything was done ;) Only downside of this is that I can't tell what went wrong and when it may happen again?!

yocto adding packages /packages-groups in custom distro

i am facing problem in adding packages/package-groups to custom distro file which is based on poky distro.
i have created custom distro file and enabled it in local.oonf file. it is compiling perfectly, But when add any package or package-group to distro file using variables like :
POKY_DEFAULT_DISTRO_FEATURES , DISTRO_FEATURES and POKY_DEFAULT_EXTRA_RDEPENDS then these packages are neither compiled or become part of final image.
Content of my custom distro file :
include conf/distro/poky.conf
DISTRO = "paras"
DISTRO_NAME = "Paras-Linux"
DISTRO_VERSION = "1.0"
DISTRO_CODENAME = "orange"
PARAS_DEFAULT_DISTRO_FEATURES = "\
packagegroup-paras-core \
packagegroup-paras-compress \
packagegroup-paras-network \
"
POKY_DEFAULT_DISTRO_FEATURES = "largefile multiarch ${PARAS_DEFAULT_DISTRO_FEATURES}"
PACKAGE_CLASSES = "package_rpm"
PREFERRED_PROVIDER_base-utils = "packagegroup-paras-core"
VIRTUAL-RUNTIME_base-utils = "packagegroup-paras-core"
VIRTUAL-RUNTIME_base-utils-hwclock = "util-linux-hwclock"
VIRTUAL-RUNTIME_base-utils-syslog = "syslog-ng"
INIT_MANAGER ?= "systemd"
i have also tried using distro_feature variable :
DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${POKY_DEFAULT_DISTRO_FEATURES} ${PARAS_DEFAULT_DISTRO_FEATURES}"
is it possible to add package/package-groups in distro file if not then what is the point of distro file ?
Note : i am using yocto [branch hardknott]
You can add
IMAGE_INSTALL_append = " package_name" to your conf/local.conf file in your build folder
Make sure that you leave a space in the quotes - that is intentional as this is a concatenated string of package names.

cx_Freeze '#rpath/libQtDeclarative.4.dylib': doesn't exist or not a regular file

from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = ["idna","lib","gui","plugins"], excludes = ["Tcl","tcl"]
import sys
base = 'Win32GUI' if sys.platform=='win32' else None
executables = [
Executable('electrum-xvg', base=base, targetName = 'Electrum XVG',icon="electrum.icns")]
setup(name='electrum-xvg',
version = '1.0',
description = '',
options = dict(build_exe = buildOptions),
executables = executables])
I have the above setup.py file which I am using to try build application on OSX Sierra. But when I use python setup.py bdist_mac it raises error
#rpath/libQtDeclarative.4.dylib
error: can't copy '#rpath/libQtDeclarative.4.dylib': doesn't exist or not a regular file
libQtDeclarative.4.dylib is present in ~/anaconda/envs/pyqtapp/lib on my system but when I used otool -D libQtDeclarative.4.dylib it raised error that no such file exists, so I used
install_name_tool -id "#rpath/libQtDeclarative.4.dylib" libQtDeclarative.4.dylib
in ~/anaconda/envs/pyqtapp/lib now when I run otool -D libQtDeclarative.4.dylib I get
libQtDeclarative.4.dylib:
#rpath/libQtDeclarative.4.dylib
but cx_Freeze still raises the error
error: can't copy '#rpath/libQtDeclarative.4.dylib': doesn't exist or not a regular file
Try explicitly setting includes (list of relative paths):
includefiles = ['README.txt', 'CHANGELOG.txt', 'helpers\uncompress\unRAR.exe', , 'helpers\uncompress\unzip.exe']

Compiling C++ with textmate

I have problem with compiling cpp that include another cpp files
so I have Main.cpp Numbers.h and Numbers.cpp and it seems that TextMate only compile my Main.cpp and doesn't include the rest. I tried using xcode and it was working fine..
Here is the error from TextMate cmd+R:
Undefined symbols:
"Numbers::Numbers(int)", referenced from:
_main in ccMrD1Eq.o
"Numbers::print()", referenced from:
_main in ccMrD1Eq.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Any suggestion?
Btw, here is the invoked command:
#!/usr/bin/env ruby
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor"
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document"
mode = ENV["TM_SCOPE"].slice(/.*?\bsource\.((?:obj)?c(\+\+)?)/, 1)
case mode
when "c"
g = "GCC"
env = "C"
ext = "c"
lang = "c"
when "c++"
g = "GXX"
env = "CXX"
ext = "cc"
lang = "c++"
when "objc"
g = "GCC"
env = "OBJC"
ext = "m"
lang = "objective-c"
when "objc++"
g = "GXX"
env = "OBJCXX"
ext = "mm"
lang = "objective-c++"
end
TextMate.save_current_document(ext)
TextMate::Executor.make_project_master_current_document
flags = ENV["TM_#{env}_FLAGS"] || "-Wall -include stdio.h #{"-include iostream" unless mode[/c\+\+$/].nil?} #{"-framework Cocoa" unless mode[/^obj/].nil?}"
args = [ENV["TM_#{g}"] || g.downcase.gsub("x", "+"), flags + " -x #{lang}", ENV["TM_FILEPATH"]]
TextMate::Executor.run(args, :version_args => ["--version"], :version_regex => /\A([^\n]*) \(GCC\).*/m)
TextMate only does a simple compile of the .cpp file you're currently editing. Unlike Xcode or other full development environments it won't compile other source files in the project or perform linking.
(In TextMate click Bundles > Bundle Editor > Show Bundle Editor, then choose Run in the C section and you'll see exactly what TextMate is doing when you "Run" a .cpp file.)
You probably need to add additional command line parameters...
You can add additional command line parameters to g++ by altering the variable TM_CXX_FLAGS.
The best way to do this is probably to add a per project variable:
http://manual.macromates.com/en/environment_variables#project_dependent_variables
If the change is meant to be global you can add it to TextMate's static vars section
http://manual.macromates.com/en/environment_variables#static_variables
i don't have enough info to be certain of the command you're invoking.
if it's Xcode.tmbundle Build and Run, then it's invoking xcodebuild -- you should be able to reproduce and fix the error in Xcode.

Resources