Skip to content

Fix RTAI build: M_PI_2 undeclared#11

Merged
rodw-au merged 1 commit intorodw-au:state-tags-arcsfrom
grandixximo:fix-rtai-mpi2
May 3, 2026
Merged

Fix RTAI build: M_PI_2 undeclared#11
rodw-au merged 1 commit intorodw-au:state-tags-arcsfrom
grandixximo:fix-rtai-mpi2

Conversation

@grandixximo
Copy link
Copy Markdown

LinuxCNC PR LinuxCNC#3995's RTAI job fails:

src/emc/motion/control.c:2283:60: error: 'M_PI_2' undeclared (first use in this function); did you mean 'M_PI_2l'?

M_PI_2 is a glibc/_GNU_SOURCE extension that is not exposed by RTAI's rtapi_math.h. M_PI is available in both, so replace M_PI_2 with M_PI / 2.0 in the two G2/G3 heading lines.

Test plan

  • Local uspace build clean.
  • CI RTAI job (verifies on push).

M_PI_2 is a glibc extension and is not exposed by RTAI's rtapi_math.h,
so the RTAI build fails with 'M_PI_2 undeclared' at control.c:2283.
M_PI is available in both, so use M_PI/2.0 instead.
Copy link
Copy Markdown
Owner

@rodw-au rodw-au left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should work we already use M_PI in interp_convert.

@rodw-au rodw-au merged commit de27899 into rodw-au:state-tags-arcs May 3, 2026
14 checks passed
@grandixximo grandixximo deleted the fix-rtai-mpi2 branch May 4, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants