ERROR: Failed to spawn fakeroot worker to run /PATH_TO_THIS/example_0.1.bb:do_install: [Errno 2] No such file or directory - c

I am trying to compile a c code and install it using yocto. it is successfully compiled using do_compile.
I tried to install using do_install, it is giving bellow error.
ERROR: Failed to spawn fakeroot worker to run /PATH_TO_THIS/example_0.1.bb:do_install: [Errno 2] No such file or directory
Please find my bb file below
SUMMARY = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR} /MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://sample.c"
S = "${WORKDIR}"
do_compile() {
x86_64-linux-gnu-gcc sample.c -o test_example
}
do_install() {
install -d ${D}${bindir}
install -m 0755 test_example ${D}${bindir}
}

Based on your comment above that you are using -b - that is almost certainly the cause of this issue. When you use -b bitbake will print this warning:
WARNING: Buildfile specified, dependencies will not be handled. If this is not what you want, do not use -b / --buildfile.
One of the dependencies that you may be missing is the fakeroot program (pseudo). Using -b is likely preventing that from being built.
Instead of using -b, you should put the recipe into a place bitbake can find it (to test, could be meta/recipes-extended/example, but when you do it properly you should create your own layer and put it there). Then you can just build it like any other recipe:
bitbake example

Related

Static library -lzita-resampler installed in /usr/local/lib unable to be found when using gcc

I'm trying to install a binary called audiowmark (link) from source on my Mac. The instructions say to run ./configure but when I do that, I run in to an error that claims:
checking for _Z28zita_resampler_major_versionv in -lzita-resampler... no
configure: error: You need to install libzita-resampler to build this package.
As a result, I need to install the libzita-resampler library. As a novice in C/CMake/Make, this is where things got a bit confusing for me. I think I'm installing this package correctly (I see the libzita-resampler.a in my usr/local/lib), but I still receive the above error. Can someone help guide me in the right direction to ensure I installed correctly? From my understanding, /usr/local/lib is a default path that is checked for libraries when running gcc.
To install libzita-resampler, I found the GitHub repo (link) and loaded the source to my computer.
I first created a build directory in this library and cd-ed in to it:
mkdir build && cd build
With cmake installed, I was able to run
cmake ..
Which created the Makefile for my computer, I then ran the following commands with Make
make
Which output the following
jordan#Jordans-MBP-3 build % make
[ 20%] Building CXX object CMakeFiles/zita-resampler.dir/source/resampler.cc.o
[ 40%] Building CXX object CMakeFiles/zita-resampler.dir/source/vresampler.cc.o
[ 60%] Building CXX object CMakeFiles/zita-resampler.dir/source/resampler-table.cc.o
[ 80%] Building CXX object CMakeFiles/zita-resampler.dir/source/cresampler.cc.o
[100%] Linking CXX static library libzita-resampler.a
[100%] Built target zita-resampler
And therefore ran the install step
make install
Which output
jordan#Jordans-MBP-3 build % make install
[100%] Built target zita-resampler
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libzita-resampler.a
-- Installing: /usr/local/lib/cmake/zita-resampler/zita-resamplerConfig.cmake
-- Installing: /usr/local/lib/cmake/zita-resampler/zita-resamplerConfigVersion.cmake
-- Installing: /usr/local/lib/cmake/zita-resampler/zita-resamplerTargets.cmake
-- Installing: /usr/local/lib/cmake/zita-resampler/zita-resamplerTargets-noconfig.cmake
Which successfully added the static library .a to my lib directory.
So with this set up, I'd assume I would be able to then run the audiowmark's ./configure command again but I still receive the same error indicating that I didn't install this library correctly. Is there a final step to get the ./configure step to "find" this new library that I installed that I missed?
Here's the relevant code that looks for the library in the ./configure script. I see that it's adding LIBS= -lzita-resampler so it should find it in my directory path now...right?
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _Z28zita_resampler_major_versionv in -lzita-resampler" >&5
printf %s "checking for _Z28zita_resampler_major_versionv in -lzita-resampler... " >&6; }
if test ${ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lzita-resampler $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char _Z28zita_resampler_major_versionv ();
int
main (void)
{
return _Z28zita_resampler_major_versionv ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv=yes
else $as_nop
ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv" >&5
printf "%s\n" "$ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv" >&6; }
if test "x$ac_cv_lib_zita_resampler__Z28zita_resampler_major_versionv" = xyes
then :
printf "%s\n" "#define HAVE_LIBZITA_RESAMPLER 1" >>confdefs.h
LIBS="-lzita-resampler $LIBS"
else $as_nop
as_fn_error $? "You need to install libzita-resampler to build this package." "$LINENO" 5
fi
Thanks for any guidance, learning as I go here.

trouble running make on CBLAS

I'm trying to build a BLAS shared library for use with ghostjat/np cannot get make to run successfully on the CBLAS source code. I performed these exact steps on an Ubuntu 20 workstation:
# create new directory
mkdir ~/blas
cd ~/blas
# fetch and extract the CBLAS source code linked from the BLAS page
wget http://www.netlib.org/blas/blast-forum/cblas.tgz
tar -xvzf cblas.tgz
#cd into the CBLAS dir
cd CBLAS
#get appropriate make file according to README:
rm Makefile.in
ln -s Makefile.LINUX Makefile.in
#then we try make
make
This results in an error because gfortran was not installed:
gfortran -O3 -c sdotsub.f
make[1]: gfortran: Command not found
make[1]: *** [Makefile:247: sdotsub.o] Error 127
make[1]: Leaving directory '/home/foo/biz/machine-learning/blas/CBLAS/src'
make: *** [Makefile:147: allprecision] Error 2
So I install gfortran
sudo apt install gfortran
# answer YES to prompts
I am then able to make most of the project, but it croaks with an error:
make[1]: Entering directory '/home/foo/biz/machine-learning/blas/CBLAS/testing'
gcc -I../include -O3 -DADD_ -c c_sblas1.c
gfortran -O3 -c c_sblat1.f
c_sblat1.f:214:48:
214 | CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
| 1
Warning: Rank mismatch in argument ‘strue1’ at (1) (scalar and rank-1) [-Wargument-mismatch]
c_sblat1.f:218:48:
218 | CALL STEST1(SASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
| 1
Warning: Rank mismatch in argument ‘strue1’ at (1) (scalar and rank-1) [-Wargument-mismatch]
gfortran -o xscblat1 c_sblat1.o c_sblas1.o ../lib/cblas_LINUX.a libblas.a
gfortran: error: libblas.a: No such file or directory
make[1]: *** [Makefile:72: xscblat1] Error 1
make[1]: Leaving directory '/home/foo/biz/machine-learning/blas/CBLAS/testing'
make: *** [Makefile:180: alltst] Error 2
What is the problem here? This is mostly greek to me, but it looks like it compiles successfully all the CBLAS source code except it seems to barf when it gets to the testing, complaining that it cannot find a file, libblas.a. Can someone help me make sure this make operation completes?
Also, I was expecting this compilation step to produce a shared library, perhaps cblas.so or something. I am hoping this process will yield a viable BLAS library that I can use with ghostjat/np to perform fast matrix operations from a PHP script. However, there are no files in this directory ending in .so. Should I be looking for some other file?
EDIT: the comments have suggested that perhaps I should 'install BLAS' or 'install the libopenblas-dev package' on this machine. Let me first say that my goal is to obtain a library that I might distribute with some PHP source code. I am under the impression that building/making CBLAS will provide this library.
EDIT 2: After attempting a lot of trial and error, I think (but am not sure) that CBLAS is not a full-blown implementation of the BLAS functionality, but just a C wrapper around the BLAS functions, which are written in FORTRAN. It would appear that the makefile in CBLAS must be changed to point to a BLAS static library. I've been able to build the BLAS 3.11.0 library like so:
cd ~/blas
curl https://netlib.org/blas/blas-3.11.0.tgz > blas-3.11.0.tgz
tar -xvzf blas-3.11.0.tgz
cd BLAS-3.11.0
make
this runs for about a minute or so and yields a static lib, blas_LINUX.a. I take note of this file's location:
/Users/foo/Desktop/biz/machine-learning/blas2/BLAS-3.11.0/blas_LINUX.a.
I then return to my previously downloaded/extracted CBLAS folder:
cd ~/blas/CBLAS
and note this information in the README file:
BLLIB is your Legacy BLAS library
I edit this line in Makefile.in:
BLLIB = libblas.a
so that it refers instead to the static blas_LINUX. I just compiled above:
BLLIB = /Users/foo/Desktop/biz/machine-learning/blas2/BLAS-3.11.0/blas_LINUX.a
I save the make file and then make CBLAS:
make clean all
This runs for awhile, but fails in the testing phase with a certain gfortrain complaint:
( cd testing && make all )
gcc -I../include -O3 -DADD_ -c c_sblas1.c
gfortran -O3 -c c_sblat1.f
c_sblat1.f:214:48:
214 | CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
| 1
Error: Rank mismatch in argument 'strue1' at (1) (scalar and rank-1)
c_sblat1.f:218:48:
218 | CALL STEST1(SASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
| 1
Error: Rank mismatch in argument 'strue1' at (1) (scalar and rank-1)
make[1]: *** [c_sblat1.o] Error 1
make: *** [alltst] Error 2
Not a direct answer, but since you're on Ubuntu you can just install the libopenblas-dev package which contains the cblas headers and will pull in a high performance BLAS library as a dependency.
I stumbled across these directions which have worked for me, at least on Ubuntu 20.04. A couple of things changed so I list the exact steps I took here on my Ubuntu 20.04 workstation. The basic solution is to first compile BLAS (this appears to be FORTRAIN code) into a static library, blas_LINUX.a, and then modify the CBLAS files to point to that static library. There are tgz archives for both on the BLAS homepage.
# make a working dir
mkdir ~/cblas
cd ~/cblas
# fetch the BLAS library (not CBLAS, just BLA)S
wget http://www.netlib.org/blas/blas-3.11.0.tgz
tar -xvzf blas-3.11.0.tgz
cd BLAS-3.11.0
make
This will produce a file, blas_LINUX.a. Take note of its location here, you'll need to refer to it in the CBLAS make file. Next, fetch CBLAS and compile.
# get out of this directory back to our working dir
cd ..
# fetch CBLAS tgz, linked from netlib page
wget http://www.netlib.org/blas/blast-forum/cblas.tgz
# extract it
tar -cvzf cblas.tgz
# cd into CBLAS dir for edits
cd CBLAS
# remove default makefile
rm Makefile.in
# copy LINUX make file to Makefile.in
ln -s Makefile.LINUX Makefile.in
# edit Makefile.in
nano Makefile.in
Make the following changes:
# path to just-compiled static lib
# NOTE your path will be different
BLLIB = /home/sneakyimp/cblas/BLAS-3.11.0/blas_LINUX.a
CBLIB = ../lib/cblas_$(PLAT).so
CFLAGS = -O3 -DADD_ -fPIC
FFLAGS = -O3 -fPIC
ARCH = gcc
ARCHFLAGS = -shared -o
Save & close Makefile.in and then make CBLAS
# this takes a bit of time
make
# ls -al lib
You should now have your so file in lib/cblas_LINUX.so
I was able edit the blas.h file in a composer-installed ghostjat/np to point to this cblas_LINUX.so file, and eventually get it working, but you'll have complaints about various functions in the that blas.h file which are not defined in CBLAS. If you remove each of the functions it complains about you may get it to work or not. I was able to get it working on Ubuntu 20 running php 8.2, but have had trouble on other machines. My attempt to run cblas_dgemm on a matrix i defined resulted in this error:
php: symbol lookup error: /home/sneakyimp/cblas/CBLAS/lib/cblas_LINUX.so: undefined symbol: dgemm_

MOTIF compiling error / X11/intrinsic.h missing

i have MOTIF installed X11
a easy program is saved as hello.c
there is the following message
where can i get the X11/intrinsic.h , file ???
need help to compile
my system : MX-16 Linux Debian Jessie / i386
Code:
hans#mx1:~/Documents
$ cc push.c -o push -lXm -lXt -lX11
In file included from push.c:2:0:
/usr/include/Xm/Xm.h:59:27: fatal error: X11/Intrinsic.h: No such file or directory
#include <X11/Intrinsic.h>
^
compilation terminated.
hans#mx1:~/Documents
I installed the libxt-dev package on my Debian box:
apt-get install libxt-dev
Then the proper header will be installed:
# find /usr -name "Intrinsic.h" -print
/usr/include/X11/Intrinsic.h
Been using xv for several decades now -- I always find myself trying to rebuild it.
The copy on my system came from libxt-dev
$ locate Intrinsic
/usr/include/X11/Intrinsic.h
/usr/include/X11/IntrinsicI.h
/usr/include/X11/IntrinsicP.h
$ dpkg-query -S /usr/include/X11/Intrinsic.h
libxt-dev:amd64: /usr/include/X11/Intrinsic.h
You may want to install and use apt-file - you can ask it for a filename and it will tell you which packages (that you don't even have to have installed - just from the repos in your sources.lists) contain a file with that name

Build Jansson 2.7 failed if I copy the directory elsewhere

I'm using Jansson 2.7 for my project. I found something that causes a build failed.
If I try:
tar -zxvf jansson-2.7.tar.gz
cd jansson-2.7/
./configure
make
Everything is just fine. But If I try:
tar -zxvf jansson-2.7.tar.gz
cp jansson-2.7 jansson-2.7-test -r
cd jansson-2.7-test/
./configure
make
Configure will success, but make will fail:
make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/nick/Downloads/jansson-2.7-test/missing aclocal-1.14
/home/nick/Downloads/jansson-2.7-test/missing: line 81: aclocal-1.14: command not found
WARNING: 'aclocal-1.14' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [aclocal.m4] Error 127
Any clues? Thanks!
I ran into this same issue simply extracting and trying to run configure/make. Following the link provided by nick2100, I found the following commands fixed the problem:
./configure
make AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=:
make AUTOCONF=: AUTOHEADER=: AUTOMAKE=: ACLOCAL=: install

Pkg-config file is on the pkg-config path but can not be found by configure script

I am trying to install libvirt from source. The version I am trying to install is 1.2.7. I want libssh2 enabled. Here is how I call the configure script:
./configure --prefix=/home/administrator/dev/workspaces/libvirt/built/libvirt-1.2.7/ --with-sasl --with-qemu --with-lxc --with-gnutls --with-remote --with-ssh2 --with-polkit
I got the following error:
configure: error: You must install the libssh2 >= 1.3 pkg-config module to compile libvirt
I downloaded the libssh2 lib version 1.4.3 and installed it using the default options:
$ ./configure
$ make
$ sudo make install
Here is some useful info:
$ sudo ldconfig
$ sudo updatedb
$ locate libssh2.so
/usr/local/lib/libssh2.so
/usr/local/lib/libssh2.so.1
/usr/local/lib/libssh2.so.1.0.1
$ locate libssh2.pc
/usr/local/lib/pkgconfig/libssh2.pc
$ pkg-config --variable pc_path pkg-config
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
Obviously the libssh2.pc file is on the pkg-config path. However, when I tried executing the configure script for libvirt, the same error occurred. Any ideas what I am doing wrong ? Thank you.
EDIT: Fragment of the config.log file:
34475 configure:59141: checking for SSH2
34476 configure:59148: $PKG_CONFIG --exists --print-errors "libssh2 >= 1.3"
34477 configure:59151: $? = 0
34478 configure:59165: $PKG_CONFIG --exists --print-errors "libssh2 >= 1.3"
34479 configure:59168: $? = 0
34480 configure:59182: result: no
34481 Package libssl was not found in the pkg-config search path.
34482 Perhaps you should add the directory containing `libssl.pc'
34483 to the PKG_CONFIG_PATH environment variable
34484 Package 'libssl', required by 'libssh2', not found
34485 configure:59225: error: You must install the libssh2 >= 1.3 pkg-config module to compile libvirt
...
34576 ac_cv_env_PKG_CONFIG_LIBDIR_set=
34577 ac_cv_env_PKG_CONFIG_LIBDIR_value=
34578 ac_cv_env_PKG_CONFIG_PATH_set=
34579 ac_cv_env_PKG_CONFIG_PATH_value=
34580 ac_cv_env_PKG_CONFIG_set=
34581 ac_cv_env_PKG_CONFIG_value=
...
34874 ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config
36432 PKG_CONFIG='/usr/bin/pkg-config'
36433 PKG_CONFIG_LIBDIR=''
36434 PKG_CONFIG_PATH=''

Resources