Errors running cmake

Discussion about building and installing Elmer
Gary R
Posts: 162
Joined: 12 Apr 2012, 07:23
Antispam: Yes
Location: Long Beach CA, USA

Errors running cmake

Post by Gary R »

Elmer version - latest git download
Debian 9 (Stretch) Linux OS
KDE Desktop
KVM virtual-machine

I am having trouble getting a clean cmake run on the Elmer git download. I modified the CMakeLists.txt file to allow the compiling of ElmerGUI and a couple of other modules. My present concern is the message:
Could NOT find Hypre (missing: Hypre_INCLUDE_DIR)

Now Debian has a libhypre-2.11.1 package that I have installed. Is this what is causing the problem? What should I do to fix this?

Gary R
Gary R
Posts: 162
Joined: 12 Apr 2012, 07:23
Antispam: Yes
Location: Long Beach CA, USA

Re: Errors running cmake

Post by Gary R »

Amendment:

cmake can't find hypre even though it is installed. In Debian Stretch the library is installed in /usr/lib/x86_64-linux-gnu/ and as libHYPRE_*******.so files. This is not the usual place for lib files. Where does cmake look for the lib files. I have looked at the CMakeLists.txt file but can't quite make out where cmake looks for them.

Please help.

Gary R.
Gary R
Posts: 162
Joined: 12 Apr 2012, 07:23
Antispam: Yes
Location: Long Beach CA, USA

Re: Errors running cmake

Post by Gary R »

Amendment 2

It turns out, after doing a lot of digging I found that Hypre is only useful for massively parallel computers. My 4 processor system doesn't apply. I shut off Hypre and the Hypre errors went away. But I now get the errror:

Checking if ParMetis library is needed by Mumps -- yes
CMake Error at cmake/Modules/FindMumps.cmake:149 (MESSAGE):
Metis library not found, needed by found Mumps library.
Call Stack (most recent call first):
CMakeLists.txt:164 (FIND_PACKAGE)

Metis has been installed in /elmergrid/src/metis directory. So why can't cmake find it.

Gary R
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Errors running cmake

Post by raback »

Hi

ElmerGrid uses due to historical reasons on older version of Metis. MUMPS needs some concurrent version of Metis. There is a branch in github where we try to harmonize things such that also ElmerGrid would use an existing Metis library, if present. As for now you need two different ones.

Also MUMPS is not required even though it might be more useful for 2-4 cores than Hypre.

-Peter
Gary R
Posts: 162
Joined: 12 Apr 2012, 07:23
Antispam: Yes
Location: Long Beach CA, USA

Re: Errors running cmake

Post by Gary R »

Thanks for the reply. But where do I get an older copy of Metis? Also, how old? I couldn't find a copy on GitHub.
For some of the work I wish to do with Elmer I am going to be pushing my computer power to the limit and need all of the speed I can get. Further the Debian repository is really rough to use when trying to install out of date software. This means that I need source code and a good cmake file.

Gary R
Gary R
Posts: 162
Joined: 12 Apr 2012, 07:23
Antispam: Yes
Location: Long Beach CA, USA

Re: Errors running cmake

Post by Gary R »

Amemdment:

I tried turning off mumps to see I could get a clean compile but now get the following error:

Checking whether /usr/bin/f95 supports EXECUTE_COMMAND_LINE
Checking whether /usr/bin/f95 supports EXECUTE_COMMAND_LINE -- yes
You have called ADD_LIBRARY for library CMakeFiles without any source files. This typically indicates a problem with your CMakeLists.txt file
Found 108 modules from /home/gary/Elmer/elmerfem/fem/src/modules
CMake Error at cmake/Modules/AddModules.cmake:27 (ADD_LIBRARY):
add_library cannot create target "CMakeFiles" because another target with
the same name already exists. The existing target is a shared library
created in source directory "/home/gary/Elmer/elmerfem/fem/src/modules".
See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
cmake/Modules/AddModules.cmake:64 (ADD_ELMER_MODULE)
fem/src/modules/contrib/CMakeLists.txt:1 (ADD_ELMER_MODULES)

Not sure where to find policy CMP0002 documentation.

You know, i've been working in this installation for several weeks. It has been a fight all the way. One thing that would help a lot is a README that listed the packages that need to be installed for a Debian installation. Things like VTK really throw me for a loop. A search in Debian packages turns up a long list of packages that contain vtk. It is unclear which of these, if any, that need to be installed. Another problem when looking for help is that the Ubuntu's package management system has at least one command that Debian doesn't have. This command is constantly referenced. A README for Debian will work for Ubuntu but not necessarily the other way around.

Gary R
kataja
Posts: 74
Joined: 09 May 2014, 16:06
Antispam: Yes

Re: Errors running cmake

Post by kataja »

Looks like you have an in-source build where the temporary build objects are locate withing the source directory. I suggest starting from clean source directory and following compilation instructions in https://www.csc.fi/web/elmer/sources-and-compilation.

Basically this just means that you shouldn't run the cmake command in the elmer source directory but create an empty directory where to run it.

cheers,
Juhani
Gary R
Posts: 162
Joined: 12 Apr 2012, 07:23
Antispam: Yes
Location: Long Beach CA, USA

Re: Errors running cmake

Post by Gary R »

Thank you for your reply.

I'm running cmake-gui to compile Elmer. I have the source directory set to /home/gary/Elmer/elmerfem and the build directory set to /home/gary/Elmer/build. There is a ton of .c and .h files in /home/gary/Elmer/elmerfem/elmergrid/src/metis. I assume that this is the metis source code. I'm still getting the "Metis Library not found" error. I'm not sure what to do next?

Gary R.
Gary R
Posts: 162
Joined: 12 Apr 2012, 07:23
Antispam: Yes
Location: Long Beach CA, USA

Re: Errors running cmake. Round 2

Post by Gary R »

I gave up on trying to compile Elmer on a Debian system. I loaded my virtual machine with Ubuntu 17.04 and am trying again to install Elmer from source code. I get the following compile error:
CMake Error at CMakeLists.txt:146 (FIND_PACKAGE):
Could not find a package configuration file provided by "ML" with any of
the following names:

MLConfig.cmake
ml-config.cmake

Add the installation prefix of "ML" to CMAKE_PREFIX_PATH or set "ML_DIR" to
a directory containing one of the above files. If "ML" provides a separate
development package or SDK, be sure it has been installed.
I have ML loaded in the system (ran apt install smlnj) but still get the errror. How do I correct this.

Any help will be sincerely appreciated.

Gary R.
kataja
Posts: 74
Joined: 09 May 2014, 16:06
Antispam: Yes

Re: Errors running cmake

Post by kataja »

The ML here refers to Trilinos ML. So either disable trilinos from build options or install trilinos with ML.

Compiling Elmer against all of the libraries supported might be a tedious task so I suggest disabling as much of the WITH_* options in cmake-gui as possible.

CHeers
Post Reply