Setting up zint on a mac with macOS Montery Version 12.3.1
Hi All I have been struggling today trying to setup and use the Barcode module zint in ConTeXt and failed. I have followed the instructions on the wiki ( https://wiki.contextgarden.net/Barcodes ) but with some changes as follows. Which maybe why I failed. 1) I downloaded Zint using Homebrew since I'm using macOS, and installed it according to the instructions. 2) Since I'm using LMTX I looked for the file libzint.dylib and found it in /opt/homebrew/Cellar/zint/2.10.0/lib . This is different from the path given on the wiki. The directory contained three files, two of which were aliases, libzint.2.10.dylib and libzint.dylib, and an exe file libzint.2.10.0.0.dylib 3) I created the path $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint and copied libzint.2.10.0.0.dylib into but replaced dylib with 'so' as suggested on the wiki instructions. So I basically added lib/luametatex/zint to texmf-osx-64/bin . 4) I ran mtxrun --generate to update the database. 5) I ran the MWE below but no barcode appeared. The console output shows: /modules > using user prefixed file 'libs-imp-zint'/ // /modules > 'zint' is loaded/ however further down the output it gives: /optional > unable to locate library 'libzint'/ // I have tried renaming libzint2.10.0.0.so to libzint.so, but still no barcode. Is their something I am missing? Tips or hints appreciated. Best Wishes Keith McKay %%%%%%%%%%%%%% MWE %%%%%%%% \usemodule[zint] \starttext \barcode[alternative=isbn,text=9783865419026,width=4cm] \barcode[alternative=isbnx, text=9783865419026, width=4cm] \barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, width=3cm] \stoptext
On my macOS High Sierra your MWE works fine. Although I remember that I didn't use Homebrew, but had to build zint manually.
From log:
optional > using library '/Users/monty/context/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so' Here it is enough that libzint.so be a link: libzint.so -> /usr/local/lib/libzint.2.10.0.0.dylib Delete the texmf-cache and run ./mtxrun --generate again, once you've made this link (or copied libzint.2.10.0.0.dylib to $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex /zint/libzint.so) [image: image.png] Greetings, L. Montgomery PD.- Does zint-qt work well? El dom, 10 abr 2022 a las 8:49, Keith McKay via ntg-context (< ntg-context@ntg.nl>) escribió:
Hi All
I have been struggling today trying to setup and use the Barcode module zint in ConTeXt and failed. I have followed the instructions on the wiki ( https://wiki.contextgarden.net/Barcodes ) but with some changes as follows. Which maybe why I failed.
1) I downloaded Zint using Homebrew since I'm using macOS, and installed it according to the instructions.
2) Since I'm using LMTX I looked for the file libzint.dylib and found it in /opt/homebrew/Cellar/zint/2.10.0/lib . This is different from the path given on the wiki. The directory contained three files, two of which were aliases, libzint.2.10.dylib and libzint.dylib, and an exe file libzint.2.10.0.0.dylib
3) I created the path $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint and copied libzint.2.10.0.0.dylib into but replaced dylib with 'so' as suggested on the wiki instructions. So I basically added lib/luametatex/zint to texmf-osx-64/bin .
4) I ran mtxrun --generate to update the database.
5) I ran the MWE below but no barcode appeared. The console output shows:
*modules > using user prefixed file 'libs-imp-zint'*
*modules > 'zint' is loaded*
however further down the output it gives:
*optional > unable to locate library 'libzint'*
I have tried renaming libzint2.10.0.0.so to libzint.so, but still no barcode. Is their something I am missing? Tips or hints appreciated.
Best Wishes
Keith McKay
%%%%%%%%%%%%%% MWE %%%%%%%%
\usemodule[zint]
\starttext
\barcode[alternative=isbn,text=9783865419026,width=4cm]
\barcode[alternative=isbnx, text=9783865419026, width=4cm]
\barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, width=3cm]
\stoptext
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
Hi Keith,
On 10 Apr 2022, at 14:49, Keith McKay via ntg-context
wrote: Hi All
I have been struggling today trying to setup and use the Barcode module zint in ConTeXt and failed. I have followed the instructions on the wiki ( https://wiki.contextgarden.net/Barcodes ) but with some changes as follows. Which maybe why I failed.
1) I downloaded Zint using Homebrew since I'm using macOS, and installed it according to the instructions.
2) Since I'm using LMTX I looked for the file libzint.dylib and found it in /opt/homebrew/Cellar/zint/2.10.0/lib . This is different from the path given on the wiki. The directory contained three files, two of which were aliases, libzint.2.10.dylib and libzint.dylib, and an exe file libzint.2.10.0.0.dylib
You have Hombrew installed in a non-standard location. Mine is in /usr/local/Cellar with the executables linked into /usr/local/bin. But, assuming other Homebrew commands work when run from Terminal then you might still be okay.
3) I created the path $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint and copied libzint.2.10.0.0.dylib into but replaced dylib with 'so' as suggested on the wiki instructions. So I basically added lib/luametatex/zint to texmf-osx-64/bin .
"Yes" to creating the path but "no" to copying. Create a symbolic link instead. So, in Terminal: $ cd $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint # In my case I used the following: $ ln -s /usr/local/Cellar/zint/2.10.0/lib/libzint.dylib libzint.so # For you with Homebrew in a different location, try: $ ln -s /opt/homebrew/Cellar/zint/2.10.0/lib/libzint.dylib libzint.so Then steps 4 and 5 as below. I ran the MWE below: the ISBN worked, the ISBNX didn't, the QR code did. This is on Monterey.
4) I ran mtxrun --generate to update the database.
5) I ran the MWE below but no barcode appeared. The console output shows:
modules > using user prefixed file 'libs-imp-zint' modules > 'zint' is loaded
however further down the output it gives:
optional > unable to locate library 'libzint'
I have tried renaming libzint2.10.0.0.so to libzint.so, but still no barcode. Is their something I am missing? Tips or hints appreciated. Best Wishes Keith McKay
%%%%%%%%%%%%%% MWE %%%%%%%% \usemodule[zint] \starttext \barcode[alternative=isbn,text=9783865419026,width=4cm] \barcode[alternative=isbnx, text=9783865419026, width=4cm] \barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, width=3cm] \stoptext
— Bruce Horrocks Hampshire, UK
Hi All I created the symbolic link as suggested by Bruce and Luis and still got the error message optional > unable to locate library 'libzint' in my text editor. I use TeXworks. However, I thought I would try running from the Terminal app and it worked. It found libzint and output the pdf with both barcodes and the qrcode. I have no idea why it works in the Terminal and not TexWorks, I'm guessing I have a path issue which I need to investigate. Notes 1) My machine is a mac-mini-M1 with macos Monterey and I'm running the latest ConTeXt version 2) Bruce noted that my Homebrew was installed in a non-standard location so I checked on the Hombrew website and it is installed in opt/homebrew for Apple Silicon i.e the M1 chip. Maybe Bruce's homebrew was installed on an earlier version. Thanks to Luis and Bruce for their suggestions. Best Wishes Keith McKay On 10/04/2022 22:26, Bruce Horrocks wrote:
Hi Keith,
On 10 Apr 2022, at 14:49, Keith McKay via ntg-context
wrote: Hi All
I have been struggling today trying to setup and use the Barcode module zint in ConTeXt and failed. I have followed the instructions on the wiki (https://wiki.contextgarden.net/Barcodes ) but with some changes as follows. Which maybe why I failed.
1) I downloaded Zint using Homebrew since I'm using macOS, and installed it according to the instructions.
2) Since I'm using LMTX I looked for the file libzint.dylib and found it in /opt/homebrew/Cellar/zint/2.10.0/lib . This is different from the path given on the wiki. The directory contained three files, two of which were aliases, libzint.2.10.dylib and libzint.dylib, and an exe file libzint.2.10.0.0.dylib You have Hombrew installed in a non-standard location. Mine is in /usr/local/Cellar with the executables linked into /usr/local/bin.
But, assuming other Homebrew commands work when run from Terminal then you might still be okay.
3) I created the path $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint and copied libzint.2.10.0.0.dylib into but replaced dylib with 'so' as suggested on the wiki instructions. So I basically added lib/luametatex/zint to texmf-osx-64/bin . "Yes" to creating the path but "no" to copying. Create a symbolic link instead.
So, in Terminal:
$ cd $TEXROOT/tex/texmf-osx-64/bin/lib/luametatex/zint
# In my case I used the following: $ ln -s /usr/local/Cellar/zint/2.10.0/lib/libzint.dylib libzint.so
# For you with Homebrew in a different location, try: $ ln -s /opt/homebrew/Cellar/zint/2.10.0/lib/libzint.dylib libzint.so
Then steps 4 and 5 as below. I ran the MWE below: the ISBN worked, the ISBNX didn't, the QR code did. This is on Monterey.
4) I ran mtxrun --generate to update the database.
5) I ran the MWE below but no barcode appeared. The console output shows:
modules > using user prefixed file 'libs-imp-zint' modules > 'zint' is loaded
however further down the output it gives:
optional > unable to locate library 'libzint'
I have tried renaming libzint2.10.0.0.so to libzint.so, but still no barcode. Is their something I am missing? Tips or hints appreciated. Best Wishes Keith McKay
%%%%%%%%%%%%%% MWE %%%%%%%% \usemodule[zint] \starttext \barcode[alternative=isbn,text=9783865419026,width=4cm] \barcode[alternative=isbnx, text=9783865419026, width=4cm] \barcode[alternative=qrcode, text={https://wiki.contextgarden.net}, width=3cm] \stoptext — Bruce Horrocks Hampshire, UK
On 12 Apr 2022, at 21:04, Keith McKay
wrote: Hi All I created the symbolic link as suggested by Bruce and Luis and still got the error message
optional > unable to locate library 'libzint'
in my text editor. I use TeXworks. However, I thought I would try running from the Terminal app and it worked. It found libzint and output the pdf with both barcodes and the qrcode. I have no idea why it works in the Terminal and not TexWorks, I'm guessing I have a path issue which I need to investigate.
Could be a path issue - or some other environment variable. This link should help you decide what needs to go where: https://unix.stackexchange.com/questions/71253/what-should-shouldnt-go-in-zs...
Notes 1) My machine is a mac-mini-M1 with macos Monterey and I'm running the latest ConTeXt version 2) Bruce noted that my Homebrew was installed in a non-standard location so I checked on the Hombrew website and it is installed in opt/homebrew for Apple Silicon i.e the M1 chip. Maybe Bruce's homebrew was installed on an earlier version.
Ah, I'm on an Intel Mac which still uses the old approach. Apologies for the red herring.
Thanks to Luis and Bruce for their suggestions. Best Wishes Keith McKay
— Bruce Horrocks Hampshire, UK
Hi! I have issues to get this to work With latest LMTX installed on my Monterey intel MacBook Air and Zint version 2.11 This appears in my log entry … optional > using library '/Users/janneman/CTX/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so' zint > something went wrong: invalid result vector zint > something went wrong: invalid result vector zint > something went wrong: invalid result vector …
13 apr. 2022 kl. 00:47 skrev Bruce Horrocks via ntg-context
: On 12 Apr 2022, at 21:04, Keith McKay
wrote: Hi All I created the symbolic link as suggested by Bruce and Luis and still got the error message
optional > unable to locate library 'libzint'
in my text editor. I use TeXworks. However, I thought I would try running from the Terminal app and it worked. It found libzint and output the pdf with both barcodes and the qrcode. I have no idea why it works in the Terminal and not TexWorks, I'm guessing I have a path issue which I need to investigate.
Could be a path issue - or some other environment variable. This link should help you decide what needs to go where: https://unix.stackexchange.com/questions/71253/what-should-shouldnt-go-in-zs...
Notes 1) My machine is a mac-mini-M1 with macos Monterey and I'm running the latest ConTeXt version 2) Bruce noted that my Homebrew was installed in a non-standard location so I checked on the Hombrew website and it is installed in opt/homebrew for Apple Silicon i.e the M1 chip. Maybe Bruce's homebrew was installed on an earlier version.
Ah, I'm on an Intel Mac which still uses the old approach. Apologies for the red herring.
Thanks to Luis and Bruce for their suggestions. Best Wishes Keith McKay
— Bruce Horrocks Hampshire, UK
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
I've seen this error with zinc compiled from source in github, not with v. 2.10.0 (sourceforge). Later I will try the latest v. 2.11.0. Cheers, L. Montgomery El lun., 30 de mayo de 2022 13:19, Jan-Erik Hägglöf via ntg-context < ntg-context@ntg.nl> escribió:
Hi!
I have issues to get this to work
With latest LMTX installed on my Monterey intel MacBook Air and Zint version 2.11
This appears in my log entry
… optional > using library '/Users/janneman/CTX/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so' zint > something went wrong: invalid result vector zint > something went wrong: invalid result vector zint > something went wrong: invalid result vector …
13 apr. 2022 kl. 00:47 skrev Bruce Horrocks via ntg-context < ntg-context@ntg.nl>:
On 12 Apr 2022, at 21:04, Keith McKay
wrote: Hi All I created the symbolic link as suggested by Bruce and Luis and still got the error message
optional > unable to locate library 'libzint'
in my text editor. I use TeXworks. However, I thought I would try running from the Terminal app and it worked. It found libzint and output the pdf with both barcodes and the qrcode. I have no idea why it works in the Terminal and not TexWorks, I'm guessing I have a path issue which I need to investigate.
Could be a path issue - or some other environment variable. This link should help you decide what needs to go where: < https://unix.stackexchange.com/questions/71253/what-should-shouldnt-go-in-zs...
Notes 1) My machine is a mac-mini-M1 with macos Monterey and I'm running the latest ConTeXt version 2) Bruce noted that my Homebrew was installed in a non-standard location so I checked on the Hombrew website and it is installed in opt/homebrew for Apple Silicon i.e the M1 chip. Maybe Bruce's homebrew was installed on an earlier version.
Ah, I'm on an Intel Mac which still uses the old approach. Apologies for the red herring.
Thanks to Luis and Bruce for their suggestions. Best Wishes Keith McKay
— Bruce Horrocks Hampshire, UK
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
On Mon May 30, 2022 at 8:19 PM CEST, Jan-Erik Hägglöf via ntg-context wrote:
With latest LMTX installed on my Monterey intel MacBook Air and Zint version 2.11
optional > using library '/Users/janneman/CTX/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so' zint > something went wrong: invalid result vector zint > something went wrong: invalid result vector zint > something went wrong: invalid result vector …
Luametatex is still built against zint 2.10, which is on the binary level incompatible with 2.11, so you should try 2.10 in the meantime. Ultimately there are three possibilities for the long run: 1) Everyone sticks with 2.10 (which may be problematic since binaries for this "old" version may gradually cease to be available). 2) Hans updates luametatex to zint 2.11, which would mean that a lot of people would need to update their zint installations now (and possibly in the future for every update). This is what was done last time with the update to 2.10. 3) luametatex gains compatibility with 2.10 *and* 2.11. Not sure what is the best way to proceed, since 3) is the messiest implementation wise, but nicest for the users. Michal Vlasák PS: Previously I also suggested option 4: The optional libraries for selected platforms would be built on the context garden and available for download (perhaps incorporated into the not yet existing module manager?). Building the some of the small libraries is easy, but for the advanced ones one would have to also build transitive dependencies and this gets out of hand quickly with e.g. curl (and in this case the returns are diminishing - curl AFAIK is so stable, that such breakage like with zint shouldn't ever happen). For what it's worth, this is my repository which allows building some of the simple libs on Linux (with the possibility to cross compile to Windows). It will probably also work on Mac. The versions of the libraries are pinned e.g. zint is locked to 2.10, so at least that should work, but I didn't follow closely updates to others in luametatex. https://github.com/vlasakm/context-optional-libraries
On Tue, 31 May 2022, Michal Vlasák via ntg-context wrote:
On Mon May 30, 2022 at 8:19 PM CEST, Jan-Erik Hägglöf via ntg-context wrote:
With latest LMTX installed on my Monterey intel MacBook Air and Zint version 2.11
optional > using library '/Users/janneman/CTX/tex/texmf-osx-64/bin/lib/luametatex/zint/libzint.so' zint > something went wrong: invalid result vector zint > something went wrong: invalid result vector zint > something went wrong: invalid result vector …
Luametatex is still built against zint 2.10, which is on the binary level incompatible with 2.11, so you should try 2.10 in the meantime.
Ultimately there are three possibilities for the long run:
1) Everyone sticks with 2.10 (which may be problematic since binaries for this "old" version may gradually cease to be available).
2) Hans updates luametatex to zint 2.11, which would mean that a lot of people would need to update their zint installations now (and possibly in the future for every update). This is what was done last time with the update to 2.10.
3) luametatex gains compatibility with 2.10 *and* 2.11.
Not sure what is the best way to proceed, since 3) is the messiest implementation wise, but nicest for the users.
Another option is to call the binary via the filter module. Here is an example which uses the `barcode` binary. It should be easy to adapt this to call `zint`. https://github.com/adityam/filter/blob/dev/tests/13-filtersetup.tex The filter module caches the result, so the overhead of calling a binary instead of a library will be negligible. Aditya
participants (6)
-
Aditya Mahajan
-
Bruce Horrocks
-
Jan-Erik Hägglöf
-
Keith McKay
-
Luis Montgomery
-
Michal Vlasák