EXTRA_DIST for Makefile.am repeats the directory name - c++

I'm using EXTRA_DIST within a Makefile.am to copy some folders:
EXTRA_DIST = input/
The problem is that it repeats the directory name input/input/
Do you know any solution for this problem? is this a bug of automake?

I have found the solution. With: "EXTRA_DIST = input" instead of "EXTRA_DIST = input/" works fine

Related

Bitbake does not include my recipe in build

I am trying to do something straightforward: add a new layer and a new recipe. I used the
bitbake-layers create-layer
command to create the layer, and added the layer directory path to BBLAYERS variable in BUILDDIR/conf/bblayers.conf.
layer.conf
BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "myname-mytest"
BBFILE_PATTERN_myname-mytest = "^${LAYERDIR}/"
BBFILE_PRIORITY_myname-mytest = "6"
LAYERVERSION_myname-mytest = "1"
LAYERSERIES_COMPAT_myname-mytest = "sumo"
Added this in local.conf:
local.conf
IMAGE_INSTALL_APPEND = " mytest-app"
bitbake-layers show-recipes
shows my layer and recipe.
mytest-app:
meta-myname-mytest 1.0
Errors in my recipe are caught in the bitbake build, but without any error, no output is produced under WORKDIR/image or logs are produced under WORKDIR/temp!
Have done this on other platforms, and can't for the life of me tell what I am doing wrong. Thanks for any help!!
It's IMAGE_INSTALL_append, not IMAGE_INSTALL_APPEND. c.f. https://docs.yoctoproject.org/bitbake/bitbake-user-manual/bitbake-user-manual-metadata.html#appending-and-prepending-override-style-syntax
For the new yocto version, you need to use
IMAGE_INSTALL:append
instead of
IMAGE_INSTALL_append
and you will be OK

meson add existing dll as dependency

I want to add a dll as dependency to my own project under Windows.
I tried following:
lept_include = include_directories('../libs/tesseract')
lept_lib = '/g/programming/meson/libs/tesseract/liblept-5.dll'
lept_dep = declare_dependency(link_with:lept_lib, include_directories:lept_include)
executable('test1', 'main.cpp', dependencies: [boost_dep, lept_dep])
but got this error:
..\meson.build:25:0: ERROR: '/g/programming/meson/libs/tesseract/liblept-5.dll' is not a target.
I also tried this but dit not work either:
cc = meson.get_compiler('cpp')
lib_l1 = cc.find_library('liblept-5.dll', dirs : ['/g/programming/meson/libs/tesseract'])
lib_l2 = cc.find_library('liblept-5', dirs : ['/g/programming/meson/libs/tesseract'])
lib_l3 = cc.find_library('lept-5.dll', dirs : ['/g/programming/meson/libs/tesseract'])
lib_l4 = cc.find_library('lept-5', dirs : ['/g/programming/meson/libs/tesseract'])
How can I achieve this?
thanks
Amazingly lib_l4 = cc.find_library('lept-5', dirs : ['/cygdrive/g/programming/meson/libs/tesseract']) is working now. At first I was using MSYS for windows, now I tried CYGWIN and the lib was found.

bazel WORKSPACE file for external repository leads to missing #includes

I'm trying to set up a workspace file for a project that uses googletest. I'm following the instructions here: https://docs.bazel.build/versions/master/cpp-use-cases.html#including-external-libraries.
I have a WORKSPACE file that looks like this:
new_http_archive(
name = "gtest",
url = "https://github.com/google/googletest/archive/release-1.7.0.zip",
sha256 = "b58cb7547a28b2c718d1e38aee18a3659c9e3ff52440297e965f5edffe34b6d0",
build_file = "gtest.BUILD",
strip_prefix = "googletest-release-1.7.0",
)
I have a BUILD file that looks like this:
COPTS = [
"-I/usr/local/include",
"-Iexternal/gtest/include",
"-Wno-sign-compare",
]
cc_test(
name = "gaussian_test",
srcs = ["gaussian_test.cc"],
copts = COPTS,
deps = [
"//:boom",
"//:boom_test_utils",
"#gtest//:main",
],
)
The #include section of my gaussian_test.cc file includes the line:
#include "gtest/gtest.h"
When I try to run the test I get
Models/tests/gaussian_test.cc:1:10: fatal error: gtest/gtest.h: No such file or directory
#include "gtest/gtest.h"
In my main repository I solve this problem by manually installing googletest in /usr/local, but I'm looking for a more portable solution, and also looking to clear up a fundamental misunderstanding I seem to have about how the WORKSPACE file is supposed to operate. Thanks.
The missing part of my question was the gtest-BUILD file, which contained the missing path information.

Executing an .exe file on files in another folder

I have my python code that runs a C++ code, which takes files in another folder as input.
I have my codes in folder A, and the input files are in folder B, and I have been trying this:
path = 'C:/pathToInputFiles'
dirs = os.listdir(path)
for path in dirs:
proc = subprocess.Popen([fullPathtoCppCode, inputFiles])
However, I keep receiving WindowsError: [Error 2] The system cannot find the file specified
The only way it works is when I put the C++ executable file in the same folder of the input files, which I am avoiding to do.
How can I make python reads the file path properly?
Try using os.path.join after your for statement.
path = os.path.join(directory, filename)
for example
def test(directory):
for filename in os.listdir(directory):
filename = os.path.join(directory, filename)
proc = subprocess.Popen([fullPathtoCppcode, inputFiles])

Issue with ftputil library and JPG-files

I have code shown below
for root, dirs, files in ftp_host.walk(ftp_host.curdir, topdown=False):
if ftp_host.path.isdir(root):
for folder in ftp_host.path.normpath(root).split('/'):
target_dir = os.path.join(target_dir, folder)
if not os.path.exists(target_dir):
os.mkdir(target_dir)
for name in files:
target_file = os.path.join(target_dir, name)
# print name - I am able to see all files here including *.JPG
if ftp_host.path.isfile(name):
# print name - there no any *.JPG
ftp_host.download(name, target_file)
target_dir = curdir
When I am trying to download recursively all files from target FTP, but I can't any JPG's.
Please advice where I am wrong
My bad... I dind't correct move to specific directory. ftputils work very well!