Exported procedure socket:tcp_connect/2 is not defined

Odd. Do the tests run fine? Please run

 ctest -j $(nproc)

Also, what do you get from the built-in test:

swipl
?- check_installation.

Old installations should not bother the process. Variables such as LD_LIBRARY_PATH and SWI_HOME_DIR can cause problems. Cmake checks for this and issues a warning.

Note that you may have problems if you compile the new version to be installed at the same place as the old one and you install the new one “over” the old one. In that case, remove the old one. You find it using swipl --home and simply remove it using rm -r <dir>. So, in a one liner using this command. I’d first run swipl --home to verify you are not removing something else!!

 rm -r $(swipl --home)

You normally get a warning about deleting the read-only file boot.prc. Just confirm.