The methods described below are referred from these links
viewtopic.php?f=11&t=3725&sid=de900ae98 ... d23#p12723
http://www.elmerfem.org/elmerwiki/index ... sing_Cmake
I am very thankful to Peter for instructing us a lucid way to compile and install elmer in Ubuntu.
For users of CentOS, the methods of installing Elmer (via Cmake) are described in this thread started by Xavier.
- i. For the context of here , the scripts with "$" in their front mean that they are to be typed in the terminal and if they are without it "they are to be written in places other than terminal".
- i. Install cmake-qt-gui
Code: Select all
$sudo apt-get install cmake-qt-gui
- ii. Find the number of processors of CPU by typing
in the terminal. For this context, it was 4.
Code: Select all
$nproc
this number will used later as make -j 4 install[/b]
Steps for Building, Installing and Testing Elmer in Ubuntu 14.04
1. Create a directory to download elmer software and jump into the directory
Code: Select all
$mkdir elmer
Code: Select all
$cd elmer
Code: Select all
$git clone git://www.github.com/ElmerCSC/elmerfem
Code: Select all
$git clone https://www.github.com/ElmerCSC/elmerfem
Code: Select all
$ mkdir build
Code: Select all
$ cd build
#Method A: Using cmake-gui to build elmer
Open the cmake-gui
Code: Select all
$ cmake-gui
- a) Click the browse source in "where is the source code" and select it as
b)Click the browse build in "where to build the binaries" and select it as
Code: Select all
HOME/username/elmer/elmerfem
c) ConfigureCode: Select all
HOME/username/elmer/build
d) Set the CMAKE_BUILD_TYPE in its default condition of None (empty value as shown in figure below) at the corresponding row in the "Value" column (can be studied from this reference.[CMAKE_BUILD_TYPE=None implies that CMAKE_C_FLAGS or CMAKE_CXX_FLAGS are used.]Code: Select all
CMAKE_BUILD_TYPE= ..........(No value means None)
or,
The other options for values are Debug or Release or RelWithDebInfo or MinSizeRel
i.e.For some specific requirements, one can select from any one of these build types]Code: Select all
CMAKE_BUILD_TYPE= .......... CMAKE_BUILD_TYPE= RelWithDebInfo CMAKE_BUILD_TYPE=Debug CMAKE_BUILD_TYPE=Release CMAKE_BUILD_TYPE=MinSizeRel
Some user settings for destination install folder are:
**Either : User setiings for installation path
The prefix of install directory can be changed to the desired path by clicking at the corresponding rows of the "Value" column:**Or: Default settings (Has to be proceeded as root user during installation i.e. $sudo -s)Code: Select all
CMAKE _INSTALL_PREFIX home/username/elmer/install ELMER_SOLVER_HOME home/username/elmer/install/share/elmersolver
By default, the install destination for Elmer will appear as following during the configuration process in the gui of cmake-gui:Code: Select all
CMAKE_INSTALL_PREFIX /usr/local ELMER_SOLVER_HOME /usr/local/share/elmersolver
e) Configure to update
f) Select the required parameters one by one and click configure each time to update selection. ( For a minimal ElmerNonGUI version, the default options given in the cmake-gui is sufficient. In my context, the only selected option by default was WITH_MPI.)
For more parameters, look at the contents of elmerfem directory and choose the parameters
(e.g. WITH_ELMERGUI -->>Configure to Update, again the Cmake leads to additional features within ElmerGUI, have a look within the elmerfem/ElmerGUI/ directory and click the available libraries such as with matc, WITH_PYTHONQT, WITH_PARAVIEW ...and so on.Click configure to update. Libraries which are not within ElmerGUI directory of downloaded elmerfem, should be shown the path if cmake doesnot find them when searching. ) In the same way, select WITH_ELMERGUILOGGER -->> Configure, WITH_ELMERGUITESTER -->> Configure, ...WITH_Elmerice -->>Configure and so on.
(Note: The selection or unselection of a parameter followed by "configure" clicking will update the change made in "Cmake configure procedure")
g) Generate
#Method B Using cmake Command
Code: Select all
$cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install ../elmerfem
- Note: With each of these methods, Makefile will be generated along with other prerequisites for Elmer installataion.
5. Compile using the generated Makefile
Code: Select all
$ make -j4 install
Code: Select all
$ ctest -j4
Code: Select all
$gedit ~/.bashrc
Code: Select all
export ELMER_HOME=$HOME/elmer/install/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib
export PATH=$PATH:$ELMER_HOME/bin
In this way, the building and installation of elmer in Ubuntu 14.04 is completed. This installation via cmake does not include Elmer Post and so users can use Paraview for post-processing(After the Elmer Post installation is available via cmake, this sentence will be removed from here).
Getting Started with Elmer Tests or Examples using Elmer NonGUI
Steps for Running of the ElmerNonGui Tutorial/ Elmer Test
It is assumed that the elmerfem and install folders are in the /home/elmer/ directory.
1. Make an elmer_project directory outside the elmer directory (i.e. elmer_project directory resides in home directory for running tutorials and other works of the user)
Code: Select all
$mkdir elmer_project
Code: Select all
$cp -r $HOME/elmer/elmerfem/fem/tests/CavityLid/ $HOME/elmer_project/CavityLid
Code: Select all
$cd ~/elmer_project/CavityLid/
Code: Select all
$ElmerGrid 1 2 square.grd
Code: Select all
$gedit case.sif
Code: Select all
Post File = case.vtu
Save the edited file.
6. Run the ElmerSolver command
Code: Select all
$ElmerSolver > anyname.log 2>&1
Code: Select all
$paraview
Code: Select all
$sudo apt-get install paraview
1. At the ElmerGUI directory in ~/elmer/install/share/ directory,copy the contents(.xml files) of edf-extra folder to edf folder
Code: Select all
$ cp ~/elmer/install/share/ElmerGUI/edf-extra/* ~/elmer/install/share/ElmerGUI/edf/
3. Open the GUi of elmer
Code: Select all
$ElmerGUI
Yours
Anil Kunwar