glipari / ptask

Periodic Real-Time Task interface facility to pthreads

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

errore nella compilazione

fabriziodiblasi opened this issue · comments

Riscontro questa serie di errori durante la compilazione:

Scanning dependencies of target ptask
[ 1%] Building C object src/CMakeFiles/ptask.dir/pbarrier.c.o
[ 3%] Building C object src/CMakeFiles/ptask.dir/pmutex.c.o
[ 5%] Building C object src/CMakeFiles/ptask.dir/ptask.c.o
[ 6%] Building C object src/CMakeFiles/ptask.dir/ptime.c.o
[ 8%] Building C object src/CMakeFiles/ptask.dir/rtmode.c.o
[ 10%] Building C object src/CMakeFiles/ptask.dir/tstat.c.o
[ 11%] Building C object src/CMakeFiles/ptask.dir/libdl.c.o
[ 13%] Building C object src/CMakeFiles/ptask.dir/dle_timer.c.o
[ 15%] Building C object src/CMakeFiles/ptask.dir/calibrate.c.o
[ 16%] Linking C static library libptask.a
[ 16%] Built target ptask
Scanning dependencies of target pbarr_example
[ 18%] Building C object examples/CMakeFiles/pbarr_example.dir/pbarr_example.c.o
[ 20%] Linking C executable pbarr_example
[ 20%] Built target pbarr_example
Scanning dependencies of target modes
[ 22%] Building C object examples/CMakeFiles/modes.dir/modes.c.o
[ 23%] Linking C executable modes
[ 23%] Built target modes
Scanning dependencies of target deadline_exception
[ 25%] Building C object examples/CMakeFiles/deadline_exception.dir/deadline_exception.c.o
[ 27%] Linking C executable deadline_exception
[ 27%] Built target deadline_exception
Scanning dependencies of target pcp
[ 28%] Building C object examples/CMakeFiles/pcp.dir/pcp.c.o
In file included from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:8:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:24:20: error: conflicting types for ‘fadd’
__MATHCALL_NARROW (__MATHCALL_NAME (add), __MATHCALL_REDIR_NAME (add), 2);
^~~~~~~~~~~~~~~
In file included from /usr/local/include/allegro/base.h:41,
from /usr/local/include/allegro.h:25,
from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:7:
/usr/local/include/allegro/alcompat.h:44:7: note: previous definition of ‘fadd’ was here
AL_ALIAS(fixed fadd(fixed x, fixed y), fixadd(x, y))
^~~~~~~~
In file included from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:8:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:27:20: error: conflicting types for ‘fdiv’
__MATHCALL_NARROW (__MATHCALL_NAME (div), __MATHCALL_REDIR_NAME (div), 2);
^~~~~~~~~~~~~~~
In file included from /usr/local/include/allegro/base.h:41,
from /usr/local/include/allegro.h:25,
from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:7:
/usr/local/include/allegro/alcompat.h:47:7: note: previous definition of ‘fdiv’ was here
AL_ALIAS(fixed fdiv(fixed x, fixed y), fixdiv(x, y))
^~~~~~~~
In file included from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:8:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:30:20: error: conflicting types for ‘fmul’
__MATHCALL_NARROW (__MATHCALL_NAME (mul), __MATHCALL_REDIR_NAME (mul), 2);
^~~~~~~~~~~~~~~
In file included from /usr/local/include/allegro/base.h:41,
from /usr/local/include/allegro.h:25,
from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:7:
/usr/local/include/allegro/alcompat.h:46:7: note: previous definition of ‘fmul’ was here
AL_ALIAS(fixed fmul(fixed x, fixed y), fixmul(x, y))
^~~~~~~~
In file included from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:8:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:33:20: error: conflicting types for ‘fsub’
__MATHCALL_NARROW (__MATHCALL_NAME (sub), __MATHCALL_REDIR_NAME (sub), 2);
^~~~~~~~~~~~~~~
In file included from /usr/local/include/allegro/base.h:41,
from /usr/local/include/allegro.h:25,
from /home/fabrizio/Documenti/ptask-master/examples/pcp.c:7:
/usr/local/include/allegro/alcompat.h:45:7: note: previous definition of ‘fsub’ was here
AL_ALIAS(fixed fsub(fixed x, fixed y), fixsub(x, y))
^~~~~~~~
make[2]: *** [examples/CMakeFiles/pcp.dir/build.make:63: examples/CMakeFiles/pcp.dir/pcp.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:273: examples/CMakeFiles/pcp.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Quale versione della libreria allegro è installata nel sistema? Gli esempi sono compatibili con la versione 4 e non con la 5.

Credo si tratti proprio di un problema legato ad allegro. Sembra (ma non ho il modo di testarlo) che utilizzi le include di allegro 4 con la libreria allegro 5, o viceversa, per cui i prototipi delle funzioni non collimano.

Provi a disinstallare tutte le versioni di allegro, ed ad installare con apt-get solo la liballegro4-dev.

La libreria ptask non dipende da Allegro, solo alcuni esempi ne hanno bisogno. Una soluzione temporanea è di disabilitare la compilazione di tali esempi, commentandoli nel corrispondente file CMakeList.txt

Ok, quindi chiudo questa issue. Potrebbe per fare fare una pull request per correggere il bug?
Per quanto riguarda le istruzioni per linkare la libreria, la invito a scrivermi su giuseppe punto lipari at univ-lille punto fr con una lista degli errori.