macOS
In this section you will perform a quick installation of easifem library and run some sample programs.
Following steps are performed in this section.
- Installing
easifemcommand line interface. - Set up the environment variables by using
easifemCLI. - Install
easifemlibrary.
It is recommended that you read (and follow) the steps given below to quickly install easifem. However, due to any reason, if you do not want to read the instruction given below, then just copy and paste the command given below.
- bash/zsh
- fish
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \
brew update && brew upgrade && \
brew install gcc gfortran libomp curl git python3 cmake ninja lapack openblas hdf5 plplot gnuplot doxygen gtk4 lua go && \
git clone https://github.com/easifem/config.git ~/.config/easifem && \
source ~/.config/easifem/easifemvar.sh && \
easifem install extpkgs base classes
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \
brew update && brew upgrade && \
brew install gcc gfortran libomp curl git python3 cmake ninja lapack openblas hdf5 plplot gnuplot doxygen gtk4 lua go && \
git clone https://github.com/easifem/config.git ~/.config/easifem && \
source ~/.config/easifem/easifemvar.fish && \
easifem install extpkgs base classes
Step by step building
Step 1: Install system dependencies
brew install gcc gfortran libomp curl git python3 cmake ninja lapack openblas hdf5 plplot gnuplot doxygen gtk4 lua go
If you are using Clang compiler then make sure to set LDFLAGS and CPPFLAGS as follows (otherwise, openmp cannot be used)
Fish shell
set -gx LDFLAGS "-L/opt/homebrew/opt/libomp/lib"
set -gx CPPFLAGS "-I/opt/homebrew/opt/libomp/include"
Bash or Zsh shell
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
Step 2: Install easifem CLI
You can read more about
easifemcommand line interface here
make sure go language is installed. If not then run brew install go
To install easifem command line interface, you can use the following command.
go install github.com/easifem/easifemGO/cmd/easifem@latest
To install the development version of easifem, you can use the following command.
go install github.com/easifem/easifemGO/cmd/easifem@dev
Now easifem is installed on your system, you can check the location by using the command which easifem.
You can get the help by using the following command.
easifem help
Step 3: Setting up environment variables
To configure easifem and to get snippets it is better to clone the git repository from github.com/easifem/config to $HOME/.config/easifem by using following.
git clone https://github.com/easifem/config.git ~/.config/easifem
You can read more more about the configuration files here.
If your active shell is zsh or bash, then please run the following command.
# add to ~/.bashrc or ~/.zshrc
source ~/.config/easifem/easifemvar.sh
If your active shell is fish, then run the following command.
# add to ~/.config/fish/config.fish
source ~/.config/easifem/easifemvar.fish
Check your shell
You can check your active shell by using the following command.
echo $SHELL
Now, you need to modify the shell file by adding following lines.
Click here to see how to modify the shell(recommended)
If you do not want to source the easifemvar files every time you open a new terminal window, then please add following lines to your shell configuration.
- Bash Shell
- Zsh Shell
- 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.
If you are using the Zsh shell, then you can place easifemvar.sh in your shell. Open ~/.zshrc file 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.
If you are using Fish shell, then you can place easifemvar.fish in your shell. For fish shell, open ~/.config/fish/config.fish in the editor and add the following line at the end of the file:
source $HOME/.config/easifem/easifemvar.fish
- Save the file and exit.
- Restart your terminal.
Step 4: install easifem
easifem install extpkgs base classes