Error in testing SMP mode for pc386 and amd64 (and other bsps)

Facing Issue in RTEMS_SMP mode for solving and testing

Setting value of RTEMS_SMP doesnt seem to work as intended.
the parameter gets detected as unknown configuration option in the
./waf configure and on building using ./waf the bsp builds but the smp tests dont get created for the bsps.
Tried testing this on main and on my seperate branch.

Attached Output of ./waf configure and the config file used for testing

[DEFAULT]
RTEMS_POSIX_API = True
BUILD_TESTS = True
RTEMS_SMP = True

[i386/pc386]
[x86_64/amd64]

I tried your config.ini with rtems 6 and I did not get your error:

cd rtems
git co origin/6
./waf configure --prefix=${some_path} --rtems-tools=/opt/rtems/6/bin

Did you see smptests being created?

Can you run this on rtems 7?

Won’t the smptests require BUILD_SMPTESTS = True in you config.ini?

See for example ./waf bspdefaults --rtems-bsps=x86_64/amd64

This is still for RTEMS 6:

$ ls build/x86_64/amd64/testsuites/smptests
smp01		   smpfatal09.exe	   smpschededf01
smp01.exe	   smpipi01		   smpschededf01.exe
smp02		   smpipi01.exe		   smpschededf02
smp02.exe	   smpirqs01		   smpschededf02.exe
smp03		   smpirqs01.exe	   smpschededf03
smp03.exe	   smpload01		   smpschededf03.exe
smp05		   smpload01.exe	   smpschededf04
smp05.exe	   smplock01		   smpschededf04.exe
smp07		   smplock01.exe	   smpschedsem01
smp07.exe	   smpmigration01	   smpschedsem01.exe
smp08		   smpmigration01.exe	   smpscheduler01
smp08.exe	   smpmigration02	   smpscheduler01.exe
smp09		   smpmigration02.exe	   smpscheduler02
smp09.exe	   smpmrsp01		   smpscheduler02.exe
smpaffinity01	   smpmrsp01.exe	   smpscheduler03
smpaffinity01.exe  smpmulticast01	   smpscheduler03.exe
smpatomic01	   smpmulticast01.exe	   smpscheduler04
smpatomic01.exe    smpmutex01		   smpscheduler04.exe
smpcache01	   smpmutex01.exe	   smpscheduler05
smpcache01.exe	   smpmutex02		   smpscheduler05.exe
smpcapture01	   smpmutex02.exe	   smpscheduler06
smpcapture01.exe   smpopenmp01		   smpscheduler06.exe
smpcapture02	   smpopenmp01.exe	   smpscheduler07
smpcapture02.exe   smppsxaffinity01	   smpscheduler07.exe
smpclock01	   smppsxaffinity01.exe    smpsignal01
smpclock01.exe	   smppsxaffinity02	   smpsignal01.exe
smpfatal01	   smppsxaffinity02.exe    smpstart01
smpfatal01.exe	   smppsxmutex01	   smpstart01.exe
smpfatal02	   smppsxmutex01.exe	   smpstrongapa01
smpfatal02.exe	   smppsxsignal01	   smpstrongapa01.exe
smpfatal03	   smppsxsignal01.exe	   smpswitchextension01
smpfatal03.exe	   smpschedaffinity01	   smpswitchextension01.exe
smpfatal04	   smpschedaffinity01.exe  smpthreadlife01
smpfatal04.exe	   smpschedaffinity02	   smpthreadlife01.exe
smpfatal05	   smpschedaffinity02.exe  smpthreadpin01
smpfatal05.exe	   smpschedaffinity03	   smpthreadpin01.exe
smpfatal06	   smpschedaffinity03.exe  smpunsupported01
smpfatal06.exe	   smpschedaffinity04	   smpunsupported01.exe
smpfatal08	   smpschedaffinity04.exe  smpwakeafter01
smpfatal08.exe	   smpschedaffinity05	   smpwakeafter01.exe
smpfatal09	   smpschedaffinity05.exe

You confirmed for the x86,
SMP Tests are created for my rtems 7 build too,

The problem lies with the pc386 specifically since for that the smptests are not being created along with the unknown configuration option displayed when using ./waf configure

At least for RTEMS 6 the SMP tests are also present for i386/pc386:

frank_k@kuehndel-nb-lin /home/EB/frank_k/src/rtems -→ ls build/i386/pc386/testsuites/smptests/
smp01		   smpfatal09.exe	   smpschededf01
smp01.exe	   smpipi01		   smpschededf01.exe
smp02		   smpipi01.exe		   smpschededf02
smp02.exe	   smpirqs01		   smpschededf02.exe
smp03		   smpirqs01.exe	   smpschededf03
smp03.exe	   smpload01		   smpschededf03.exe
smp05		   smpload01.exe	   smpschededf04
smp05.exe	   smplock01		   smpschededf04.exe
smp07		   smplock01.exe	   smpschedsem01
smp07.exe	   smpmigration01	   smpschedsem01.exe
smp08		   smpmigration01.exe	   smpscheduler01
smp08.exe	   smpmigration02	   smpscheduler01.exe
smp09		   smpmigration02.exe	   smpscheduler02
smp09.exe	   smpmrsp01		   smpscheduler02.exe
smpaffinity01	   smpmrsp01.exe	   smpscheduler03
smpaffinity01.exe  smpmulticast01	   smpscheduler03.exe
smpatomic01	   smpmulticast01.exe	   smpscheduler04
smpatomic01.exe    smpmutex01		   smpscheduler04.exe
smpcache01	   smpmutex01.exe	   smpscheduler05
smpcache01.exe	   smpmutex02		   smpscheduler05.exe
smpcapture01	   smpmutex02.exe	   smpscheduler06
smpcapture01.exe   smpopenmp01		   smpscheduler06.exe
smpcapture02	   smpopenmp01.exe	   smpscheduler07
smpcapture02.exe   smppsxaffinity01	   smpscheduler07.exe
smpclock01	   smppsxaffinity01.exe    smpsignal01
smpclock01.exe	   smppsxaffinity02	   smpsignal01.exe
smpfatal01	   smppsxaffinity02.exe    smpstart01
smpfatal01.exe	   smppsxmutex01	   smpstart01.exe
smpfatal02	   smppsxmutex01.exe	   smpstrongapa01
smpfatal02.exe	   smppsxsignal01	   smpstrongapa01.exe
smpfatal03	   smppsxsignal01.exe	   smpswitchextension01
smpfatal03.exe	   smpschedaffinity01	   smpswitchextension01.exe
smpfatal04	   smpschedaffinity01.exe  smpthreadlife01
smpfatal04.exe	   smpschedaffinity02	   smpthreadlife01.exe
smpfatal05	   smpschedaffinity02.exe  smpthreadpin01
smpfatal05.exe	   smpschedaffinity03	   smpthreadpin01.exe
smpfatal06	   smpschedaffinity03.exe  smpunsupported01
smpfatal06.exe	   smpschedaffinity04	   smpunsupported01.exe
smpfatal08	   smpschedaffinity04.exe  smpwakeafter01
smpfatal08.exe	   smpschedaffinity05	   smpwakeafter01.exe
smpfatal09	   smpschedaffinity05.exe

You are right. In RTEMS 7 RTEMS_SMP is missing from i386/pc386 (it is present for x86_64/amd64 and it is present in RTEMS 6):

cd rtems
git co main
./waf bspdefaults --rtems-bsps=i386/pc386 | fgrep RTEMS_SMP

Hm, the support was removed by commit 925405f3adf6e87c01c53a93c5ee16a8267eed06. See file spec/build/cpukit/optsmp.yml.

I think you should use the target i386/pc686 instead of i386/pc386. SMP support is present for the 686 target:

./waf bspdefaults --rtems-bsps=i386/pc686 | fgrep RTEMS_SMP

Sorry, I do not understand this question.

@gedare @frank_k
For the MR, smp tests are created for amd64 thats fine.
For the pc386 or pc686 (as of now), smptests were being created but architecturally this board is not smp based, rtems7 introduced spec based build so if the bsp is not smp based then waf gives error below.

What is the right course of action here?

The first issue, I think, this is just a misunderstanding.

Symmetric Multiprocessing (SMP) makes uses of several cores of a microprocessor. Consequently, enabling SMP makes only sense when a processor has several cores. If you do not enable RTEMS SMP for a multi-core processor then only one core is used while the other cores never run any code.

A pc368 denotes an Intel CPU from 1980s - the first 32 bit Intel processor, single core (the notion of multi-core systems did not even exists). These where used in the classical MS-DOS PC of that time (without graphical “Windows” user interface if I remember right). Therefore, RTEMS_SMP does not make any sense for pc386. That it was supported in RTEMS 6 is simply a mistake or bug.

A pc686 denotes a modern Intel multi-core CPU. If you sitting in front of a Laptop or PC with Intel or AMD CPU, that is a pc686. Here, RTEMS_SMP makes sense.

I do not know what you are up to, but if you do not use an extreme old PC/processor pc386 is probably not the BSP you want to use.

The linking error your are getting is a different issue. It should not happen.

The linker tries to link two similar or even identical files together:

  • testsuites/smptests/smpfatal08/init.c.713 and
  • testsuites/smptests/smpfatal08/init.c.76

I do not know how this can happen. One of them should not exist and not being part of the linking process. This is most likely a local bug in you worktree. Try to remove the build folder in the rtems repo and re-run ./waf configure [...] and then ./waf. If you have installed rtems before (./waf install) the you may even need to get rid of the installed rtems to avoid it gets part of the linking.