Installing, Compiling & Running Elmer in Ubuntu 14.04

Discussion about building and installing Elmer
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

fatal error: tcl.h

Post by teobo »

Hi annier,
thanks for the effort, tried out the new compile script, too.
As well

Code: Select all

apt-get install tcl8.6-dev
dpkg -L tcl8.6-dev |grep tcl.h
The compilation still breaks off with error.
Log below and in attachment. What can one do?
tia

Code: Select all

 954  sh compile2.sh >anyname.log  2>&1
  955  tail anyname.log 
  956  less anyname.log 
  957  history
kubuntu@kubuntu:~/elmerfem$ cat compile2.sh 
#!/bin/sh -f
    #the compiler (here the gcc 4.X suite)
    export CC=gcc
    export CXX=g++
    export FC=gfortran
    export F77=gfortran
    #the compiler flags
    export CFLAGS=""
    export FCFLAGS=""
    export F77FLAGS=""
    export FFLAGS=""
    #linking
    export LDFLAGS=""
    #paths
    #export ELMER_HOME="/path/to/Elmerdir"
    export ELMER_HOME="$HOME/elmerinst"
    # modules
    modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter  post"
    # configure and build
    for m in $modules; do
      cd $m ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
    done
    # configure and build the module fem using mpi related aspect
    cd fem; ./configure --prefix=$ELMER_HOME --with-mpi-inc-dir=/usr/include/mpich2 
    make clean
    make
    make install 
    cd ..
    done

kubuntu@kubuntu:~/elmerfem$ tail -n20 anyname.log 
Making install in glaux
make[2]: Entering directory `/home/kubuntu/elmerfem/post/src/glaux'
make[3]: Entering directory `/home/kubuntu/elmerfem/post/src/glaux'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/home/kubuntu/elmerfem/post/src/glaux'
make[2]: Leaving directory `/home/kubuntu/elmerfem/post/src/glaux'
Making install in camera
make[2]: Entering directory `/home/kubuntu/elmerfem/post/src/camera'
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src -I../../src/include    -O -m64 -fPIC -I/home/kubuntu/elmerinst/include -pthread -pthread -I/usr/include/freetype2 -MT camera.o -MD -MP -MF .deps/camera.Tpo -c -o camera.o camera.c
camera.c:346:17: fatal error: tcl.h: No such file or directory
 #include <tcl.h>
                 ^
compilation terminated.
make[2]: *** [camera.o] Error 1
make[2]: Leaving directory `/home/kubuntu/elmerfem/post/src/camera'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/kubuntu/elmerfem/post/src'
make: *** [install-recursive] Error 1
compile2.sh: 29: compile2.sh: Syntax error: "done" unexpected
Attachments
anyname.log
(383.76 KiB) Downloaded 534 times
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

Hi Teobo,
I am very sorry for sending you the script with wrong syntax.
The word "done " was wrongly written twice in the compile script.
Please retry with this one.
And replyhere with either your answer or logfile again.

Code: Select all

 #!/bin/sh -f
    #the compiler (here the gcc 4.X suite)
    export CC=gcc
    export CXX=g++
    export FC=gfortran
    export F77=gfortran
    #the compiler flags
    export CFLAGS=""
    export FCFLAGS=""
    export F77FLAGS=""
    export FFLAGS=""
    #linking
    export LDFLAGS=""
    #paths
    #export ELMER_HOME="/path/to/Elmerdir"
    export ELMER_HOME="$HOME/elmerinst"
    # modules
    modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter  post"
    # configure and build
    for m in $modules; do
       cd $m ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
       # configure and build the module fem using mpi related aspect
       cd fem; ./configure --prefix=$ELMER_HOME --with-mpi-inc-dir=/usr/include/mpi && make clean && make && make install && cd ..
    done
Yours
Anil Kunwar
Last edited by annier on 11 Oct 2014, 18:09, edited 1 time in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

ok another try. :) Go for it..
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

Code: Select all

./configure --prefix=$ELMER_HOME --with-mpi-inc-dir=/usr/include/mpich2

checking for compilation of an MPI program... configure: error: MPI not found; check paths for MPI package first...
I believe some program related with mpi must be installed or be reinstalled. But I do not know which. Btw a list of deb packages could be useful for your howto, too.

and then afterwards:

Code: Select all

make
..
checking for mpi-inc-directory... /usr/include/mpich2
/usr/include/HYPRE_utilities.h:26:17: fatal error: mpi.h: No such file or directory
1. indeed there is no mpi.h in /usr/include/mpich2
2. error message comes, too, when mpi is declared disabled by configure.

Ideas?
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

Hi Teobo,
1. The error message about inclusion of mpi is similar to the one which has been posted in the following post.
viewtopic.php?f=3&t=3585&sid=6167e34580 ... 98837357af

2. In my context, i could install Elmer in Ubuntu 14.04 Desktop Computer without separately requiring the fem module with mpi whereas i have still not been able to compile it in the Ubuntu 14.04 netbook. In the desktop computer, there is a symlink of mpi in /usr/include and so i hope Elmer could be installed in it easily. I will write later about the file system configuration of /usr/include/ of my Ubuntu 14.04 netbook after i see it.

3.I think Elmer fem module requires the mpi interface (with all the required .h files) whether we quote it or not in the compile script, so i guess it is inherently necessary to provide a " fulfilling" symlink of mpi in the /usr/include/ directory.

Code: Select all

$ sudo -s
$ln -s /path/A/   /usr/include/mpi 
Note 1: Path A is the path to the directory where you have mpi installed and typing the command above, you will be able to create a symlink(symbolic link) of mpi in /usr/include/ directory. If you do not have mpi installed, install openmpi or any mpi with sudo apt-get install command.Then you have to find the path of installed directory and further create its symlink in /usr/include/ directory.

Code: Select all

$sudo -s
$ln -s /path/to/openmpi's_include_directory/ /usr/include/mpi

4. Note 2: >>>>>Some of my thoughts
I checked the linking of mpi within the desktop computer that is how the mpi link in /usr/include/ was made.
i. openmpi is installed at the /usr/lib/ directory.
ii. The include (only include and not lib) directory of openmpi was linked in the /etc/alternatives/ directory. If we have to manually do it, we have to be root and type the following command in terminal.

Code: Select all

$ln -s /usr/lib/openmpi/include/  /etc/alternatives/mpi
.
Now, the contet of openmpi/include/ were linked within a newly created mpi directory there.
iii. This is futher linked to the /usr/include/ directory as following. We need to be root to operate in the computer system files.

Code: Select all

ln -s /etc/alternatives/mpi/  /usr/include/mpi 
iv. As fem module of Elmer requires mpi interface via /usr/include/ directory it can access it if it is provided there as a symlink.
v. It is my thought and i am not sure how it works. Any suggesting answers are welcome.
vi. Importantly, i did not make this symlink myself and it may have been built during the installation of some softwares as this linking was coded in them. So, i think we have to check whether mpi with the following contents are present or linked in the /usr/include/ directory.

Code: Select all

contents of symlinked mpi in the desktop computer's /usr/include/ directory
1. openmpi/  >>>>this directory has a lot of subfolders and .h files inside it again.
2.mpi.h   >>>>>this file was mentioned as the missing file in the error message
3.mpi-ext.h
4.mpif.h
5.mpif-commn.h
6.mpif-config.h
7.mpif-mpi-io.h
8.mpi_portable_platform.h
vii. Importantly, the symlink mpi in the /usr/include, has the mpi.h file which has been stated to be missing in the above error message.


Yours
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

CODE: SELECT ALL
./configure --prefix=$ELMER_HOME --with-mpi-inc-dir=/usr/include/mpich2
in the previous post you mention /usr/include/mpi. Should not the option changed to mpi-with-mpi-inc-dir=/usr/include/mpi ,too?
tia
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

Hi,
made some steps forward, - I believe because of installing a few packages, gonna post them later.
Some binaries seem ready, however there is no ElmerPost between .

Thats the next error. Somebody an idea?
camera.c:346:17: fatal error: tcl.h: No such file or directory
#include <tcl.h>
here ist the log:
https://www.dropbox.com/s/uc47xamitznqi ... e.log?dl=0

Code: Select all

kubuntu@kubuntu:~/elmerfem$ cat compile3.sh 
#!/bin/sh -f
    #the compiler (here the gcc 4.X suite)
    export CC=gcc
    export CXX=g++
    export FC=gfortran
    export F77=gfortran
    #the compiler flags
    export CFLAGS=""
    export FCFLAGS=""
    export F77FLAGS=""
    export FFLAGS=""
    #linking
    export LDFLAGS=""
    #paths
    #export ELMER_HOME="/path/to/Elmerdir"
    export ELMER_HOME="$HOME/elmerinst"
    # modules
    modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter  post"
    # configure and build
    for m in $modules; do
       cd $m ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
       # configure and build the module fem using mpi related aspect
       cd fem; ./configure --prefix=$ELMER_HOME --with-mpi-inc-dir=/usr/include/mpi && make clean && make && make install && cd ..
    done
kubuntu@kubuntu:~/elmerfem$ ls ../elmerinst/bin/
elmerf90  elmerf90-nosh  ElmerGrid  elmerld  ElmerMesh2D  ElmerSolver  ElmerSolver_mpi	GebhardtFactors  matc  Mesh2D  SC2Elmer  ViewFactors
kubuntu@kubuntu:~/elmerfem$ 
Thats what I tried without success:

Code: Select all

root@kubuntu:~# apt-file search tcl.h|grep -w tcl.h
liboop-dev: /usr/include/oop-tcl.h
perl-tk: /usr/lib/perl5/Tk/pTk/tcl.h
tcl8.4-dev: /usr/include/tcl8.4/tcl-private/generic/tcl.h
tcl8.4-dev: /usr/include/tcl8.4/tcl.h
tcl8.5-dev: /usr/include/tcl8.5/tcl-private/generic/tcl.h
tcl8.5-dev: /usr/include/tcl8.5/tcl.h
tcl8.6-dev: /usr/include/tcl8.6/tcl-private/generic/tcl.h
tcl8.6-dev: /usr/include/tcl8.6/tcl.h
root@kubuntu:~# apt-get install tcl8.5-dev

annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

Hi Teobo,
The main installation issue for Elmer in some computers lacking libraries needed for graphics card compatibility is with the installation of ElmerPost as post module.
In my Ubuntu 14.04 (64 bit) netbook,the compilation had previously shown error messages. Just you were trying there, i was trying the installation of Elmer in my Ubuntu 14.04 netbook here. To find out where the compilation stops, i compiled each of the following modules separately:
hutiter, matc, umfpack, mathlibs, elmergrid, meshgen2d, eio and post. The compilation encountered error during the installation of post module. But since i was installing each module separately, the failure in installation of post module did not affect the other modules.
Then i proceeded with the installation of fem module with mpi-with-mpi-inc-dir=/usr/include/mpi, and its installation also went successful.
Now, the Elmer (without the ElmerPost option) is installed in my netbook.

I tested the Elmer and it ran successfully. For postprocessing, i am using the Paraview software.
It can be installed with

Code: Select all

sudo apt-get install paraview
In the solver input file (abcd.sif), if we put,

Code: Select all

post file = efgh.vtu
, the output file can be viewed with paraview.

Just after the installation and compilation tips, the tips about testing of CavityLid tutorial in ElmerNonGui has been written along with. You can test your installed Elmer with those steps.

Yours
Anil Kunwar
Last edited by annier on 15 Oct 2014, 20:11, edited 9 times in total.
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
annier
Posts: 1168
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by annier »

Hi Teobo,
Please try with this compile script in step 4.

Code: Select all

  #!/bin/sh -f
        #the compiler (here the gcc 4.X suite)
        export CC=gcc
        export CXX=g++
        export FC=gfortran
        export F77=gfortran
        #the compiler flags
        export CFLAGS=""
        export FCFLAGS=""
        export F77FLAGS=""
        export FFLAGS=""
        #linking
        export LDFLAGS=""
        #paths
        #export ELMER_HOME="/path/to/Elmerdir"
        export ELMER_HOME="$HOME/elmerinst"
        # modules
        #modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter and fem"
        cd hutiter ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
        cd matc ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
        cd umfpack ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
        cd mathlibs ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
        cd elmergrid ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
        cd meshgen2d ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
        cd eio  ; ./configure --prefix=$ELMER_HOME && make clean && make && make install && cd ..
        # configure and build the module fem using mpi related aspect
        cd fem; ./configure --prefix=$ELMER_HOME --with-mpi-inc-dir=/usr/include/mpi && make clean && make && make install && cd ..
        done
This compile script compiles elmer without Elmer Post and each module has been compiled separately.

Yours
Anil Kunwar
Anil Kunwar
Faculty of Mechanical Engineering, Silesian University of Technology, Gliwice
teobo
Posts: 97
Joined: 07 Sep 2014, 10:41
Antispam: Yes

Re: Installing, Compiling & Running ElmerNonGUI in Ubuntu 14.04

Post by teobo »

hello,
I am still compiling, and meanwhile I ask here I keep on trying things and get to new stages sometimes. Trying out things cost much time compiling and therefore is not so easy to find trade offs between asking and trying.
here is the logs

Code: Select all

https://www.dropbox.com/s/uc47xamitznqiw2/anyname.log?dl=0
kubuntu@kubuntu:~/elmerfem$ tail -n20 anyname.log
Making all in modules
make[3]: Entering directory `/home/kubuntu/elmerfem/post/src/modules'
gcc -DHAVE_CONFIG_H -I. -I../..   -I/usr/include/tk8.6 -I/usr/include/tcl8.6  -O -m64 -fPIC -I/home/kubuntu/elmerinst/include -pthread -pthread -I/usr/include/freetype2 -MT matctcl.o -MD -MP -MF .deps/matctcl.Tpo -c -o matctcl.o matctcl.c
matctcl.c: In function ‘matc_tcl’:
matctcl.c:82:18: error: ‘Tcl_Interp’ has no member named ‘result’
    if ( TCLInterp->result && (n=strlen(TCLInterp->result))>0 )
                  ^
matctcl.c:82:49: error: ‘Tcl_Interp’ has no member named ‘result’
    if ( TCLInterp->result && (n=strlen(TCLInterp->result))>0 )
                                                 ^
matctcl.c:85:53: error: ‘Tcl_Interp’ has no member named ‘result’
        for( i=0; i<n; i++ ) M( res,0,i ) = TCLInterp->result[i];
                                                     ^
make[3]: *** [matctcl.o] Error 1
make[3]: Leaving directory `/home/kubuntu/elmerfem/post/src/modules'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/kubuntu/elmerfem/post/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kubuntu/elmerfem/post'
make: *** [all] Error 2
kubuntu@kubuntu:~/elmerfem$ 
These were the packages that I by and by installed:

Code: Select all

apt-get install liblapack-dev  libatlas-dev libarpack2-dev libparpack2-dev libmpich2-dev libhypre-dev  libqwt-dev libvtk5-qt4-dev libpythonqt-dev libpythonqt2.1  libftgl-dev
apt-get install tcl8.6-dev




root@kubuntu:~# grep insta /var/log/dpkg.log |grep -v installed
2014-10-07 16:48:53 install elmer-dbg:amd64 <none> 6.1.0.svn.5396.dfsg2-4ubuntu1
2014-10-07 16:48:54 install elmer-doc:all <none> 2011.09.06-1
2014-10-10 14:47:18 install tcl8.6-dev:amd64 <none> 8.6.1-4ubuntu1
2014-10-10 21:42:21 install libmpich10:amd64 <none> 3.0.4-6ubuntu1
2014-10-10 21:42:23 install libcr-dev:amd64 <none> 0.8.5-2.1
2014-10-10 21:42:23 install hwloc-nox:amd64 <none> 1.8-1ubuntu1
2014-10-10 21:42:25 install libmpich-dev:amd64 <none> 3.0.4-6ubuntu1
2014-10-10 21:42:26 install mpich:amd64 <none> 3.0.4-6ubuntu1
2014-10-10 21:42:27 install mpich2:amd64 <none> 3.0.4-6ubuntu1
2014-10-10 22:45:23 install curl:amd64 <none> 7.35.0-1ubuntu2.1
2014-10-10 22:45:24 install libconfig-file-perl:all <none> 1.50-2
2014-10-10 22:45:25 install libregexp-assemble-perl:all <none> 0.35-8
2014-10-10 22:45:26 install apt-file:all <none> 2.5.2ubuntu1
2014-10-10 23:28:51 install libmpich2-dev:amd64 <none> 3.0.4-6ubuntu1
2014-10-10 23:41:26 install python-scientific:amd64 <none> 2.9.4-1
2014-10-10 23:41:27 install python-mpi:all <none> 2.9.4-1
2014-10-10 23:41:28 install mpich2python:amd64 <none> 2.9.4-1
2014-10-10 23:41:30 install pyro:all <none> 1:3.14-1.1
2014-10-10 23:41:31 install python-netcdf:amd64 <none> 2.9.4-1
2014-10-11 14:32:24 install libparpack2-dev:amd64 <none> 3.1.5-2
2014-10-11 16:57:18 install tcl8.5-dev:amd64 <none> 8.5.15-2ubuntu1
2014-10-11 19:46:36 install libgssrpc4:amd64 <none> 1.12+dfsg-2ubuntu4.2
2014-10-11 19:46:38 install libkadm5clnt-mit9:amd64 <none> 1.12+dfsg-2ubuntu4.2
2014-10-11 19:46:39 install libkdb5-7:amd64 <none> 1.12+dfsg-2ubuntu4.2
2014-10-11 19:46:40 install libkadm5srv-mit9:amd64 <none> 1.12+dfsg-2ubuntu4.2
2014-10-11 19:46:41 install comerr-dev:amd64 <none> 2.1-1.42.9-3ubuntu1
2014-10-11 19:46:41 status triggers-pending install-info:amd64 5.2.0.dfsg.1-2
2014-10-11 19:46:42 install krb5-multidev:amd64 <none> 1.12+dfsg-2ubuntu4.2
2014-10-11 19:46:44 install libatlas-dev:all <none> 3.10.1-4
2014-10-11 19:46:45 install libavutil-dev:amd64 <none> 6:9.16-0ubuntu0.14.04.1
2014-10-11 19:46:46 install libavcodec-dev:amd64 <none> 6:9.16-0ubuntu0.14.04.1
2014-10-11 19:46:48 install libavformat-dev:amd64 <none> 6:9.16-0ubuntu0.14.04.1
2014-10-11 19:46:49 install libcf0:amd64 <none> 1:4.1.3-7ubuntu2
2014-10-11 19:46:50 install libfontconfig1-dev:amd64 <none> 2.11.0-0ubuntu4.1
2014-10-11 19:46:51 install libftgl-dev:amd64 <none> 2.1.3~rc5-4+nmu1
2014-10-11 19:46:53 install libmysqlclient-dev:amd64 <none> 5.5.38-0ubuntu0.14.04.1
2014-10-11 19:46:54 install libnetcdff5:amd64 <none> 1:4.1.3-7ubuntu2
2014-10-11 19:46:55 install libnetcdf-dev:amd64 <none> 1:4.1.3-7ubuntu2
2014-10-11 19:46:56 install libssl-dev:amd64 <none> 1.0.1f-1ubuntu2.5
2014-10-11 19:46:58 install libpq-dev:amd64 <none> 9.3.5-0ubuntu0.14.04.1
2014-10-11 19:46:59 install libpythonqt2.1:amd64 <none> 2.1.0~svn247-1
2014-10-11 19:47:00 install libpythonqt-dev:amd64 <none> 2.1.0~svn247-1
2014-10-11 19:47:01 install libqwt6:amd64 <none> 6.0.0-1.2
2014-10-11 19:47:02 install libqwt-dev:amd64 <none> 6.0.0-1.2
2014-10-11 19:47:03 install libssl-doc:all <none> 1.0.1f-1ubuntu2.5
2014-10-11 19:47:04 install libswscale-dev:amd64 <none> 6:9.16-0ubuntu0.14.04.1
2014-10-11 19:47:05 install x11proto-scrnsaver-dev:all <none> 1.2.2-1
2014-10-11 19:47:06 install libxss-dev:amd64 <none> 1:1.2.2-1
2014-10-11 19:47:06 install x11proto-render-dev:all <none> 2:0.11.1-2
2014-10-11 19:47:07 install libxrender-dev:amd64 <none> 1:0.9.8-1
2014-10-11 19:47:09 install libxft-dev:amd64 <none> 2.3.1-2
2014-10-11 19:47:09 install tk8.6-dev:amd64 <none> 8.6.1-3ubuntu2
2014-10-11 19:47:11 install libvtk5-dev:amd64 <none> 5.8.0-14.1ubuntu3
2014-10-11 19:47:14 install libvtk5-qt4-dev:amd64 <none> 5.8.0-14.1ubuntu3
2014-10-11 19:47:33 trigproc install-info:amd64 5.2.0.dfsg.1-2 5.2.0.dfsg.1-2
2014-10-11 19:47:33 status half-configured install-info:amd64 5.2.0.dfsg.1-2
2014-10-12 00:22:19 install tk8.5-dev:amd64 <none> 8.5.15-2ubuntu3
Post Reply