crest-lab / crest

CREST - A program for the automated exploration of low-energy molecular chemical space.
https://crest-lab.github.io/crest-docs/
GNU Lesser General Public License v3.0
198 stars 42 forks source link

Installation on OpenSUSE leap 15 cannot find MKL for GCC #123

Closed MichailDanikas closed 2 years ago

MichailDanikas commented 2 years ago

I'm working on OpenSUSE leap 15 OS and I have trouble on building crest with cmake and meson. I follow the commands bellow. export FC=gfortran CC=gcc meson setup -Dla_backend=mkl _build_intel --prefix=$PWD/_dist


The Meson build system
Version: 0.59.4
Source dir: /opt/crest
Build dir: /opt/crest/_build_intel
Build type: native build
Project name: crest
Project version: 2.11.0
Fortran compiler for the host machine: gfortran (gcc 7.5.0 "GNU Fortran (SUSE Linux) 7.5.0")
Fortran linker for the host machine: gfortran ld.bfd 2.37.20211103-150100
C compiler for the host machine: gcc-11 (gcc 11.2.1 "gcc-11 (SUSE Linux) 11.2.1 20210816 [revision 056e324ce46a7924b5cf10f61010cf9dd2ca10e9]")
C linker for the host machine: gcc-11 ld.bfd 2.37.20211103-150100
Host machine cpu family: x86_64
Host machine cpu: x86_64
Run-time dependency OpenMP found: YES 4.5

config/meson.build:70:4: **ERROR**: Fortran shared or static library '**mkl_gf_lp64**' not found

A full log can be found at /opt/crest/_build_intel/meson-logs/meson-log.txt

Any tips on how to solve the problem with mkl_gf_lp64? I tried to install multiple packages regarding mkl, but I'm new to all these. When I try with cmake or simple make I also have errors. With meson was the easiest to follow.

awvwgk commented 2 years ago

Have you followed the instructions for installing MKL from the Intel repository using zypper?

https://www.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/yum-dnf-zypper.html

After following the steps to add the Intel repository you should be able to use

sudo zypper install intel-oneapi-mkl-devel

Make sure to activate the Intel oneAPI package with

. /opt/intel/oneapi/setvars.sh

Or the MKL will not be findable when building crest.

MichailDanikas commented 2 years ago

Eventually this was the problem. I skiped soome step which caused the problem to not find mkl. However the following error was prompted:

localhost:/opt/crest # meson install -C _build_intel

ninja: Entering directory '/opt/crest/_build_intel'
[3/89] Compiling Fortran object crest.p/src_filemod.f90.o
FAILED: crest.p/src_filemod.f90.o crest.p/filemod.mod
gfortran -Icrest.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -O2 -g -ffree-line-length-none -fbacktrace -DWITH_MKL -fopenmp -Jcrest.p -o crest.p/src_filemod.f90.o -c ../src/filemod.f90
../src/filemod.f90:331:20:
  integer :: cursor
                 1
Warning: Unused variable ‘cursor’ declared at (1) [-Wunused-variable]

[..more]

I also think this problem is caused by my end also. Do you may have an idea what could cause this kind of an error?

pprcht commented 2 years ago

Hi, this is just an -Wunused-variable warning, these are usually ignored. There must be some other error (also declared as such by the compiler) that causes the build to fail. Can you look into the output again?

Note that I updated the code just yesterday (#126) to remove all those -Wunused-variable warnings with gfortran. Maybe you want to use this source.

MichailDanikas commented 2 years ago

Hi, I'm really sorry for the late replies but I don't always have access to the working station. I just cloned the updated repository and tried again. This time the error that was prompted is:

meson install -C _build_intel

ninja: Entering directory `/opt/crest/_build_intel'
[3/86] Compiling Fortran object crest.p/src_filemod.f90.o
FAILED: crest.p/src_filemod.f90.o crest.p/filemod.mod 
gfortran -Icrest.p -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -O2 -g -ffree-line-length-none -fbacktrace -Wno-maybe-uninitialized -Wno-uninitialized -DWITH_MKL -fopenmp -Jcrest.p -o crest.p/src_filemod.f90.o -c ../src/filemod.f90
../src/filemod.f90:306:0:

       call move_alloc(tmp, self%f)

internal compiler error: in gimplify_expr, at gimplify.c:12290
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.opensuse.org/> for instructions.
[24/86] Compiling Fortran object crest.p/src_strucreader.f90.o
ninja: build stopped: subcommand failed.
Could not rebuild /opt/crest/_build_intel

I am not sure how to follow these errors. Thank you in advance

awvwgk commented 2 years ago

This is an error in your GFortran compiler distributed by OpenSuse, nothing we can do anything about this in crest. You can follow the instructions at https://bugs.opensuse.org/ to report a bug at the OpenSuse distribution team, however GFortran 7.5.0 is out of long-term support for a few years now.

Since you already use GCC 11.2.1 as C compiler, it might be worth to upgrade your GFortran to the same more recent version and try again.

MichailDanikas commented 2 years ago

Ok, at least now I know the problem is on my end. Thank you so much for all the information!