Which Protoc Does "Make" Command Use? - makefile

I am trying to build LAB which generate robust facial landmark.
In installation guide it says one needs to install Caffe prerequisites which I'd checked CUDA and BLAS well installed on my AWS EC2 instance.
Then I git cloned and typed make under the cloned git folder named in LAB
But it returns following error
CXX .build_release/src/caffe/proto/caffe.pb.cc
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:0:
.build_release/src/caffe/proto/caffe.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
#error This file was generated by a newer version of protoc which is
^
.build_release/src/caffe/proto/caffe.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
#error incompatible with your Protocol Buffer headers. Please update
^
.build_release/src/caffe/proto/caffe.pb.h:14:2: error: #error your headers.
#error your headers.
^
In file included from .build_release/src/caffe/proto/caffe.pb.cc:4:0:
.build_release/src/caffe/proto/caffe.pb.h:23:35: fatal error: google/protobuf/arena.h: No such file or directory
compilation terminated.
Makefile:588: recipe for target '.build_release/src/caffe/proto/caffe.pb.o' failed
make: *** [.build_release/src/caffe/proto/caffe.pb.o] Error 1
The error above looks like I am using old version of libprotoc so if I type in which protoc it returns
/home/ubuntu/anaconda3/bin//protoc
and for protoc --version it returns libprotoc 3.5.1
and for whereis protoc it returns
protoc: /usr/local/bin/protoc /home/ubuntu/anaconda3/bin/protoc /usr/share/man/man1/protoc.1.gz
Thus since it looks like I have another protoc in /usr/local/bin I had checked its version via /usr/local/bin/protoc --version which returns
libprotoc 3.3.0
Hereby I have two problems:
1) I don't know if I use make cmd, which protoc being referred.
2) I don't know the error requires which version of protoc.
How can I check and get the proper information regarding above two problems?

Try something like PROTOC=/home/ubuntu/anaconda3/bin/protoc make
Make sure compiler got correct path to protobuf headers with appropriate -I option.

Related

Install xdebug failing on Mac

I am running MacOS Big Sur (ver 11.4) w/ PHP 7.4.19. I am trying to install xdebug w/ homebrew:
pecl install xdebug
but it fails with:
5 warnings and 4 errors generated.
make: *** [xdebug.lo] Error 1
ERROR: `make' failed
I tried downloading source and running make but I get the same error:
In file included from /usr/local/Cellar/php#7.4/7.4.19_1/include/php/Zend/zend.h:356:
/usr/local/Cellar/php#7.4/7.4.19_1/include/php/Zend/zend_operators.h:523:10: error:
'asm goto' constructs are not supported yet
__asm__ goto(
I have Googled to no avail. Has anyone else encountered this?
This is because of a mismatch between compilers. You didn't enough include information about which part was compiled by which compiler, but one of them was compiled by LLVM, and the other with GCC. This causes a mismatch.
You need to make sure that you're using the same compiler for both.

Compile Error When compile gRPC that `‘-std=c++11’ is valid for C++/ObjC++ but not for C

I am trying to compile grpc_python_plugin. I downloaded the latest grpc package in Github. Following the instruction, I went into the grpc directory, and start to compile with
make grpc_python_plugin
, and get the following error:
wcf#wcf-OptiPlex-7060:~/resq/grpc$ make grpc_python_plugin
[C] Compiling third_party/address_sorting/address_sorting.c
cc1: error: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [-Werror]
cc1: all warnings being treated as errors
Makefile:2972: recipe for target '/home/wcf/resq/grpc/objs/opt/third_party/address_sorting/address_sorting.o' failed
make: *** [/home/wcf/resq/grpc/objs/opt/third_party/address_sorting/address_sorting.o] Error 1
Since the Makefile for grpc is so giant, I cannot find any way to solve the problem. Could you share some idea on my problem? Thank you for your time.
The problem may be that I install the protobuf outside the grpc git program. When I install protobuf in grpc's third_party. All things go well.
The way I made it work was deleting "-Werror" from CPPFLAGS in the Makefile. But yes, I also installed protobuf outside of grpc.

Fabric-sdk-go 'ld.exe: cannot find -lltdl' error

When I try to get the fabric-sdk-go I get the following error:
$ go get github.com/hyperledger/fabric-sdk-go/pkg/fabric-client
# github.com/hyperledger/fabric-sdk-go/vendor/github.com/miekg/pkcs11
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lltdl
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lltdl
collect2.exe: error: ld returned 1 exit status
Does anyone have an idea what is the issue and how to resolve this?
The error message told us that the library libltdl which is required by github.com/miekg/pkcs11 is missing. Although you didn't mention it explicitly, I think you're using MSYS2 as the development environment. Do the following steps to install the missing library.
Search for the missing library, type pacman -Ss ltdl in MSYS2 terminal to get the exact package name. Here, ltdl is the keyword related to missing library which we got from error message. You should get something like:
msys/libltdl 2.4.6-2
A system independent dlopen wrapper for GNU libtool
From the result we know that the missing library is provided in libltdl package. It seems trivial, but sometimes a library may be provided by more than one package, e.g. a package which has prefix mingw-w64-i686-* for 32-bit system and the other with prefix mingw-w64-x86_64-* for 64-bit system.
Install the package by: pacman -S libltdl.
Reinstall the go package by: go get -v github.com/hyperledger/fabric-sdk-go/pkg/fabric-client.

cross-compiling with gcc, got storage size of ... isn't known error when it is defined in an include file under sysroot

I have a question very simliar to Cross compiler default include path setup but there wasn't the answer I was looking for.
I built a cross-compiler for openrisc. I have it in ~/openrisck/toolchain/
under there, I have bin(or32-linux-* excutables are here), include, lib, lib64, libexec, or32-linux, share.
under or32-linux, I have bin, include, lib, sys-root.
When I build busybox, I gave CONFIG_CROSS_COMPILER_PREFIX as "or32-linux-".
and CONFIG_SYSROOT as "$SYSROOT" which is ~/openrisk/toolchain/or32-linux/sys-root.
then I run 'make install' in buxybox source. Since the path includes the cross-compiler directory, it compiles for or32-linux-. But I have an error below
ckim : srctree = /home/ckim/openrisc/busybox
CC applets/applets.o
In file included from /home/ckim/openrisc/toolchain/bin/../lib/gcc/or32-linux/4.5.1-or32-1.0rc1/include-fixed/syslimits.h:7:0,
from /home/ckim/openrisc/toolchain/bin/../lib/gcc/or32-linux/4.5.1-or32-1.0rc1/include-fixed/limits.h:34,
from include/platform.h:141,
from include/libbb.h:13,
from include/busybox.h:8,
from applets/applets.c:9:
/home/ckim/openrisc/toolchain/bin/../lib/gcc/or32-linux/4.5.1-or32-1.0rc1/include-fixed/limits.h:169:61: fatal error: limits.h: No such file or directory
compilation terminated.
make[1]: *** [applets/applets.o] Error 1
make: *** [applets_dir] Error 2
which makes me thinks that Ah! the cross-compiler uses the include path relative to the executable. (see above bin/../lib/gcc/or32-linux/version/include-fixed)
So the include limits.h goes to the gcc's limits.h correctly. The last file syslimits.h has #include_next when the limits.h file have already been included. and the compiler complains that the file cannot be found.
Can somebody tell me how to solve this problem? (limits.h includes syslimits.h and syslimits.h includes limits.h .. )
EDIT : I ran 'make CROSS_COMPILE=or32-linux- CONFIG_PREFIX=$SYSROOT install'
then I got 'lutimes undeclared in coreutil/touch.c' error. Assuming the limit.h problem is gone, this means I should give these command line arguments because CROSS_COMPILE for make is different from CONFIG_CROSS_COMPILER_PREFIX in busybox configuration and make's CONFIG_PREFIX is different from CONFIG_SYSROOT for busybox configuration. so to remove the lutimes error, I ran 'make menuconfig' and removed CONFIG_TOUCH. Then I reran the make(make CROSS_COMPILE=or32-linux- CONFIG_PREFIX=$SYSROOT install), and this time got
procps/free.c: In function 'free_main':
procps/free.c:51:17: error: storage size of 'info' isn't known
procps/free.c:77:2: warning: implicit declaration of function 'sysinfo'
I found that in $SYSROOT/usr/include/sys/sysinfo.h, struct sysinfo is defined. I don't know why it says it's not defined. Any help would be deeply appreciated. Thanks!
For anyone who might be facing the same problem I had..
I tried about 3 times with the old toolchain but failed.
Yesterday, I got help from IRC (openrisc) and someone told me there is an updated toolchain for or1k. (not or32 which is old. I should have read the opencore page first..)
The page is
http://opencores.org/or1k/OpenRISC_GNU_tool_chain#Linux_.28uClibc.29_toolchain_.28or1k-linux-uclibc.29 (read from Linux (uClibc) toolchain (or1k-linux-uclibc))

Error in automake

I’ve trying to create install package for hello world sample C program.
I’ve done following staps.
autoscan
mv configure.scan configure.ac
edit configure.ac to add some macros.
aclocal
create Makefile.am within
bin_PROGRAMS = hello
hello_SOURCES = hello.c
Finally I did automake .
Then I got messages bellow. .
configure.ac:12: error: required file './compile' not found
configure.ac:12: 'automake --add-missing' can install 'compile'
configure.ac:6: error: required file './missing' not found
configure.ac:6: 'automake --add-missing' can install 'missing'
Makefile.am: error: required file './INSTALL' not found
Makefile.am: 'automake --add-missing' can install 'INSTALL'
Makefile.am: error: required file './NEWS' not found
Makefile.am: error: required file './README' not found
Makefile.am: error: required file './AUTHORS' not found
Makefile.am: error: required file './ChangeLog' not found
Makefile.am: error: required file './COPYING' not found
Makefile.am: 'automake --add-missing' can install 'COPYING'
Makefile.am: error: required file './depcomp' not found
Makefile.am: 'automake --add-missing' can install 'depcomp'
There aren’t any strings including compile, missing ,NEW, README or the massage said being required in Makefile.am an configure.ac files.
What should I do?
Those are information about version of some products.
CentOS release 6.4
autocomf-2.69
automake-1.14
m4-1.4
Those files need to exist to conform to the standard 'automake/autoconf' set of files.
Follow the instructions it gives you: "automake --add-missing", and the missing files will be created with dummy information which you would (in a perfect world) fill in appropriately.
Try perusing the autotools tutorial, or perhaps the autobook. See also StackOverflow: Getting started with autotools.
Additionally, read the man pages, try automake --help, read what the utility helpfully output to assist you?
Probably adding foreign to AM_INIT_AUTOMAKE macro in configure.ac could be helpful in this case.

Resources