Forum OpenACS Q&A: Re: fail modload libthread

Collapse
3: Re: fail modload libthread (response to 1)
Posted by Tyge Cawthon on

Thank you for the fast response and pointing me into the right direction.

Summary:

ns_install_dir = /usr/local/ns
config variable dir = /usr/local/ns/lib
file = /usr/local/ns/lib/nsConfig.sh

Edit the nsConfig.sh file and changed version_thread from blank to 2.8.9. Re-ran the install-ns.sh. The value for version_thread is still bank.

Looking at the code more closely to understand why the changed variable in the nsConfig.sh are not showing up in the install-ns.sh

I do not want to waste yours or anyone else's time. I will read up on how and where the nsConfig.sh data comes from and how to force the version_thread to be some value.

Thanks again the response.

What I discovered I see the version_thread (Version Tcl thread library) is blank.

install-ns.sh settings
SETTINGS   build_dir              (Build directory)                 /usr/local/src
           ns_install_dir         (Installation directory)          /usr/local/ns
           version_ns             (Version of NaviServer)           4.99.31
           git_branch_ns          (Branch for git checkout of ns)   main
           version_modules        (Version of NaviServer Modules)   4.99.31
           version_tcllib         (Version of Tcllib)               1.20
           version_thread         (Version Tcl thread library)      
           version_xotcl          (Version of NSF/NX/XOTcl)         2.4.0
           version_tcl            (Version of Tcl)                  8.6.16
           version_tdom           (Version of tDOM)                 0.9.5
           ns_user                (NaviServer user)                 nsadmin
           ns_group               (NaviServer group)                nsadmin
                                  (Make command)                    make
                                  (Type command)                    type -p
           ns_modules             (NaviServer Modules)              nsdbpg
           with_mongo             (Add MongoDB client and server)   0
           with_postgres          (Install PostgreSQL DB server)    1
           with_postgres_driver   (Add PostgreSQL driver support)   1
           with_ns_deprecated     (NaviServer with deprecated cmds) 1
           with_system_malloc     (Tcl compiled with system malloc) 0
           with_debug_flags       (Tcl and nsd compiled with debug) 0
           with_ns_doc            (NaviServer documentation)        1

           pg_user                (PostgreSQL user)                 postgres
                                  (PostgreSQL include)              /usr/include/postgresql
                                  (PostgreSQL lib)                  /usr/lib
                                  (PostgreSQL Packages)             postgresql libpq

cat nsConfig.sh

build_dir="/usr/local/src"
ns_install_dir="/usr/local/ns"
version_ns=4.99.31
version_modules=4.99.31
version_tcl=8.6.16
version_tcllib=1.20
version_thread=
version_xotcl=2.4.0
version_tdom=0.9.5
ns_user=nsadmin
pg_user=postgres
ns_group=nsadmin
with_mongo=0
with_postgres=1
with_postgres_driver=1
with_ns_deprecated=1
with_system_malloc=0
pg_incl="/usr/include/postgresql"
pg_lib="/usr/lib"
make="make"
type="type -p"
debian=0
redhat=0
macosx=0
sunos=0
freebsd=0
archlinux=0
alpine=0
wolfi=1

I edited the file nsConfig.sh changed version_thread from blank to 2.8.9 and re-ran the install-ns.sh script, but results are still blank.

ls -ltr `find  /usr/local/ns/lib/thread* -type f`
/usr/local/ns/lib/thread2.8.8/libthread2.8.8.so
/usr/local/ns/lib/thread2.8.8/ttrace.tcl
/usr/local/ns/lib/thread2.8.8/pkgIndex.tcl
/usr/local/ns/lib/thread2.8.9/libthread2.8.9.so
usr/local/ns/lib/thread2.8.9/ttrace.tcl
/usr/local/ns/lib/thread2.8.9/pkgIndex.tcl
/usr/local/ns/lib/thread2.8.10/libthread2.8.10.so
/usr/local/ns/lib/thread2.8.10/ttrace.tcl
/usr/local/ns/lib/thread2.8.10/pkgIndex.tcl
/usr/local/ns/lib/thread3.0.0/libtcl9thread3.0.0.so
/usr/local/ns/lib/thread3.0.0/pkgIndex.tcl
/usr/local/ns/lib/thread2.8.11/libthread2.8.11.so
/usr/local/ns/lib/thread2.8.11/ttrace.tcl
/usr/local/ns/lib/thread2.8.11/pkgIndex.tcl
Collapse
4: Re: fail modload libthread (response to 3)
Posted by Gustaf Neumann on
The value for versionthread is still bank.

The empty value for "version_thread" is intentional. It indicates that install‑ns.sh should automatically select the correct version for your Tcl installation, as different Tcl versions require different thread libraries.

Edit the nsConfig.sh file
I am not aware of any situation, where there is need to edit the file nsConfig.sh

and re-ran the install-ns.sh and version_thread is still blank.

Regarding editing nsConfig.sh: there is generally no need to modify that file. In fact, install‑ns.sh does not read nsConfig.sh at all. If you want to override default settings, you can specify non-default values directly on the command line [1]. For example, you can run:

version_thread=2.8.9 bash install-ns.sh

However, in your case, the issue likely stems from multiple versions of libthread being installed in /usr/local/ns/lib. OpenACS uses alphabetical sorting to pick the newest version, which means that "libthread2.8.9" comes before "libthread2.8.10" or "libthread2.8.11."

Additionally, there appears to be a thread library for Tcl9 in your listing, but Tcl9 requires unreleased versions of NaviServer and OpenACS and involves numerous migration challenges. There is a long list with required migration activities on the Tcl pages, there was as well a talk from Rolf on the last OpenACS/Tcl conferences on his experiences with porting tcllib). My recommendation: don't use it for now.

To resolve the issue, the simplest approach is to remove the extra thread libraries and then rerun install‑ns.sh:

rm -rf  /usr/local/ns/lib/thread*

This should allow install‑ns.sh to detect and use the appropriate thread library version, and OpenACS will pick it up.

All the best
-g
[1] https://github.com/gustafn/install-ns