Page 1 of 1

Error compiling apgsearch v5.0

Posted: February 22nd, 2020, 1:01 am
by creeperman7002
I followed the steps in the tutorial for compiling and using apgsearch. When I tried to enter ./recompile.sh, this error popped up:

Code: Select all

$ ./recompile.sh
rm -f *.o */*.o *.op */*.op *.gdca */*.gcda *.profraw *.profdata apgluxe
echo Clean done
Clean done
Skipping updates; use --update to update apgluxe automatically.
Downloading lifelib...
Submodule 'lifelib' (https://gitlab.com/apgoucher/lifelib.git) registered for path 'lifelib'
Cloning into '/home/YouWIllNeverKnow/apgmera/lifelib'...
Submodule path 'lifelib': checked out '3749afe4a8fd293721781a9fd949d14c1dcd0050'
Rule unspecified; assuming b3s23.
Symmetry unspecified; assuming C1.
Configuring rule b3s23; symmetry C1
which: no python3 in (/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/WINDOWS/System32/WindowsPowerShell/v1.0:/cygdrive/c/WINDOWS/System32/OpenSSH:/cygdrive/c/Users/YouWIllNeverKnow/AppData/Local/Microsoft/WindowsApps)
Using  to configure lifelib...
./recompile.sh: line 87: /cygdrive/c/Users/YouWIllNeverKnow/AppData/Local/Microsoft/WindowsApps/python3: Permission denied
Any ideas on how to fix this?

Re: Error compiling apgsearch v5.0

Posted: February 22nd, 2020, 2:09 am
by wildmyron
It looks like you don't have any version of Python installed. When you installed Cygwin did you check which extra packages to install? For apgmera you need git, make, python2 or python3, and gcc-g++. You can install extra packages by running the installer again.

Re: Error compiling apgsearch v5.0

Posted: February 22nd, 2020, 11:27 am
by creeperman7002
wildmyron wrote: February 22nd, 2020, 2:09 am It looks like you don't have any version of Python installed. When you installed Cygwin did you check which extra packages to install? For apgmera you need git, make, python2 or python3, and gcc-g++. You can install extra packages by running the installer again.
When this error popped up, I installed python2, but the error is persisting.

Re: Error compiling apgsearch v5.0

Posted: February 22nd, 2020, 9:47 pm
by wildmyron
I think I know what's happening now: I previously read about this issue and just remembered. What's happening is that Windows has installed two dummy python executables which are used to open the Python installers from the Windows store [1]. The recompile.sh script detects the python3.exe "shim" as an installed python3, but of course the rest of the process fails when it tries to use it. The build process preferentially uses python3 so it never gets to see your actual python2 install.

To resolve this you can either:
- install python3 in Cygwin and make sure it's earlier on the Path than the shim (which it should be),
- follow the advice in this stack overflow post to disable the shims https://stackoverflow.com/a/58773979 , or
- wait for apgoucher to provide a work around in the recompile.sh script


[1] https://devblogs.microsoft.com/python/p ... 19-update/

Re: Error compiling apgsearch v5.0

Posted: February 22nd, 2020, 10:17 pm
by creeperman7002
I tried the 1st option and it worked, but I now have this error:

Code: Select all

g++ -c -Wall -Wextra -pedantic -O3 -pthread -flto -march=native --std=c++11  main.cpp -o main.o
In file included from /usr/include/wchar.h:6:0,
                 from /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/cwchar:44,
                 from /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/bits/postypes.h:40,
                 from /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/iosfwd:40,
                 from /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/ios:38,
                 from /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/ostream:38,
                 from /usr/lib/gcc/x86_64-pc-cygwin/7.4.0/include/c++/iostream:39,
                 from main.cpp:1:
/usr/include/sys/reent.h:14:10: fatal error: stddef.h: No such file or directory
 #include <stddef.h>
          ^~~~~~~~~~
compilation terminated.
make: *** [makefile:81: main.o] Error 1
EDIT: I installed gcc-core (and made sure the version is the same as gcc-g++) and apgsearch works perfectly.

Re: Error compiling apgsearch v5.0

Posted: February 23rd, 2020, 10:58 am
by wildmyron
Sorry, I can't help you with that one. That seems like a pretty standard header, I can't imagine why it would be missing / not found by the compiler.

Searching for that error message led me to https://stackoverflow.com/questions/316 ... 3#32410193
That may be relevant, but if you have a fresh Cygwin install I don't see how you could end up in that state.

Re: Error compiling apgsearch v5.0

Posted: August 8th, 2025, 7:38 pm
by b-engine
I couldn't get recompile.sh to work, even if make and gcc is installed.

Code: Select all

t6970@User:~/apgmera$ ls
LICENCE.txt  immediate.sh  lifelib   makefile     recompile.sh  update-lifelib.sh
README.md    includes      main.cpp  mkparams.py  test
t6970@User:~/apgmera$ sudo ./recompile.sh --rule B2cen3kq4-j568/S14j5-kq6aik78
sh -c 'rm -f apgluxe *.o */*.o *.op */*.op *.gdca */*.gcda *.profraw *.profdata || true'
echo Clean done
Clean done
Ensuring lifelib is up-to-date...
Symmetry unspecified; assuming C1.
Configuring rule B2cen3kq4-j568/S14j5-kq6aik78; symmetry C1
Using /usr/bin/python3 to configure lifelib...
Warning: B2cen3kq4-j568/S14j5-kq6aik78 interpreted as b2cen3kq4-j568s14j5-kq6aik78
Valid symmetry: C1
Success!
g++ -c -Wall -Wextra -pedantic -O3 -pthread -g -march=native -flto --std=c++11  main.cpp -o main.o
make: g++: No such file or directory
make: *** [makefile:83: main.o] Error 127
t6970@User:~/apgmera$ ls
LICENCE.txt  immediate.sh  lifelib   makefile     recompile.sh  update-lifelib.sh
README.md    includes      main.cpp  mkparams.py  test
t6970@User:~/apgmera$
This is the WSL specification:

Code: Select all

t6970@User:~/apgmera$ uname -a
Linux User 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Really glad that I'm using terminal, if apgsearch is in GUI, I would need to screenshot and post them.

EDIT: It works now.

Re: Error compiling apgsearch v5.0

Posted: August 9th, 2025, 10:39 am
by wildmyron
b-engine wrote: August 8th, 2025, 7:38 pm I couldn't get recompile.sh to work, even if make and gcc is installed.

Code: Select all

t6970@User:~/apgmera$ ls
LICENCE.txt  immediate.sh  lifelib   makefile     recompile.sh  update-lifelib.sh
README.md    includes      main.cpp  mkparams.py  test
t6970@User:~/apgmera$ sudo ./recompile.sh --rule B2cen3kq4-j568/S14j5-kq6aik78
sh -c 'rm -f apgluxe *.o */*.o *.op */*.op *.gdca */*.gcda *.profraw *.profdata || true'
echo Clean done
Clean done
Ensuring lifelib is up-to-date...
Symmetry unspecified; assuming C1.
Configuring rule B2cen3kq4-j568/S14j5-kq6aik78; symmetry C1
Using /usr/bin/python3 to configure lifelib...
Warning: B2cen3kq4-j568/S14j5-kq6aik78 interpreted as b2cen3kq4-j568s14j5-kq6aik78
Valid symmetry: C1
Success!
g++ -c -Wall -Wextra -pedantic -O3 -pthread -g -march=native -flto --std=c++11  main.cpp -o main.o
make: g++: No such file or directory
make: *** [makefile:83: main.o] Error 127
t6970@User:~/apgmera$ ls
LICENCE.txt  immediate.sh  lifelib   makefile     recompile.sh  update-lifelib.sh
README.md    includes      main.cpp  mkparams.py  test
t6970@User:~/apgmera$
This is the WSL specification:

Code: Select all

t6970@User:~/apgmera$ uname -a
Linux User 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Really glad that I'm using terminal, if apgsearch is in GUI, I would need to screenshot and post them.
You need more than just make and gcc — g++, for example. Rather than installing all the individual packages you think you need, install the meta-package build-essential which gives you a fairly comprehensive development environment

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
If you had already done that, or already tried to install g++, then it seems something went wrong as g++ is not found. You could try

Code: Select all

sudo apt-get check
to show if there are any broken packages.
If not, then I can't imagine what might be going on.Try rebooting your computer and trying again, perhaps?

If you're not using Ubuntu or some other Debian based system then please say which distribution and version you are using. E.g. share output of:

Code: Select all

lsb_release -a
the output of "uname -a" shows kernel information — which for WSL2 comes from Microsoft