configure: error: linking to Fortran libraries from C fails

Issue #55 resolved
Former user created an issue

Hello,

I have been trying to download Tempo2 with its plugins using psrsoft:

$PSRSOFT_DIR/bin/psrsoft tempo2

I keep receiving this error and am at a loss with how to correct: checking for Fortran libraries of gfortran... -L//lib -L/usr/local/lib -L/home/jeagle/psrsoft/psrsoft/usr/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. -ldl -lgfortran -lm -lquadmath //lib/libdl.a //lib/libm.a //lib/libc.a checking for dummy main to link with Fortran libraries... unknown configure: error: in /home/jeagle/psrsoft/psrsoft/usr/src/tempo2': configure: error: linking to Fortran libraries from C fails Seeconfig.log' for more details ex=$? if [ $ex != 0 ] ; then exit $ex fi Build script failed!

I have already checked that my Fortran and C compilers are the same. I've included my config.log just in case. Is anyone able to help me resolve this issue?

Comments (6)

  1. Jordan Eagle

    Hi, I’m the original poster of this. I think I was using an outdated version of gcc when trying to download (4.8.5 for both gcc and gfortran) so I instead ran this command (I was in a centos7 slac server so it uses .tcsh):

    scl enable devtoolset-8 bash
    

    Please note this command may be only valid for slac servers. You may need another way to use a different version of gcc if you face similar issues.

    Once using a more recent version of gcc and gfortan with the above (or similar) command above, the following enabled me to download both psrchive and tempo2 with no glitches. For anyone else facing this issue here is what I did for my successful attempt.

    You are now running in a bash shell so the commands are no longer in tcsh (if you use the above command)

    export PSRSOFT_DIR=/path/to/directory
    

    Which is just declaring a short cut for my psrsoft directory. Now download the packages you want:

    $PSRSOFT_DIR/bin/psrsoft psrchive
    $PSRSOFT_DIR/bin/psrsoft tempo2
    
    $PSRSOFT_DIR/bin/psrsoft-shell
    

    This is activates a psrsoft environment in a bash shell, but you can specify other shells (http://www.pulsarastronomy.net/wiki/Software/PSRSoft#toc6). You can use any of the packages you have downloaded in this environment.

  2. Paul Ray

    Hi Jordan, for what it is worth our primary linux machine at NRL is also CentOS 7 and it compiles Tempo2 just fine using the stock compilers (gcc and gfortran 4.8.5). Not sure why the difference.

  3. Jordan Eagle

    Hi Paul,

    You are absolutely right. It is not an issue with gcc/gfortran compatibility as the same issue arose on a separate remote server. I still don't know what is causing this issue and why I got it to work only once with the above prescription.

    Best, ~~~~~~~~~~~~ Jordan L. Eagle Predoctoral Fellow Harvard & Smithsonian | Center for Astrophysics 617-496-7622 www.jordanleagle.com

  4. Sergei A. Trushkin

    Hi,

    I would like to work with TEMPO2 (i am astronomer), and

    i downloaded tempo2-2013.9.1.tar.gz for compilation.

    Well, my PC OS is Fedora: 5.8.9-200.fc32.x86_64

    and it has gcc-10.2.1-1.fc32.x86_64, gcc-gfortran-10.2.1-1.fc32.x86_64

    Sure i installed a lot of *devel.rpm and libs.rpm for the compilation of TEMPO2.

    But its configure :

    configure: error: in `~satr/tempo2-2013.9.1':
    configure: error: linking to Fortran libraries from C fails

    In config.log:

    configure:14383: checking for dummy main to link with Fortran 77 libraries
    configure:18395: checking for dummy main to link with Fortran libraries
    ac_cv_f77_dummy_main=none
    ac_cv_fc_dummy_main=unknown
    ac_cv_fortran_dummy_main=unknown

    Is it the reason of the fail?

    How I can decide the trouble?

    Thank you for advance,

    Sergei

  5. Sergei A. Trushkin

    Victory!

    I have done the configure , compilation and installation of TEMPO2.

    The main problem was with usage of 686 and x86_64 libraries (libm, libc and libgfortran). I have used x86_64.

    Good luck,

    Sergei

  6. Log in to comment