linking problem (undefined reference to `_gfortran_stop_numeric_f08')

Problems with Dalton installation? Find answers or ask for help here
Post Reply
sujona
Posts: 9
Joined: 17 Sep 2018, 13:22
First name(s): Jonatan
Last name(s): Öström
Affiliation: SU
Country: Sweden

linking problem (undefined reference to `_gfortran_stop_numeric_f08')

Post by sujona » 17 Sep 2018, 14:04

After running

Code: Select all

./setup
cd build
make
everything is compiled (I do see a lot of warnings about real*8 arguments passed to integer*4 though) but at the linking step i get the error

Code: Select all

[100%] Built target dalton
[100%] Linking Fortran executable dalton.x
lib/libdalton.a(gptrygve.F.o): In function `quit_':
gptrygve.F:(.text+0x264): undefined reference to `_gfortran_stop_numeric_f08'
collect2: error: ld returned 1 exit status
CMakeFiles/dalton.x.dir/build.make:103: recipe for target 'dalton.x' failed
make[2]: *** [dalton.x] Error 1
CMakeFiles/Makefile2:1303: recipe for target 'CMakeFiles/dalton.x.dir/all' failed
make[1]: *** [CMakeFiles/dalton.x.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
I tried gfortran 4.7 and 5.4 on ubuntu 16.04, same result. So apparently some library is missing. Any suggestion on how to solve this?

User avatar
magnus
Posts: 479
Joined: 27 Jun 2013, 16:32
First name(s): Jógvan Magnus
Middle name(s): Haugaard
Last name(s): Olsen
Affiliation: Hylleraas Centre, UiT The Arctic University of Norway
Country: Norway

Re: linking problem (undefined reference to `_gfortran_stop_numeric_f08')

Post by magnus » 17 Sep 2018, 14:18

Which version of Dalton are you trying to compile?

User avatar
magnus
Posts: 479
Joined: 27 Jun 2013, 16:32
First name(s): Jógvan Magnus
Middle name(s): Haugaard
Last name(s): Olsen
Affiliation: Hylleraas Centre, UiT The Arctic University of Norway
Country: Norway

Re: linking problem (undefined reference to `_gfortran_stop_numeric_f08')

Post by magnus » 17 Sep 2018, 15:16

As you write, you are possibly missing some library or maybe there is a mismatch. I was able to successfully compile Dalton using the official Docker base image of Ubuntu 16.04 where I installed the default gcc, g++, and gfortran (in addition to python, git, and cmake). The packages that I could see are directly relevant to gfortran were: gfortran-5, libgfortran-5-dev, and libgfortran3. Are you possibly missing one of these?

sujona
Posts: 9
Joined: 17 Sep 2018, 13:22
First name(s): Jonatan
Last name(s): Öström
Affiliation: SU
Country: Sweden

Re: linking problem (undefined reference to `_gfortran_stop_numeric_f08')

Post by sujona » 17 Sep 2018, 21:40

Hi Magnus, thanks for your response and effort! I chose release/2016 branch from github. The libraries you mention were installed on the system. But I found the error. Apparently Anaconda python tends to link to conda libraries instead of system libraries. The setup-script calls the default python which for me is from anaconda, where those libraries apparently weren't present. Installing libgfortran through conda didn't help either in this case. However, when using system python it compiled and linked without problems. (Still a lot of warnings about passing reals to integer arguments though.)

User avatar
magnus
Posts: 479
Joined: 27 Jun 2013, 16:32
First name(s): Jógvan Magnus
Middle name(s): Haugaard
Last name(s): Olsen
Affiliation: Hylleraas Centre, UiT The Arctic University of Norway
Country: Norway

Re: linking problem (undefined reference to `_gfortran_stop_numeric_f08')

Post by magnus » 18 Sep 2018, 09:06

Glad you figured it out :-) You can safely ignore those warnings but it is recommended that you run the test suite to ensure everything works properly.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests