installing libcerf throws error when entering make - c

I need to use the erfi function in my C program, so I tried to install the libcerf library, where it is supposed to be contained. I downloaded it, went to the directory and entered ./configure. So far so good. Now when I enter 'make' it gives me the following error:
`localhost:libcerf-1.3 NAME$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in lib
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -pedantic -Wall -Werror -g -O2 -MT w_of_z.lo -MD -MP -MF .deps/w_of_z.Tpo -c -o w_of_z.lo w_of_z.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -pedantic -Wall -Werror-g -O2 -MT w_of_z.lo -MD -MP -MF .deps/w_of_z.Tpo -c w_of_z.c -fno-common -DPIC -o .libs/w_of_z.o
w_of_z.c:79:21: error: unused function 'cpolar' [-Werror,-Wunused-function]
static inline cmplx cpolar(double r, double t)
^
1 error generated.
make[2]: *** [w_of_z.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
There seems to be some problem with an unused function. This confuses me since this is the only way known to me to install libraries and I did not really do anything but the ./configure command. Yet it doesnt work. Additionally, I can't help myself with the output I get. I have tried googling it but could not get any further. I am using a Mac. Any help is appreciated.
Thanks a lot!

Related

CSAPP archlab: Fail to compile the simulator

When I compile the simulator using 'make', it appears an error.
(cd misc; make all)
make[1]: Entering directory '/root/archlab-handout/sim/misc'
gcc -Wall -O1 -g -fcommon -c yis.c
gcc -Wall -O1 -g -fcommon -c isa.c
gcc -Wall -O1 -g -fcommon yis.o isa.o -o yis
gcc -Wall -O1 -g -fcommon -c yas.c
flex yas-grammar.lex
mv lex.yy.c yas-grammar.c
gcc -O1 -fcommon -c yas-grammar.c
gcc -Wall -O1 -g -fcommon yas-grammar.o yas.o isa.o -lfl -o yas
/usr/bin/ld: cannot find -lfl
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:32: yas] Error 1
make[1]: Leaving directory '/root/archlab-handout/sim/misc'
make: *** [Makefile:26: all] Error 2
It seems like 'ld' returned 1 exit status. Can anyone help me how to solve this problem?
I have just learning computer science systematically for a while, and I do lack the experience with solving these problems.

ZooKeeper C binding installation

I am trying to install the C binding for ZooKeeper while ssh'ed to another computer using a build system: i386-pc-solaris2.11 (I don't know if that is important). Anyways, the computer I ssh'ed to is running a linux based OS.
I ran the following code in the command line:
cd ../zookeeper
cd src
cd c
./configure
make
The terminal inputs above were taken from the Apache website for setting up the C shell client. The error code I am getting is originates from the make:
libtool: link: ( cd ".libs" && rm -f "libzookeeper_mt.la" && ln -s
"../libzookeeper_mt.la" "libzookeeper_mt.la" )
gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -
D_POSIX_PTHREAD_SEMANTICS -Wall -Werror -g -O2 -D_GNU_SOURCE -MT cli.o
-MD -MP -MF .deps/cli.Tpo -c -o cli.o `test -f 'src/cli.c' || echo
'./'`src/cli.c
mv -f .deps/cli.Tpo .deps/cli.Po
/bin/sh ./libtool --tag=CC --mode=link gcc -Wall -Werror -g -O2 -
D_GNU_SOURCE -o cli_st cli.o libzookeeper_st.la
libtool: link: gcc -Wall -Werror -g -O2 -D_GNU_SOURCE -o .libs/cli_st
cli.o ./.libs/libzookeeper_st.so -lnsl -lsocket -lm -R/usr/local/lib
gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -
D_POSIX_PTHREAD_SEMANTICS -DTHREADED -g -O2 -D_GNU_SOURCE -MT cli_mt-
cli.o -MD -MP -MF .deps/cli_mt-cli.Tpo -c -o cli_mt-cli.o `test -f
'src/cli.c' || echo './'`src/cli.c
mv -f .deps/cli_mt-cli.Tpo .deps/cli_mt-cli.Po
/bin/sh ./libtool --tag=CC --mode=link gcc -DTHREADED -g -O2 -
D_GNU_SOURCE -o cli_mt cli_mt-cli.o libzookeeper_mt.la
libtool: link: gcc -DTHREADED -g -O2 -D_GNU_SOURCE -o .libs/cli_mt
cli_mt-cli.o ./.libs/libzookeeper_mt.so -lnsl -lsocket -lm -lpthread -
R/usr/local/lib
Undefined first referenced
symbol in file
__ .sync_fetch_and_add ./.libs/libzookeeper_mt.so
ld: fatal: symbol referencing errors. No output written to .libs/cli_mt
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `cli_mt'
Current working directory
/workspace/kunalp/mysource/usr/src/kunalp/zookeeperC2/src/c
*** Error code 1
make: Fatal error: Command failed for target `all'
cli_mt:localhost:2181 does not work as the ZooKeeper library is not installed in /usr/local/lib . I do however have zookeeper working in the C client on my local computer, I just need it working on this system.
Please help, this is just the installation of zookeeper on a linux computer. I don't understand linux too well, nor do I understand the error code given to me from this makefile.
EDIT: I figured out that I do not have permissions to change the /usrs/local/lib directory on this server. I tried
distclean && ./configure --prefix=/workspace/kunalp/zookeeper/ --libdir=/workspace/kunalp/zookeeper/lib && make install
to relocate the library directory. This however did not fix the problem, giving me the following error:
/bin/sh ./libtool --tag=CC --mode=link gcc -DTHREADED -g -O2 -
D_GNU_SOURCE -o cli_mt cli_mt-cli.o libzookeeper_mt.la
libtool: link: gcc -DTHREADED -g -O2 -D_GNU_SOURCE -o .libs/cli_mt
cli_mt-cli.o ./.libs/libzookeeper_mt.so -lnsl -lsocket -lm -lpthread -
R/workspace/kunalp/zookeeper/lib
Undefined first referenced
symbol in file
__sync_fetch_and_add ./.libs/libzookeeper_mt.so
ld: fatal: symbol referencing errors. No output written to .libs/cli_mt
collect2: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `cli_mt'
Thanks
The Solaris compiler does not have __sync_fetch_and_add. To fix this I had to find an equivalent function in the Solaris compailer: atomic_add() and replace __sync_fetch_and_add with atomic_add() in mt_adaptor.c. This fixed my make command

Error 2 while building project in eclipse

16:22:14 **** Incremental Build of configuration Default for project ccsds-compression.git.old ****
make all
'Building file: ../../src/AC_Coding.c'
sparc-leon3-none-gcc.exe -c -O3 -pedantic -Wall -msoft-float -mcpu=v8 -mtune=leon -Wno-long-long -funroll-loops -fmessage-length=0 -std=c99 -I. -I....\src -o AC_Coding.o ../../src/AC_Coding.c process_begin: CreateProcess((null), sparc-leon3-none-gcc.exe -c -O3 -pedantic -Wall -msoft-float -mcpu=v8 -mtune=leon -Wno-long-long -funroll-loops -fmessage-length=0 -std=c99 -I. -I....\src -o AC_Coding.o ../../src/AC_Coding.c, ...) failed. make (e=2): The system cannot find the file specified.
make: *** [AC_Coding.o] Error 2
I am receiving this error when building the project. Could someone guide me as to how I should resolve this?

Msys compile of C code

I'm not very familiar with compiling C code, especially on Windows using MinGW/Msys. Here is my problem. I am attempting to compile an open-source M3u8-segmenter C code for Windows. The open-source examples all deal with linux, but I have successfully compiled the code on my Mac OSX machine without a problem.
In Msys on Windows, the ./configure is successful, but once I do the Make, I get the following error. It appears to related to the signal.h include, but I'm not sure. Any insight would be appreciated.
make[1]: Entering directory `/home/install/m3u8-segmenter-master/tests'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/install/m3u8-segmenter-master/tests'
make[1]: Entering directory `/home/install/m3u8-segmenter-master'
gcc -DPACKAGE_NAME=\"m3u8-segmenter\" -DPACKAGE_TARNAME=\"m3u8-segmenter\" -DPAC
KAGE_VERSION=\"0.3\" -DPACKAGE_STRING=\"m3u8-segmenter\ 0.3\" -DPACKAGE_BUGREPOR
T=\"http://github.com/johnf/m3u8-segmenter/issues\" -DPACKAGE_URL=\"http://m3u8-
segmenter.inodes.org\" -DPACKAGE=\"m3u8-segmenter\" -DVERSION=\"0.3\" -DSTDC_HEA
DERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_
H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -
DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_GETOPT_H=1 -DHAVE
_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_MEMMOVE=1 -DHAVE_MEMSET=1 -DHAVE_STRRCHR=1 -D
HAVE_STRTOL=1 -I. -Ic:/msys/1.0/local/include -g -O2 -Wall -Wextra -Wdeclar
ation-after-statement -Wpointer-arith -funsigned-char -Werror -Wall -Wstrict-pro
totypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wneste
d-externs -Wshadow -Wbad-function-cast -Wwrite-strings -MT m3u8_segmenter-m3u8-
segmenter.o -MD -MP -MF .deps/m3u8_segmenter-m3u8-segmenter.Tpo -c -o m3u8_segme
nter-m3u8-segmenter.o `test -f 'm3u8-segmenter.c' || echo './'`m3u8-segmenter.c
m3u8-segmenter.c: In function 'main':
m3u8-segmenter.c:212:22: error: storage size of 'act' isn't known
m3u8-segmenter.c:413:5: error: implicit declaration of function 'sigaction' [-We
rror=implicit-function-declaration]
m3u8-segmenter.c:413:5: error: nested extern declaration of 'sigaction' [-Werror
=nested-externs]
m3u8-segmenter.c:212:22: error: unused variable 'act' [-Werror=unused-variable]
cc1.exe: all warnings being treated as errors
make[1]: *** [m3u8_segmenter-m3u8-segmenter.o] Error 1
make[1]: Leaving directory `/home/install/m3u8-segmenter-master'
make: *** [all-recursive] Error 1
To emulate UNIX on Windows, Cygwin is more appropriate than MSys/MinGW as pointed by this post

How to build Gotoblas2 on Opensuse 12.2

While building GotoBlas2 on my x86_64 by using the default make file, I encounter the following build error:
gcc -O2 -DEXPRECISION -m128bit-long-double -Wall -m64
-DF_INTERFACE_GFORT -fPIC -DSMP_SERVER -DMAX_CPU_NUMBER=8 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -I.. -w -o linktest linktest.c ../libgoto2_nehalemp-r1.13.so -L/usr/lib64/gcc/x86_64-suse-linux/4.7 -L/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/lib
-L/usr/lib64/gcc/x86_64-suse-linux/4.7/../../.. -l -l -lgfortran -lm -lquadmath -lm -lc && echo OK. /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
cannot find -l-l collect2: error: ld returned 1 exit status make[1]:
* [../libgoto2_nehalemp-r1.13.so] Error 1 make[1]: Leaving directory `/home/ken/bin/build/GotoBLAS2/exports' make: * [shared] Error 2
In an attempt to remedy the problem I searched my package manager for a library to satisfy -l-l, looking for things like libl, liblex, libflex, etc but I can't find anything to satisfy the link.
Any ideas?
To fix this, edit line 298 in f_check to
"print MAKEFILE "FEXTRALIB=$linker_L -lgfortran -lm -lquadmath -lm $linker_a\n";"

Resources