environment settings

Mark Brethen mark.brethen at gmail.com
Sun Nov 25 19:55:39 UTC 2018


LD is currently defined as $(CC). There is a bsd port that is maintained and current, see #57669 <https://trac.macports.org/ticket/57669>. They patch the makefile, using f77 instead, among other changes. My patch is as follows:

diff -ur taucs.orig/config/darwin.mk taucs/config/darwin.mk
--- taucs.orig/config/darwin.mk 2003-08-24 05:10:51.000000000 -0500
+++ taucs/config/darwin.mk      2018-11-24 20:16:59.000000000 -0600
@@ -9,32 +9,32 @@
 DEFFLG=-D
 
 #CC        = gcc
-CFLAGS    = -O3 -faltivec
+CFLAGS    += $(PICFLAG)
 COUTFLG   = -o ./
 
-FC        = $(CC)
-FFLAGS    = $(CFLAGS)
+FC        = $(F77)
+FFLAGS   += $(PICFLAG)
 FOUTFLG   = $(COUTFLG)
 
-LD        = $(CC) 
-LDFLAGS   = $(CFLAGS)
+LD        = $(FC) 
+LDFLAGS  := -L$(DIRLIB) -L./ $(CFLAGS)
 LOUTFLG   = $(COUTFLG)
 
-AR        = ar -cr
-AOUTFLG   =
+AR       += cr
+#AOUTFLG   =
 
-RANLIB    = ranlib
+#RANLIB    = ranlib
 RM        = rm -rf
 
-LIBBLAS   = -framework vecLib
-LIBLAPACK = 
-LIBMETIS  = -Lexternal/lib/darwin -lmetis
+LIBBLAS   = -framework Accelerate
+LIBLAPACK = -framework Accelerate
+LIBMETIS  = -lmetis
 
-LIBF77 = -Lexternal/lib/darwin -lf2c
+#LIBF77 = -Lexternal/lib/darwin -lf2c
 # crypto is for ftime, which is used by the timing routines
 # the documentation says its in libcompat, but on my system
 # there is no libcompat, but libcrypto provides it
-LIBC   = -lm -lcrypto
+#LIBC   = -lm -lcrypto


I think their build process requires overriding the build phase in macports.


Mark Brethen
mark.brethen at gmail.com



> On Nov 25, 2018, at 12:43 PM, David Strubbe <dstrubbe at macports.org> wrote:
> 
> Did you check that "LD" is actually the variable that this Makefile uses to set the linker? There's no need to do this two-step approach anyway. You can just put LD=$[configure.f77} in the build.args.
> 
> 
> David
> 
> On Sun, Nov 25, 2018 at 10:35 AM Ryan Schmidt <ryandesign at macports.org <mailto:ryandesign at macports.org>> wrote:
> 
> 
> On Nov 25, 2018, at 09:13, Mark Brethen wrote:
> 
> > (resent with correction)
> > 
> > I’m using the compilers group with
> > 
> > compilers.choose    cc f77
> > compilers.setup     require_fortran
> > 
> > below is the env settings:
> > 
> > :debug:configure Environment: 
> > :debug:configure CC='/usr/bin/clang'
> > :debug:configure CC_PRINT_OPTIONS='YES'
> > :debug:configure CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_marbre_ports_math_taucs/taucs/work/.CC_PRINT_OPTIONS'
> > :debug:configure CFLAGS='-pipe -Os -arch x86_64'
> > :debug:configure CPATH='/opt/local/include'
> > :debug:configure CPPFLAGS='-I/opt/local/include'
> > :debug:configure CXX='/usr/bin/clang++'
> > :debug:configure CXXFLAGS='-pipe -Os -stdlib=libc++ -arch x86_64'
> > :debug:configure F77='/opt/local/bin/gfortran-mp-8'
> > :debug:configure F77FLAGS='-m64'
> > :debug:configure F90FLAGS='-pipe -Os -m64'
> > :debug:configure FCFLAGS='-pipe -Os -m64'
> > :debug:configure FFLAGS='-pipe -Os'
> > :debug:configure INSTALL='/usr/bin/install -c'
> > :debug:configure LDFLAGS='-L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64'
> > :debug:configure LIBRARY_PATH='/opt/local/lib'
> > :debug:configure MACOSX_DEPLOYMENT_TARGET='10.12'
> > :debug:configure OBJC='/usr/bin/clang'
> > :debug:configure OBJCFLAGS='-pipe -Os -arch x86_64'
> > :debug:configure OBJCXX='/usr/bin/clang++'
> > :debug:configure OBJCXXFLAGS='-pipe -Os -stdlib=libc++ -arch x86_64'
> > 
> > for this particular port, I need to override the build and pass F77 as the linker. I tried
> > 
> > build.args-append   CC=${configure.cc} \
> >                   F77=${configure.f77}
> > 
> > build.target        lib/${os.platform}${os.major}/libtaucs.a
> > 
> > build {
> >   ui_info "Building libtaucs archives:"
> >   system -W ${worksrcpath} "${build.cmd} ${build.args} ${build.target}"
> > }
> > 
> > with 'LD = $(F77)’ in the Makefile, but that didn’t work. How should I pass this during build?
> 
> I suppose that ought to work, except that perhaps the problem you're running into is that ${build.args} is a list of values. If you want to concatenate all those list items with spaces and include that expanded value in a string, as you're doing here, you'll need to use the expand operator ({*}). Technically, build.cmd and build.target (and all other MacPorts options) are lists too, though they might only contain one item at the moment. To properly expand all those lists into strings, you'd use: "{*}${build.cmd} {*}${build.args} {*}${build.target}".
> 
> However, you probably should not override the build phase with this custom code block, because then you don't get a lot of conveniences that MacPorts provides. The custom build block you showed above doesn't look like it's trying to do anything different from the standard build phase, so I would just remove it. If you let MacPorts do the build phase the default way, you wouldn't run into that problem. Though I'm not 100% certain that was the problem, since you didn't show the way in which it didn't work.
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20181125/a51027fe/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: darwin.mk
Type: application/octet-stream
Size: 878 bytes
Desc: not available
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20181125/a51027fe/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20181125/a51027fe/attachment-0001.html>


More information about the macports-dev mailing list