Open ARCJ137442 opened 1 month ago
Thank you! This PR is a good fit for the Portability branch: https://github.com/opennars/OpenNARS-for-Applications/tree/portability This branch is better suitable as it does not depend on POSIX and Windows support for POSIX is fluctuating / non-stable. Does evaluation.py lead to the correct / same results as on a Linux or UNIX OS?
It is good that it does not need Cygwin but only MinGW now. Maybe it can be called build_mingw.cmd and be added to the portability branch?
It is good that it does not need Cygwin but only MinGW now. Maybe it can be called build_mingw.cmd and be added to the portability branch?
I agree.
This script was originally written by me to test ONA in Windows 11 with MinGW,
and The PR submission left out a prerequisite: to remove NetworkNAR
/ UDPNAR
references (presumably because there is no socket.h
in Windows) in order for GCC to compile successfully on Windows.
In this case, the script may still be incomplete, so instead of putting it in the master
branch, it might be better to put it in portability
branch first (because it's needed to modify the source code to work)
Does evaluation.py lead to the correct / same results as on a Linux or UNIX OS?
This .cmd
script is primarily for Windows and I have not tested it on other Linux/UNIX systems yet.
However, I tried to run the script misc\Python\NAR.py
, and when the executable file (.exe
) path in def spawnNAR()
is correct, it will run and interact normally.
This script was originally written by me to test ONA in Windows 11 with MinGW, and The PR submission left out a prerequisite: to remove
NetworkNAR
/UDPNAR
references (presumably because there is nosocket.h
in Windows) in order for GCC to compile successfully on Windows.
For example, if you compile directly with build.cmd
in the master
branch, the following results might happen:
In file included from [...]\src\NetworkNAR\UDPNAR.h:35,
from [...]\src\NetworkNAR\UDPNAR.c:25:
[...]\src\NetworkNAR\UDP.h:38:10: fatal error: sys/socket.h: No such file or directory
38 | #include <sys/socket.h>
| ^~~~~~~~~~~~~~
compilation terminated.
I agree. Portability branch has no NetworkNAR, so this issue would resolve itself there and could simplify the compilation script potentially (to remove any POSIX reference at least)
Feature
Translated shell script
build.cmd
for WindowsNAR.exe
NoWarn
to fit the platform environments-Wno-implicit-function-declaration -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast
-Wno-dollar-in-identifier-extension
Environment of testing
.\NAR.exe
Previews
Compilation on Terminal
CMD & PowerShell:
Runtime