tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

compiler framework, fortran, libtool, and other headaches




Hello,

I recently added lang/gcc44 to pkgsrc with C, C++, OBJC, and FORTRAN support. Then I updated mk/compiler/gcc.mk accordingly. I used the entries for lang/gcc34 as an example in gcc.mk for what to do about gcc44.

However, the more I have looked at this, the more problems I see. I'm wondering if I have just confused myself or if we have a more fundamental problem we need to address.

Here are the issues I see.

- if I try to just universally use gcc44 (or gcc34) by setting GCC_REQD in my /etc/mk.conf, I have a bootstrap problem in that I end up with circular dependencies when trying to build things like digest. This is especially true for a bulk build.

- Since pkgsrc uses its own libtool, we really need to use one compiler for all packages (on a given system) and this compiler (and at least the C, C++, and FORTRAN languages) needs to be available when libtool is built. This is because libtool stores information about the particular compiler. It makes me wonder if we need to have a per-compiler libtool or if we need to somehow build a new libtool each time a libtool-using package is built. On these lines, lang/f2c builds a shared library and uses libtool so to avoid the circular dependencies, mk/compiler/f2c.mk had a hook to ignore needing f2c when building libtool. But then this results in a not-quite-right libtool build.

- mk/compiler/g95.mk also ignores g95 when building libtool. This is probably a holdover from f2c.mk

- mk/compiler/gcc.mk has some code at the end where it tries to decide if gcc supplied a fortran compiler. However the code only works if the gcc packages have already been installed. The code doesn't see if the gcc packages *can* provide fortran if simply compiled and installed. So we have another chicken and egg and in particular we have no way to tell pkgsrc "use gcc3-f77" or "use gcc44 that has gfortran" via a mk.conf setting.

- In the past when I was using pkgsrc on solaris, my recipe was to use whatever gcc I could find pre-built for solaris and bootstrap pkgsrc into something like /opt/pkgsrc-gcc and then build the latest gcc packges. Then I'd point to those compilers and bootstrap pkgsrc into /opt/pkg or /usr/pkg and use my locally built gcc as the compiler. This method seemed to work, but it was quite a few years ago and doesn't seem quite compatible with the compiler framework and things like GCC_REQD because of using pkg_admin, but I may have not correctly followed the code through here.

At the end of the day, all I really want is a way to specify PKGSRC_FORTRAN=gfortran and have it Just Work, but some of the interactions with libtool have me a little confused as to how all this can be made to really work smoothly and correctly.

Comments?  Suggestions?

Thanks
-Dan


Home | Main Index | Thread Index | Old Index