PJOBs won't build with 15.3.0 - DECLARE_JOB: too few arguments

Technical questions regarding the XTC tools and programming with XMOS.
amartelloni
New User
Posts: 2
Joined: Tue Jul 02, 2024 10:37 am

PJOBs won't build with 15.3.0 - DECLARE_JOB: too few arguments

Post by amartelloni »

Hi all,

I'm running into trouble with the latest XTC Tools 15.3.0 release. Whenever I include
<xcore/parallel.h>
in a C/C++ file, with the purpose of running tasks in parallel within the same tile, I run into this error:

Code: Select all

[ 25%] Building CXX object CMakeFiles/i2s-io.dir/src/i2s/i2s.cpp.obj
In file included from /home/virgult/Dev/XMOS/meml_XMOS/src/i2s/i2s.cpp:1:
/home/virgult/Dev/XMOS/meml_XMOS/src/i2s/i2s.hpp:7:5: error: too few arguments provided to function-like macro invocation
    DECLARE_JOB(i2s_task, ());
    ^
/home/virgult/Frameworks/XMOS/XTC/15.3.0/target/include/xcore/parallel.h:124:24: note: expanded from macro 'DECLARE_JOB'
                       _XCORE_PAR_ARG_PACK_PREPARE(_ARG_TYPES_PACK), \
                       ^
/home/virgult/Frameworks/XMOS/XTC/15.3.0/target/include/xcore/_support/xcore_parallel_impl.h:196:45: note: expanded from macro '_XCORE_PAR_ARG_PACK_PREPARE'
#define _XCORE_PAR_ARG_PACK_PREPARE(_PACK) (_XCORE_PAR_ARG_PACK_PREPARE_I _PACK)
                                            ^
/home/virgult/Frameworks/XMOS/XTC/15.3.0/target/include/xcore/_support/xcore_parallel_impl.h:195:44: note: expanded from macro '_XCORE_PAR_ARG_PACK_PREPARE_I'
#define _XCORE_PAR_ARG_PACK_PREPARE_I(...) _XCORE_APPLY(_XCORE_PAR_PACK_ASSIGN_NAME, ## __VA_ARGS__)
                                           ^
/home/virgult/Frameworks/XMOS/XTC/15.3.0/target/include/xcore/_support/xcore_meta_macro.h:72:31: note: expanded from macro '_XCORE_APPLY'
#define _XCORE_APPLY(_F, ...) _XCORE_APPLY_I(_F, _XCORE_SEP_COMMA, ## __VA_ARGS__)
                              ^
/home/virgult/Frameworks/XMOS/XTC/15.3.0/target/include/xcore/_support/xcore_meta_macro.h:71:29: note: expanded from macro '_XCORE_APPLY_I'
#define _XCORE_APPLY_I(...) _XCORE_APPLY_II(__VA_ARGS__)
                            ^
/home/virgult/Frameworks/XMOS/XTC/15.3.0/target/include/xcore/_support/xcore_meta_macro.h:70:95: note: expanded from macro '_XCORE_APPLY_II'
#define _XCORE_APPLY_II(_F, _SEP, ...) _XCORE_APPLICATOR(__VA_ARGS__)(_F, _SEP, ## __VA_ARGS__)
                                                                                              ^
/home/virgult/Frameworks/XMOS/XTC/15.3.0/target/include/xcore/_support/xcore_meta_macro.h:25:9: note: macro '_XCORE_APPLY01' defined here
#define _XCORE_APPLY01(_F, _SEP, _A0, ...) _F(_A0)                   _XCORE_APPLY00(_F, _SEP, ## __VA_ARGS__)
        ^
1 error generated.
make[2]: *** [CMakeFiles/i2s-io.dir/build.make:90: CMakeFiles/i2s-io.dir/src/i2s/i2s.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/i2s-io.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
The job is declared (hopefully correctly?) as:

Code: Select all

#ifndef __I2S_HPP__
#define __I2S_HPP__

extern "C" {
    #include <xcore/parallel.h>

    DECLARE_JOB(i2s_task, ());
}


#endif  // __I2S_HPP__
...in a header that I then include in the file implementing the main task for that tile.

Building with XTC 15.2.1 gets rid of the problem! But I lose all the functionality that I need with 15.3.0 (e.g. better xgdb, included cmake).

I raised a ticket on the XMOS official website with the issue, but haven't got any feedback yet. Would anyone be able to reproduce the issue? Many things (including examples in xcore_iot) won't build with 15.3.0 for me, due to this error. Any pointer much appreciated. Thanks!