Skip to content
Daniel edited this page Jul 7, 2026 · 3 revisions

Conda Package

A kdb-x module can be loaded as a conda package into your q session using qmamba.

You can use Rattler, a cross platform conda package builder, to build a conda package. Other conda package builders are available and can be used.

Rattler can be installed using micromamba.

Building

Building a conda package

Install Micromamba:

=== ":fontawesome-solid-desktop: Linux and macOS"

```bash
"${SHELL}" <(curl -L micro.mamba.pm)
```

=== ":fontawesome-solid-desktop: Windows"

```bash
Invoke-Expression ((Invoke-WebRequest -Uri https://micro.mamba.pm/install.ps1 -UseBasicParsing).Content)
```

Create a new environment for building, e.g. build:

micromamba create --name build
micromamba activate build

Install rattler-build and rattler-index

Note

Conda channel defaults If you want to avoid using anaconda.com and rely on the open source conda-forge you can update you ~/.condarc file to look like

$ cat ~/.condarc
channels:
  - conda-forge
  - nodefaults
micromamba install rattler-build rattler-index -c conda-forge

Build the package

Note

Sample recipe If you want to see a template recipe take a look at one of our open source modules.

cd recipe
rattler-build build

Publish the package

Note

Channel to publish You can publish your package to different channels. For illustrations we are publishing to a channel on a local file system. You could also publish to a conda channel such as anaconda.org.

mkdir /tmp/mychannel
rattler-index -f fs /tmp/mychannel/
rattler-build publish output/linux-64/q-kx-fusionx-1.2.1-hb0f4dca_0.conda --to file:///tmp/mychannel

Testing

Install the module

qmamba:use`kx.qmamba
qmamba.create "myenv";
qmamba.activate "myenv"; 
qmamba.search `SPECS`CHANNEL!(enlist "q-kx*";enlist"file://tmp/mychannel/linux-64/")
qmamba.install `SPECS`CHANNEL!(enlist "q-kx-fusionx";("file://tmp/mychannel/linux-64/";"conda-forge"))

Load the pcre2 APIs from the fusionx module.

q)pcre2:use`fusion:pcre2
q)pcre2
version| code
match  | code
replace| code
compile| code

Links

Clone this wiki locally