Page 1 of 1

libxc no longer builds on macosx gfortran 4.5

Posted: Wed May 04, 2011 11:03 am
by mverstra
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

Re: libxc no longer builds on macosx gfortran 4.5

Posted: Wed May 04, 2011 12:22 pm
by pouillon
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).

Re: libxc no longer builds on macosx gfortran 4.5

Posted: Wed May 04, 2011 2:17 pm
by mverstra
Still fails after a full source tree clean and rebuild from new build directory. I don't get it....

Re: libxc no longer builds on macosx gfortran 4.5

Posted: Wed May 04, 2011 2:37 pm
by mverstra
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

Re: libxc no longer builds on macosx gfortran 4.5

Posted: Wed May 04, 2011 2:54 pm
by mverstra
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

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

Posted: Fri May 27, 2011 12:37 pm
by paulfons
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

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

Posted: Sun Jun 05, 2011 8:28 pm
by mverstra
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

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

Posted: Fri Sep 14, 2012 9:12 pm
by mlazar
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.