Skip to main content

Environment variables

To install EASIFEM you need to define following environment variables in your shell.

  • EASIFEM_INSTALL_DIR: The location of file system where EASIFEM will be installed. For example, /opt, ${HOME}, /usr/local/. Default location is $HOME/.easifem/install/.
  • EASIFEM_SOURCE_DIR: The location of file system where the source code of EASIFEM will be downloaded. For example, ~/.easifem/src/.
  • EASIFEM_BUILD_DIR: The location of file system where build files will be stored. These files are necessary for installation, and after installation you can remove them if you want. Always keep your build directory separated from your source and install directory. For example, ~/.easifem/build/.

The above-mentioned environment variables are the fundamental environment variables, which are used for defining other variables as shown in the following table.

Env-var namedescriptionexample
EASIFEM_INSTALL_DIRLocation of file system where EASIFEM library will install its components and external packages.~/.easifem/install/
EASIFEM_SOURCE_DIRLocation of file system where the source code will be downloaded.~/.easifem/src/
EASIFEM_BUILD_DIRLocation of file system where the build files will be stored.~/.easifem/build/
EASIFEM_EXTPKGSLocation of file system where external packages will be installed.$EASIFEM_INSTALL_DIR/easifem/extpkgs
EASIFEM_BASELocation where easifemBase library will be installed.EASIFEM_BASE=EASIFEM_INSTALL_DIR/easifem/base
EASIFEM_CLASSESLocation where easifemClasses library will be installed.EASIFEM_INSTALL_DIR/easifem/classes
EASIFEM_MATERIALSLocation where easifemMaterials library will be installed.EASIFEM_INSTALL_DIR/easifem/materials
EASIFEM_KERNELSLocation where easifemKernels library will be installed.EASIFEM_INSTALL_DIR/easifem/kernels

Automatic setup of environment variables​

note

First, make sure you have successfully installed the easifem CLI as mentioned in Step-1.

You can set up the environment variables by using the easifem CLI application.

easifem setenv --install /home/easifem/install --build /home/easifem/build --source /home/easifem/src

You can also use short flags for --install (-i), --build (-b), and --source (-s) as shown below.

easifem setenv -i ~/.easifem/install -b ~/.easifem/build -s ~/.easifem/src

This command will create config files for bash, zsh, and fish shell in ~/.config/easifem directory.

  • For bash and zsh shell, the name of the file is easifemvar.sh
  • For fish shell, the name of the file is easifemvar.fish.

Then, you can run following command to bring the changes in your current shell session.

For bash and zsh SHELL πŸ‰
source ${HOME}/.config/easifem/easifemvar.sh
For fish SHELL 🍎
source $HOME/.config/easifem/easifemvar.fish
Click here to see how to check your SHELL

The following command will provide the information of the current shell.

echo $SHELL
Modify the SHELL

Now you need to a line to your default shell, the process is described below for Bash, Zsh, and Fish shell.

If you are using Bash shell, then you can place easifemvar.sh in your shell. Open ~/.bashrc in the editor, and add the following line at the end of the file.

source ${HOME}/.config/easifem/easifemvar.sh
  • Save the file and exit.
  • Restart your terminal, and try following command.
echo $EASIFEM_INSTALL_DIR

Manual set up of environment variable​

If you want to set up the environment variable by yourself, then you can follow the following instructions.

Add following environment to ~/.bashrc

    export EASIFEM_INSTALL_DIR=$HOME/.easifem/install
export EASIFEM_BUILD_DIR=$HOME/.easifem/build/
export EASIFEM_SOURCE_DIR=$HOME/.easifem/src/

export EASIFEM_BASE=$EASIFEM_INSTALL_DIR/easifem/base
export EASIFEM_CLASSES=$EASIFEM_INSTALL_DIR/easifem/classes
export EASIFEM_EXTPKGS=$EASIFEM_INSTALL_DIR/easifem/extpkgs
export EASIFEM_APP=$EASIFEM_INSTALL_DIR/easifem/app
export EASIFEM_MATERIALS=$EASIFEM_INSTALL_DIR/easifem/materials
export EASIFEM_KERNELS=$EASIFEM_INSTALL_DIR/easifem/kernels

export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${EASIFEM_EXTPKGS}/lib/pkgconfig"

export PATH="${PATH}:${EASIFEM_EXTPKGS}/bin"
export PATH="${PATH}:${EASIFEM_APP}/bin"

export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${EASIFEM_BASE}/lib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${EASIFEM_CLASSES}/lib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${EASIFEM_EXTPKGS}/lib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${EASIFEM_APP}/lib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${EASIFEM_MATERIALS}/lib"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${EASIFEM_KERNELS}/lib"