Hi.
On Friday 01 February 2008, Michael Schuster wrote:
> > Would it make sense to build our packages so they install in / instead of
> > in /opt/something so that people can use pkgadd -R /alternate/root to put
> > them where they want?
>
> yes please! (read: yes, it would make sense, can we please attempt to have
> this happen)
Yes. Me, too, please.
And Adriaan wrote:
> In *principle* changing include/paths.inc in both KBE and SPECS should do the
> trick, but there might be hard-coded /opt/foss here and there in the
> codebase. Something to hunt down with lots of compilation cycles.
NONONO! No try and error! That's not very effective. A simple sed and/or awk
script does that job.
I did it, it works fine. Tribute goes to Stefan and Adriaan for this, thy
helped me to start on IRC.
Have to grab it from my .bash_history. Wait.
SHELLSNIPPET
cd SPECS/
find . -type f -exec egrep -l '/opt/foss' \{\} + >OPT_FOSS.lst
vi OPT_FOSS.lst
for f in `cat OPT_FOSS.lst`; do T=$$; sed -e "s#/opt/foss#\%\{_foss_prefix\}#g"
$f >/tmp/sed.$T; mv $f $f.orig; cp -fp $f.orig $f; cp -fp /tmp/sed.$T $f; done
find . -type f -exec egrep -l '/opt/foss' \{\} +
vi include/paths.inc
find . -type f -exec egrep -l '/opt/foss' \{\} +
find . -type f \! -name '*.orig' -exec egrep -l '/opt/kdebld' \{\} +
>OPT_KDEBLD.lst
cat OPT_KDEBLD.lst
for f in `cat OPT_KDEBLD.lst`; do T=$$; sed -e
"s#/opt/kdebld#\%\{_kbe_prefix\}#g" $f >/tmp/sed.$T;
echo mv $f $f.orig; mv $f $f.orig; echo cp -fp $f.orig $f; cp -fp $f.orig $f;
echo cp -fp /tmp/sed
.$T $f; cp -fp /tmp/sed.$T $f; done
head include/paths.inc
vi include/paths.inc
find . -type f \! -name '*.orig' -exec egrep -l '/opt/qt3' \{\} + >OPT_QT3.lst
find . -type f \! -name '*.orig' -exec egrep -l '/opt/qt4' \{\} + >OPT_QT4.lst
find . -type f \! -name '*.orig' -exec egrep -l '/opt/1[12]/SUNWspro' \{\} +
>OPT_SUNWspro.lst
find . -type f \! -name '*.orig' -exec egrep -l '/opt/qt[34]' \{\} + >OPT_QT.lst
find . -type f \! -name '*.orig' -exec egrep -l '/opt/.+/SUNWspro' \{\} +
>OPT_SUNWspro.lst
cat OPT_SUNWspro.lst
find . -type f \! -name '*.orig' -exec egrep -l '/opt/kde' \{\} + >OPT_KDE.lst
for f in `cat OPT_QT.lst OPT_SUNWspro.lst OPT_KDE.lst`; do T=$$; sed -e
"s#/opt/qt3#\%\{_qt3_prefix\}#g" -e "s#/opt/qt4#\%\{_qt4_prefix\}#g" -e
"s#/opt/SS12/SUNWspro#\%\{_ss12_prefix\}#g" -e
"s#/opt/SS11/SUNWspro#\%\{_ss11_prefix\}#g" -e
"s#/opt/kde3#\%\{_kde3_prefix\}#g" -e "s#/opt/kde4#\%\{_kde4_prefix\}#g" $f
>/tmp/sed.$T; echo mv $f $f.orig; mv $f $f.orig; echo cp -fp $f.orig $f; cp -fp
$f.orig $f; echo cp -fp /tmp/sed.$T $f; cp -fp /tmp/sed.$T $f; done
find . -type f \! -name '*.orig' -exec egrep -l '/opt/kde' \{\} +
find . -type f \! -name '*.orig' -exec egrep -l '/opt/' \{\} +
find . -type f \! -name '*.orig' -exec egrep '/opt/' \{\} +
clear
find . -type f \! -name '*.orig' -exec egrep '/opt/' \{\} +
find . -type f \! -name '*.orig' -exec egrep '/opt/' \{\} + >OPT.lst
vi OPT.lst
find . -type f \! -name '*.orig' -exec egrep -l '/opt/' \{\} + >OPT.lst
vi OPT.lst
find . -type f \! -name '*.orig' -exec egrep -l '/opt/' \{\} +
find . -type f \! -name '*.orig' -exec egrep '/opt/' \{\} +
find . -type f \! -name '*.orig' -exec egrep -l '/opt/qt-3' \{\} +
find . -type f \! -name '*.orig' -exec egrep -l '/opt/qt-4' \{\} +
find . -type f \! -name '*.orig' -exec egrep '/opt/qt-4' \{\} +
find . -type f \! -name '*.orig' -exec egrep '/opt/qt' \{\} +
for f in `cat OPT.lst`; do T=$$; sed -e "s#/opt/qt-4.3#\%\{_qt4_prefix\}#g" -e
"s#/opt/SUNWspro#\%\
{_ss12_prefix\}#g" -e "s#/opt/kdebld#\%\{_kbe_prefix\}#g" $f >/tmp/sed.$T; echo
mv $f $f.orig; mv $
f $f.orig; echo cp -fp $f.orig $f; cp -fp $f.orig $f; echo cp -fp /tmp/sed.$T
$f; cp -fp /tmp/sed.$T $f; done
TEPPINSLLEHS
Then, in some file(s), MAKEFLAGS are set to do parallel build, but the #CPU is
not computed right.
Must check for online and "no-intr", better use
MAKEFLAGS="`/usr/sbin/psrinfo|nawk '$2==\"on-line\"||\"no-intr\"{n++}END{print
"\-j\", n+1}'`"
Add at least one because the master make process merely does nothing. I suppose
scaling by a factor of 1.3 is reasonable. n+1 is int(1.3*n) then in the above
awk command.
My CPUs are mostly idle during the build, meaning it's not well parallelized.
I'd like to see the load at the #CPU's or above, but sadly it's between 1 and
2, occasionally 2-4.
> I suppose it would be possible to install to / in a zone and then install to
> (say) /usr or /opt/foss with pkgadd -R.
Yes, of course. Do you think I'm going to risk the health of my global zone
again by fiddling around with foreign software? After installing KDE from
blastwave (I've been a greenhorn) I had to re-install the whole system... Read:
IMHO it's a necessity.
Final note is about autoconf and friends: These tools were designed to help
developers doing configuration mgmt for different platforms, i.e. compiler
flags, paths etc. But: They did it plain wrong. Please do not take this as an
accusation; I just write fast. I know this task is a big challenge and last
not least autotools seem to work more or less well across Linux,*BSD,and some
others. E.g. by default, an autoconf-generated package cant compile a shared
lib on Solaris. Conclusion: These are viruses, and all those GNU'ish packages
are infected. The defaults for Solaris are hardcoded _wrong_. And, AFAIK,
there is no central database for the right Compiler flags etc., and this is by
design. Consequently, every new pkg we add will come in with wrong default
settings, because automake shipps with them and the innocent developer does not
and can not know the right settings for each and every architecture/OS/system.
Means we need a medicine, and inoculate all the packages to read the correct
values from a central place whose content will grow out of our efforts. For
instance, I see from the output of homerun's build log that he's doing a
compile for opteron. He can, if he explicitely wants to, but for sure this
should not be the default compile flags for a x86 system.
My proposal is: Two basics -- among others -- have to be done:
1. Free choice of installations paths for KBE, KDE-deps and the final product,
KDE.
2. Defensive common defaults for all pkgs for Compile, Link, Makeflags, etc.
Can be fine-tuned pkg by pkg later. AFAIC the default should be to compile
- -32 (bit)
- no explicit setting of arch, isa, target etc, so we have compiler
defaults.
- largefile support
- c99/ISO (C) resp. apache-stdcxx (C++)
- default optimization (but, Studio seems to do fine with -O5)
- is there some runtime automagic available for programs/libraries to use
SSE/VIS if present?
This is a silly question because I know there is, but for these things
I'm just a user.
- IEEE fp math (can be overwritten to include violations for pkgs that
benefit from that)
This is PoD (point of discussion): Should we set the default to
-fsimple=2 etc and override to
do strict IEEE fp math only for some pkgs that need this?
for both SPARC and x86, since KDE is end-user, client software. Some pkgs might
need or benefit from 64 bit, we can see and change later. Probably those of you
who already have KDE running can provide a list of pkgs that run noticeable
faster with 64 bit. I'd like to concentrate on fixing bugs/portability
pitfalls/and the like in the C/C++ code, not in obscure M4 files where two and
more different syntaxes are mixed in just one source file. Just dreaming?
3. Parallel build. KDE is huge, that's why I consider this essential, too.
Stefan (+others?) has done a lot of work to identify pkg dependencies. I can
live with building KBE serially, even the deps. These hopefully don't change
frequently. But the whole KDE tree? No, please.
4. Keep discussion entries short :)
5. Do we have/need some kind of automagic test framework? pkg is ANSI/ISO clean
-> compiles -> runs -> can do (file IO, network IO, write to display, write to
audio) etc?
Cheers, paul
--
This message posted from opensolaris.org