PX4 Build Issue - Nuttx Config Mismatch

Hi Folks,
I’m new to PX4. I tried to build the software. But I’m encountering error which is as follows:
– Found PythonInterp: /usr/bin/python3 (found version “3.8.10”)
– Using C++11
– Release build type: MinSizeRel
RegularExpression::compile(): Nested *?+.
RegularExpression::compile(): Error in compile.
CMake Error at platforms/nuttx/CMakeLists.txt:63 (if):
if given arguments:

"NOT" "/home/sbasu/WS/AP/C++-PX4-Autopilot/PX4-Autopilot/boards/px4/fmu-v5/nuttx-config" "MATCHES" "/home/sbasu/WS/AP/C++-PX4-Autopilot/PX4-Autopilot/boards/px4/fmu-v5/nuttx-config"

Regular expression “/home/sbasu/WS/AP/C+±PX4-Autopilot/PX4-Autopilot/boards/px4/fmu-v5/nuttx-config”
cannot compile

I have tried the following commands:
[$] git clone https://github.com/PX4/PX4-Autopilot.git --recursive
[$] bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
[$] git submodule sync --recursive && git submodule update --init --recursive
[$] make distclean
[$] make px4_fmu-v5_default

I have tried on Ubuntu and on Fedora. Same issue.
Thanks in advance.

I’m puzzled. I have never seen this.

Could it be because you have ++ in your path C+±PX4-Autopilot ?

Dear Mr. Julian,
Thanks a lot for your reply.
Since, I’m working with several flight controllers such as betaflight, which is C based, I named the directories as C-betaflight and C+±PX4-Autopilot. It is NOT REALLY plus-minus. Anyway, after your suggestion, I changed the directory name as CPP-PX4-Autopilot.
And that error is gone but the build failed.
These error messages were seen:
as: unrecognized option ‘–64’
make[1]: *** [Makefile.host:203: incdir] Error 1
/bin/sh: 1: /home/sbasu/WS/AP/CPP-PX4-Autopilot/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/tools/incdir: not found
/bin/sh: 1: /home/sbasu/WS/AP/CPP-PX4-Autopilot/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/tools/incdir: not found
as: unrecognized option ‘–64’
make[2]: *** [Makefile.host:203: incdir] Error 1
as: unrecognized option ‘–64’
make[2]: *** [Makefile.host:203: incdir] Error 1
[17/1260] Generating …/…/…/…/platforms/nuttx/NuttX/nuttx/tools/jlink-nuttx.so
FAILED: …/…/platforms/nuttx/NuttX/nuttx/tools/jlink-nuttx.so
cd /home/sbasu/WS/AP/CPP-PX4-Autopilot/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/tools && make --no-print-directory --silent -f Makefile.host jlink-nuttx
as: unrecognized option ‘–64’
make[1]: *** [Makefile.host:231: jlink-nuttx.so] Error 1
[21/1260] Generating …/…/…/platforms/nuttx/NuttX/nuttx/.config
as: unrecognized option ‘–64’
make[1]: *** [Makefile.host:203: incdir] Error 1
/bin/sh: 1: /home/sbasu/WS/AP/CPP-PX4-Autopilot/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/tools/incdir: not found
/bin/sh: 1: /home/sbasu/WS/AP/CPP-PX4-Autopilot/PX4-Autopilot/platforms/nuttx/NuttX/nuttx/tools/incdir: not found
as: unrecognized option ‘–64’
make[2]: *** [Makefile.host:203: incdir] Error 1
as: unrecognized option ‘–64’
make[2]: *** [Makefile.host:203: incdir] Error 1
[22/1260] Generating uORB topic ucdr headers
ninja: build stopped: subcommand failed.
make: *** [Makefile:227: px4_fmu-v5_default] Error 1

Could this be a toolchain issue. I’m using gcc-arm-none-eabi-9-2020-q2-update which got installed in my /opt when I ran [$] bash ./PX4-Autopilot/Tools/setup/ubuntu.sh

I did
[$] which as
/opt/gcc-arm-none-eabi-9-2020-q2-update/arm-none-eabi/bin/as

[$] whereis as
as: /usr/bin/as /opt/gcc-arm-none-eabi-9-2020-q2-update/arm-none-eabi/bin/as /usr/share/man/man1/as.1.gz

Therefore, it seems that “as” of GCC is used first while arm’s “as” comes second in the order. But this shouldn’t have happened.

In .bashrc, I have set the PATH variable as follows:
export PATH=“/opt/gcc-arm-none-eabi-9-2020-q2-update/bin:/opt/gcc-arm-none-eabi-9-2020-q2-update/arm-none-eabi/bin:$PATH”

So, how do I alter the order of [$] whereis as

Best Regards.

I could build it successfully.

Thanks a lot Mr. Julian.

Great, so how did you fix it? I missed it…