Hi,
Wanted to try the tokenize.pl package and used pack_install as in the subject on MacOS. The .zip was downloaded but the installation failed. I don’t understand what to do from the error messages below. Any suggestions on how to fix this?
Thank you.
?- pack_install(tokenize).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Install tokenize@1.0.1 from https://github.com/shonfeder/tokenize/archive/v1.0.1.zip Y/n?
ERROR: /private/var/folders/qt/pkj_bbgn65zblkm1m_pn3vk80000gn/T/AppTranslocation/524304D2-B159-4F3E-8EA0-E89CF83206E9/d/SWI-Prolog.app/Contents/swipl/library/archive.pl:96:
ERROR: /private/var/folders/qt/pkj_bbgn65zblkm1m_pn3vk80000gn/T/AppTranslocation/524304D2-B159-4F3E-8EA0-E89CF83206E9/d/SWI-Prolog.app/Contents/swipl/library/archive.pl:96: Initialization goal raised exception:
ERROR: dlopen(/private/var/folders/qt/pkj_bbgn65zblkm1m_pn3vk80000gn/T/AppTranslocation/524304D2-B159-4F3E-8EA0-E89CF83206E9/d/SWI-Prolog.app/Contents/swipl/lib/fat-darwin/archive4pl.so, 0x0001): Library not loaded: '/usr/local/opt/zstd/lib/libzstd.1.dylib'
Referenced from: '/private/var/folders/qt/pkj_bbgn65zblkm1m_pn3vk80000gn/T/AppTranslocation/524304D2-B159-4F3E-8EA0-E89CF83206E9/d/SWI-Prolog.app/Contents/Frameworks/libarchive.13.dylib'
Reason: tried: '/usr/local/opt/zstd/lib/libzstd.1.dylib' (no such file), '/usr/local/lib/libzstd.1.dylib' (no such file), '/usr/lib/libzstd.1.dylib' (no such file)
ERROR: In:
ERROR: [55] throw(error(shared_object(open,'dlopen(/private/var/folders/qt/pkj_bbgn65zblkm1m_pn3vk80000gn/T/AppTranslocation/524304D2-B159-4F3E-8EA0-E89CF83206E9/d/SWI-Prolog.app/Contents/swipl/lib/fat-darwin/archive4pl.so, 0x0001): Library not loaded: \'/usr/local/opt/zstd/lib/libzstd.1.dylib\'\n Referenced from: \'/private/var/folders/qt/pkj_bbgn65zblkm1m_pn3vk80000gn/T/AppTranslocation/524304D2-B159-4F3E-8EA0-E89CF83206E9/d/SWI-Prolog.app/Contents/Frameworks/libarchive.13.dylib\'\n Reason: tried: \'/usr/local/opt/zstd/lib/libzstd.1.dylib\' (no such file), \'/usr/local/lib/libzstd.1.dylib\' (no such file), \'/usr/lib/libzstd.1.dylib\' (no such file)'),context(...,_5510878)))
ERROR: [53] <meta call>
ERR ...
Hm, the error doesn’t look like it has anything to do with the tokenize pack in particular, but that your swipl isn’t able to load libzstd to extract the archive. How did you install SWI? Are you able to install any other packs?
This git versions need git rather than libarchive to unpack. tokenize can be installed fine on the current 8.5.20 release (tested using the bundled app on Monterey running on an M1). That also installes list_util. I don’t know what use_library/1 does, but the system
?- use_module(library(list_util)).
true.
works fine.
8.4.1 is old. 8.4.3 might work (not tested), 9.0, based on 8.5.20 will be released soon.
It was a problem with my mac missing various libraries. The problem resolved after I did a “brew upgrade” and added some missing libraries.
Thanks to everyone for their suggestions.