Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Sep 2010 00:57:56 -0400
From:      jhell <jhell@DataIX.net>
To:        Scot Hetzel <swhetzel@gmail.com>
Cc:        bf1783@gmail.com, maho@freebsd.org, freebsd-ports@freebsd.org
Subject:   Re: math/blas linking to gfortran with LDADD?= -lgfortran
Message-ID:  <4C7DDD54.7020602@DataIX.net>
In-Reply-To: <AANLkTinVXMOanGiMsBGBgyMtOWpDEUrLzaetZfFXn7p_@mail.gmail.com>
References:  <AANLkTinhAPY-PEH_TegMAEx1ejHf_WoEL8KZU%2BoXGhFD@mail.gmail.com> <4C7D76A6.7080401@DataIX.net> <AANLkTi=X6=o6bLy4EcGafiinK0UWjzUUPL6NNM6ad0i8@mail.gmail.com> <AANLkTinVXMOanGiMsBGBgyMtOWpDEUrLzaetZfFXn7p_@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 09/01/2010 00:10, Scot Hetzel wrote:
> On Tue, Aug 31, 2010 at 10:06 PM, b. f. <bf1783@googlemail.com> wrote:
>> On 8/31/10, jhell <jhell@dataix.net> wrote:
>>> Looking closer at the math/blas & math/lapack ports:
>>>
>>> This statement does not make any sense. The logic is backwards for every
>>> instance. And WITH_PROFILE would do.
>>> .if !(defined(NOPROFILE) || defined(NO_PROFILE) || defined(WITHOUT_PROFILE))
>>> PLIST_FILES+=   lib/libblas_p.a
>>> .endif
>>>
>>> Which is basically saying:
>>> Add that profile lib if NOPROFILE is not defined "_p is a profiled lib
>>> why would you want to install this if the admin has NOT defined NOPROFILE?
>>>
>>
>> Er, I'm not sure what you're getting at here. No means no.  Really.
>> The default, as I explained, is to build and install the profiling
>> libraries, unless one or more of three disabling variables has been
>> defined. And that's the default because users of these ports often use
>> the profiled libraries when analyzing performance of their programs,
>> which are usually computationally-intensive.  Why the three variables?
>>  Because they control whether the profiling libraries are actually
>> built via bsd.compat.mk and bsd.lib.mk.
>>
> Actually there are only 2 *_PROFILE variables (WITH_PROFILE and
> WITHOUT_PROFILE) that are user visible for the FreeBSD sources. The
> NOPROFILE variable is depreceiated, and the NO_PROFILE variable is
> only supposed to be used in Makefiles according to bsd.own.mk:
> 
> # Define MK_* variables (which are either "yes" or "no") for users
> # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
> # make(1) environment.
> # These should be tested with `== "no"' or `!= "no"' in makefiles.
> # The NO_* variables should only be set by makefiles.
> 
> So according to bsd.own.mk, this is the correct test for the math/blas
> port to determine if profiling libraries should be built:
> 
> .if !defined(WITHOUT_PROFILE)
> PLIST_FILES+=   lib/libblas_p.a
> .endif
> 
> I also tested how these variables responded:
> 
> vbox# cd /usr/src/lib/libcam
> vbox# make -V WITH_PROFILE -V MK_PROFILE -V NO_PROFILE -V WITHOUT_PROFILE
> 
> yes
> 
> 
> vbox# make -V WITH_PROFILE -V MK_PROFILE -V NO_PROFILE -V
> WITHOUT_PROFILE WITH_PROFILE=yes
> yes
> yes
> 
> 
> vbox# make -V WITH_PROFILE -V MK_PROFILE -V NO_PROFILE -V
> WITHOUT_PROFILE NO_PROFILE=yes
> 
> no
> yes
> 
> vbox# make -V WITH_PROFILE -V MK_PROFILE -V NO_PROFILE -V
> WITHOUT_PROFILE WITHOUT_PROFILE=yes
> 
> no
> 
> yes
> 
> vbox# make -V WITH_PROFILE -V MK_PROFILE -V NO_PROFILE -V
> WITHOUT_PROFILE NOPROFILE=yes
> "/usr/share/mk/bsd.compat.mk", line 35: warning: NOPROFILE is
> deprecated in favour of NO_PROFILE
> 
> no
> yes
> 
> 
> As can be seen, NOPROFILE is deprecated.
> 
> NOTE: WITHOUT_PROFILE would need to be set in /etc/make.conf (instead
> of /etc/src.conf) to disable building profiled libraries in the
> FreeBSD sources and the math/blas port.
> 
> Scot

Thank you Scot

As for src.conf Yes I know it would need to be defined in make.conf
globally to effect src & ports. But to my belief at the time I did not
believe that anything in ports would blindly assume that setting
something with profiling would be acceptable which is why I suggested
the if defined(WITH_PROFILE) instead. Things that enable options like
profiling usually used for debugging that is not used in general usually
lead to an infestation of other targets and programs that link against
them and in some cases like the -PIE instance a while back with samba
and cups where something in one of the source files was configured in a
way that lead to global profiling of anything that had enabled -PIE
during their builds resulting in *.gprof files being created in /. This
is just one of the reasons why I don't like profiling enabled without
the user knowing that its going to happen.

For reference PR/143924 & MFC commit r205567 that happened during
releng/7.2 days.


Regards & Thank you again.

-- 

 jhell,v



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C7DDD54.7020602>