libxc no longer builds on macosx gfortran 4.5  [SOLVED]

option, parallelism,...

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.
Locked
mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

libxc no longer builds on macosx gfortran 4.5

Post by mverstra » Wed May 04, 2011 11:03 am

Hello everybody,

just merged trunk, and libxc no longer builds. I have tried repeated removes and cleans of the plugins and the tgz file, but still:

libtool: link: ( cd ".libs" && rm -f "libxc.la" && ln -s "../libxc.la" "libxc.la" )
make[8]: *** No rule to make target `xc_f90_lib_m.mod', needed by `all-am'. Stop.
make[7]: *** [all] Error 2
make[6]: *** [all-recursive] Error 1
make[5]: *** [all] Error 2
make[4]: *** [build-stamp] Error 2
make[3]: *** [package-ready] Error 2
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


the only mod file which is generated is libxc-1.0/src/libxc_funcs_m.mod

The tgz file has not been changed, so the error must come from
1) the build system
or
2) a new patch (did not see any... in bzr diff)

While I'm at it, the new configure script and makemake output is very helpful!

Matthieu
Matthieu Verstraete
University of Liege, Belgium

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: libxc no longer builds on macosx gfortran 4.5

Post by pouillon » Wed May 04, 2011 12:22 pm

just merged trunk, and libxc no longer builds.

Does not come from me. I haven't touched the plugins/fallbacks part for while.

While I'm at it, the new configure script and makemake output is very helpful!

My pleasure. :) I can still refine it a little bit, but I'd like to keep it as compact as possible (i.e. readable on a 80x24 terminal).
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

Re: libxc no longer builds on macosx gfortran 4.5

Post by mverstra » Wed May 04, 2011 2:17 pm

Still fails after a full source tree clean and rebuild from new build directory. I don't get it....
Matthieu Verstraete
University of Liege, Belgium

mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

Re: libxc no longer builds on macosx gfortran 4.5

Post by mverstra » Wed May 04, 2011 2:37 pm

The problem appears to be that FCCPP is set to ' ', so it is considered set, whereas it is useless. For some reason libxc build does not fail when it is unable to preprocess/compile libxc_master.F90

How can I pass FCCPP to libxc? Or get it to default to CPP, which would be fine.

Matthieu
Matthieu Verstraete
University of Liege, Belgium

mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

Re: libxc no longer builds on macosx gfortran 4.5

Post by mverstra » Wed May 04, 2011 2:54 pm

Ok, looks solved - my fault: there was a missing /usr/bin/cpp, which is in a non-standard place on mac OSX. I added a link, and abinit found the proper cpp instead of gcc -E, and then libxc followed.

ciao
Matthieu Verstraete
University of Liege, Belgium

paulfons
Posts: 16
Joined: Tue Apr 12, 2011 10:10 am

Re: [SOLVED] libxc no longer builds on macosx gfortran 4.5

Post by paulfons » Fri May 27, 2011 12:37 pm

Hi compiling libxc using ifort has also been causing me trouble. I was hoping you might be so kind as to elaborate on the problems with getting cpp to properly parse the libxc.f90 source. I note that the cpp file on my macs (10.6.7) both have a cpp at /usr/bin/cpp and I am still having problems. What link must me made to eliminate these problems? Any help would be gratefully received as I have found evidence of others having the same problem and the solution to date has been not to compile libxc (which is of course undesirable). Thanks for your help.



/bin/sh ../libtool --tag=FC --tag=F77 --mode=compile /opt/openmpi//bin/mpif90 -free -g -extend-source -vec-report0 -noaltparam -nofpscomp -O3 -xHost -c -o libxc_la-libxc.lo `test -f 'libxc.f90' || echo './'`libxc.f90
libtool: ignoring unknown tag F77
libtool: compile: /opt/openmpi//bin/mpif90 -free -g -extend-source -vec-report0 -noaltparam -nofpscomp -O3 -xHost -c libxc.f90 -o libxc_la-libxc.o
libxc.f90(30): error #5078: Unrecognized token '#' skipped

mverstra
Posts: 655
Joined: Wed Aug 19, 2009 12:01 pm

Re: [SOLVED] libxc no longer builds on macosx gfortran 4.5  [SOLVED]

Post by mverstra » Sun Jun 05, 2011 8:28 pm

This is very ugly, but I have highjacked the default cpp, which is normally found in the Xcode directories, by adding the following symbolic link

/usr/bin/cpp -> /opt/local/bin/cpp-mp-4.5
(or whichever version of cpp/gcc you have installed - I use macports)


otherwise abinit/libxc default to gcc -E, which does not behave quite the same way (in particular for libxc which is heavily pre-processed).

Matthieu
Matthieu Verstraete
University of Liege, Belgium

mlazar
Posts: 1
Joined: Fri Sep 14, 2012 9:00 pm

Re: [SOLVED] libxc no longer builds on macosx gfortran 4.5

Post by mlazar » Fri Sep 14, 2012 9:12 pm

Thank you Matthieu, your suggestion perfectly solved my problem (compiling abinit on a Mac):

1. I made a backup of /usr/bin/cpp by typing: sudo /usr/bin/cpp /usr/bin/backup
2. I made a symbolic link by typing: sudo ln -s /opt/local/bin/cpp-mp-4.5 /usr/bin/cpp
3. I compiled the program by typing: sudo make install
4. I unlinked the symbolic link by typing: sudo unlink /usr/bin/cpp
5. I put back the original link by typing: sudo mv /usr/bin/backup /usr/bin/cpp

This solved my problem of compiling abinit on a Mac OS X. I spelled things out more in case someone doesn't know how to do the linking etc.

Thank you.

Locked