Classes
Before installing the easifemClasses
library please make sure that you have installed
easifem CLI (recommended method)
You can install easifemClasses
by using the command line application.
easifem install classes
You can install both easifemBase
and easifemClasses
by using the command line application.
easifem install easifem
To install easifemClasses by using you need toml configuration file. The toml configuration file is given below.
- You can read more about the toml configuration file here.
- The most recent toml configuration file is located at git repository.
name = "classes"
isActive = true
buildSystem = "cmake"
git = 'github.com/easifem/classes.git'
sourceDir = "${HOME}/Dropbox/easifem/easifem-classes/"
buildDir = "${HOME}/.easifem/easifem/build/classes/"
installDir = "${HOME}/.easifem/easifem/install/classes/"
buildType = "Debug"
buildSharedLibs = true
buildStaticLibs = false
libName = "easifemClasses"
targetName = "easifemClasses"
projectName = "easifemClasses"
param.MAX_NODE_TO_NODE = 256
param.MAX_NODE_TO_ELEM = 128
runtest = true
license = "GPL3"
# cmakePrefixPath=["${HOME}/.easifem/easifem/install/base/"]
# buildOptions = []
dependencies = ["base"]
Using CMake
easifem uses CMake build system.
To manually install easifem
from the source we need to perform following tasks.
- Download the source code from git repository.
- Configuration the project by using CMake.
- Build by using CMake.
- Install by using CMake.
Step-1: Download source code
- Git+https
- Git+ssh
- GitHub CLI
- ↢
git clone https://github.com/easifem/classes.git classes
git clone git@github.com:easifem/classes.git classes
gh repo clone easifem/classes classes
Step-2: Configuration
After downloading the source code, enter the source directory, and make a build directory.
cd classes
mkdir ./build
To configure the easifemClasses
library you can define following variables:
Variable | Type | Options | Default |
---|---|---|---|
CMAKE_BUILD_TYPE | STRING | Release , Debug | Release |
BUILD_SHARED_LIBS | BOOL | ON , OFF | ON |
CMAKE_INSTALL_PREFIX | PATH | Please specify | $EASIFEM_CLASSES |
An example of configuration step is given below:
export EASIFEM_CLASSES=${HOME}/.local/easifem/classes
cmake -G "Ninja" -S ./ -B ./build \
-D CMAKE_BUILD_TYPE:STRING=Release \
-D BUILD_SHARED_LIBS:BOOL=ON \
-D CMAKE_INSTALL_PREFIX:PATH=${EASIFEM_CLASSES}
Step-3 and 4: Build and Install
After configuration, you can build and install the library by using:
cmake --build ./build --target --install
Build options
CMAKE_BUILD_TYPE
If CMAKE_BUILD_TYPE
denotes the build type of library. You can read more it at the cmake website.
This variable is string type and it can take following values:
Release
: IfCMAKE_BUILD_TYPE
is set toRelease
, then highly optimized version ofeasifemBase
is built without any debugging facility. This option should be used by the users of easifem.Debug
: IfCMAKE_BUILD_TYPE
is set toDebug
, then library is built with debugging facility. This is useful for developer of easifem. No optimization, asserts enabled, [custom debug (output) code enabled], debug info included in executable (so you can step through the code with a debugger and have address to source-file:line-number translation).RelWithDebInfo
: optimized, with debug info, but no debug (output) code or asserts.MinSizeRel
: same as Release but optimizing for size rather than speed.
You can set this option by using --D CMAKE_BUILD_TYPE:STRING=Release
.
BUILD_SHARED_LIBS
If BUILD_SHARED_LIBS
is set to ON
, then position independent code (PIC) shared library will be built. Otherwise, a static library will be built.
You can read more about BUILD_SHARED_LIBS
at the cmake website.
You can set this option by using --D BUILD_SHARED_LIBS:BOOL=ON
.
CMAKE_INSTALL_PREFIX
CMAKE_INSTALL_PREFIX
is a PATH
option, which specifies the location of file system where easifemClasses
library will be installed. If you have set the environment variables correctly then you can specify it to $EASIFEM_CLASSES
, which is given by $EASIFEM_INSTALL_DIR/easifem/classes/
You can set this option by using --D CMAKE_INSTALL_PREFIX:PATH=$EASIFEM_CLASSES
.
You can read about CMAKE_INSTALL_PREFIX
at the cmake website.