Menu

Can't great static executables

Help
Carolyn
2016-07-01
2016-07-01
  • Carolyn

    Carolyn - 2016-07-01

    Is there a way to build static executables. I have tried several different ways and no matter
    what I do I get the following error.

    /usr/bin/ld: attempted static link of dynamic object `/opt/gcc/4.9.2/snos/lib/../lib64/libgfortran.so'
    collect2: error: ld returned 1 exit status

    Your input is appreciated.

    I use LDFLAGS=-static' --disable-shared --enable-static
    as arguments to the configure script.

     
  • henry Butowsky

    henry Butowsky - 2016-07-01

    HI Carolyn,
    I don't understand why you are linking to fortran libs as NCO has no FORTRAN code ?
    i am no expert in these matters but this is what I understand
    1) if you build NCO with -static only libs this only applies to the NCO libs. if you say wanna link statically to the netCDF files then you'll have to build them static only as well

    ...Henry

     
  • Carolyn

    Carolyn - 2016-07-01

    Hi Henry,
    I was using the cray wrappers (cc and CC) on our xc40. Apparently it
    doesn't play nice. ISo when I go
    to the gcc g++ directly, no wrappers, it all now compiles! But when I do
    an ldd, I see links to thinks like libc and libm. I thought the netcdf
    libraries were buillt static, but they are not. Sorry for the confusion. Thanks
    for your assistance. It seems we have a mixture of static and dynamic.

     

Log in to post a comment.