Skip to content

"braces around scalar initializer" compilation error #225

@m8pple

Description

@m8pple

Compilation fails due to extra braces:

# > /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/src/vars_128.cpp:17:67: error: braces around scalar initializer for type 'float'
# > const global_props_t GraphProperties OS_ATTRIBUTE_UNUSED= {{0.001}};
# > ^

Orchestrator version is dt10_development_branch at 6e2198f - code gen is the same as 1.0.0-alpha head.

Source file is https://github.com/POETSII/Orchestrator/blob/6e2198fd599a983f3f5efeaab67906e2d679469a/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml

The source line that is going wrong is:

#include "vars_128.h"
const global_props_t GraphProperties OS_ATTRIBUTE_UNUSED= {{0.001}};
OS_PRAGMA_UNUSED(GraphProperties)

The declaration of global_props_t is:

typedef struct amg_properties_t 
{
// Line 5
float residualTol;

} global_props_t;

This extra braces problem occurs with initialisers in many cases, and is one of the most common
compilation problems I see so far.

I couldn't see any other issues mentioning it, though only searched for the error message components.


dt10@joxer:/mnt/e/dt10_all/POETS/Orchestrator$ Tests/ReferenceXML/test_compile.sh 
TAP version 13

#Validation of /mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml Failed.
# > Relative xml path = /mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml
# > Absolute xml path = /mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml
# > spawn ./orchestrate.sh
# > [WARN] Launcher: Not running on a POETS box, and found no motherships running on alternative machines, so we're not spawning any mothership processes.
POETS>load /app = "/mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml"
# > 14:55:13.01:  20(I) The microlog for the command 'load /engine = "../Config/POETSHardwareOneBox.ocfg"' will be written to '../Output/Microlog/Microlog_2021_05_28T14_55_13p0.plog'.
# > POETS>Msg: linear_problem = '// Line 31
# > float x;
# > float b;
# > '
# > Msg: linear_solution = '// Line 37
# > float x;
# > float r;
# > int32_t i;
# > '
# > Msg: jacobi_exchange = '// Line 42
# > float x;
# > uint32_t tag;
# > '
# > Msg: fine_to_coarse = '// Line 47
# > float b;
# > float max_r;
# > '
# > Msg: coarse_to_fine = '// Line 52
# > float x;
# > float max_r;
# > '
# > Msg: done = '// Line 55
# > // CFrag /mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml.Graphs.GraphType.MessageTypes.MessageType.Message empty
# > '
# > POETS> 14:55:13.04: 140(I) Topology loaded from file ||../Config/POETSHardwareOneBox.ocfg||.
# > POETS> 14:55:13.04:  23(I) load /app = "/mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml"
# > POETS> 14:55:13.04:  20(I) The microlog for the command 'load /app = "/mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml"' will be written to '../Output/Microlog/Microlog_2021_05_28T14_55_13p1.plog'.
# > POETS> 14:55:13.04: 235(I) Application file /mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml loading...
# > POETS> 14:55:13.04:  65(I) Application file /mnt/e/dt10_all/POETS/Orchestrator/Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml loaded in 46 ms.
tlink /app = *
# > POETS> 14:55:13.06:  23(I) tlink /app = *
# > POETS> 14:55:13.06:  20(I) The microlog for the command 'tlink /app = *' will be written to '../Output/Microlog/Microlog_2021_05_28T14_55_13p2.plog'.
# > POETS>place /tfill = *
# > POETS> 14:55:13.06:  23(I) place /tfill = *
# > POETS> 14:55:13.06:  20(I) The microlog for the command 'place /tfill = *' will be written to '../Output/Microlog/Microlog_2021_05_28T14_55_13p3.plog'.
# > POETS> 14:55:13.06: 309(I) Attempting to place graph instance 'amg_poisson_8x8' using the 'tfil' method...
# > POETS> 14:55:13.06: 302(I) Graph instance 'amg_poisson_8x8' placed successfully.
POETS>compose /app = *
POETS> 14:55:14.09:  23(I) compose /app = *
# > POETS> 14:55:14.09:  20(I) The microlog for the command 'compose /app = *' will be written to '../Output/Microlog/Microlog_2021_05_28T14_55_13p4.plog'.
# > POETS> 14:55:14.09: 803(I) Composing graph instance 'amg_poisson_8x8'...
# > POETS> 14:55:14.09: 806(W) Graph instance 'amg_poisson_8x8' compose failed. Check the microlog for details.
POETS>Timeout or unexpected outcome while composing app.
# plog is in ../Output/Microlog/Microlog_2021_05_28T14_55_13p4.plog

# > ========================================================================================================================
# > 28/05/2021 14:55:13.06 file ../Output/Microlog/Microlog_2021_05_28T14_55_13p4.plog
# > command [compose /app = *]
# > from console
# > ========================================================================================================================
# > 
# > 
# > Composing amg_poisson_8x8...
# > Generating Supervisor...    Done!
# > Generating code for 5 cores
# > Core 0: Files... Source...
# > RTS Buffer for thread 0 expanded from 2 to 10
# > 
# > Core 32: Files... Source...
# > Core 64: Files... Source...
# > Core 96: Files... Source...
# > Core 128: Files... Source...
# > RTS Buffer for thread 0 expanded from 1 to 10
# > 
# > Make called with make -j$(nproc --ignore=4) all SOFTSWITCH_TRIVIAL_LOG_HANDLER=1 SOFTSWITCH_LOGLEVEL=2 > make_errs.txt 2>&1
# > Compilation failed! make_errs.txt dump ++++++++++++++++++++++++++++++++++++++++
# > 
# > riscv32-unknown-elf-g++ -mabi=ilp32 -march=rv32imf -static -mcmodel=medany -fvisibility=hidden -nostartfiles -pipe -fsingle-precision-constant -fno-builtin-printf -ffp-contract=off -std=c++14 -Wall -O2  -DTRIVIAL_LOG_HANDLER -DP_LOG_LEVEL=2 -I /mnt/e/dt10_all/POETS/Orchestrator/Tinsel/include -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/inc -I /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/inc -I/mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated -I /mnt/e/dt10_all/POETS/Orchestrator/Generics -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Common -Wall -c -o softswitch.o /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/src/softswitch.cpp
# > riscv32-unknown-elf-g++ -mabi=ilp32 -march=rv32imf -static -mcmodel=medany -fvisibility=hidden -nostartfiles -pipe -fsingle-precision-constant -fno-builtin-printf -ffp-contract=off -std=c++14 -Wall -O2  -DTRIVIAL_LOG_HANDLER -DP_LOG_LEVEL=2 -I /mnt/e/dt10_all/POETS/Orchestrator/Tinsel/include -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/inc -I /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/inc -I/mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated -I /mnt/e/dt10_all/POETS/Orchestrator/Generics -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Common -Wall -c -o vars_128_0.o /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/src/vars_128_0.cpp
# > riscv32-unknown-elf-g++ -mabi=ilp32 -march=rv32imf -static -mcmodel=medany -fvisibility=hidden -nostartfiles -pipe -fsingle-precision-constant -fno-builtin-printf -ffp-contract=off -std=c++14 -Wall -O2  -DTRIVIAL_LOG_HANDLER -DP_LOG_LEVEL=2 -I /mnt/e/dt10_all/POETS/Orchestrator/Tinsel/include -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/inc -I /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/inc -I/mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated -I /mnt/e/dt10_all/POETS/Orchestrator/Generics -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Common -Wall -c -o io.o /mnt/e/dt10_all/POETS/Orchestrator/Tinsel/lib/io.c
# > riscv32-unknown-elf-gcc -mabi=ilp32 -march=rv32imf -static -mcmodel=medany -fvisibility=hidden -nostartfiles -pipe -fsingle-precision-constant -fno-builtin-printf -ffp-contract=off -std=c++14 -Wall -O2  -DTRIVIAL_LOG_HANDLER -DP_LOG_LEVEL=2 -I /mnt/e/dt10_all/POETS/Orchestrator/Tinsel/include -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/inc -I /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/inc -I/mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated -I /mnt/e/dt10_all/POETS/Orchestrator/Generics -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Common -Wall -c -o entry.o /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/inc/entry.S
# > riscv32-unknown-elf-g++ -mabi=ilp32 -march=rv32imf -static -mcmodel=medany -fvisibility=hidden -nostartfiles -pipe -fsingle-precision-constant -fno-builtin-printf -ffp-contract=off -std=c++14 -Wall -O2  -DTRIVIAL_LOG_HANDLER -DP_LOG_LEVEL=2 -I /mnt/e/dt10_all/POETS/Orchestrator/Tinsel/include -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/inc -I /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/inc -I/mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated -I /mnt/e/dt10_all/POETS/Orchestrator/Generics -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Common -Wall -c -o softswitch_main.o /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/src/softswitch_main.cpp
# > riscv32-unknown-elf-g++ -mabi=ilp32 -march=rv32imf -static -mcmodel=medany -fvisibility=hidden -nostartfiles -pipe -fsingle-precision-constant -fno-builtin-printf -ffp-contract=off -std=c++14 -Wall -O2  -DTRIVIAL_LOG_HANDLER -DP_LOG_LEVEL=2 -I /mnt/e/dt10_all/POETS/Orchestrator/Tinsel/include -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/inc -I /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/inc -I/mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated -I /mnt/e/dt10_all/POETS/Orchestrator/Generics -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Common -Wall -c -o softswitch_common.o /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/src/softswitch_common.cpp
# > /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/src/vars_128_0.cpp:33:59: error: braces around scalar initializer for type 'uint32_t' {aka 'long unsigned int'}
# > devtyp_exit_props_t Thread_0_DeviceProperties[1] = {{{64}}};
# > ^
# > /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/src/vars_128_0.cpp:35:53: error: braces around scalar initializer for type 'uint32_t' {aka 'long unsigned int'}
# > devtyp_exit_state_t Thread_0_DeviceState[1] = {{{0}}};
# > ^
# > riscv32-unknown-elf-g++ -mabi=ilp32 -march=rv32imf -static -mcmodel=medany -fvisibility=hidden -nostartfiles -pipe -fsingle-precision-constant -fno-builtin-printf -ffp-contract=off -std=c++14 -Wall -O2  -DTRIVIAL_LOG_HANDLER -DP_LOG_LEVEL=2 -I /mnt/e/dt10_all/POETS/Orchestrator/Tinsel/include -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Softswitch/inc -I /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/inc -I/mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated -I /mnt/e/dt10_all/POETS/Orchestrator/Generics -I /mnt/e/dt10_all/POETS/Orchestrator/Source/Common -Wall -c -o vars_128.o /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/src/vars_128.cpp
# > Makefile:186: recipe for target 'vars_128_0.o' failed
# > make: *** [vars_128_0.o] Error 1
# > make: *** Waiting for unfinished jobs....
# > /mnt/e/dt10_all/POETS/Orchestrator/Output/Composer/amg_poisson_8x8__amg_poisson_8x8/Generated/src/vars_128.cpp:17:67: error: braces around scalar initializer for type 'float'
# > const global_props_t GraphProperties OS_ATTRIBUTE_UNUSED= {{0.001}};
# > ^
# > Makefile:189: recipe for target 'vars_128.o' failed
# > make: *** [vars_128.o] Error 1
# > rm softswitch_main.o softswitch_common.o
# > 
# > Compilation failed! make_errs.txt dump ----------------------------------------
not ok 0 - Compile Tests/ReferenceXML/v4/PEP20/apps/amg_poisson_8_8_v4.xml
dt10@joxer:/mnt/e/dt10_all/POETS/Orchestrator$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    composerIssues related to the ComposerxmlXML convergence issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions