I’m struggling to upgrade swipl 9.2.9 to 10.0.2 on FreeBSD 14.3. After a successful build and installation of the package, when I try to run swipl via CLI only (without GUI or X, which is how I normally use swipl).
# swipl
FATAL: could not find SWI-Prolog home
Tried source: environment $SWI_HOME_DIR or $SWIPL
Found /usr/local/lib/swipl/bin/amd64-freebsd/swipl: no such directory
Tried source: using “swipl.home” from “/usr/local/lib/swipl/bin/amd64-freebsd/swipl”
Found /usr/local/lib/swipl: no ABI file
Tried source: compiled in
Found /usr/local/lib/swipl: no ABI file
I’ve reduced swipl as much as possible but still obtain the original FATAL messages. I have: CMAKE_ARGS= -DSWIPL_PACKAGES_PYTHON=OFF -DSWIPL_PACKAGES_GUI=OFF -DSWIPL_PACKAGES_TIPC=OFF -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF -DUSE_GMP=OFF -DMULTI_THREADED=ON -DSWIPL_PACKAGES_ODBC=OFF -DCURSES_NEED_NCURSES=OFF -DCURSES_NEED_WIDE=OFF CMAKE_ARGS+= -DINSTALL_DOCUMENTATION=OFF -DBUILD_TESTING=OFF
After reviewing
the build installation notes for Debian, Redhat, Arch and “other systems”
Please disregard my earlier PR, as the solution was to:
swipl --abi-version > /usr/local/lib/swipl/ABI
The hints were in
Tried source: environment $SWI_HOME_DIR or $SWIPL Found /usr/local/lib/swipl: no ABI file Tried source: using “swipl.home” from “/usr/local/lib/swipl/bin/amd64-freebsd/swipl” Found /usr/local/lib/swipl: no ABI file Tried source: compiled in Found /usr/local/lib/swipl: no ABI file
Once the ABI file is created in the correct location, swipl starts correctly without needing to set any environment variables. So for those that come across a similar problem, at least for the FreeBSD package the necessary files are boot.prc and the new ABI file in /usr/local/lib/swipl.
I needed to refer to an earlier version of swipl to find what it thinks is the home, via
Finding the home has not changed AFAIK, except there is a verbose mode . Also, whether some dir is the home used to be simply checking for boot.prc, but now we check the ABI file to see whether the Prolog system and the home are compatible. This saves a lot of trouble we used to have where a new swipl found an old home, after which pretty much anything between completely functioning and an immediate hard crash could follow. Notably the “almost works” could be nasty to diagnose
Thanks Jan. Yes, you’re right the home didn’t change. I didn’t fully understand the message as I was sidetracked changing the environment files SWI_HOME_DIR and SWIPL. The only step that mattered was creating the ABI file, could be worth mentioning in the building page . I was also pleased to find that the ABI number only relied upon swipl information and not any operating system attributes (other than arch), as well.
But, that is simply created as part of the standard ninja install step, no? I guess you needed to supply a list of files for the package manager and missed to add this one?
Thank-you Jan. Yes, I can confirm that the ABI is created during the build process. Because I’m preceding the FreeBSD package, I didn’t find anything about this file in the usual build instructions. I’ll be sure to pass on my notes. I appreciate your patience
PS For any FreeBSD folk that find this note, its in both