Page 1 of 1

[SOLVED] How to make static executable of abinit 6.0.3 ?

Posted: Thu May 13, 2010 3:36 pm
by spamrefuse
Hi,

In the days of version 5.X, I used to produce a static executable, as follows:

$ setenv LDFLAGS "-static"
$ ./configure --disable-etsf_io --disable-libxc --disable-netcdf --disable-bigdft --disable-wannier90
$ make
# make install

But with 6.0.3, the configure ends with error:

=================================
=== C support
=================================

checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/home/myhome/Desktop/Research/Abinit/Software/abinit-6.0.3':
configure: error: C compiler cannot create executables
See `config.log' for more details.


The config.log file doesn't tell me much. Its last line is:

configure: exit 77

Can somebody tell me how to get the static executable with 6.0.3?

Thank you!

Rob.

Re: How to make static executable of abinit 6.0.3 ?

Posted: Mon May 17, 2010 8:26 pm
by pouillon
The config.log file does tell much about the failure, but you'll not find it at the end of the file. You should look for the last occurrence of "failed program was" instead.

Please note that not only Abinit has evolved since the time of 5.x. GCC has changed as well, and you might need to use different options. What about "-static-libgcc" instead of "-static"? Depending on your architecture, the correct option may also be "-Bstatic". On Mac, a static build might be very difficult to achieve, if achievable at all. Sometimes, it is necessary to use the "-Wl,..." option to pass arguments to the linker.

In any case, the contents of config.log will let you know what happened.

Re: How to make static executable of abinit 6.0.3 ?

Posted: Tue May 18, 2010 2:49 am
by spamrefuse
Thank you for your reply.

My system is Fedora/Linux and I managed to get the static executable as follows:

1) install the glibc-static package for the /usr/lib/libc.a library.

2) set the LDFLAGS environment variable, like this:
setenv LDFLAGS "-static `gcc -print-file-name=libgfortran.a` `gcc -print-file-name=libgcc.a` `gcc -print-file-name=libc.a`"

(use the property of gcc -print-file-name=library to get the full path to the static libraries)

3) finally run the usual configure and make stuff.

Rob.

Re: How to make static executable of abinit 6.0.3 ?

Posted: Wed Jul 21, 2010 2:48 pm
by spamrefuse
Hi,

This does not seem to work anymore with 6.2.1.

I use the same configure options, but with 6.2.1 it produces
the usual dynamically linked abinit executable.

Has the procedure changed from 6.0.3 to 6.2.1 ?

Thanks,
Rob.