Building zookeeper 3.4.12 c client on solaris machine fails with libtool error - shell

I am trying to build zookeeper 3.4.12 c client on the Solaris machine. Below are the steps that I followed,
unzip/untar the source tarball and cd to the zookeeper-x.x.x/src/c
directory.
Do a "./configure [OPTIONS]" to generate the makefile.
./configure --without-cppunit
This step fails with below error,
/bin/sh ./libtool --tag=CC --mode=link gcc -Wall -Werror -g -O2
-D_GNU_SOURCE -no-undefined -version-info 2 -lnsl -lsocket -export-symbols-regex '(zoo_|zookeeper_|zhandle|Z|format_log_message|log_message|logLevel|deallocate_|allocate_|zerror|is_unrecoverable)'
-o libzookeeper_st.la -rpath /usr/local/lib libzkst.la libhashtable.la libtool: link: /bin/nm -p ./.libs/libzkst.a ./.libs/libhashtable.a | | /bin/gsed 's/.* //' | sort | uniq > .libs/libzookeeper_st.exp ./libtool[1732]: eval: syntax error at line 1: `|' unexpected
*** Error code 3 make: Fatal error: Command failed for target `libzookeeper_st.la'
Any idea on the error?
Regards,
Ashwini.

The error is because you're missing a command in this portion of the command line:
... ./.libs/libzkst.a ./.libs/libhashtable.a | | /bin/gsed 's/.* //' ...
If you can find that recipe in the Makefile, there's probably a $(something) there that's expanded to an empty string, thus attempting a null command in the pipeline.

Found the issue. There was something like this in make file :
"libzookeeper_st.la: $(libzookeeper_st_la_OBJECTS) $(libzookeeper_st_la_DEPENDENCIES) $(AM_V_CCLD)$(libzookeeper_st_la_LINK) -rpath $(libdir)".
Where in if I remove -rpath $(libdir) everything builds properly.
Dont know what -rpath $(libdir) does. -rpath $(libdir) expands to "-rpath /usr/local/lib". But this resolves the issue.

Related

Problem installing ndless-sdk: error building genzehn

I am trying to install Ndless sdk on my Windows computer (with CygWin). I run
.../Ndless/ndless-sdk/toolchain/build_toolchain.sh
and I fixed all the problems with that. After that, according to the instructions, I went in the (top) Ndless directory and ran "make". It got stuck at this point and whatever I did, I could not get it to compile "genzehn"
.../Ndless/ndless-sdk/tools/genzehn/genzehn.cpp
What should I do?
The log(both stdout and stderr for make in "Ndless"):
https://pastebin.com/fpH6Mf2v
make all in genzehn...
make[3]: Entering directory '/Ndless/ndless-sdk/tools/genzehn'
g++ -Wall -Wextra -std=c++11 -I elfio-3.2 genzehn.cpp -lboost_program_options -lz -o ../../bin/genzehn || g++ -Wall -Wextra -std=c++11 -I elfio-3.2 genzehn.cpp -lboost_program_options-mt -lz -o ../../bin/genzehn
In file included from genzehn.cpp:12:
zehn.h:1:1: error: expected unqualified-id before ‘.’ token
1 | ../../include/zehn.h
| ^
genzehn.cpp: In function ‘int main(int, char**)’:
genzehn.cpp:96:9: error: ‘Zehn_header’ was not declared in this scope; did you mean ‘gz_header’?
96 | Zehn_header header;
| ^~~~~~~~~~~
| gz_header

Yocto project cannot find asm/errno.h

I'm trying to compile a program that requires asm/errno.h header.
Building C object CMakeFiles/modem.dir/src/client.c.o
| /home/kristupas/yocto/oe-core/build/tmp-glibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc -Dmodem_EXPORTS -std=gnu99 -march=armv7-a -mfloat-abi=softfp -mfpu=neon --sysroot=/home/kristupas/yocto/oe-core/build/tmp-glibc/sysroots/mdm9607 -O2 -fexpensive-optimizations -frename-registers -fomit-frame-pointer -fPIC -I/home/kristupas/yocto/oe-core/build/tmp-glibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libmodem/1.0-r0/libmodem/src -I/home/kristupas/yocto/oe-core/build/tmp-glibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libmodem/1.0-r0/libmodem/include -o CMakeFiles/modem.dir/src/client.c.o -c /home/kristupas/yocto/oe-core/build/tmp-glibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libmodem/1.0-r0/libmodem/src/client.c
| [ 83%] /home/kristupas/yocto/oe-core/build/tmp-glibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libmodem/1.0-r0/libmodem/src/client.c:14:25: fatal error: asm/ernno.h: No such file or directory
| #include <asm/ernno.h>
^
The --sysroot argument is set correctly to my targets sysroot, but gcc still can't find the header, even though it's clearly there:
ls -la /home/kristupas/yocto/oe-core/tmp-glibc/sysroots/mdm9607/usr/include/asm/ | grep "errno\.h"
-rw-r--r-- 3 kristupas kristupas 31 Kov 9 16:06 errno.h
Doing
echo | /home/kristupas/yocto/oe-core/build/tmp-glibc/sysroots/x86_64-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc -R -Wp. -v -
returns this:
--includedir=/home/kristupas/yocto/oe-core/build/tmp-glibc/sysroots/x86_64-linux/usr/include
This is the include directory for the host, which does not contain asm/errno.h. Shouldn't it point to targets sysroot instead?
Turns out I misspelled errno and failed to notice it for hours!

"llvm-g++: command not found" while building BitCoin

I was following this guide:
When I ran:
make -f makefile.osx USE_UPNP=-
here is what I got in the terminal:
/bin/sh ../share/genbuild.sh obj/build.h
fatal: bad default revision 'HEAD'
llvm-g++ -c -g -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -DMAC_OSX -DMSG_NOSIGNAL=0 -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6 -DUSE_UPNP=- -DHAVE_BUILD_INFO -I"/Users/Bob/mycoin/src" -I"/Users/Bob/mycoin/src"/obj -I"/opt/local/include" -I"/opt/local/include/db48" -MMD -MF obj/version.d -o obj/version.o version.cpp
/bin/sh: llvm-g++: command not found
make: *** [obj/version.o] Error 127
Since Xcode 5 doesn't ship with llvm-g++ anymore, you need to install it manually. One of the possible ways is to install command-line tools.
Another option is to just set CXX to g++ in makefile.osx.

How to run "gmake install"?

I am now installing a code on my mac.
The code is from here. Look for "Benchmark and Boundary Detection Code" in this page.
In the readme file, it says:
(1) For the image and segmentation reading routines in the Dataset
directory to work, make sure you edit Dataset/bsdsRoot.m to point to
your local copy of the BSDS dataset.
(2) Run 'gmake install' from this directory to build everything. You
should then probably put the lib/matlab directory in your MATLAB path.
(3) Read the Benchmark/README file.
For the 1st step, I did as suggested.
For the 2nd step, I am pretty confused. I ran command gmake install in MATLAB, however, I got:
gmake
Undefined function or variable 'gmake'.
Actually, before running MATLAB, I installed gmake port through macports.
I just did it in terminal, however, this is what I got...
hou229:segbench yaozhongsong$ cd /Users/yaozhongsong/Documents/MATLAB/segbench
hou229:segbench yaozhongsong$ sudo gmake install
gmake[1]: execvp: ../Util/gethosttype: Permission denied
gmake[1]: Entering directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
GNUmakefile-library:26: *** mexSuffix not defined. Stop.
gmake[1]: Leaving directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
hou229:segbench yaozhongsong$
In MATLAB, I also did like this:
!gmake install
/bin/bash: gmake: command not found
How to do the 2nd step in readme file?
Thanks in advance!
#Amro
hou229:segbench yaozhongsong$ cd /Users/yaozhongsong/Documents/MATLAB/segbench
hou229:segbench yaozhongsong$ sudo gmake install
Password:
gmake[1]: execvp: ../Util/gethosttype: Permission denied
gmake[1]: Entering directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
mkdir -p ../lib/matlab
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Exception.cc -o build//Exception.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c String.cc -o build//String.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Random.cc -o build//Random.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Timer.cc -o build//Timer.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Matrix.cc -o build//Matrix.o
Matrix.cc:13:21: error: ieee754.h: No such file or directory
Matrix.cc: In function ‘double nextpow2(double)’:
Matrix.cc:86: error: ‘ieee754_double’ was not declared in this scope
Matrix.cc:86: error: expected `;' before ‘val’
Matrix.cc:87: error: ‘val’ was not declared in this scope
Matrix.cc:88: error: ‘IEEE754_DOUBLE_BIAS’ was not declared in this scope
Matrix.cc: At global scope:
Matrix.cc:48: warning: ‘snan’ defined but not used
Matrix.cc:49: warning: ‘inf’ defined but not used
gmake[1]: *** [build//Matrix.o] Error 1
gmake[1]: Leaving directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
For the "mexSuffix not defined" error, first run mexext inside MATLAB, take that output (I suspect it is mexmaci64), edit the file Util/GNUmakefile-library and add the following at line 24:
mexSuffix := mexmaci64
replace the value with the one you get from mexext
Note: I haven't tested any of this, I am on a Windows machine..
You need to run gmake from the Terminal (command line), not in MATLAB.

make library not found

I'm trying to compile a program using a third party library, Omnet++ in my case. Apparently "make" does not find a library, but the path it uses is correct as you can see (in the sense that I can see the library under omnet++ source tree)
pv135168:basic Bob$ opp_makemake
Creating Makefile in /Users/Bob/Code/network_sim/basic... Makefile created, running "make depend" to add dependencies... opp_makedep -Y --objdirtree -I. -f Makefile -P\$O/ -- ./*.cc
pv135168:basic Bob$ make
g++ -c -g -Wall
-fno-stack-protector -m32 -DHAVE_PCAP -DXMLPARSER=libxml
-DWITH_PARSIM -DWITH_NETBUILDER -I.
-I/Users/Bob/Code/omnetpp-4.1/include -o out/gcc-debug//txc1.o txc1.cc g++ -m32 -Wl,-rpath,/Users/Bob/Code/omnetpp-4.1/lib -Wl,-rpath,. -o out/gcc-debug//basic out/gcc-debug//txc1.o -Wl,-all_load
-L"/Users/Bob/Code/omnetpp-4.1/lib/gcc"
-L"/Users/Bob/Code/omnetpp-4.1/lib" -u _tkenv_lib -lopptkenvd
-loppenvird -lopplayoutd -u _cmdenv_lib -loppcmdenvd -loppenvird
-loppsimd -lstdc++
ld: library not found for -lopptkenvd
collect2: ld returned 1 exit status make: *** [out/gcc-debug//basic]
Error 1 pv135168:basic Bob$
It's looking in the following directories for a file called libopptkenvd.dylib or libopptkenvd.a:
/Users/Bob/Code/omnetpp-4.1/lib/gcc
/Users/Bob/Code/omnetpp-4.1/lib
Is that file in one of those directories (or in the standard directories like /usr/lib)? I don't see an indication of that in your output.

Resources