I want to compile and run HPC Challenge benchmark on my server.
When I want to make hpcc-1.5.0 with mpicc compiler I get this error:
../../../../STREAM/stream.c:178:26: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘a’
static double * restrict a, * restrict b, * restrict c;
^
../../../../STREAM/stream.c: In function ‘checkSTREAMresults’:
../../../../STREAM/stream.c:263:16: error: ‘a’ undeclared (first use in this function)
if (fabs(a[j]/aj-1.0) > epsilon) {
^
../../../../STREAM/stream.c:263:16: note: each undeclared identifier is reported only once for each function it appears in
../../../../STREAM/stream.c:280:16: error: ‘b’ undeclared (first use in this function)
if (fabs(b[j]/bj-1.0) > epsilon) {
^
../../../../STREAM/stream.c:297:16: error: ‘c’ undeclared (first use in this function)
if (fabs(c[j]/cj-1.0) > epsilon) {
^
../../../../STREAM/stream.c: In function ‘computeSTREAMerrors’:
../../../../STREAM/stream.c: In function ‘HPCC_Stream’:
../../../../STREAM/stream.c: In function ‘tuned_STREAM_Copy’:
../../../../STREAM/stream.c: In function ‘tuned_STREAM_Scale’:
../../../../STREAM/stream.c: In function ‘tuned_STREAM_Add’:
../../../../STREAM/stream.c: In function ‘tuned_STREAM_Triad’:
make[1]: *** [../../../../STREAM/stream.o] Error 1
make[1]: Leaving directory `/root/hpcc-1.5.0/hpl/lib/arch/build'
make: *** [all] Error 2
It seems STREAM uses some variables that is not declared.
This is because of using restrict keywords for the array. To compile stream, you have to use -std=c99 option.
Add -std=c99 flag in your Make.$(arch) file in CCFLAGS section. Like this:
CCFLAGS = $(HPL_DEFS) -fomit-frame-pointer -O3 -funroll-loops -std=c99
Source: https://anilmaurya.wordpress.com/2016/04/26/hpc-1-5-0-compile-time-error/
I've some error on this class construction,
cwrapper.h
#include "SimpleCLM.h"
using namespace std;
using namespace cv;
class A{
public:
A();
~A();
met1();
};
void *A_init();
A_m1(void *p);
cwrapper.c
#include "cwrapper.h"
using namespace std;
using namespace cv;
void *A_init()
{
A *p = new A;
return (void *)p;
}
A_m1(void *p)
{
return p->met1();
}
A::met1()
{
return begin();
}
begin is a function in SimpleCLM.h.
Here is the errors on make,
In file included from /home/samuel/Desktop/matlab_cpp/cwrapper.h:1,
from /home/samuel/Desktop/matlab_cpp/cwrapper.c:1:
/home/samuel/Desktop/matlab_cpp/SimpleCLM.h:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘begin’
In file included from /home/samuel/Desktop/matlab_cpp/cwrapper.c:1:
/home/samuel/Desktop/matlab_cpp/cwrapper.h:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
/home/samuel/Desktop/matlab_cpp/cwrapper.h:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
/home/samuel/Desktop/matlab_cpp/cwrapper.h:6: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘A’
/home/samuel/Desktop/matlab_cpp/cwrapper.h:14: warning: data definition has no type or storage class
/home/samuel/Desktop/matlab_cpp/cwrapper.c:3: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
/home/samuel/Desktop/matlab_cpp/cwrapper.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
/home/samuel/Desktop/matlab_cpp/cwrapper.c: In function ‘A_init’:
/home/samuel/Desktop/matlab_cpp/cwrapper.c:8: error: ‘A’ undeclared (first use in this function)
/home/samuel/Desktop/matlab_cpp/cwrapper.c:8: error: (Each undeclared identifier is reported only once
/home/samuel/Desktop/matlab_cpp/cwrapper.c:8: error: for each function it appears in.)
/home/samuel/Desktop/matlab_cpp/cwrapper.c:8: error: ‘p’ undeclared (first use in this function)
/home/samuel/Desktop/matlab_cpp/cwrapper.c:8: error: ‘new’ undeclared (first use in this function)
/home/samuel/Desktop/matlab_cpp/cwrapper.c:8: error: expected ‘;’ before ‘A’
/home/samuel/Desktop/matlab_cpp/cwrapper.c: In function ‘A_m1’:
/home/samuel/Desktop/matlab_cpp/cwrapper.c:14: warning: dereferencing ‘void *’ pointer
/home/samuel/Desktop/matlab_cpp/cwrapper.c:14: error: request for member ‘met1’ in something not a structure or union
/home/samuel/Desktop/matlab_cpp/cwrapper.c: At top level:
/home/samuel/Desktop/matlab_cpp/cwrapper.c:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
make[2]: *** [CMakeFiles/cwrapper.dir/cwrapper.c.o] Error 1
make[1]: *** [CMakeFiles/cwrapper.dir/all] Error 2
make: *** [all] Error 2
It is impossible to create a class in C; you would have to tell the compiler somehow that you want to compile C++.
I'm installing luasocket module for Lua, but I got the following error message:
[root#localhost local]# wget http://files.luaforge.net/releases/luasocket/luasocket/luasocket-2.0.2/luasocket-2.0.2.tar.gz
[root#localhost local]# tar zxvf luasocket-2.0.2.tar.gz
[root#localhost local]# cd luasocket-2.0.2
[root#localhost luasocket-2.0.2]# make && make install
cd src; make all
make[1]: Entering directory `/usr/local/luasocket-2.0.2/src'
gcc -DLUASOCKET_DEBUG -pedantic -Wall -O2 -fpic -c -o luasocket.o luasocket.c
luasocket.c:20:17: error: lua.h: No such file or directory
luasocket.c:21:21: error: lauxlib.h: No such file or directory
luasocket.c:24:24: error: compat-5.1.h: No such file or directory
In file included from luasocket.c:30:
luasocket.h:30: error: expected ‘)’ before ‘*’ token
In file included from luasocket.c:31:
auxiliar.h:37: error: expected ‘)’ before ‘*’ token
auxiliar.h:38: error: expected ‘)’ before ‘*’ token
auxiliar.h:39: error: expected ‘)’ before ‘*’ token
auxiliar.h:40: error: expected ‘)’ before ‘*’ token
auxiliar.h:41: error: expected ‘)’ before ‘*’ token
auxiliar.h:42: error: expected ‘)’ before ‘*’ token
auxiliar.h:43: error: expected ‘)’ before ‘*’ token
auxiliar.h:44: error: expected ‘)’ before ‘*’ token
auxiliar.h:45: error: expected ‘)’ before ‘*’ token
auxiliar.h:46: error: expected ‘)’ before ‘*’ token
In file included from luasocket.c:32:
except.h:33: error: expected ‘)’ before ‘*’ token
In file included from luasocket.c:33:
timeout.h:19: error: expected ‘)’ before ‘*’ token
timeout.h:26: error: expected ‘)’ before ‘*’ token
In file included from luasocket.c:34:
buffer.h:39: error: expected ‘)’ before ‘*’ token
buffer.h:41: error: expected ‘)’ before ‘*’ token
buffer.h:42: error: expected ‘)’ before ‘*’ token
buffer.h:43: error: expected ‘)’ before ‘*’ token
buffer.h:44: error: expected ‘)’ before ‘*’ token
In file included from luasocket.c:35:
inet.h:27: error: expected ‘)’ before ‘*’ token
inet.h:35: error: expected ‘)’ before ‘*’ token
inet.h:36: error: expected ‘)’ before ‘*’ token
In file included from luasocket.c:36:
tcp.h:34: error: expected ‘)’ before ‘*’ token
In file included from luasocket.c:37:
udp.h:31: error: expected ‘)’ before ‘*’ token
In file included from luasocket.c:38:
select.h:15: error: expected ‘)’ before ‘*’ token
luasocket.c:43: error: expected ‘)’ before ‘*’ token
luasocket.c:44: error: expected ‘)’ before ‘*’ token
luasocket.c:45: error: expected ‘)’ before ‘*’ token
luasocket.c:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘mod’
luasocket.c:60: warning: ISO C does not allow extra ‘;’ outside of a function
luasocket.c:62: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘func’
luasocket.c:66: warning: ISO C does not allow extra ‘;’ outside of a function
luasocket.c:71: error: expected ‘)’ before ‘*’ token
luasocket.c:80: error: expected ‘)’ before ‘*’ token
luasocket.c:89: error: expected ‘)’ before ‘*’ token
luasocket.c:113: error: expected ‘)’ before ‘*’ token
make[1]: *** [luasocket.o] Error 1
make[1]: Leaving directory `/usr/local/luasocket-2.0.2/src'
make: *** [all] Error 2
Can anybody help me? thanks in advance :)
You will need to set LUAINC.
Since you didn't specify which OS you are using, I can't give you a
definitive answer what to set it to. On Debian, if you want to build
for Lua5.1, set it to -I/usr/include/lua5.1/
You can set the variable by editing config (which is included from
makefile) or by specifying it on the command line:
$ make LUAINC=-I/usr/include/lua5.1/
The recommended solution did not work for me using Alpine 3.4. In order to make it work in this environment I had to download the package and hack the following.
luasec-luasec-0.6/src/luasocket/usocket.h
/* TODO: ifdef the ALPINE #include <sys/poll.h> */
#include <poll.h>
Then changes to Makefile
# Inform the location to install the modules
LUAPATH ?= /usr/local/share/lua/5.1
LUACPATH ?= /usr/local/lib/lua/5.1
# Edit the lines below to inform new path, if necessary.
# Path below points to internal LuaSocket's help files.
LUAINCDIR = -I/usr/local/api-gateway/luajit/include/luajit-2.1
INC_PATH ?= -I/usr/include
LIB_PATH ?= -L/usr/lib
INCDIR = -I. $(LUAINCDIR) $(INC_PATH) <------ include new path
LIBDIR = -L./luasocket $(LIB_PATH)
Hope this helps if anyone else is stuck with this particular problem.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I was trying to install the Virtual COM drivers from FTDI (http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz) on ubuntu 10.04.
I downloaded the file and tried to compile it. But it shows errors like these:
Can anybody tell me the reason?
I installed the linux kernel development packages
Below is the output of make.
I removed some parts because of the size limitation
sudo make
gcc -Wall -D__KERNEL__ -DMODULE -I/lib/modules/2.6.32-41-generic/build/include -D__SMP__ -DSMP -DMODVERSIONS -include /lib/modules/2.6.32-41-generic/build/include/linux/modversions.h -I/usr/src/linux-2.6.32-41-generic/drivers/usb/serial/ -O -c -o ftdi_sio.o ftdi_sio.c
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/kernel.h:11,
from ftdi_sio.c:251:
/lib/modules/2.6.32-41-generic/build/include/linux/linkage.h:5:25: error: asm/linkage.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/kernel.h:15,
from ftdi_sio.c:251:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:17:24: error: asm/bitops.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/kernel.h:15,
from ftdi_sio.c:251:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h: In function ‘get_bitmask_order’:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:29: warning: implicit declaration of function ‘fls’
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h: In function ‘hweight_long’:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:45: warning: implicit declaration of function ‘hweight32’
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:45: warning: implicit declaration of function ‘hweight64’
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h: In function ‘fls_long’:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:132: warning: implicit declaration of function ‘fls64’
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h: In function ‘__ffs64’:
/lib/modules/2.6.32-41-generic/build/include/linux/bitops.h:147: warning: implicit declaration of function ‘__ffs’
In file included from ftdi_sio.c:251:
/lib/modules/2.6.32-41-generic/build/include/linux/kernel.h:21:21: error: asm/bug.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/preempt.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:50,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:56:29: error: asm/thread_info.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/preempt.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:50,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:65: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:65: warning: its scope is only this definition or declaration, which is probably not what you want
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘set_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:67: warning: implicit declaration of function ‘set_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:67: error: dereferencing pointer to incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:70: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘clear_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:72: warning: implicit declaration of function ‘clear_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:72: error: dereferencing pointer to incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:75: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘test_and_set_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:77: warning: implicit declaration of function ‘test_and_set_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:77: error: dereferencing pointer to incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:80: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘test_and_clear_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:82: warning: implicit declaration of function ‘test_and_clear_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:82: error: dereferencing pointer to incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:85: warning: ‘struct thread_info’ declared inside parameter list
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h: In function ‘test_ti_thread_flag’:
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:87: warning: implicit declaration of function ‘test_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/thread_info.h:87: error: dereferencing pointer to incomplete type
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/list.h:6,
from /lib/modules/2.6.32-41-generic/build/include/linux/preempt.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:50,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/prefetch.h:14:27: error: asm/processor.h: No such file or directory
/lib/modules/2.6.32-41-generic/build/include/linux/prefetch.h:15:23: error: asm/cache.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/preempt.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:50,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/list.h:7:24: error: asm/system.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h: In function ‘smp_mb__after_lock’:
/lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:137: warning: implicit declaration of function ‘smp_mb’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/spinlock.h:321:24: error: asm/atomic.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/wait.h:26:25: error: asm/current.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:15,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h: In function ‘write_seqlock’:
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h:64: warning: implicit declaration of function ‘smp_wmb’
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h: In function ‘read_seqbegin’:
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h:93: warning: implicit declaration of function ‘cpu_relax’
/lib/modules/2.6.32-41-generic/build/include/linux/seqlock.h:96: warning: implicit declaration of function ‘smp_rmb’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/bitmap.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h:95,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:16,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/string.h:21:24: error: asm/string.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:16,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h: In function ‘__first_node’:
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h:239: warning: implicit declaration of function ‘find_first_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h: In function ‘__next_node’:
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h:245: warning: implicit declaration of function ‘find_next_bit’
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h: In function ‘__first_unset_node’:
/lib/modules/2.6.32-41-generic/build/include/linux/nodemask.h:263: warning: implicit declaration of function ‘find_first_zero_bit’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:20:22: error: asm/page.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:353: error: expected specifier-qualifier-list before ‘atomic_long_t’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/notifier.h:13,
from /lib/modules/2.6.32-41-generic/build/include/linux/memory_hotplug.h:6,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:666,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/mutex.h: In function ‘mutex_is_locked’:
/lib/modules/2.6.32-41-generic/build/include/linux/mutex.h:118: warning: implicit declaration of function ‘atomic_read’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/notifier.h:14,
from /lib/modules/2.6.32-41-generic/build/include/linux/memory_hotplug.h:6,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:666,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/rwsem.h:22:65: error: asm/rwsem.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/memory_hotplug.h:6,
from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:666,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/notifier.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/notifier.h:62: error: field ‘rwsem’ has incomplete type
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h: In function ‘populated_zone’:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:699: error: ‘struct zone’ has no member named ‘present_pages’
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h: In function ‘is_normal’:
/lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:748: error: ‘struct zone’ has no member named ‘zone_pgdat’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:7,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/topology.h:34:26: error: asm/topology.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmdebug.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/autoconf.h:991:1: warning: "CONFIG_NR_CPUS" redefined
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/mmzone.h:12,
from /lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:4,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/threads.h:16:1: warning: this is the location of the previous definition
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:12,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h: In function ‘allocflags_to_migratetype’:
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:121: warning: implicit declaration of function ‘WARN_ON’
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h: In function ‘gfp_zone’:
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:219: error: ‘ZONE_DMA’ undeclared (first use in this function)
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:219: error: (Each undeclared identifier is reported only once
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:219: error: for each function it appears in.)
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:219: error: ‘ZONE_HIGHMEM’ undeclared (first use in this function)
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h: In function ‘alloc_pages_node’:
/lib/modules/2.6.32-41-generic/build/include/linux/gfp.h:284: warning: implicit declaration of function ‘cpu_to_node’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/time.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/ktime.h:24,
from /lib/modules/2.6.32-41-generic/build/include/linux/timer.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/math64.h:5:23: error: asm/div64.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/time.h:9,
from /lib/modules/2.6.32-41-generic/build/include/linux/ktime.h:24,
from /lib/modules/2.6.32-41-generic/build/include/linux/timer.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/math64.h: In function ‘div_u64_rem’:
/lib/modules/2.6.32-41-generic/build/include/linux/math64.h:43: warning: implicit declaration of function ‘do_div’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/ktime.h:25,
from /lib/modules/2.6.32-41-generic/build/include/linux/timer.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/timex.h:170:23: error: asm/timex.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/ktime.h:25,
from /lib/modules/2.6.32-41-generic/build/include/linux/timer.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:8,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
/lib/modules/2.6.32-41-generic/build/include/linux/jiffies.h:257:31: error: division by zero in #if
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:11,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:26: error: expected specifier-qualifier-list before ‘atomic_long_t’
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h: In function ‘cancel_delayed_work’:
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:240: error: ‘struct work_struct’ has no member named ‘data’
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h: In function ‘__cancel_delayed_work’:
/lib/modules/2.6.32-41-generic/build/include/linux/workqueue.h:255: error: ‘struct work_struct’ has no member named ‘data’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/kmemtrace.h:12,
from /lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:13,
from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/trace/events/kmem.h: In function ‘trace_kmalloc’:
/lib/modules/2.6.32-41-generic/build/include/trace/events/kmem.h:47: warning: implicit declaration of function ‘smp_read_barrier_depends’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/slab.h:162,
from ftdi_sio.c:254:
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:53: error: expected specifier-qualifier-list before ‘atomic_long_t’
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:142: error: ‘PAGE_SHIFT’ undeclared here (not in a function)
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h: In function ‘kmalloc_large’:
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:232: warning: implicit declaration of function ‘get_order’
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:236: error: ‘PAGE_SIZE’ undeclared (first use in this function)
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h: In function ‘kmalloc’:
/lib/modules/2.6.32-41-generic/build/include/linux/slub_def.h:246: error: ‘PAGE_SIZE’ undeclared (first use in this function)
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/fs.h:369,
from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:9,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/linux/dcache.h: In function ‘dget’:
/lib/modules/2.6.32-41-generic/build/include/linux/dcache.h:336: warning: implicit declaration of function ‘BUG_ON’
/lib/modules/2.6.32-41-generic/build/include/linux/dcache.h:337: warning: implicit declaration of function ‘atomic_inc’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/fs.h:470,
from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:9,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/linux/quota.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/quota.h:384: error: field ‘dqptr_sem’ has incomplete type
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:9,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:748: error: field ‘i_alloc_sem’ has incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:926: error: expected specifier-qualifier-list before ‘atomic_long_t’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:9,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:1337: error: field ‘s_umount’ has incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h: In function ‘file_accessed’:
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:1738: error: ‘struct file’ has no member named ‘f_flags’
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h: In function ‘put_write_access’:
/lib/modules/2.6.32-41-generic/build/include/linux/fs.h:2130: warning: implicit declaration of function ‘atomic_dec’
In file included from /usr/include/asm/termios.h:1,
from /lib/modules/2.6.32-41-generic/build/include/linux/termios.h:5,
from /lib/modules/2.6.32-41-generic/build/include/linux/tty.h:11,
from ftdi_sio.c:255:
/lib/modules/2.6.32-41-generic/build/include/asm-generic/termios.h:51:25: error: asm/uaccess.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/module.h:14,
from ftdi_sio.c:258:
/lib/modules/2.6.32-41-generic/build/include/linux/elf.h:7:21: error: asm/elf.h: No such file or directory
In file included from ftdi_sio.c:258:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:20:23: error: asm/local.h: No such file or directory
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:21:24: error: asm/module.h: No such file or directory
In file included from ftdi_sio.c:258:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:302: error: field ‘arch’ has incomplete type
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:319: error: expected specifier-qualifier-list before ‘Elf_Sym’
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:455: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/lib/modules/2.6.32-41-generic/build/include/linux/module.h: In function ‘__module_get’:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:470: warning: implicit declaration of function ‘local_inc’
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:470: warning: implicit declaration of function ‘__module_ref_addr’
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:472: warning: implicit declaration of function ‘local_read’
In file included from ftdi_sio.c:258:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h: At top level:
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:712: warning: type defaults to ‘int’ in declaration of ‘Elf_Ehdr’
/lib/modules/2.6.32-41-generic/build/include/linux/module.h:712: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/usb.h:14,
from ftdi_sio.c:261:
/lib/modules/2.6.32-41-generic/build/include/linux/delay.h:14:23: error: asm/delay.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/usb.h:14,
from ftdi_sio.c:261:
/lib/modules/2.6.32-41-generic/build/include/linux/delay.h: In function ‘ndelay’:
/lib/modules/2.6.32-41-generic/build/include/linux/delay.h:39: warning: implicit declaration of function ‘udelay’
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/interrupt.h:12,
from /lib/modules/2.6.32-41-generic/build/include/linux/usb.h:15,
from ftdi_sio.c:261:
/lib/modules/2.6.32-41-generic/build/include/linux/hardirq.h:10:25: error: asm/hardirq.h: No such file or directory
In file included from /lib/modules/2.6.32-41-generic/build/include/linux/interrupt.h:13,
from /lib/modules/2.6.32-41-generic/build/include/linux/usb.h:15,
from ftdi_sio.c:261:
/lib/modules/2.6.32-41-generic/build/include/linux/irqflags.h:57:26: error: asm/irqflags.h: No such file or directory
I'm thinking your missing the asm symlink. I didn't go through everything, but a lot of these errors are missing "asm/XXXX.h".
Let's take a look at the first error. Check your include directory in your kernel:
#/usr/src/linux/include> ls
In this directory you should have a "linux" directory, which should contain linkage.h. Opening this we see:
#include <asm/linkage.h>
So it's looking for an "asm" directory in /usr/src/linux/include. Do you have on there? Is it pointing at the correct architecture for your system? Here's the top of my linux/include
mike#linux-4puc:/usr/src/linux/include> ls -l
total 120
drwxr-xr-x 3 root root 4096 Aug 1 10:51 acpi
lrwxrwxrwx 1 root root 47 Aug 1 12:08 asm -> /usr/src/linux-3.1.10-1.16/arch/x86/include/asm
My system didn't originally have this symlink so I had to add it in when I started via:
mike#linux-4puc:/usr/src/linux/include> ln -s /usr/src/linux-3.1.10-1.16/arch/x86/include/asm asm
I want to make m3u8-segmenter for Http Live Stream: https://github.com/johnf/m3u8-segmenter
There are errors when I make, the errors are:
gcc -g -O -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings -Werror m3u8-segmenter.c -o m3u8-segmenter -lavformat -lavcodec -lavutil
m3u8-segmenter.c: In function ‘add_output_stream’:
m3u8-segmenter.c:82:14: error: ‘CODEC_TYPE_AUDIO’ undeclared (first use in this function)
m3u8-segmenter.c:82:14: note: each undeclared identifier is reported only once for each function it appears in
m3u8-segmenter.c:94:14: error: ‘CODEC_TYPE_VIDEO’ undeclared (first use in this function)
m3u8-segmenter.c: In function ‘main’:
m3u8-segmenter.c:338:5: error: ‘av_open_input_file’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1090) [-Werror=deprecated-declarations]
m3u8-segmenter.c:352:5: error: implicit declaration of function ‘guess_format’ [-Werror=implicit-function-declaration]
m3u8-segmenter.c:352:5: error: nested extern declaration of ‘guess_format’ [-Werror=nested-externs]
m3u8-segmenter.c:352:10: error: assignment makes pointer from integer without a cast [-Werror]
m3u8-segmenter.c:371:18: error: ‘CODEC_TYPE_VIDEO’ undeclared (first use in this function)
m3u8-segmenter.c:376:18: error: ‘CODEC_TYPE_AUDIO’ undeclared (first use in this function)
m3u8-segmenter.c:387:5: error: ‘av_set_parameters’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1434) [-Werror=deprecated-declarations]
m3u8-segmenter.c:392:5: error: ‘dump_format’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1559) [-Werror=deprecated-declarations]
m3u8-segmenter.c:406:5: error: ‘url_fopen’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279) [-Werror=deprecated-declarations]
m3u8-segmenter.c:411:5: error: ‘av_write_header’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1492) [-Werror=deprecated-declarations]
m3u8-segmenter.c:444:67: error: ‘PKT_FLAG_KEY’ undeclared (first use in this function)
m3u8-segmenter.c:455:13: error: ‘put_flush_packet’ is deprecated (declared at /usr/local/include/libavformat/avio.h:293) [-Werror=deprecated-declarations]
m3u8-segmenter.c:456:13: error: ‘url_fclose’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280) [-Werror=deprecated-declarations]
m3u8-segmenter.c:476:13: error: ‘url_fopen’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279) [-Werror=deprecated-declarations]
m3u8-segmenter.c:482:13: error: ‘av_write_header’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1492) [-Werror=deprecated-declarations]
m3u8-segmenter.c:514:5: error: ‘url_fclose’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280) [-Werror=deprecated-declarations]
cc1: all warnings being treated as errors
make: *** [all] Error 1
You're getting those errors because for some reason, this block in libav_compat.h took effect:
/* Support older versions of ffmpeg and libav */
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52, 64, 0)
#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
#define AV_PKT_FLAG_KEY PKT_FLAG_KEY
#endif
But whichever headers are supposed to define CODEC_TYPE_AUDIO and CODEC_TYPE_VIDEO don't. From the comment there, it looks like you probably should update your other software (ffmpeg and/or libav) and then try again.