Install Couchbase Lite for C
Description — Installing Couchbase Lite for C
- Steps in Getting Started
-
Install | Build and Run
Download
Couchbase Lite for C 3.2.0 is available for all supported platforms — see: Platform Availability.
You can obtain the downloads here:
-
Android, iOS and Windows — Mobile & Edge
-
Linux and macOS — downloads table
The binary release download comprises a root directory (libcblite-community), which contains:
-
For Linux, Windows, Android, and Mac OS:
-
lib
— the core library binaries -
include
— the header files for inclusion -
bin
— the Couchbase Lite for C.dll
files (Microsoft Windows-only) .
-
-
For iOS, an xcframework.
Debug Symbols
Debug symbol versions are available for all desktop variants of C (Windows, macOS, Debian, Ubuntu and Raspbian) - see: downloads table. For Android and iOS the symbols are incorporated in the standard release package. |
Downloading Vector Search
You can obtain the download for the Vector Search extension here:
-
Vector Search Extension — Download Vector Search
To use Vector Search, you must have Couchbase Lite installed and add the Vector Search extension to your Couchbase Lite application. Vector Search is available only for 64-bit architectures and Intel processors that support the Advanced Vector Extensions 2 (AVX2) instruction set. To verify whether your device supports the AVX2 instructions set, follow these instructions. |
Install for Linux
Using APT
Using the Advanced Package Tool (apt) is the easiest way to install Couchbase Lite on Ubuntu and Debian platforms. Just download the meta package that apt requires to automatically get and install Couchbase Lite, including any dependencies.
-
Download the meta package
-
curl
-
wget
curl -O https://packages.couchbase.com/releases/couchbase-release/couchbase-beta-1.0-noarch.deb
wget https://packages.couchbase.com/releases/couchbase-release/couchbase-beta-1.0-noarch.deb
-
-
Install the meta package
-
apt
-
dpkg
sudo apt install ./couchbase-beta-1.0-noarch.deb
sudo dpkg -i ./couchbase-beta-1.0-noarch.deb
-
-
Update the local package database
sudo apt update
-
Install the required release package(s)
-
Enterprise
-
Community
Runtime Onlysudo apt install libcblite
Developmentsudo apt install libcblite-dev
Runtime Onlysudo apt install libcblite-community
Developmentsudo apt install libcblite-dev-community
-
At this point, you are ready to start building the Getting Started app, or doing your own thing with Couchbase Lite for C
Using .deb Package
Use your package manager to install from a local .deb
file.
-
Just
wget
the appropriate.deb
package — see downloads table for a package URL. -
Install the package and its dependency, using
apt install
-
For community version:
sudo apt install ./libcblite-community sudo apt install ./libcblite-dev-community
-
For enterprise version:
sudo apt install ./libcblite sudo apt install ./libcblite-dev
-
-
From here, you need to pass the
-lcblite
command-line flag to the compiler when you build.
At this point, you are ready to start building the Getting Started app, or doing your own thing with Couchbase Lite for C
Install Vector Search for Linux
Before you can use Vector Search, you must download and install the Vector Search library to the location in your project where the library can be accessed and loaded at run time. The Vector Search extension for the C platform ships with supported prebuilt libraries containing the required dependencies.
You need to set the LD_LIBRARIES_PATH
to the extension location instead of installing the libraries yourself.
In the code, before opening the database and using the vector search extension, you must call the CBL_SetExtensionPath function shown below to set the path to the installed location of the vector search library.
CBLError error {};
if (!CBL_EnableVectorSearch(FLStr("/path/to/extension_dir"), &error)) {
throw std::domain_error("Invalid / Not Found Extension Library");
}
Install for Windows
To install the Couchbase for C libraries on Windows from a downloaded release binary:
-
Download and extract the release package — see: Mobile & Edge
-
From within the root directory, libcblite-community, deploy the
lib
,include
andbin
libraries to a location accessible to your compiler. -
Within Visual Studio:
-
Create a new C++ project
Be sure to select x64 for 64-bit builds
-
Within Project Properties → C++ directories → Library Directories, Add
<path-to-deployed-directories>/lib
-
Within Project Properties → C++ directories → Include Directories, Add
<path-to-deployed-directories>/include
-
Within Project Properties → Linker → Input → Additional Dependencies, Add
cblite.lib
-
-
Copy
<path-to-deployed-directories>/bin/cblite.dll
to your build locationCouchbase Lite for C does not have any preferred installation path for the
.dll
. It is up to you to determine where best to place it so it is available during execution, though copying to a location on the system path is not recommended on Windows
Install Vector Search for Windows
To use the Vector Search extension:
-
Download and extract the Vector Search extension.
-
Put the library in your development environment.
In the code, before opening the database and using the vector search extension, you must call the CBL_SetExtensionPath function shown below to set the path to the installed location of the vector search library.
CBLError error {};
if (!CBL_EnableVectorSearch(FLStr("/path/to/extension_dir"), &error)) {
throw std::domain_error("Invalid / Not Found Extension Library");
}
Couchbase Lite Vector Search does not have any preferred installation path for the .dll . It is up to you to determine where best to place it so it is available during execution.
|
Install for macOS
To install the Couchbase for C libraries on macOS from a downloaded release package:
-
Download and extract the release package here — downloads table.
-
Optionally … From within the root directory, libcblite-community, Copy the
include
andlib
directories to/usr/local/
-
Within Xcode:
-
Create a new project
-
Add
<path/to>/include
to the project’s Header Search Path -
Add
<path/to>/lib
to the project’s Library Search Path -
Drag
libcblite-community.dylib
into your Xcode project. Then, within the dialog:-
Select Create Directory References If Needed
-
Check the correct target is selected
-
-
At this point, you are ready to start building the Getting Started app, or doing your own thing with Couchbase Lite for C
Install Vector Search for macOS
Couchbase does not support homebrew for 3.2.0 beta-3 installation of Couchbase Lite or Vector Search. |
Before you can use Vector Search, you must download and install the Vector Search library to the location in your project where the library can be accessed and loaded at run time. The Vector Search extension for the C platform ships with supported prebuilt libraries containing the required dependencies.
In the code, before opening the database and using the vector search extension, you must call the CBL_SetExtensionPath function shown below to set the path to the installed location of the vector search library.
CBLError error {};
if (!CBL_EnableVectorSearch(FLStr("/path/to/extension_dir"), &error)) {
throw std::domain_error("Invalid / Not Found Extension Library");
}
Install for iOS
To install the Couchbase for C libraries for iOS from a downloaded release package:
-
Download and extract the release package here — Mobile & Edge
-
Drag
CouchbaseLite.xcframework
into your Xcode project, then within the dialog:-
Select Create Directory References If Needed
-
Check the correct target is selected
-
At this point, you are ready to start building the Getting Started app, or doing your own thing with Couchbase Lite for C
If you encounter a build error — Include of non-modular header inside framework module — You may need to change the build setting
allow non-modular includes in framework module
to Yes
.
Install Vector Search for iOS
-
Download and extract the Vector Search extension into your XCode project location.
-
Select your target settings in XCode and drag CouchbaseLiteVectorSearch.xcframework from your Finder to the Frameworks, Libraries, and Embedded Content section.
-
Import the xcframework and start using it in your project.
-
Objective-C
-
Swift
[NSBundle bundleWithIdentifier: "com.couchbase.vectorSearchExtension"].bundlePath
Bundle(identifier: "com.couchbase.vectorSearchExtension").bundlePath
You can then set the extension path with the snippet below.
CBLError error {};
if (!CBL_EnableVectorSearch(FLStr("/path/to/extension_dir"), &error)) {
throw std::domain_error("Invalid / Not Found Extension Library");
}
Install for Android
This install assumes use of the Android Studio IDE. In addition to the Couchbase Lite for C download you also require the following tool chain dependencies, all installable from within Android Studio if necessary:
-
CMake 3.18.1
-
NDK 21.4.7075529
-
Build tools 30.0.2
In this instance the release comprises a ready to adapt application project.
-
Download and Unpack the binary release here — Mobile & Edge
-
Within Android Studio, select and open the project folder (within the libcblite-community folder)
-
-
Check the above dependencies are installed, select any that are not
OK to Continue
Once the install is finished, you can build and run this skeleton app.
Install Vector Search for Android
To use Vector Search in your Android applications, follow the steps below:
-
Download and extract the Vector Search extension into your project location.
-
The package must be installed to the location in your project where the library can be accessed and loaded while the executable is running.
-
The Vector Search download for CBL-C only contains the Vector Search libraries needed to include in your app.
-
Steps to include the prebuilt native library can be found here.
-
-
Create a Android app project in Android Studio
-
The location of the native library can be found using the following snippet:
-
Default Packaging
-
Legacy Packaging
String getExtensionPath(Context context) {
String packagePath = context.getPackageResourcePath();
if (packagePath == null) { return null; }
String arch = getArch();
if (arch == null) { return null; }
return packagePath + "!/lib/" + arch; // "!" is important for locating non-extracted library.
}
String getArch() {
final List<String> abis = Arrays.asList(Build.SUPPORTED_ABIS);
if (abis.contains()) { return "arm64-v8a"; }
if (abis.contains("x86_64")) { return "x86_64"; }
return null;
}
static String getExtensionPath() {
return context.getApplicationInfo().nativeLibraryDir
}
In the code, before opening the database and using the vector search extension, you must call the CBL_SetExtensionPath function shown below to set the path to the installed location of the vector search library.
CBLError error {};
if (!CBL_EnableVectorSearch(FLStr("/path/to/extension_dir"), &error)) {
throw std::domain_error("Invalid / Not Found Extension Library");
}
At this point, you are ready to start building the Getting Started app, or doing your own thing with Couchbase Lite for C
Platform Availability
Couchbase Lite for C is available on the platforms shown in the tables below.
Deprecation Notice
Support for the following will be deprecated in this release and will be removed in a future release:
Please plan to migrate your apps to use an appropriate alternative version. |
Linux
Distro | Version | x64 | ARM 32 | ARM 64 |
---|---|---|---|---|
Debian |
9 |
|||
10 (Buster) |
||||
11 (Bullseye) |
||||
12 (Bookworm) |
||||
Raspberry Pi OS |
10 |
|||
Raspbian |
9 |
|||
Ubuntu |
20.04 LTS |
|||
22.04 LTS |
Download Links
Couchbase Lite for C is available for all Supported Platforms. You can obtain downloads for Linux and macOS from the links here in the downloads table.
Couchbase Lite Release 3.2.0
MacOS
-
Enterprise Edition
-
Community Edition
Platform | Download | SHA | Debug Symbols |
---|---|---|---|
MacOS |
Platform | Download | SHA | Debug Symbols |
---|---|---|---|
MacOS |
Windows
-
Enterprise Edition
-
Community Edition
Platform | Download | SHA | Debug Symbols |
---|---|---|---|
Windows |
couchbase-lite-c-enterprise-3.2.0-windows-x86_64-symbols.zip |
Platform | Download | SHA | Debug Symbols |
---|---|---|---|
Windows |
Debian
-
Enterprise Edition
-
Community Edition
Platform | Download | SHA | Debug Symbols |
---|---|---|---|
Debian |
|||
couchbase-lite-c-community-3.2.0-linux-x86_64-symbols.tar.gz |
|||
Ubuntu
-
Enterprise Edition
-
Community Edition
Platform | Download | SHA | Debug Symbols |
---|---|---|---|
Ubuntu |
|||
couchbase-lite-c-community-3.2.0-linux-x86_64-symbols.tar.gz |
|||
Raspbian
Please use the Debian .deb
download choosing the appropriate version (debian9
or debian10
) and architecture.
Vector Search Release 1.0.0
You must have Couchbase Lite installed before you can use the Vector Search Extension. Vector Search is available only for 64-bit architectures. The Vector Search extension is an Enterprise-only feature. |
Linux
-
Enterprise
Platform | Download | SHA | Debug Symbols |
---|---|---|---|
Linux |
couchbase-lite-vector-search-1.0.0-linux-aarch64-symbols.zip |
||