[Solved] Error during installation at: make -j

Discussion about building and installing Elmer
Post Reply
ScientistRenzo
Posts: 57
Joined: 14 Mar 2021, 21:01
Antispam: Yes

[Solved] Error during installation at: make -j

Post by ScientistRenzo »

I am on Windows 10.
I am using Oracle VM VirtualBox.
I am using Ubuntu 20.04 on Oracle VM VirtualBox.
I followed the YouTube video "Elmer compilation for Ubuntu Focal", I typed into the terminal on Ubuntu, and I may have caught errors during the cmake -C ../elmer.cmake ../elmerfem/ -DCMAKE_INSTALL_PREFIX="/home/elmeruser/Elmer" command, and the make -j 3 command.
If you recommend restarting and following another installation tutorial, thank you in advance.


Here's the installation process I followed on Ubuntu within a vm.
sudo apt install -y --no-install-recommends \
build-essential \
git \
libblas-dev \
liblapack-dev \
libmumps-dev \
libparmetis-dev \
libhypre-dev \
gfortran \
mpich \
sudo \
cmake \
ca-certificates \
less

sudo apt-get install -y liboce-modeling-dev \
liboce-foundation-dev \
qtscript5-dev \
libqt5script5 \
libqt5widgets5 \
libqt5core5a \
libqt5gui5 \
libqt5help5 \
libqt5opengl5 \
libqt5opengl5-dev \
libqt5svg5-dev \
libvtk6.3 \
libvtk6-dev \
libvtk6.3-qt \
libvtk6-qt-dev

git clone https://github.com/ElmerCSC/elmerfem.git

Then I followed the video to make the elmer.cmake (precache) file and I deleted the last few lines of code as instructed.
SET(WITH_MPI TRUE CACHE BOOL "")
SET(WITH_LUA TRUE CACHE BOOL "")
SET(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "")
SET(WITH_Mumps TRUE CACHE BOOL "")
SET(WITH_Hypre TRUE CACHE BOOL "")
SET(Hypre_INCLUDE_DIR "/usr/include/hypre" CACHE PATH "")
SET(WITH_ElmerIce TRUE CACHE BOOL "")

SET(ELMER_SOLVER_HOME "/usr/share/elmersolver" CACHE PATH "")

# ElmerGUI related.
SET(WITH_ELMERGUI TRUE CACHE BOOL "")
SET(WITH_OCC TRUE CACHE BOOL "")
SET(WITH_VTK FALSE CACHE BOOL "")
SET(WITH_PARAVIEW TRUE CACHE BOOL "")
SET(WITH_QWT FALSE CACHE BOOL "")
SET(WITH_QT5 TRUE CACHE BOOL "")
SET(QWT_LIBRARY "/usr/lib/libqwt-qt5.so.6" CACHE FILE "qwt library file name")

# CPack related
SET(MAKE_RPM_PACKAGE FALSE CACHE BOOL "")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS
"libopenblas-base, libmumps-5.2.1, libopenmpi3, libparmetis4.0, libmetis5, libhypre-2.18.2, libblas.so.3, liblapack.so.3 , liboce-modeling11, liboce-foundation11, libqt5widgets5, libqt5script5, libqt5core5a, libqt5gui5, libqt5help5, libqt5opengl5, libvtk6.3 , libvtk6.3-qt" CACHE STRING "")
SET(BYPASS_DEB_DEPENDENCIES TRUE CACHE BOOL "") # Elmer packaging specific. Dont try to automatically pick required packages.

# docker tries to run mpi as root:
SET(MPIEXEC_PREFLAGS "--allow-run-as-root" CACHE STRING "")

Then I continued, making a build directory
mkdir build
cd build
cmake -C ../elmer.cmake ../elmerfem -DMAKE_INSTALL_PREFIX="/home/elmeruser/Elmer"

Here is the output right now:
loading initial cache file ../elmer.cmake
CMake Warning (dev) at /home/renzo/elmer.cmake:19 (SET):
implicitly converting 'FILE' to 'STRING' type.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Checking whether GFortran version >= 4.8 -- yes
-- ------------------------------------------------
-- Mesh adaptation 2D/3D looking for [Mmg] tools
-- Library not found: >MMG_FOUND<
-- Missing: >MMG_INCLUDE_DIR< , >MMG_LIBRARY<, to compile MMG3DSolver
-- ------------------------------------------------
-- A library with LAPACK API found.
-- Finding Mumps
-- Checking if Metis library is needed by Mumps
-- Checking if Metis library is needed by Mumps -- yes
-- Checking if ParMetis library is needed by Mumps
-- Checking if ParMetis library is needed by Mumps -- yes
-- A library with Mumps API found.
-- Mumps include dir: /usr/include
-- Mumps libraries: /usr/lib/x86_64-linux-gnu/libdmumps.so;/usr/lib/x86_64-linux-gnu/libmumps_common.so;/usr/lib/x86_64-linux-gnu/libpord.so;/usr/lib/x86_64-linux-gnu/libscalapack-openmpi.so;/usr/lib/x86_64-linux-gnu/libmetis.so;/lib/libparmetis.so
-- Checking whether /usr/bin/f95 supports PROCEDURE POINTER
-- Checking whether /usr/bin/f95 supports PROCEDURE POINTER -- yes
-- Checking whether /usr/bin/f95 supports CONTIGUOUS
-- Checking whether /usr/bin/f95 supports CONTIGUOUS -- yes
-- Checking whether /usr/bin/f95 supports EXECUTE_COMMAND_LINE
-- Checking whether /usr/bin/f95 supports EXECUTE_COMMAND_LINE -- yes
-- Adding optional package ElmerIce
-- ------------------------------------------------
-- Elmer/Ice package: Looking for [NetCDF] & [NetCDF Fortran] libraries
-- Library not found: >NetCDF_FOUND<
CMake Warning at elmerice/Solvers/CMakeLists.txt:26 (MESSAGE):

Missing: >NetCDF_INCLUDE_DIR< , >NetCDF_LIBRARY<, >NetCDFF_LIBRARY<
some functionalities will be disabled


-- ------------------------------------------------
-- Elmer/Ice package: Looking for [HDF5] & [HDF5 Fortran] libraries
-- Library not found: >HDF5_FOUND<
CMake Warning at elmerice/Solvers/CMakeLists.txt:49 (MESSAGE):

Missing: >HDF5_INCLUDE_DIR< , >HDF5_LIBRARY<, >HDF5F_LIBRARY<
some functionalities will be disabled


-- Found 124 modules from /home/renzo/elmerfem/fem/src/modules
-- ELMERSOLVER_RPATH_STRING_MOD $ORIGIN/../lib/elmersolver
-- ELMERLIB_RPATH_STRING $ORIGIN/
-- Found 691 tests
-- checking for thread-local storage - found
-- ------------------------------------------------
-- BLAS library: /usr/lib/x86_64-linux-gnu/libblas.so
-- LAPACK library: /usr/lib/x86_64-linux-gnu/liblapack.so;/usr/lib/x86_64-linux-gnu/libblas.so
-- ------------------------------------------------
-- Fortran compiler: /usr/bin/f95
-- Fortran flags: -O2 -g -DNDEBUG
-- ------------------------------------------------
-- C compiler: /usr/bin/cc
-- C flags: -O2 -g -DNDEBUG
-- ------------------------------------------------
-- CXX compiler: /usr/bin/c++
-- CXX flags: -O2 -g -DNDEBUG
-- ------------------------------------------------
-- Building Lua
-- ------------------------------------------------
-- ------------------------------------------------
-- Package filename: elmerfem-9.0-58f9634a-20210315_Linux-x86_64
-- Patch version: 9.0-58f9634a
-- Configuring done
-- Generating done
-- Build files have been written to: /home/renzo/build


Then I got an error during make -j:
make -j 3

[ 66%] Built target elmersolver make: *** [Makefile:163: all] Error 2

I forget what I did, but I got a different error after doing something:
[ 62%] Building C object fem/src/CMakeFiles/elmersolver.dir/SolveHypre.c.o In file included from /usr/include/hypre/_hypre_utilities.h:8, from /home/renzo/elmerfem/fem/src/SolveHypre.c:47: /usr/include/hypre/HYPRE_utilities.h:20:10: fatal error: mpi.h: No such file or directory 20 | #include "mpi.h" | ^~~~~~~ compilation terminated. [ 62%] Building CXX object fem/src/CMakeFiles/elmersolver.dir/SolveTrilinos.cxx.o make[2]: *** [fem/src/CMakeFiles/elmersolver.dir/build.make:986: fem/src/CMakeFiles/elmersolver.dir/SolveHypre.c.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/Makefile2:17668: fem/src/CMakeFiles/elmersolver.dir/all] Error 2 make: *** [Makefile:163: all] Error 2

In desperation I tried to this command from the sources and compilation to see if it would fix this:
cmake -DWITH_ELMERGUI:BOOL=FALSE -DWITH_MPI:BOOL=FALSE -DCMAKE_INSTALL_PREFIX=../install ../elmerfem

Now when I type make -j I get the error:
[ 62%] Building C object fem/src/CMakeFiles/elmersolver.dir/SolveHypre.c.o
In file included from /usr/include/hypre/_hypre_utilities.h:8,
from /home/renzo/elmerfem/fem/src/SolveHypre.c:47:
/usr/include/hypre/HYPRE_utilities.h:20:10: fatal error: mpi.h: No such file or directory
20 | #include "mpi.h"
| ^~~~~~~
compilation terminated.
[ 62%] Building CXX object fem/src/CMakeFiles/elmersolver.dir/SolveTrilinos.cxx.o
make[2]: *** [fem/src/CMakeFiles/elmersolver.dir/build.make:986: fem/src/CMakeFiles/elmersolver.dir/SolveHypre.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:17668: fem/src/CMakeFiles/elmersolver.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

Hm. I'm lost right now. Thank you for your help.

Edit: I tried following viewtopic.php?f=2&t=3653&p=12338&hilit= ... i.h#p12338 and still, no go
Last edited by ScientistRenzo on 16 Mar 2021, 20:17, edited 1 time in total.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Error during installation at: make -j

Post by kevinarden »

Once on the Ubuntu machine you can install elmer by doing, no compile necessary

sudo apt-add-repository ppa:elmer-csc-ubuntu/elmer-csc-ppa
sudo apt-get update
sudo apt-get install elmerfem-csc
sudo apt-get install elmerfem-csc-eg
ScientistRenzo
Posts: 57
Joined: 14 Mar 2021, 21:01
Antispam: Yes

Re: Error during installation at: make -j

Post by ScientistRenzo »

Thanks.
I've done that.
Now when I hop into
cd build
and run
ctest -j
All the tests fail.
What's the problem and fix?
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Error during installation at: make -j

Post by kevinarden »

The install using Elmer repository installs the binary files already compiled therefor there is no build directory. If you have a build direct it is from a previous compile attempt. Installing the binaries directly from the repository means you can run elmer form a command line

ElmerGUI (for the GUI interface)
Elmerolver (for the solver)
ElmerGrid (for ElmerGrid tranlates meshes, etc>)

there is nothing to test
ScientistRenzo
Posts: 57
Joined: 14 Mar 2021, 21:01
Antispam: Yes

Re: Error during installation at: make -j

Post by ScientistRenzo »

Ok great. Thanks!
ScientistRenzo
Posts: 57
Joined: 14 Mar 2021, 21:01
Antispam: Yes

Re: [Solved] Error during installation at: make -j

Post by ScientistRenzo »

Solved: I uninstalled everything, then followed https://www.youtube.com/watch?v=xPDzlGYK_kM. Thanks for helping.
Post Reply