I want to explore the use of SQLite Archive files. I downloaded the amalgamation source code from the downloads page (https://sqlite.org/download.html) and compiled it (gcc shell.c sqlite3.c -lpthread -ldl).
I managed to compile the executable but the Archives option is not there.
Running ./sqlite3 -A shows the error:
./sqlite3: Error: unknown option: -A
Trying to run the .ar command in commandline shows:
Error: unknown command or invalid arguments: "ar". Enter ".help" for help
Running .help also does not show the option for .archive.
How do I install SQLite with the Archives extension?
Compile from source…
$ curl -LO https://www.sqlite.org/src/tarball/sqlite.tar.gz
$ tar xzf sqlite.tar.gz
$ mkdir build
$ cd build
$ ../sqlite/configure
$ make
You will find the executable command line program (sqlite3) in the build directory.
Add compile options by changing the ../sqlite/configure line to something like…
$ ../sqlite/configure CFLAGS='-DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FOREIGN_KEYS=1'
View configure help for more flags like linking additional libraries…
$ ../sqlite/configure --help
Optionally install the headers (sqlite3.h) and libraries (libsqlite3.a, libsqlite3.so, libsqlite3.dylib, etc) by running…
$ make install
Ensure archive support exists…
$ ./sqlite3 -help
...
OPTIONS include:
-A ARGS... run ".archive ARGS" and exit
...
You have to compile it with SQLITE_HAVE_ZLIB defined (And link with -lz).
It's easiest using the autoconf or src source distribution, since the configure script tests for a bunch of things including zlib, and compiles the library and shell with a bunch of useful options that you're not using in your manual compilation of the shell.
Related
I was able to use ZuluFX 8 with javapackager on Windows. However, on a Mac I get this error:
Bundler Mac Application Image skipped because of a configuration problem: Cannot determine which JRE/JDK exists in the specified runtime directory.
Advice to fix: Point the runtime directory to one of the JDK/JRE root, the Contents/Home directory of that root, or the Contents/Home/jre directory of the JDK.
It's pretty easy to just move the package into Contents/Home but I doubt that will work as it seems there is no JRE bundled with the Mac version of ZuluFX 8. Is this something that can be worked around?
It's pretty easy to just move the package into Contents/Home but I doubt that will work as it seems there is no JRE bundled with the Mac version of ZuluFX 8.
From what I'm seeing, I'm not sure that's correct. The ZuluFx 8 archive for Mac contains a jre directory. I extracted the archive to ~/zuluFX and from there created the Contents/Home directory as required by MacOS and added a symbolic link to said jre directory there. I then set $JAVA_HOME accordingly:
$ pwd
/Users/cody/zuluFX
$ mkdir -p Contents/Home
$ ln -s ../../jre .
$ export JAVA_HOME=~/zuluFX
Then I utilized a simple javapackager example on github to test its usage (I have no other JREs/JDKs installed on this box). The example app simply dumps Java properties and environment variables in a TextArea.
I had to modify the 3build script in the example to comment out its attempt to re-set $JAVA_HOME, but otherwise, it builds successfully, with the following javapackager command:
javapackager \
-deploy -Bruntime=${JAVA_HOME} \
-native image \
-srcdir . \
-srcfiles MacJavaPropertiesApp.jar \
-outdir release \
-outfile ${APP_DIR_NAME} \
-appclass MacJavaPropertiesApp \
-name "MacJavaProperties" \
-title "MacJavaProperties" \
-nosign \
-v
When I launch the resulting app, it reports the usage of the azul/zulu jre as expected:
Trying to just compile Eiffel_18.07/examples/store/esql/ on Debian 9 I've got following error:
In file included from od243.c:202:0,
from big_file_C8_c.c:42:
/opt/Eiffel_18.07/library/store/dbms/rdbms/odbc/Clib/odbc.h:27:17: fatal error: sql.h: No such file or directory
#include <sql.h>
^
compilation terminated.
Makefile:36: recipe for target 'big_file_C8_c.o' failed
make[1]: *** [big_file_C8_c.o] Error 1
Makefile:72: recipe for target 'C8/Cobj8.o' failed
make: *** [C8/Cobj8.o] Error 2
make: *** Waiting for unfinished jobs....
an apt-get install unixodbc unixodbc-dev odbc-postgresql got me further to
gcc: error: /opt/Eiffel_18.07/library/store/spec/linux-x86-64/lib/libodbc.a: No such file or directory
Makefile:177: recipe for target 'esql' failed
When I try to go to /opt/Eiffel_18.07/library/store/dbms/rdbms/odbc/Clib thinking I'll be able to generate some code to get it working following the /opt/Eiffel_18.07/library/store/install into /opt/Eiffel_18.07/library/store/dbms/rdbms/odbc/Clib trying a sudo /opt/Eiffel_18.07/studio/spec/linux-x86-64/bin/finish_freezing -library
got
cp: cannot stat '/usr/include/eiffelstudio-18.07/config.sh': No such file or directory
Can't find config.sh.
Makefile.SH: 6: .: Can't open ./config.sh
Being a fan of Eiffel, it doesn't seem to be working out of the box and I didn't find enough documentation to get it working :-()
Here is a sequence of steps that allowed me to build the example on Ubuntu 16.04:
Download and unpack EiffelStudio in a new directory (let's denote the absolute path as #ES#).
Set environment variables:
export ISE_EIFFEL=#ES#
export ISE_PLATFORM=linux-x86-64
export PATH=$PATH:$ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin
These commands assume bash, replace them with equivalents when using another shell.
Install package unixodbc-dev:
sudo apt-get install unixodbc-dev
Compile C code of the Eiffel library store:
cd ${ISE_EIFFEL}/library/store/dbms/rdbms/odbc/Clib
finish_freezing -library
Note: no need to prefix finish_freezing with sudo unless EiffelStudio has been installed to a path without write permissions for ordinary users. Otherwise (e.g., for the original poster of the problem on Debian 9, where EiffelStudio has been installed under /opt), permissions have to be elevated:
sudo -i
cd ${ISE_EIFFEL}/library/store/dbms/rdbms/odbc/Clib
finish_freezing -library
exit
Compile the example esql:
cd ${ISE_EIFFEL}/examples/store/esql
ec -c_compile -config esql.ecf -target esql_odbc
Run the compiled executable:
./EIFGENs/esql_odbc/W_code/esql
Login as root changed my problem instead of only doing a sudo of the finish_freezing command
sudo -i
and then
cd ${ISE_EIFFEL}/library/store/dbms/rdbms/odbc/Clib
finish_freezing -library
I downloaded the sqlite3 source file (not amalgamation version)
There are test folder and many test files (journal1.test , pager1.test ... etc)
How to execute these test files?
Go to the SQLite's download page and download the Snapshop of the complete (raw) source tree on the Alternative Source Code Formats section.
Unzip it, cd into the folder and run:
sudo apt install tcl-dev zlib1g-dev
./configure
make test
You can run the quick test instead (less than 3 minutes):
make quicktest
Or just the tcl tests (aka veryquick):
make tcltest
On Mac
brew install tcl-tk
./configure --with-tcl=/usr/local/opt/tcl-tk/lib
make test
As an example of my problem let's use libqb (https://github.com/ClusterLabs/libqb).
To install it from the sources I do the next:
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
The problem is that the version in "/usr/lib/pkgconfig/libqb.pc" is UNDEFINED.
I suspect that I have to pass a parameter to ./configure but I don't know which one.
I do it on Debian.
There are two ways to get sources:
use git ($ git clone)
download sources in an archive
In case of using git, you won't see this problem, because it uses git to get correct version of sources during build.
In case of archive you have to create .tarball-version file in the top dir and put there version you want. For example: $ echo "0.17.0" > .tarball-version.
P.S.: there will be created .version file during build. So, if you did any changes to .tarball-version then you have to remove .version file.
I want to call ShellCheck, a Haskell program for linting shell scripts, from a Makefile.
When I install ShellCheck via cabal install, it is installed as ~/.cabal/bin/shellcheck. So, I have configured Bash accordingly:
$ cat ~/.bashrc
export PATH="$PATH:~/.cabal/bin"
$ source ~/.bashrc
$ shellcheck -V
ShellCheck - shell script analysis tool
version: 0.3.4
license: GNU Affero General Public License, version 3
website: http://www.shellcheck.net
This enables me to run shellcheck from any directory in Bash. However, when I try to call it from a Makefile, make cannot find shellcheck.
$ cat Makefile
shlint:
-shlint lib/
shellcheck:
-shellcheck lib/**
lint: shlint shellcheck
$ make shellcheck
shellcheck lib/**
/bin/sh: 1: shellcheck: not found
make: [shellcheck] Error 127 (ignored)
I think that make is not receiving the same PATH as my normal Bash shell. How can I fix this?
Try using $HOME, not ~:
export PATH="$PATH:$HOME/.cabal/bin"
The ~-means-home-directory feature is not supported in pathnames everywhere in all shells. When make runs a recipe it doesn't use the user's shell (that would be a disaster!) it uses /bin/sh always.
On some systems (particularly Debian/Ubuntu-based GNU/Linux distributions) the default /bin/sh is not bash, but rather dash. Dash doesn't support ~ being expanded in the PATH variable.
In general, you should reserve ~ for use on the command line as a shorthand. But in scripting, etc. you should always prefer to write out $HOME.
ETA:
Also, the double-star syntax lib/** is a non-standard feature of shells like bash and zsh and will not do anything special in make recipes. It is identical to writing lib/*.
You can force make to use a different shell than /bin/sh by adding:
SHELL := /bin/bash
to your makefile, for example, but this makes it less portable (if that's an issue).