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.
[SOLVED] How to make static executable of abinit 6.0.3 ?
Moderators: fgoudreault, mcote
Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
-
- Posts: 35
- Joined: Wed Jan 20, 2010 3:08 am
Re: How to make static executable of abinit 6.0.3 ?
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.
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.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain
Simune Atomistics
Donostia-San Sebastián, Spain
-
- Posts: 35
- Joined: Wed Jan 20, 2010 3:08 am
Re: How to make static executable of abinit 6.0.3 ?
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.
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.
-
- Posts: 35
- Joined: Wed Jan 20, 2010 3:08 am
Re: How to make static executable of abinit 6.0.3 ?
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.
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.