Page 1 of 1

linking problem (undefined reference to `_gfortran_stop_numeric_f08')

Posted: 17 Sep 2018, 14:04
by sujona
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?

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

Posted: 17 Sep 2018, 14:18
by magnus
Which version of Dalton are you trying to compile?

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

Posted: 17 Sep 2018, 15:16
by magnus
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?

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

Posted: 17 Sep 2018, 21:40
by sujona
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.)

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

Posted: 18 Sep 2018, 09:06
by magnus
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.