2021-10-14

tcl-lmdb v0.4.2

 

檔案放置網頁

tcl-lmdb - Tcl interface to the Lightning Memory-Mapped Database

About

This is the Lightning Memory-Mapped Database (LMDB) extension for Tcl using the Tcl Extension Architecture (TEA).

LMDB is a Btree-based database management library with an API similar to BerkeleyDB. The library is thread-aware and supports concurrent read/write access from multiple processes and threads. The DB structure is multi-versioned, and data pages use a copy-on-write strategy, which also provides resistance to corruption and eliminates the need for any recovery procedures. The database is exposed in a memory map, requiring no page cache layer of its own. This extension provides an easy to use interface for accessing LMDB database files from Tcl.

Main Change

  1. Update LMDB source code.
  2. generic/tclmdb.c: Improve code to create list


這一樣也是一個 checkpoint 版本,只是建立 tag 追蹤從上一個版本以來的變化。tcl-lmdb 有一個小變動,更改了幾個 Tcl_NewListObj 的部份,設定 List 的數目,其它的沒有變動。

tcl-opencv v0.11

tcl-opencv

 

第一次 tag 的時候發現 ::cv::readOpticalFlow and ::cv::writeOpticalFlow 可以在 OpenCV 3.x  使用,但是需要 contrib module optflow(OpenCV 4.0 才移進 video module),所以沒有編譯 optflow module 的 3.x 版會編譯失敗。可是這是別人提供的 patch,我似乎最好不要直接 mark 掉,所以我移掉 0.11 的 tag,更新文件提醒有這件事以後,才又再 re-tag 一次。

因為這個問題,我在 OpenSUSE build service 上的 OpenSUSE LEAP 15.2 需要將  science/openSUSE_Leap_15.2 repository 放在第一位(這樣就會使用 OpenCV 4.5.x,而不是 3.3.x)才行,所以我也更新了 RPM spec,直接設定 OpenCV 版本 >= 4.5。

如果不是自己編譯,那麼 Linux distribution 的套件怎麼選擇 contrib module  是個問題,很明顯的 Linux distribution 間會有不同的選法,這對於我來說是個大問題(簡單的說就是 Debian/Ubuntu 可以編譯過的,OpenSUSE 不一定可以,反之亦然)。最簡單的做法就是進入 main module 才考慮加入套件的 command。

2021-10-04

PLplot, Tcl and openSUSE

我不知道在其它平台的情況怎麼樣,但是有趣的地方在於,如果我自己從 source code build 以後安裝,問題反而小一點。

首先是使用 zypper 安裝:

sudo zypper in plplot-common plplot-tcltk-devel plplot-driver-cairo plplot-driver-svg

從安裝檔案可以發現,pkgIndex.tcl 在 /usr/share/plplot5.15.0 (ps. 版本號要看安裝的版本而定),所以要讓 Tcl shell 可以正確找到的話,需要在 .tclshrc 或者是執行 tclsh 後加入下面的命令:

lappend auto_path /usr/share/plplot5.15.0

可能是因為設定的關係,pkgIndex.tcl 的目錄搜尋設定是錯的,下面是修正的設定:

    if {![string compare -length $bLen $buildDir $pkgIndexDir]} then {
        set searchdirs [list "/home/abuild/rpmbuild/BUILD/plplot-5.15.0/build/bindings/tcl"]
    } else {
        set searchdirs [list "/usr/lib64"]
    }
    if {![string compare -length $bLen $buildDir $pkgIndexDir]} then {
        set searchdirs [list "/home/abuild/rpmbuild/BUILD/plplot-5.15.0/build/drivers"]
    } else {
        set searchdirs [list "/usr/lib64/plplot5.15.0/drivers"]
    }
    if {![string compare -length $bLen $buildDir $pkgIndexDir]} then {
        set searchdirs [list "/home/abuild/rpmbuild/BUILD/plplot-5.15.0/build/drivers"]
    } else {
        set searchdirs [list "/usr/lib64/plplot5.15.0/drivers"]
    }

 

如果使用 tclsh ,還需要:

package require Pltcl

 

但是設定完上列的項目,在 pltcl 執行 plinit 初始化仍然會有下面的錯誤訊息:

plInitDispatchTable: Could not open drivers directory, aborting operation

或者是 tclsh 沒有選擇列表的情況下有下列的訊息:

Enter device number or keyword:

這表示 PLplot 找不到 driver 的位置(但是其實你已經安裝了)。 一個解法是設定 PLPLOT_DRV_DIR,例如下面的設定:

export PLPLOT_DRV_DIR=/usr/lib64/plplot5.15.0/drivers