Are there instructions for how to build from source when a package is not in the repository?

Are there instructions for how to install items not in the Official or AUR respositories? I don’t know the proper terms for it.

I’d like to install Critcl, Tcllib 2.0, and Tcl 9.0; none of which appear to be in a repository. I found some instructions from these sources but am not sure how to start. Some build commands are given but I’m not sure in what folder to place the sources. (This link recommends usr/local/src because it won’t get over-written by the package manager.)

I’m pretty sure that:

  1. Critcl has to be installed first before Tcllib 2.0 because it requires it for tcllibc.
  2. Tcl 9.0 has to be installed before Tcllib 2.0 because it must be compiled for either Tcl 8 or 9.

I have Tcl 8.6 and Tcllib 1.21. What should happen to them if I get these installed? Should they be gone or should they still be usable versions?

I’d also like to learn how to compile a version of SQLite from its Fossil branch (with the desired flags) and test my applications using it while they’re still testing that version before releasing it. That is, without losing the current installed release.

Could you please point me to where I can learn that Manjaro part of this? Thank you.

critcl-git is available in the AUR. I just successfully installed it on my mini-PC:

[2025-03-09T11:04:22+1100] [ALPM] transaction started
[2025-03-09T11:04:22+1100] [ALPM] installed tcllib (2.0-1)
[2025-03-09T11:04:22+1100] [ALPM] transaction completed
[2025-03-09T11:04:22+1100] [ALPM] running '30-systemd-update.hook'...
[2025-03-09T11:04:32+1100] [ALPM] transaction started
[2025-03-09T11:04:32+1100] [ALPM] installed critcl-git (3.3.r5.254bdff-1)
[2025-03-09T11:04:32+1100] [ALPM] transaction completed
[2025-03-09T11:04:32+1100] [ALPM] running '30-systemd-update.hook'...

All you need to do is run the following command, which will also build the tcllib dependency:

pamac build critcl-git
1 Like

Thank you. I found the instructions for critcl from Andreas Kupries site (I think he made critcl) and appear to have it installed.

But I have not been able to get Tcl 9.0 installed; and I think I messed up because Tcl 9.0 must be installed first. I didn’t think it mattered for critcl but it appears critcl installs tcllib 2.0.1 which is to be ocmplied after Tcl 9.0. So, I need to uninstall it and get Tcl 9.0 installed first.

The configure step for Tcl 9.0 appears to work but the make step does not.

Makefile:2193: warning: overriding recipe for target '/home/gary/Tcl'
Makefile:2188: warning: ignoring old recipe for target '/home/gary/Tcl'
Makefile:2198: warning: overriding recipe for target '/home/gary/Tcl'
Makefile:2193: warning: ignoring old recipe for target '/home/gary/Tcl'
Makefile:2307: warning: overriding recipe for target '/home/gary/Tcl'
Makefile:2198: warning: ignoring old recipe for target '/home/gary/Tcl'
Makefile:2309: warning: overriding recipe for target '/home/gary/Tcl'
Makefile:2307: warning: ignoring old recipe for target '/home/gary/Tcl'
Makefile:2311: warning: overriding recipe for target '/home/gary/Tcl'
Makefile:2309: warning: ignoring old recipe for target '/home/gary/Tcl'
Makefile:2319: warning: overriding recipe for target '/home/gary/Tcl'
Makefile:2311: warning: ignoring old recipe for target '/home/gary/Tcl'
make: Circular /home/gary/Tcl <- /home/gary/Tcl dependency dropped.
make: Circular 9.0/macosx/configure <- /home/gary/Tcl dependency dropped.
make: *** No rule to make target '9.0/macosx/configure.ac', needed by '9.0/macosx/configure'.  Stop.

Right now, I am stumped on this.

Why do you need tcl 9.0? critcl_howto_install - C Runtime In Tcl (CriTcl) recommends tcl 8.6, which is in Manjaro’s repos:

While CriTcl currently supports running on Tcl 8.4 and higher, and the creation of packages for the same, the last release for this version was in 2013 (9 years ago at the time of writing). Similarly, the last release for Tcl 8.5 was in 2016 (6 years ago). Both are official end of life.

Given this I recommend to install and use Tcl 8.6.

mbn info tcl -q | grep -Ev 'Name|Repository|Packager'
Branch         : archlinux
Version        : 8.6.16-1
Build Date     : Wed 25 Dec 2024 21:17:11 
Branch         : unstable
Version        : 8.6.16-1
Build Date     : Wed 25 Dec 2024 21:17:11 
Branch         : testing
Version        : 8.6.16-1
Build Date     : Wed 25 Dec 2024 21:17:11 
Branch         : stable
Version        : 8.6.16-1
Build Date     : Wed 25 Dec 2024 21:17:11 

mbn can be found in the manjaro-check-repos package

If you are going to try to compile critcl & associated apps manually, as you seem to be doing, then I won’t be able to provide any further help (I don’t think I’ve compiled any software in at least 5 years). Please be aware that manually compiling packages that are in the repos may break your system, as installation may overwrite important libraries installed by repo packages and cause issues with mismatching versions.

Why not just run the pamac build critcl-git command, let it draw in the required dependencies and install them automatically, and then see if it works as it should? After all, there are no issues reported in the comments section of the AUR (en) - critcl-git page.

Thanks. I think SQLite moved to using Tcl 9.0 (but I do not think it is an issue) and I use the SQLite Tcl API quite a bit and would like to stay current with them.

The main reason is that I though that bullet 3, here at tcllib was stating that the c accelerator required Tcl 9.0 but , in looking for the link and reading again, it appears that it will still work with 8.6 as the minimum.

I’d still would like to learn it becasue when SQLite states the new features are on trunk, so download, install, and test it; I can do so rather than having to wait until it is available in the repository to test my application.

1 Like

If you really, really need tcl 9.0, then you might look at installing one of the binaries recommended on the Tcl/Tk Software page.

For example, the Thomas Perschak / tcltk · GitLab page has a list of available binaries at Package Registry · Thomas Perschak / tcltk · GitLab. Maybe you could download the ubuntu.jammy version-9.0.2.0 · Generic .deb file & try using debtap to install it:

Otherwise, it might just be easier to wait until tcl 9 makes it into Arch, and then flows into Manjaro’s repos. Of course, if you switch to Unstable branch, you will have access to it a lot sooner than if you remain on Stable branch.

This link was helpful but still left with a mess that’s not connected.

First, had a few stupid errors

  1. Stupidly named the folder where extracted the source Tcl 9.0. Had to make it tcl9. Tcl then passed the make test and installed.
  2. However Tk failed for a couple reasons.
    A. There is no minizip in the Tk source as in the Tcl source, so had to install zip. See narkive post.
    B. There was a draw error that was corrected by this post https://stackoverflow.com/a/63207529/9852762 which was to export QT_X11_NO_MITSHM=1.
    C. There were other errors in the make test that had to do with stacking and focus but when it completed, it showed 574 passed / 17 skipped / and 0 failed. So, that is confusing.

Then installed critcl following https://andreas-kupries.github.io/critcl/doc/files/critcl_howto_install.html#section2.

I tried it not in root and could not get critcl to use the Tcl 9.0, which was the main goal. So, I tried to install it in root; that is, Tcl 9.0 and then critcl and it keeps using Tcl 8.6. If try to uninstall Tcl 8.6, then it states SQLite analyzer will break.

Also, when I run Tcl 9.0 (whether installed in root or under home/usr) and package require sqlite3 it uses version 3.47.1 and Tcl 8.6 use version 3.49.

I don’t see how to get all these pieces connects; that is, critcl using the new version of Tcl, Tcl using the new version of SQLite, and SQLite analyzer using the new version of Tcl.

I think I might give up at this point, and just install critcl at root with no Tcl 9.0. The tcllib 2.0.1 is installed with critcl; and, apparently, the c accelerator “stuff” works okay in Tcl 8.6.

Just do not know enough about it.

1 Like

It appears that I finally have this working and in a manner that should not conflict with Manjaro updating the system. I’m sharing this because I found it rather challenging as a novice to even locate the steps, although they now seem not so complex to execute. This post is in no manner whatsoever intended to be instruction for others; but is only more information to add to the original question, modified now to ask if this is an acceptable approach or one expected to cause problems.

The objective was to install Tcl/Tk 9.0.2 (not available in repository), Tcllib 2.0, critcl 3.3.1 (not available), tDOM, and the tip-of-trunk versions of SQLite itself and its Tcl Interface. I wanted to be able to use the new features in Tcl/Tk and test SQLite’s tip of trunk and make use of critcl for added performance at times.

After downloading all the source code tar.gz files, placed them under usr/local/src and used sudo tar xzf each_src_name.tar.gz to unpack them into separate folders.

Started with Tcl and Tk; the instructions are at https://www.tcl-lang.org/doc/howto/compile.html.

For Tcl, the instructions state to go into the unix folder and configure. There are options and the default for location is usr/local; so, I left it at that. From the unix directory,

sudo ./configure
sudo make
sudo make test

This listed 143 tests, of which 127 passed, 16 were skipped, and 0 failed.
Then

sudo make install

After that, tested that it worked but trying tclsh9.0; and confiirmed using puts $tcl_version. If also try package require sqlite3, the version will be 3.49.1 but that will be fixed a bit later in this example. This does not remove Tcl8.6 if it is installed, and it can be opened using tclsh or tclsh8.6. And if try package require sqlite3 in Tcl 8.6, it returns the version last installed through Manjaro, which, for me, is 3.50.3.

The steps were similar for Tk. Unpack the tar.gz, go to tk9.0.2/unix. However, the configure was just a bit different to ensure that it is built with Tcl 9.0 rather than 8.6; but not sure what would happen it omitted that option. Would it use 8.6 by default?

sudo ./configure --with-tcl=/usr/local/src/tcl9.0.2/unix
sudo make
sudo make test

This listed 592 tests of which 575 passed, 17 were skipped, and 0 failed.

sudo make install

At this point, tried tclsh9.0 and package require tk, and it returned version 9.0.2.


EDIT
This next step is incorrect in that using installer.tcl to install tcllib will not build the C implementations of packages that have one, that is, the tcllibc binary. These instructions are more complete than the ones first linked below. This also means that must install critcl before tcllib, which is currently installed last in this post; and it appears that critcl can still be installed using the Tcl script as shown. The purpose is to use the C implementations via critcl to improve speed.

./configure
make install

And make or make install are both supposed to build tcllibc when critcl is already installed. I can see both the tcllib2.0 and tcllibc2.0 folders in usr/local/lib but have yet to run a real test to obseve a script completing more quickly with this set up than that of the package manager which does not have critcl or the tcllibc2.0 folder.


Next, installed tcllib, using instructions at wiki.tcl-lang.org/page/Tcllib+Installation and these were the easiest since Tcl and Tk have already been installed and it uses a littleTk GUI. After unpacking, went to that directory but there is no unix directory. There should be a file named installer.tcl. Then

sudo tclsh9.0 installer.tcl

and the Tk widget appears. The default selections seemed okay, so clicked Install. It installed in a few seconds. At the first attempt, I did not use sudo and after clicking Install, another Tk widget appeared and remained empty, whilst I waited stupidly until finally looking behind it to find a permission-denied dialogue.

Tested it by tclsh9.0 again and package require nmea (as in the instructions, or any other library package) and the version number was returned.

Next SQLite. I followed the instructions at sqlite.org/src/doc/trunk/README.md under Compiling for Unix-like systems, which is what I think they at SQLite refer to as the canonical build process.

The instructions recommend making a build directory. I made it under the sqlite directory that was made when unpacked the source. Then:

..sqlite/configure --enable-all

There are many options that can be added when building SQLite from source. I’m not sure at which step they go. For example, if want to build with the ICU in order to ORDER BY based on non-ascii characters, that can be added; and I wanted to test it but will experiment with that later. Didn’t try for this attempt.

sudo make sqlite
sudo make sqldiff
sudo make tclextension-install
sudo make sqlite3_analyzer

Also ran the make verify-source which returned okay.

Tried tclsh9.0 and package require sqlite3 and the version was no longer the 3.49 packaged with Tcl but the version I downloaded, which was the most recent available 3.51.0. In the “lib” folder, 3.49.1 is still there, which I assume can be deleted.

For the SQLite CLI application, if try sqlite3 ":memory:" the version will be from the Manjaro install. If want to run the one in local, I had to

/usr/local/src/sqlite/sqlite3 ":memory:"

Next tDOM. The instructions are in the README.md file after the source is unpacked. There are some options but none appeared to apply for my use; and I just took the defaults. Went in unix folder, and

../configure
make
make test

The results were 2459 total tests, of which 2414 passed, 45 were skipped,and 0 failed.

sudo make install

Then tclsh9.0 and package require tdom returned version 0.9.6.

Last, then, is critcl. After unpacking, went into the top level of that directory where a build.tcl script should be found. Apparently, critcl can be built differently depending upon the version of Tcl. Thus, found this suggestion:

 /path/to/tclsh /path/to/critcl/build.tcl install

and from within that directory, ran

sudo tclsh9.0 build.tcl install

Then tested it by 'tclsh9.0 and package require critcl which returned version 3.3.1. The package is not found when try the same in Tcl 8.6. The build output mentioned Tcl 9; thus, it appears that critcl was built for Tcl 9.

Having SQLite, Tcl, and tcllib installed “normally” and also in usr/local doesn’t appear to cause an issue, but tDOM won’t install within Manjaro any longer. It appears to find Tcl 9.0 rather than 8.6. That is not an issue for me because I only need it in one location and no other software I use depends upon tDOM as many do on SQLite.

If my machine survives the next round of updates, this might work for my circumstances. Thanks.

I have looked at this thread from time to time but I didn’t really know if I should reply.

There is no generic instructions for building from source;   other than those provided by the developer in the documentation;   this is because it will vary from extremely complicated make files to a simple compilation; different programming languages will require different commands; different environments may play a role too.

Generally - one look at the project source - look for a README or a make file - follow instructions.

When adding custom binaries to a system you must understand the PATH variable.

So take a look at your PATH environment variable.

echo $PATH

Or simpler

path

You will see that /usr/local/bin has a higher priority than /usr/bin and that ~/.local/bin has highest priority.

This has the effect that when an application look for a given binary it will execute the first binary found. Your approach to install local binaries is correct - but it may have unintended side effects in the long term - especially if the binary shadows a system binary.

3 Likes

Thanks for the response and information. I think I understand what you wrote but don’t observe it as happening that way; so, I must be misunderstanding.

The package manager installed Tcl 8.6 and SQLite 3.50.3. I installed Tcl 9.0 and SQLIte 3.51.0.

If I type tclsh (without any version suffix) at the CLI, a Tcl 8.6 session is opened. If I type sqlite3 “:memory”, it opens 3.50.3.

I have to type tclsh9.0 to get a Tcl 9.0 session, and use a path to get version 3.51.0 of SQLite. That made me think that the system first looks where the package manager installs before looking for a local install. I’m not saying that is the case, just explaining the basis for my erroneous assumption.

echo $path is

/home/gary/.cargo/bin /home/gary/.local/bin /usr/local/sbin /usr/local/bin /usr/bin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl

Since /usr/local/bin has a higher priority, why aren’t the newer version of Tcl and SQLite opened first?

Perhaps my studying the use of the path variable will answer the rest of these questions for me.

Does the path mean that an application installed through the package manager that depends on SQLite will attempt to first open the version in /usr/local/bin?

Can the path be changed such that the system should always first look where the package manager installs before looking in /usr/local; or can I add to the path at the lowest priority end something like ~/tcl/9.0 or home/gary/mybin; or can I install them somewhere not in the path and just always provide the path to execute them?

Most of this is quite new to me. My work depends heavily on SQLite. Sometimes they have a pending release with a lot of changes and encourage people to download the tip of trunk from Fossil, build it from source, and test your applications before they release it. I’m looking for a location in which to do so without jeopardizing the rest of the system and applications that use SQLite.

Thank you.

Have you checked the install actually created a tclsh executable in /usr/local/bin? I just tried the install, and it only created a tclsh9.0 executable. You may want to check this and if necessary try creating a soft link for tclsh, something like this:

sudo ln -s /usr/local/bin/tclsh9.0 /usr/local/bin/tclsh 

I have not looked at the other problems, but it is worth double-checking what executables are actually installed for each thing.


Edited to mention sqlite:

You say

If want to run the one in local, I had to

/usr/local/src/sqlite/sqlite3 ":memory:"

So, if that is where the executable is, you’d need to add that on the PATH before any system one. It is a bit odd having an executable in a src directory but let’s ignore that for now.

You can alter the path in the appropriate file for your shell, e.g. bashrc for bash or .zshrc for zsh (the rc files are in your home directory and you can just create it if it does not exist), by adding a line like

export PATH="/usr/local/src/sqlite:$PATH"

If things are not always started from a shell command line, you may need to alter the .profile file; I think that is read for any login session. There is lots of details about where you can confiure the PATH here: Environment variables - ArchWiki

1 Like

If the binary matches the request - per name - then yes.

Example - if you have a system binary - let’s take ls utility as example.

ls list the content of a given path.

If you compile a custom binary which does something completely different but using the same name, in the example ls then your ls will be found and executed because it is first in the path.

The ls binary in /usr/local/bin is shadowing the system binary.

If you have your own compiled version of sqlite called sqlite in /usr/local/bin this binary will not shadow the system binary as the system binary is named sqlite3.

Don’t make it more complicated than it is :wink:
Just build in your $HOME directory - create directory there, put all the source files in it, extract the archives …

I created ~/test
mkdir test
cd test
downloaded the archives and put them there and extracted them

cd tcl9.0.2/unix/
./configure
make
sudo make install

This will install the just built tcl9.0.2 into /usr/local ...


Next up is critcl - I used the link on top of the page, used wget to fetch it.
The downloaded file will be called master, but it is actually either a .zip or a .tar.gz file (whichever you chose).

If you use the browser to fetch it, it will have the proper name:
andreas-kupries-critcl-3.3.1-5-g97be21c.tar.gz

Unpack that.

the resulting directory will be named:
andreas-kupries-critcl-97be21c

cd into it, then use the newly installed tclsh9.0 in /usr/local/bin to install critcl:

sudo /usr/local/bin/tclsh9.0 ./build.tcl install


Next is tk, same procedure, change into the directory ~/test/tk9.0.2/unix

To check the available options myself I use:
./configure --help | less
to read through them - you’ll see this:

--with-tcl              directory containing tcl configuration
                          (tclConfig.sh)

So, you want to use:
./configure --with-tcl=/usr/local/lib/tclConfig.sh
to make use of the just installed tcl

make
sudo make install

If you have two versions of all this - one from repos in /usr
and your own, self compiled new one in /usr/local
you can use the full path each time to be sure - but since /usr/local comes before /usr that should not be necessary.


Should you decide to do it all over by following the above outlined procedure,
make sure you first uninstall everything that you have installed so far.
Either by using the sudo make uninstall from within each (hopefully still existing) source directory,
or by simply deleting everything under /usr/local/ that belongs to your self built programs,
which is probably everything short of the subdirectories themselves.


Re compiling sqlite
it’s documented here:

SQLite: Documentation
https://sqlite.org/src/doc/trunk/README.md

The process is the same as outlined above.
run configure (run ./configure --help | less) to read about the flags

2 Likes

This indicates that make install has not run sucessfully.
After make install , the executable should be present in the “right” place. And the log will show where you can find it.

1 Like

@linux-aarhus @anon33601770 @andreas85
Thank you, I think it may be starting to penetrate the barrier of my ignorance.
The only application that has the executable in bin is Tcl. The rest are under src. I recall being confused why the instructions read configure and configure could not be found, but ./configure executed. I thought that maybe the instructions were general in that I was supposed to know to use ./ or …/ That may be where I made a group of mistakes.

I’ll try it again. Thanks for the help.

configure is a script, contained in the unpacked source archive
When run it will create the Makefile (from a template Makefile.in), which is in turn then used to compile the project

In the case of tcl9.0.2 here, it is in the directory
tcl9.0.2/unix in the unpacked archive.

It helps to use the file manager to inspect the contents of the extracted archive - then you see the files, configure, for example.

cd test/tcl9.0.2/unix/

ls
gives you:

aclocal.m4      install-sh    tclConfig.h.in    tclLoadDl.c    tcl.m4            tclUnixChan.c    tclUnixInit.c   tclUnixTest.c
configure       ldAix         tclConfig.sh.in   tclLoadDyld.c  tclooConfig.sh    tclUnixCompat.c  tclUnixNotfy.c  tclUnixThrd.c
configure.ac    Makefile.in   tclEpollNotfy.c   tclLoadNext.c  tcl.pc.in         tclUnixEvent.c   tclUnixPipe.c   tclUnixTime.c
dltest          README        tclKqueueNotfy.c  tclLoadOSF.c   tclSelectNotfy.c  tclUnixFCmd.c    tclUnixPort.h   tclXtNotify.c
installManPage  tclAppInit.c  tclLoadAix.c      tclLoadShl.c   tcl.spec          tclUnixFile.c    tclUnixSock.c   tclXtTest.c

There, among the others, is the script configure.
And no Makefile yet.

From within that directory, you run the script like this:
./configure
It’s just the path to the script.

After running ./configure there will be the Makefile used by the make command

1 Like

Thank you. I deleted and repeated but under $HOME this time and with the corrections you pointed out.

Almost everything appears to have worked. This time the executables are in /usr/local/bin except the sqlite3 cli, sqldiff, sqlite analyzer. They remained in the “bld” directory that the instructions recommended adding. I copied the sqlite3 executable into /usr/local/bin and it will run if called by path /usr/local/bin/sqlite3. If type sqlite3, the package manager installed version opens.

Tcl 9.0 uses the new SQLite version when the package is required. That’s where I’d be testing it anyway; so, it’s not important but I don’t understand it based on the $PATH and because file names are the same.

An aside is that having critcl compiled before tcllib (and using the instructions that do not use Tcl to install but are supposed to ensure that the tcllibc directory is created) hasn’t reduced the time it takes to run an AES encryption/decryption. So, I either still have it compiled incorrectly, AES does not have a c implementation that critcl can use (seem very unlikely), or I just don’t know how to use it.

Thank you for the detailed instructions; they were very helpful.

It has been quite some time since I was a Gentoo user and even longer since I built my system from scratch
(with the help of the excellent guide of the project by the same name: Linux from Scratch)
I’m definitely out of practice compiling stuff.

What I did describe here was just very basic - reading the Readme file and looking at the configure options
and then just doing the standard configure - make - make install process

re sqlite3:
it did indeed not get installed - or even built

Looking through the files after compilation, sqlite wasn’t even compiled - or only parts of it.
in the tcl9.0.2/pkgs/ directory, there is the directory sqlite3.49.1
with a configure script and a Makefile
Perhaps this just needs to be built separately - try that.
I’m not at all sure about that.

I haven’t looked that deep in all the options and don’t exactly understand your want’s and needs.

If you can, remove the “normal” repo packages, so that there is only what you compiled yourself
would be my suggestion.
So there be no confusion and having to deal with the mix.

It’s easy to reinstall those …


One thing I’m not certain of, but which could be an issue:

/etc/ld.so.conf

/usr/local/lib is not in there by default (the library search path)
You might need to fix that
and then run ldconfig

… you might have everything, but your system just isn’t aware of it,
not even seeing that there are libraries in /usr/local/lib

I’d go to the AUR or Arch packages site and have a look at the PKGBUILDs for these packages - to see how they did build them.

Thanks again. I’m pretty sure that SQLite 3.49.1 is just packaged with Tcl 9.0 such that one can use the SQLite Tcl interface without having to install SQLite.

I installed the newest version of SQLite 3.51.0 and another folder appeared next to the SQLite 3.49.1 folder where Tcl is stored and has the tclsqlite files. And it loads in tclsh9.0. Plus, the rest of the SQLite files are stored in the build directory. Point is, I think that it all worked and I can run scripts in it and perform queries in the CLI. There’s just the odd item of why all the SQLite executables ended up in the build directory instead of /usr/local/bin. I’ll look into the /etc/ld.so.conf. Everything else ended up in bin except SQLite.

This is the closest I’ve ever been to having it all work. Just a couple issues to figure out but I don’t think they’re install issues and could be I’m just not using the application correctly, such as the critcl not reducing execution time.

So, I’ll shut up now and this post can close.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.