http://www.linuxfromscratch.org/lfs/view/stable/chapter05/introduction.html
http://www.linuxfromscratch.org/lfs/view/stable/chapter04/creatingtoolsdir.html
2.4. Setting The $LFS Variable
$ sudo mkdir /monster
$ sudo su
# export LFS=/monster
$ sudo mkdir -v $LFS/sources
$ sudo chmod -v a+wt $LFS/sources
mode of ‘/monster/sources’ changed from 0755 (rwxr-xr-x) to 1777 (rwxrwxrwt)
An easy way to download all of the packages and patches is by using wget-list as an input to wget. For example:
wget --input-file=wget-list --continue --directory-prefix=$LFS/sources
wget -c http://www.linuxfromscratch.org/lfs/view/stable/md5sums
mkdir -v $LFS/tools
$ sudo ln -sv $LFS/tools /
[sudo] password for wilderman:
‘/tools’ -> ‘/monster/tools’
$ sudo groupadd lfs
$ sudo useradd -s /bin/bash -g lfs -m -k /dev/null lfs
$ sudo passwd lfs
Changing password for user lfs.
New password: 73575981.,.
Retype new password: 73575981.,.
passwd: all authentication tokens updated successfully.
$ sudo chown -v lfs $LFS/tools
changed ownership of ‘/monster/tools’ from wilderman to lfs
$ sudo sudo chown -v lfs $LFS/sources
changed ownership of ‘/monster/sources’ from root to lfs
$ su - lfs
Password:
-bash-4.2$
4.5. About SBUs
http://www.linuxfromscratch.org/lfs/view/stable/chapter04/aboutsbus.html
lfs:~$ export MAKEFLAGS='-j 64'
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/chapter05.html
lfs:~/sources/binutils-2.26$ ./config.guess
x86_64-pc-linux-gnu
5.4. Binutils-2.26 - Pass 1
5.4.1. Installation of Cross Binutils
http://www.linuxfromscratch.org/lfs/view/stable/chapter05/binutils-pass1.html
mkdir -v build
cd build
lfs:~/sources/binutils-2.26$ mkdir build
lfs:~/sources/binutils-2.26$ cd build/
../configure --prefix=/tools --with-sysroot=$LFS --target=$LFS_TGT --disable-nls --disable-werror
If building on x86_64, create a symlink to ensure the sanity of the toolchain:
$ case $(uname -m) in
> x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;
> esac
mkdir: created directory '/tools/lib'
'/tools/lib64' -> 'lib'
5.5. GCC-5.3.0 - Pass 1
5.5.1. Installation of Cross GCC
lfs:~/sources$ tar xjf /monster/sources/gcc-5.3.0.tar.bz2
lfs:~/sources/gcc-5.3.0$ tar -xf /monster/sources/mpfr-3.1.3.tar.xz
$ mv -v mpfr-3.1.3 mpfr
'mpfr-3.1.3' -> 'mpfr'
$ tar -xf /monster/sources/gmp-6.1.0.tar.xz
lfs:~/sources/gcc-5.3.0$ mv -v gmp-6.1.0 gmp
'gmp-6.1.0' -> 'gmp'
$ tar -xf /monster/sources/mpc-1.0.3.tar.gz
$ mv mpc-1.0.3 mpc
The following command will change the location of GCC's default dynamic linker to use the one installed in /tools. It also removes /usr/include from GCC's include search path. Issue:
for file in \
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
touch $file.orig
'gcc/config/tilepro/linux.h' -> 'gcc/config/tilepro/linux.h.orig'
'gcc/config/ia64/sysv4.h' -> 'gcc/config/ia64/sysv4.h.orig'
'gcc/config/ia64/linux.h' -> 'gcc/config/ia64/linux.h.orig'
'gcc/config/nios2/linux.h' -> 'gcc/config/nios2/linux.h.orig'
'gcc/config/frv/linux.h' -> 'gcc/config/frv/linux.h.orig'
'gcc/config/mn10300/linux.h' -> 'gcc/config/mn10300/linux.h.orig'
'gcc/config/sparc/linux64.h' -> 'gcc/config/sparc/linux64.h.orig'
'gcc/config/sparc/sysv4.h' -> 'gcc/config/sparc/sysv4.h.orig'
'gcc/config/sparc/linux.h' -> 'gcc/config/sparc/linux.h.orig'
'gcc/config/microblaze/linux.h' -> 'gcc/config/microblaze/linux.h.orig'
'gcc/config/m68k/linux.h' -> 'gcc/config/m68k/linux.h.orig'
'gcc/config/sh/linux.h' -> 'gcc/config/sh/linux.h.orig'
'gcc/config/tilegx/linux.h' -> 'gcc/config/tilegx/linux.h.orig'
'gcc/config/s390/linux.h' -> 'gcc/config/s390/linux.h.orig'
'gcc/config/alpha/linux.h' -> 'gcc/config/alpha/linux.h.orig'
'gcc/config/i386/linux64.h' -> 'gcc/config/i386/linux64.h.orig'
'gcc/config/i386/sysv4.h' -> 'gcc/config/i386/sysv4.h.orig'
'gcc/config/i386/linux.h' -> 'gcc/config/i386/linux.h.orig'
'gcc/config/vax/linux.h' -> 'gcc/config/vax/linux.h.orig'
'gcc/config/m32r/linux.h' -> 'gcc/config/m32r/linux.h.orig'
'gcc/config/cris/linux.h' -> 'gcc/config/cris/linux.h.orig'
'gcc/config/mips/linux.h' -> 'gcc/config/mips/linux.h.orig'
'gcc/config/xtensa/linux.h' -> 'gcc/config/xtensa/linux.h.orig'
'gcc/config/bfin/linux.h' -> 'gcc/config/bfin/linux.h.orig'
'gcc/config/linux.h' -> 'gcc/config/linux.h.orig'
'gcc/config/rs6000/linux64.h' -> 'gcc/config/rs6000/linux64.h.orig'
'gcc/config/rs6000/sysv4.h' -> 'gcc/config/rs6000/sysv4.h.orig'
'gcc/config/rs6000/linux.h' -> 'gcc/config/rs6000/linux.h.orig'
lfs:~/sources/gcc-5.3.0$ mkdir -v build
mkdir: created directory 'build'
lfs:~/sources/gcc-5.3.0$ mkdir -v build
mkdir: created directory 'build'
$ cd build
../configure \
--target=$LFS_TGT \
--prefix=/tools \
--with-glibc-version=2.11 \
--with-sysroot=$LFS \
--with-newlib \
--without-headers \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-decimal-float \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--enable-languages=c,c++
Compile GCC by running:
time make
real 2m3.648s
user 20m55.263s
sys 2m31.014s
Install the package:
make install
5.6.1. Installation of Linux API Headers
Make sure there are no stale files embedded in the package:
make mrproper
Now extract the user-visible kernel headers from the source. They are placed in an intermediate local directory and copied to the needed location because the extraction process removes any existing files in the target directory.
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include
5.7.1. Installation of Glibc
$ tar -xf /monster/sources/glibc-2.23.tar.xz
lfs:~/sources$ cd glibc-2.23/
lfs:~/sources/glibc-2.23$ mkdir -v build
mkdir: created directory 'build'
../configure \
--prefix=/tools \
--host=$LFS_TGT \
--build=$(../scripts/config.guess) \
--disable-profile \
--enable-kernel=2.6.32 \
--enable-obsolete-rpc \
--with-headers=/tools/include \
libc_cv_forced_unwind=yes \
libc_cv_ctors_header=yes \
libc_cv_c_cleanup=yes
Compile the package:
make -j64
Install the package:
make install
Caution
At this point, it is imperative to stop and ensure that the basic functions (compiling and linking) of the new toolchain are working as expected. To perform a sanity check, run the following commands:
echo 'int main(){}' > dummy.c
$LFS_TGT-gcc dummy.c
readelf -l a.out | grep ': /tools'
lfs:~/sources/glibc-2.23/build$ readelf -l a.out | grep ': /tools'
[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
$ rm -v dummy.c a.out
removed 'dummy.c'
removed 'a.out'
5.8.1. Installation of Target Libstdc++
lfs:~/sources/gcc-5.3.0$ cd libstdc++-v3/
lfs:~/sources/gcc-5.3.0/libstdc++-v3$ mkdir -v build
../libstdc++-v3/configure \
--host=$LFS_TGT \
--prefix=/tools \
--disable-multilib \
--disable-nls \
--disable-libstdcxx-threads \
--disable-libstdcxx-pch \
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/5.3.0
$ make
$ make install
5.9. Binutils-2.26 - Pass 2
CC=$LFS_TGT-gcc \
AR=$LFS_TGT-ar \
RANLIB=$LFS_TGT-ranlib \
../configure \
--prefix=/tools \
--disable-nls \
--disable-werror \
--with-lib-path=/tools/lib \
--with-sysroot
lfs:~/sources/binutils-2.26/build$ make
Install the package:
make install
Now prepare the linker for the “Re-adjusting” phase in the next chapter:
make -C ld clean
make -C ld LIB_PATH=/usr/lib:/lib
cp -v ld/ld-new /tools/bin
5.10. GCC-5.3.0 - Pass 2
5.10.1. Installation of GCC
lfs:~/sources$ tar xjf /monster/sources/gcc-5.3.0.tar.bz2
lfs:~/sources/gcc-5.3.0$ cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
> `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/include-fixed/limits.h
Once again, change the location of GCC's default dynamic linker to use the one installed in /tools.
for file in \
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
touch $file.orig
done
'gcc/config/tilepro/linux.h' -> 'gcc/config/tilepro/linux.h.orig'
'gcc/config/ia64/sysv4.h' -> 'gcc/config/ia64/sysv4.h.orig'
'gcc/config/ia64/linux.h' -> 'gcc/config/ia64/linux.h.orig'
'gcc/config/nios2/linux.h' -> 'gcc/config/nios2/linux.h.orig'
'gcc/config/frv/linux.h' -> 'gcc/config/frv/linux.h.orig'
'gcc/config/mn10300/linux.h' -> 'gcc/config/mn10300/linux.h.orig'
'gcc/config/sparc/linux64.h' -> 'gcc/config/sparc/linux64.h.orig'
'gcc/config/sparc/sysv4.h' -> 'gcc/config/sparc/sysv4.h.orig'
'gcc/config/sparc/linux.h' -> 'gcc/config/sparc/linux.h.orig'
'gcc/config/microblaze/linux.h' -> 'gcc/config/microblaze/linux.h.orig'
'gcc/config/m68k/linux.h' -> 'gcc/config/m68k/linux.h.orig'
'gcc/config/sh/linux.h' -> 'gcc/config/sh/linux.h.orig'
'gcc/config/tilegx/linux.h' -> 'gcc/config/tilegx/linux.h.orig'
'gcc/config/s390/linux.h' -> 'gcc/config/s390/linux.h.orig'
'gcc/config/alpha/linux.h' -> 'gcc/config/alpha/linux.h.orig'
'gcc/config/i386/linux64.h' -> 'gcc/config/i386/linux64.h.orig'
'gcc/config/i386/sysv4.h' -> 'gcc/config/i386/sysv4.h.orig'
'gcc/config/i386/linux.h' -> 'gcc/config/i386/linux.h.orig'
'gcc/config/vax/linux.h' -> 'gcc/config/vax/linux.h.orig'
'gcc/config/m32r/linux.h' -> 'gcc/config/m32r/linux.h.orig'
'gcc/config/cris/linux.h' -> 'gcc/config/cris/linux.h.orig'
'gcc/config/mips/linux.h' -> 'gcc/config/mips/linux.h.orig'
'gcc/config/xtensa/linux.h' -> 'gcc/config/xtensa/linux.h.orig'
'gcc/config/bfin/linux.h' -> 'gcc/config/bfin/linux.h.orig'
'gcc/config/linux.h' -> 'gcc/config/linux.h.orig'
'gcc/config/rs6000/linux64.h' -> 'gcc/config/rs6000/linux64.h.orig'
'gcc/config/rs6000/sysv4.h' -> 'gcc/config/rs6000/sysv4.h.orig'
'gcc/config/rs6000/linux.h' -> 'gcc/config/rs6000/linux.h.orig'
lfs:~/sources/gcc-5.3.0$ tar -xf /monster/sources/mpfr-3.1.3.tar.xz
mv -v mpfr-3.1.3 mpfr
tar -xf ../gmp-6.1.0.tar.xz
mv -v gmp-6.1.0 gmp
tar -xf ../mpc-1.0.3.tar.gz
mv -v mpc-1.0.3 mpc
lfs:~/sources/gcc-5.3.0$ mkdir -v build
lfs:~/sources/gcc-5.3.0$ cd build
Before starting to build GCC, remember to unset any environment variables that override the default optimization flags.
Now prepare GCC for compilation:
CC=$LFS_TGT-gcc \
CXX=$LFS_TGT-g++ \
AR=$LFS_TGT-ar \
RANLIB=$LFS_TGT-ranlib \
../configure \
--prefix=/tools \
--with-local-prefix=/tools \
--with-native-system-header-dir=/tools/include \
--enable-languages=c,c++ \
--disable-libstdcxx-pch \
--disable-multilib \
--disable-bootstrap \
--disable-libgomp
lfs:~/sources/gcc-5.3.0/build$ time make
real 21m45.295s
user 17m54.075s
sys 3m18.301s
Install the package:
make install
As a finishing touch, create a symlink. Many programs and scripts run cc instead of gcc, which is used to keep programs generic and therefore usable on all kinds of UNIX systems where the GNU C compiler is not always installed. Running cc leaves the system administrator free to decide which C compiler to install:
lfs:~/sources/gcc-5.3.0/build$ ln -sv gcc /tools/bin/cc
'/tools/bin/cc' -> 'gcc'
Caution
At this point, it is imperative to stop and ensure that the basic functions (compiling and linking) of the new toolchain are working as expected. To perform a sanity check, run the following commands:
lfs:~/sources/gcc-5.3.0/build$ echo 'int main(){}' > dummy.c
lfs:~/sources/gcc-5.3.0/build$ cc dummy.c
lfs:~/sources/gcc-5.3.0/build$ readelf -l a.out | grep ': /tools'
[Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
Once all is well, clean up the test files:
rm -v dummy.c a.out
5.11. Tcl-core-8.6.4
5.11.1. Installation of Tcl-core
Prepare Tcl for compilation:
cd unix
./configure --prefix=/tools
Build the package:
make
Compilation is now complete. As discussed earlier, running the test suite is not mandatory for the temporary tools here in this chapter. To run the Tcl test suite anyway, issue the following command:
TZ=UTC make test
Install the package:
make install
Make the installed library writable so debugging symbols can be removed later:
chmod -v u+w /tools/lib/libtcl8.6.so
Install Tcl's headers. The next package, Expect, requires them to build.
$ make install-private-headers
Installing private header files to /tools/include/
Now make a necessary symbolic link:
lfs:~/sources/tcl8.6.4/unix$ ln -sv tclsh8.6 /tools/bin/tclsh
'/tools/bin/tclsh' -> 'tclsh8.6'
5.12.1. Installation of Expect
lfs:~/sources/expect5.45$ cp -v configure{,.orig}
'configure' -> 'configure.orig'
lfs:~/sources/expect5.45$ cp -v configure{,.orig}
'configure' -> 'configure.orig'
lfs:~/sources/expect5.45$ sed 's:/usr/local/bin:/bin:' configure.orig > configure
Now prepare Expect for compilation:
./configure --prefix=/tools \
--with-tcl=/tools/lib \
--with-tclinclude=/tools/include
Build the package:
make
Install the package:
make SCRIPTS="" install
lfs:~/sources/expect5.45$ ldd /tools/bin/expect
linux-vdso.so.1 (0x00007ffe7df51000)
libexpect5.45.so => /tools/lib/expect5.45/libexpect5.45.so (0x00007fe8e6af4000)
libtcl8.6.so => /tools/lib/libtcl8.6.so (0x00007fe8e6734000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fe8e6530000)
libm.so.6 => /tools/lib/libm.so.6 (0x00007fe8e622b000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007fe8e5e8a000)
libutil.so.1 => /tools/lib/libutil.so.1 (0x00007fe8e5c87000)
libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007fe8e5a6a000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007fe8e6d25000)
5.13.1. Installation of DejaGNU
lfs:~/sources$ tar xzf /monster/sources/dejagnu-1.5.3.tar.gz
Prepare DejaGNU for compilation:
./configure --prefix=/tools
5.14.1. Installation of Check
lfs:~/sources$ tar xzf /monster/sources/check-0.10.0.tar.gz
PKG_CONFIG= ./configure --prefix=/tools
Build the package:
make
lfs:~/sources/check-0.10.0$ make check
make install
5.15.1. Installation of Ncurses
lfs:~/sources$ tar xzf /monster/sources/ncurses-6.0.tar.gz
lfs:~/sources/ncurses-6.0$ sed -i s/mawk// configure
./configure --prefix=/tools \
--with-shared \
--without-debug \
--without-ada \
--enable-widec \
--enable-overwrite
** Configuration summary for NCURSES 6.0 20150808:
extended funcs: yes
xterm terminfo: xterm-new
bin directory: /tools/bin
lib directory: /tools/lib
include directory: /tools/include
man directory: /tools/share/man
terminfo directory: /tools/share/terminfo
Compile the package:
make
Install the package:
make install
5.16.1. Installation of Bash
lfs:~/sources$ tar xzf /monster/sources/bash-4.3.30.tar.gz
HowTo Apply a Patch File To My Linux / UNIX Source Code
http://www.cyberciti.biz/faq/appy-patch-file-using-patch-command/
patch command syntax
The basic syntax is as follows:
$ patch < patch.file $ patch source.code.file < patch.file $ patch -p LEVEL < {/path/to/patch/file}
To apply a patch, one could run the following command in a shell:
$ patch < /path/to/file
./configure --prefix=/tools --without-bash-malloc
Compile the package:
make
make tests
make install
$ ln -sv bash /tools/bin/sh
'/tools/bin/sh' -> 'bash'
5.17.1. Installation of Bzip2
$ tar xzf /monster/sources/bzip2-1.0.6.tar.gz
lfs:~/sources/bzip2-1.0.6$ patch -p1 < /monster/sources/bzip2-1.0.6-install_docs-1.patch
patching file Makefile
make
make PREFIX=/tools install
5.18.1. Installation of Coreutils
lfs:~/sources$ tar xf /monster/sources/coreutils-8.25.tar.xz
lfs:~/sources/coreutils-8.25$ make
make RUN_EXPENSIVE_TESTS=yes check
make install
5.19.1. Installation of Diffutils
./configure --prefix=/tools
make
make check
make install
5.20.1. Installation of File
lfs:~/sources$ tar xf /monster/sources/file-5.25.tar.gz
lfs:~/sources$ ./configure --prefix=/tools
lfs:~/sources$ make
lfs:~/sources$ make check
lfs:~/sources$ make install
5.21.1. Installation of Findutils
lfs:~/sources$ tar xf /monster/sources/findutils-4.6.0.tar.gz
$ ./configure --prefix=/tools
$ make
$ make check
$ make install
5.22.1. Installation of Gawk
lfs:~/sources$ tar xf /monster/sources/gawk-4.1.3.tar.xz
lfs:~/sources/gawk-4.1.3$ ./configure --prefix=/tools
$ make
$ make check
$ make install
5.23.1. Installation of Gettext
lfs:~/sources$ tar xf /monster/sources/gettext-0.19.7.tar.xz
lfs:~/sources$ cd gettext-0.19.7/gettext-tools/
EMACS="no" ./configure --prefix=/tools --disable-shared
make -C gnulib-lib
make -C intl pluralx.c
make -C src msgfmt
make -C src msgmerge
make -C src xgettext
Install the msgfmt, msgmerge and xgettext programs:
cp -v src/{msgfmt,msgmerge,xgettext} /tools/bin
'src/msgfmt' -> '/tools/bin/msgfmt'
'src/msgmerge' -> '/tools/bin/msgmerge'
'src/xgettext' -> '/tools/bin/xgettext'
5.24.1. Installation of Grep
lfs:~/sources$ tar xf /monster/sources/grep-2.23.tar.xz
./configure --prefix=/tools
make
make check
make install
5.25.1. Installation of Gzip
lfs:~/sources$ tar xf /monster/sources/gzip-1.6.tar.xz
./configure --prefix=/tools
make
make check
make install
5.26.1. Installation of M4
lfs:~/sources$ tar xf /monster/sources/m4-1.4.17.tar.xz
./configure --prefix=/tools
make
make check
make install
5.27.1. Installation of Make
$ tar xf /monster/sources/make-4.1.tar.bz2
make
make check
------------------------------------------------------------------------------
Running tests for GNU make on Linux sullivan.dimar.mil.co 3.10.0-327.13.1.el7.x86_64 x86_64
GNU Make 4.1
------------------------------------------------------------------------------
Finding tests...
===========================================================================
Regression PASSED: GNU Make 4.1 (x86_64-unknown-linux-gnu) built with gcc
===========================================================================
make install
5.28.1. Installation of Patch
lfs:~/sources$ tar xf /monster/sources/patch-2.7.5.tar.xz
5.29.1. Installation of Perl
lfs:~/sources$ tar xf /monster/sources/perl-5.22.1.tar.bz2
make
$ cp -v perl cpan/podlators/pod2man /tools/bin
'perl' -> '/tools/bin/perl'
'cpan/podlators/pod2man' -> '/tools/bin/pod2man'
$ mkdir -pv /tools/lib/perl5/5.22.1
mkdir: created directory '/tools/lib/perl5'
mkdir: created directory '/tools/lib/perl5/5.22.1'
cp -Rv lib/* /tools/lib/perl5/5.22.1
5.30.1. Installation of Sed
lfs:~/sources$ tar xf /monster/sources/sed-4.2.2.tar.bz2
./configure --prefix=/tools
$ make
$ make check
$ make install
5.31.1. Installation of Tar
lfs:~/sources$ tar xf /monster/sources/tar-1.28.tar.xz
$ cd tar-1.28/
./configure --prefix=/tools
make
make check
make install
5.32.1. Installation of Texinfo
$ tar xf /monster/sources/texinfo-6.1.tar.xz
./configure --prefix=/tools
make
make check
make install
5.33.1. Installation of Util-linux
$ wget -c https://www.kernel.org/pub/linux/utils/util-linux/v2.27/util-linux-2.27.1.tar.xz
$ tar xf /monster/sources/util-linux-2.27.1.tar.xz
./configure --prefix=/tools \
--without-python \
--disable-makeinstall-chown \
--without-systemdsystemunitdir \
PKG_CONFIG=""
make
make install
5.34.1. Installation of Xz
lfs:~/sources$ tar xf /monster/sources/xz-5.2.2.tar.xz
./configure --prefix=/tools
make
make check
make install
5.35. Stripping
lfs:~/sources$ strip --strip-debug /tools/lib/*
strip: Warning: '/tools/lib/audit' is not an ordinary file
strip: Warning: '/tools/lib/expect5.45' is not an ordinary file
strip: Warning: '/tools/lib/gawk' is not an ordinary file
strip: Warning: '/tools/lib/gcc' is not an ordinary file
strip: Warning: '/tools/lib/gconv' is not an ordinary file
strip: Warning: '/tools/lib/itcl4.0.3' is not an ordinary file
strip:/tools/lib/libasan.la: File format not recognized
strip:/tools/lib/libatomic.la: File format not recognized
strip:/tools/lib/libbfd.la: File format not recognized
strip:/tools/lib/libblkid.la: File format not recognized
strip:/tools/lib/libc.so: File format not recognized
strip:/tools/lib/libcc1.la: File format not recognized
strip:/tools/lib/libcheck.la: File format not recognized
strip:/tools/lib/libcilkrts.la: File format not recognized
strip:/tools/lib/libcilkrts.spec: File format not recognized
strip:/tools/lib/libfdisk.la: File format not recognized
5.36. Changing Ownership
chown -R root:root $LFS/tools
===========================================================================
III. Building the LFS System
===========================================================================
6.2. Preparing Virtual Kernel File Systems
[wilderman@sullivan sources]$ mkdir -pv $LFS/{dev,proc,sys,run}
mkdir: created directory ‘/monster/dev’
mkdir: created directory ‘/monster/proc’
mkdir: created directory ‘/monster/sys’
mkdir: created directory ‘/monster/run’
6.2.1. Creating Initial Device Nodes
[wilderman@sullivan sources]$ sudo mknod -m 600 $LFS/dev/console c 5 1
[wilderman@sullivan sources]$ sudo mknod -m 666 $LFS/dev/null c 1 3
6.2.2. Mounting and Populating /dev
[wilderman@sullivan sources]$ sudo mount -v --bind /dev $LFS/dev
mount: /dev bound on /monster/dev
6.2.3. Mounting Virtual Kernel File Systems
[wilderman@sullivan sources]$ sudo mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
mount: devpts mounted on /monster/dev/pts.
[wilderman@sullivan sources]$ sudo mount -vt proc proc $LFS/proc
mount: proc mounted on /monster/proc.
[wilderman@sullivan sources]$ sudo mount -vt sysfs sysfs $LFS/sys
mount: sysfs mounted on /monster/sys.
[wilderman@sullivan sources]$ sudo mount -vt tmpfs tmpfs $LFS/run
mount: tmpfs mounted on /monster/run.
6.4. Entering the Chroot Environment
It is time to enter the chroot environment to begin building and installing the final LFS system. As user root, run the following command to enter the realm that is, at the moment, populated with only the temporary tools:
chroot "$LFS" /tools/bin/env -i \
HOME=/root \
TERM="$TERM" \
PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash --login +h
6.5. Creating Directories
I have no name!:/# mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt}
mkdir: created directory '/bin'
mkdir: created directory '/boot'
mkdir: created directory '/etc'
mkdir: created directory '/etc/opt'
mkdir: created directory '/etc/sysconfig'
mkdir: created directory '/home'
mkdir: created directory '/lib'
mkdir: created directory '/lib/firmware'
mkdir: created directory '/mnt'
mkdir: created directory '/opt'
mkdir -pv /{media/{floppy,cdrom},sbin,srv,var}
install -dv -m 0750 /root
install -dv -m 1777 /tmp /var/tmp
mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir -v /usr/libexec
mkdir -pv /usr/{,local/}share/man/man{1..8}
case $(uname -m) in
x86_64) ln -sv lib /lib64
ln -sv lib /usr/lib64
ln -sv lib /usr/local/lib64 ;;
esac
mkdir -v /var/{log,mail,spool}
ln -sv /run /var/run
ln -sv /run/lock /var/lock
mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local}
6.6. Creating Essential Files and Symlinks
ln -sv /tools/bin/{bash,cat,echo,pwd,stty} /bin
ln -sv /tools/bin/perl /usr/bin
ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
ln -sv /tools/lib/libstdc++.so{,.6} /usr/lib
sed 's/tools/usr/' /tools/lib/libstdc++.la > /usr/lib/libstdc++.la
ln -sv bash /bin/sh
ln -sv /proc/self/mounts /etc/mtab
Create the /etc/passwd file by running the following command:
cat > /etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/dev/null:/bin/false
daemon:x:6:6:Daemon User:/dev/null:/bin/false
messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
EOF
Create the /etc/group file by running the following command:
cat > /etc/group << "EOF"
root:x:0:
bin:x:1:daemon
sys:x:2:
kmem:x:3:
tape:x:4:
tty:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
dialout:x:10:
audio:x:11:
video:x:12:
utmp:x:13:
usb:x:14:
cdrom:x:15:
adm:x:16:
messagebus:x:18:
systemd-journal:x:23:
input:x:24:
mail:x:34:
nogroup:x:99:
users:x:999:
EOF
To remove the “I have no name!” prompt, start a new shell. Since a full Glibc was installed in Chapter 5 and the /etc/passwd and /etc/group files have been created, user name and group name resolution will now work:
exec /tools/bin/bash --login +h
touch /var/log/{btmp,lastlog,wtmp}
chgrp -v utmp /var/log/lastlog
chmod -v 664 /var/log/lastlog
chmod -v 600 /var/log/btmp
6.7.1. Installation of Linux API Headers
# tar xf /sources/linux-4.4.2.tar.xz
root:~/lfs/linux-4.4.2# make mrproper
6.8. Man-pages-4.04
root:~/lfs# tar xf /sources/man-pages-4.04.tar.xz
root:~/lfs/man-pages-4.04# make install
for i in man?; do \
install -d -m 755 /usr/share/man/"$i" || exit $?; \
install -m 644 "$i"/* /usr/share/man/"$i" || exit $?; \
done; \
6.9. Glibc-2.23
6.9.1. Installation of Glibc
root:~/lfs# tar xf /sources/glibc-2.23.tar.xz
Some of the Glibc programs use non-FHS compilant /var/db directory to store their runtime data. Apply the following patch to make such programs store their runtime data in the FHS-compliant locations:
patch -Np1 -i ../glibc-2.23-fhs-1.patch
root:~/lfs/glibc-2.23# patch -Np1 -i ../glibc-2.23-fhs-1.patch
patching file Makeconfig
Hunk #1 succeeded at 260 (offset 10 lines).
patching file nscd/nscd.h
Hunk #1 succeeded at 161 (offset 49 lines).
patching file nss/db-Makefile
patching file sysdeps/generic/paths.h
patching file sysdeps/unix/sysv/linux/paths.h
The Glibc documentation recommends building Glibc in a dedicated build directory:
mkdir -v build
cd build
Prepare Glibc for compilation:
../configure --prefix=/usr \
--disable-profile \
--enable-kernel=2.6.32 \
--enable-obsolete-rpc
Compile the package:
make
Important
In this section, the test suite for Glibc is considered critical. Do not skip it under any circumstance.
Generally a few tests do not pass, but you can generally ignore any of the test failures listed below. Now test the build results:
make check
XPASS: elf/tst-protected1a
XPASS: elf/tst-protected1b
FAIL: posix/tst-getaddrinfo4
FAIL: posix/tst-getaddrinfo5
Summary of test results:
2 FAIL
2401 PASS
84 XFAIL
2 XPASS
Though it is a harmless message, the install stage of Glibc will complain about the absence of /etc/ld.so.conf. Prevent this warning with:
touch /etc/ld.so.conf
Install the package:
make install
Install the configuration file and runtime directory for nscd:
cp -v ../nscd/nscd.conf /etc/nscd.conf
mkdir -pv /var/cache/nscd
The locales that can make the system respond in a different language were not installed by the above command. None of the locales are required, but if some of them are missing, test suites of the future packages would skip important testcases.
mkdir -pv /usr/lib/locale
localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
localedef -i de_DE -f ISO-8859-1 de_DE
localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
localedef -i de_DE -f UTF-8 de_DE.UTF-8
localedef -i en_GB -f UTF-8 en_GB.UTF-8
localedef -i en_HK -f ISO-8859-1 en_HK
localedef -i en_PH -f ISO-8859-1 en_PH
localedef -i en_US -f ISO-8859-1 en_US
localedef -i en_US -f UTF-8 en_US.UTF-8
localedef -i es_MX -f ISO-8859-1 es_MX
localedef -i fa_IR -f UTF-8 fa_IR
localedef -i fr_FR -f ISO-8859-1 fr_FR
localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
localedef -i it_IT -f ISO-8859-1 it_IT
localedef -i it_IT -f UTF-8 it_IT.UTF-8
localedef -i ja_JP -f EUC-JP ja_JP
localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
localedef -i zh_CN -f GB18030 zh_CN.GB18030
In addition, install the locale for your own country, language and character set.
Alternatively, install all locales listed in the glibc-2.23/localedata/SUPPORTED file (it includes every locale listed above and many more) at once with the following time-consuming command:
make localedata/install-locales
6.9.2. Configuring Glibc
6.9.2.1. Adding nsswitch.conf
The /etc/nsswitch.conf file needs to be created because the Glibc defaults do not work well in a networked environment.
Create a new file /etc/nsswitch.conf by running the following:
cat > /etc/nsswitch.conf << "EOF"
# Begin /etc/nsswitch.conf
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
# End /etc/nsswitch.conf
EOF
6.9.2.2. Adding time zone data
tar -xf ../../tzdata2016a.tar.gz
ZONEINFO=/usr/share/zoneinfo
mkdir -pv $ZONEINFO/{posix,right}
for tz in etcetera southamerica northamerica europe africa antarctica \
asia australasia backward pacificnew systemv; do
zic -L /dev/null -d $ZONEINFO -y "sh yearistype.sh" ${tz}
zic -L /dev/null -d $ZONEINFO/posix -y "sh yearistype.sh" ${tz}
zic -L leapseconds -d $ZONEINFO/right -y "sh yearistype.sh" ${tz}
done
cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
zic -d $ZONEINFO -p America/New_York
unset ZONEINFO
root:~/lfs/glibc-2.23/build# tzselect
You can make this change permanent for yourself by appending the line
TZ='UTC-5'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
UTC-5
Then create the /etc/localtime file by running:
root:~/lfs/glibc-2.23/build# cp -v /usr/share/zoneinfo/UTC /etc/localtime
'/usr/share/zoneinfo/UTC' -> '/etc/localtime'
6.9.2.3. Configuring the Dynamic Loader
Create a new file /etc/ld.so.conf by running the following:
cat > /etc/ld.so.conf << "EOF"
# Begin /etc/ld.so.conf
/usr/local/lib
/opt/lib
EOF
cat >> /etc/ld.so.conf << "EOF"
# Add an include directory
include /etc/ld.so.conf.d/*.conf
EOF
mkdir -pv /etc/ld.so.conf.d
6.9.3. Contents of Glibc
Installed programs:
catchsegv, gencat, getconf, getent, iconv, iconvconfig, ldconfig, ldd, lddlibc4, locale, localedef, makedb, mtrace, nscd, pcprofiledump, pldd, rpcgen, sln, sotruss, sprof, tzselect, xtrace, zdump, and zic
Installed libraries:
ld-2.23.so, libBrokenLocale.{a,so}, libSegFault.so, libanl.{a,so}, libc.{a,so}, libc_nonshared.a, libcidn.so, libcrypt.{a,so}, libdl.{a,so}, libg.a, libieee.a, libm.{a,so}, libmcheck.a, libmemusage.so, libnsl.{a,so}, libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so, libnss_nis.so, libnss_nisplus.so, libpcprofile.so, libpthread.{a,so}, libpthread_nonshared.a, libresolv.{a,so}, librpcsvc.a, librt.{a,so}, libthread_db.so, and libutil.{a,so}
Installed directories:
/usr/include/arpa, /usr/include/bits, /usr/include/gnu, /usr/include/net, /usr/include/netash, /usr/include/netatalk, /usr/include/netax25, /usr/include/neteconet, /usr/include/netinet, /usr/include/netipx, /usr/include/netiucv, /usr/include/netpacket, /usr/include/netrom, /usr/include/netrose, /usr/include/nfs, /usr/include/protocols, /usr/include/rpc, /usr/include/rpcsvc, /usr/include/sys, /usr/lib/audit, /usr/lib/gconv, /usr/lib/locale, /usr/libexec/getconf, /usr/share/i18n, /usr/share/zoneinfo, /var/cache/nscd, and /var/lib/nss_db
6.10. Adjusting the Toolchain
Now that the final C libraries have been installed, it is time to adjust the toolchain so that it will link any newly compiled program against these new libraries.
First, backup the /tools linker, and replace it with the adjusted linker we made in chapter 5. We'll also create a link to its counterpart in /tools/$(uname -m)-pc-linux-gnu/bin:
root:~/lfs/glibc-2.23/build# mv -v /tools/bin/{ld,ld-old}
'/tools/bin/ld' -> '/tools/bin/ld-old'
# mv -v /tools/bin/{ld,ld-old}
'/tools/bin/ld' -> '/tools/bin/ld-old'
root:~/lfs/glibc-2.23/build# mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
'/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/x86_64-pc-linux-gnu/bin/ld-old'
root:~/lfs/glibc-2.23/build# mv -v /tools/bin/{ld-new,ld}
'/tools/bin/ld-new' -> '/tools/bin/ld'
root:~/lfs/glibc-2.23/build# ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld
'/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/bin/ld'
Next, amend the GCC specs file so that it points to the new dynamic linker. Simply deleting all instances of “/tools” should leave us with the correct path to the dynamic linker. Also adjust the specs file so that GCC knows where to find the correct headers and Glibc start files. A sed command accomplishes this:
gcc -dumpspecs | sed -e 's@/tools@@g' \
-e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
-e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
`dirname $(gcc --print-libgcc-file-name)`/specs
It is a good idea to visually inspect the specs file to verify the intended change was actually made.
It is imperative at this point to ensure that the basic functions (compiling and linking) of the adjusted toolchain are working as expected. To do this, perform the following sanity checks:
echo 'int main(){}' > dummy.c
cc dummy.c -v -Wl,--verbose &> dummy.log
root:~# readelf -l a.out | grep ': /lib'
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
There should be no errors, and the output of the last command will be (allowing for platform-specific differences in dynamic linker name):
[Requesting program interpreter: /lib/ld-linux.so.2]
Now make sure that we're setup to use the correct start files:
# grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
/usr/lib/../lib64/crt1.o succeeded
/usr/lib/../lib64/crti.o succeeded
/usr/lib/../lib64/crtn.o succeeded
Verify that the compiler is searching for the correct header files:
grep -B1 '^ /usr/include' dummy.log
#include <...> search starts here:
/usr/include
Next, verify that the new linker is being used with the correct search paths:
# grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib64")
SEARCH_DIR("/usr/lib")
SEARCH_DIR("/lib")
SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib");
Next make sure that we're using the correct libc:
# grep "/lib.*/libc.so.6 " dummy.log
attempt to open /lib64/libc.so.6 succeeded
Lastly, make sure GCC is using the correct dynamic linker:
# grep found dummy.log
found ld-linux-x86-64.so.2 at /lib64/ld-linux-x86-64.so.2
If the output does not appear as shown above or is not received at all, then something is seriously wrong. Investigate and retrace the steps to find out where the problem is and correct it. The most likely reason is that something went wrong with the specs file adjustment. Any issues will need to be resolved before continuing on with the process.
Once everything is working correctly, clean up the test files:
rm -v dummy.c a.out dummy.log
6.11.1. Installation of Zlib
root:~/lfs# tar xf /sources/zlib-1.2.8.tar.xz
root:~/lfs# cd zlib-1.2.8/
root:~/lfs/zlib-1.2.8# make
root:~/lfs/zlib-1.2.8# make check
root:~/lfs/zlib-1.2.8# make install
The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:
mv -v /usr/lib/libz.so.* /lib
'/usr/lib/libz.so.1' -> '/lib/libz.so.1'
'/usr/lib/libz.so.1.2.8' -> '/lib/libz.so.1.2.8'
ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so
'/usr/lib/libz.so' -> '../../lib/libz.so.1.2.8'
6.12.1. Installation of File
./configure --prefix=/usr
make
make check
make install
6.13. Binutils-2.26
6.13.1. Installation of Binutils
Verify that the PTYs are working properly inside the chroot environment by performing a simple test:
expect -c "spawn ls"
This command should output the following:
spawn ls
# tar xf /sources/binutils-2.26.tar.bz2
root:~/lfs/binutils-2.26# mkdir -v build
mkdir: created directory 'build'
root:~/lfs/binutils-2.26# patch -Np1 -i ../binutils-2.26-upstream_fix-2.patch
patching file bfd/elf32-i386.c
patching file bfd/elf64-x86-64.c
patching file gas/config/tc-i386.c
patching file gas/config.in
patching file gas/configure
patching file gas/configure.ac
patching file ld/configure
patching file ld/configure.ac
patching file ld/lexsup.c
patching file opcodes/i386-dis.c
Prepare Binutils for compilation:
../configure --prefix=/usr \
--enable-shared \
--disable-werror
make check
The test 'Link with zlib-gabi compressed debug output' is known to fail.
Install the package:
make tooldir=/usr install
6.14.1. Installation of GMP
root:~/lfs# tar xf /sources/gmp-6.1.0.tar.xz
Prepare GMP for compilation:
./configure --prefix=/usr \
--enable-cxx \
--disable-static \
--docdir=/usr/share/doc/gmp-6.1.0
configure: summary of build options:
Version: GNU MP 6.1.0
Host type: haswell-pc-linux-gnu
ABI: 64
Install prefix: /usr
Compiler: gcc
Static libraries: no
Shared libraries: yes
# make
# make html
Test the results:
make check 2>&1 | tee gmp-check-log
Ensure that all 190 tests in the test suite passed. Check the results by issuing the following command:
awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
190
Install the package and its documentation:
root:~/lfs/gmp-6.1.0# make install
+-------------------------------------------------------------+
| CAUTION: |
| |
| If you have not already run "make check", then we strongly |
| recommend you do so. |
| |
| GMP has been carefully tested by its authors, but compilers |
| are all too often released with serious bugs. GMP tends to |
| explore interesting corners in compilers and has hit bugs |
| on quite a few occasions. |
| |
+-------------------------------------------------------------+
make install-html
6.15.1. Installation of MPFR
root:~/lfs# tar xf /sources/mpfr-3.1.3.tar.xz
root:~/lfs# cp -a /sources/mpfr-3.1.3-upstream_fixes-2.patch .
root:~/lfs# cd mpfr-3.1.3
./configure --prefix=/usr \
--disable-static \
--enable-thread-safe \
make
make html
make check
============================================================================
Testsuite summary for MPFR 3.1.3
============================================================================
# TOTAL: 160
# PASS: 159
# SKIP: 1
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
make install
make install-html
6.16.1. Installation of MPC
root:~/lfs# tar xf /sources/mpc-1.0.3.tar.gz
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/mpc-1.0.3
make
make html
make check
============================================================================
Testsuite summary for mpc 1.0.3
============================================================================
# TOTAL: 64
# PASS: 64
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
6.17.1. Installation of GCC
root:~/lfs# tar xf /sources/gcc-5.3.0.tar.bz2
root:~/lfs/gcc-5.3.0# mkdir -v build
mkdir: created directory 'build'
Prepare GCC for compilation:
SED=sed \
../configure --prefix=/usr \
--enable-languages=c,c++ \
--disable-multilib \
--disable-bootstrap \
--with-system-zlib
make
One set of tests in the GCC test suite is known to exhaust the stack, so increase the stack size prior to running the tests:
ulimit -s 32768
make -k check
WARNING: Couldn't find the global config file.
Test Run By root on Mon May 2 16:48:03 2016
Native configuration is x86_64-unknown-linux-gnu
=== gcc tests ===
Schedule of variations:
unix
To receive a summary of the test suite results, run:
../contrib/test_summary
Install the package:
make install
Some packages expect the C preprocessor to be installed in the /lib directory. To support those packages, create this symlink:
ln -sv ../usr/bin/cpp /lib
ln -sv gcc /usr/bin/cc
Add a compatibility symlink to enable building programs with Link Time Optimization (LTO):
# install -v -dm755 /usr/lib/bfd-plugins
install: creating directory '/usr/lib/bfd-plugins'
Add a compatibility symlink to enable building programs with Link Time Optimization (LTO):
install -v -dm755 /usr/lib/bfd-plugins
# ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/5.3.0/liblto_plugin.so \
> /usr/lib/bfd-plugins/
'/usr/lib/bfd-plugins/liblto_plugin.so' -> '../../libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/liblto_plugin.so'
Now that our final toolchain is in place, it is important to again ensure that compiling and linking will work as expected. We do this by performing the same sanity checks as we did earlier in the chapter:
root:~/lfs/gcc-5.3.0/build# echo 'int main(){}' > dummy.c
root:~/lfs/gcc-5.3.0/build# cc dummy.c -v -Wl,--verbose &> dummy.log
root:~/lfs/gcc-5.3.0/build# readelf -l a.out | grep ': /lib'
[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
Now make sure that we're setup to use the correct start files:
root:~/lfs/gcc-5.3.0/build# grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/crt1.o succeeded
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/crti.o succeeded
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/crtn.o succeeded
Verify that the compiler is searching for the correct header files:
root:~/lfs/gcc-5.3.0/build# grep -B4 '^ /usr/include' dummy.log
#include <...> search starts here:
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include
/usr/local/include
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include-fixed
/usr/include
Next, verify that the new linker is being used with the correct search paths:
root:~/lfs/gcc-5.3.0/build# grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
SEARCH_DIR("/usr/local/lib64")
SEARCH_DIR("/lib64")
SEARCH_DIR("/usr/lib64")
SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
SEARCH_DIR("/usr/local/lib")
SEARCH_DIR("/lib")
SEARCH_DIR("/usr/lib");
Next make sure that we're using the correct libc:
root:~/lfs/gcc-5.3.0/build# grep "/lib.*/libc.so.6 " dummy.log
attempt to open /lib64/libc.so.6 succeeded
Lastly, make sure GCC is using the correct dynamic linker:
root:~/lfs/gcc-5.3.0/build# grep found dummy.log
found ld-linux-x86-64.so.2 at /lib64/ld-linux-x86-64.so.2
Finally, move a misplaced file:
root:~/lfs/gcc-5.3.0/build# mkdir -pv /usr/share/gdb/auto-load/usr/lib
mkdir: created directory '/usr/share/gdb'
mkdir: created directory '/usr/share/gdb/auto-load'
mkdir: created directory '/usr/share/gdb/auto-load/usr'
mkdir: created directory '/usr/share/gdb/auto-load/usr/lib'
root:~/lfs/gcc-5.3.0/build# mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib
'/usr/lib/libstdc++.so.6.0.21-gdb.py' -> '/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.21-gdb.py'
6.18.1. Installation of Bzip2
root:~/lfs# tar xf /sources/bzip2-1.0.6.tar.gz
Apply a patch that will install the documentation for this package:
patch -Np1 -i ../bzip2-1.0.6-install_docs-1.patch
patching file Makefile
The following command ensures installation of symbolic links are relative:
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
Ensure the man pages are installed into the correct location:
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
Prepare Bzip2 for compilation with:
make -f Makefile-libbz2_so
make clean
Compile and test the package:
make
Install the programs:
make PREFIX=/usr install
Install the shared bzip2 binary into the /bin directory, make some necessary symbolic links, and clean up:
cp -v bzip2-shared /bin/bzip2
cp -av libbz2.so* /lib
ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
rm -v /usr/bin/{bunzip2,bzcat,bzip2}
ln -sv bzip2 /bin/bunzip2
ln -sv bzip2 /bin/bzcat
6.19.1. Installation of Pkg-config
root:~/lfs# tar xf /sources/pkg-config-0.29.tar.gz
Prepare Pkg-config for compilation:
./configure --prefix=/usr \
--with-internal-glib \
--disable-host-tool \
--docdir=/usr/share/doc/pkg-config-0.29
make
make check
make install
6.20.1. Installation of Ncurses
root:~/lfs/ncurses-6.0# sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in
./configure --prefix=/usr \
--mandir=/usr/share/man \
--with-shared \
--without-debug \
--without-normal \
--enable-pc-files \
--enable-widec
** Configuration summary for NCURSES 6.0 20150808:
extended funcs: yes
xterm terminfo: xterm-new
bin directory: /usr/bin
lib directory: /usr/lib
include directory: /usr/include
man directory: /usr/share/man
terminfo directory: /usr/share/terminfo
pkg-config directory: /usr/lib/pkgconfig
make
make install
root:~/lfs/ncurses-6.0# mv -v /usr/lib/libncursesw.so.6* /lib
'/usr/lib/libncursesw.so.6' -> '/lib/libncursesw.so.6'
'/usr/lib/libncursesw.so.6.0' -> '/lib/libncursesw.so.6.0'
root:~/lfs/ncurses-6.0# ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so
'/usr/lib/libncursesw.so' -> '../../lib/libncursesw.so.6'
# for lib in ncurses form panel menu ; do
> rm -vf /usr/lib/lib${lib}.so
> echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so
> ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc
Finally, make sure that old applications that look for -lcurses at build time are still buildable:
rm -vf /usr/lib/libcursesw.so
echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so
ln -sfv libncurses.so /usr/lib/libcurses.so
Finally, make sure that old applications that look for -lcurses at build time are still buildable:
rm -vf /usr/lib/libcursesw.so
echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so
ln -sfv libncurses.so /usr/lib/libcurses.so
If desired, install the Ncurses documentation:
mkdir -v /usr/share/doc/ncurses-6.0
cp -v -R doc/* /usr/share/doc/ncurses-6.0
root:~/lfs/ncurses-6.0# make distclean
6.21.1. Installation of Attr
root:~/lfs# tar xf /sources/attr-2.4.47.src.tar.gz
root:~/lfs# cd attr-2.4.47/
Modify the documentation directory so that it is a versioned directory:
# sed -i -e 's|/@pkg_name@|&-@pkg_version@|' include/builddefs.in
Prevent installation of manual pages that were already installed by the man pages package:
sed -i -e "/SUBDIRS/s|man[25]||g" man/Makefile
Prepare Attr for compilation:
./configure --prefix=/usr \
--bindir=/bin \
--disable-static
make
The tests need to be run on a filesystem that supports extended attributes such as the ext2, ext3, or ext4 filesystems. The tests are also known to fail if running multiple simultaneous tests (-j option greater than 1). To test the results, issue:
make -j1 tests root-tests
Install the package:
make install install-dev install-lib
chmod -v 755 /usr/lib/libattr.so
The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:
mv -v /usr/lib/libattr.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so
6.22.1. Installation of Acl
root:~/lfs# tar xf /sources/acl-2.2.52.src.tar.gz
Modify the documentation directory so that it is a versioned directory:
sed -i -e 's|/@pkg_name@|&-@pkg_version@|' include/builddefs.in
Fix some broken tests:
sed -i "s:| sed.*::g" test/{sbits-restore,cp,misc}.test
Additionally, fix a bug that causes getfacl -e to segfault on overly long group name:
sed -i -e "/TABS-1;/a if (x > (TABS-1)) x = (TABS-1);" \
libacl/__acl_to_any_text.c
Prepare Acl for compilation:
./configure --prefix=/usr \
--bindir=/bin \
--disable-static \
--libexecdir=/usr/lib
Compile the package:
make
Install the package:
make install install-dev install-lib
chmod -v 755 /usr/lib/libacl.so
The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:
mv -v /usr/lib/libacl.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libacl.so) /usr/lib/libacl.so
6.23. Libcap-2.25
lfs:/monster/sources$ wget -c https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.25.tar.xz
root:~/lfs# tar xf /sources/libcap-2.25.tar.xz
Prevent a static library from being installed:
sed -i '/install.*STALIBNAME/d' libcap/Makefile
Install the package:
make RAISE_SETFCAP=no prefix=/usr install
chmod -v 755 /usr/lib/libcap.so
The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:
mv -v /usr/lib/libcap.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libcap.so) /usr/lib/libcap.so
6.24.1. Installation of Sed
root:~/lfs# tar xf /sources/sed-4.2.2.tar.bz2
./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/sed-4.2.2
Compile the package and generate the HTML documentation:
make
make html
To test the results, issue:
make check
Install the package and its documentation:
make install
# make -C doc install-html
make: Entering directory '/root/lfs/sed-4.2.2/doc'
/tools/bin/mkdir -p '/usr/share/doc/sed-4.2.2'
/tools/bin/install -c -m 644 sed.html '/usr/share/doc/sed-4.2.2'
make: Leaving directory '/root/lfs/sed-4.2.2/doc'
6.25.1. Installation of Shadow
root:~/lfs# tar xf /sources/shadow-4.2.1.tar.xz
Disable the installation of the groups program and its man pages, as Coreutils provides a better version. Also Prevent the installation of manual pages that were already installed by the man pages package:
sed -i 's/groups$(EXEEXT) //' src/Makefile.in
find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;
Instead of using the default crypt method, use the more secure SHA-512 method of password encryption, which also allows passwords longer than 8 characters. It is also necessary to change the obsolete /var/spool/mail location for user mailboxes that Shadow uses by default to the /var/mail location used currently:
Make a minor change to make the default useradd consistent with the LFS groups file:
sed -i 's/1000/999/' etc/useradd
Prepare Shadow for compilation:
root:~/lfs/shadow-4.2.1# ./configure --sysconfdir=/etc --with-group-name-max-length=32
shadow will be compiled with the following features:
auditing support: no
CrackLib support: no
PAM support: no
SELinux support: no
ACL support: yes
Extended Attributes support: yes
tcb support (incomplete): no
shadow group support: yes
S/Key support: no
SHA passwords encryption: yes
nscd support: yes
subordinate IDs support: yes
Compile the package:
make
Install the package:
make install
Move a misplaced program to its proper location:
mv -v /usr/bin/passwd /bin
6.25.2. Configuring Shadow
root:~/lfs/shadow-4.2.1# pwconv
root:~/lfs/shadow-4.2.1# grpconv
CREATE_MAIL_SPOOL=yes
This parameter causes useradd to create a mailbox file for the newly created user. useradd will make the group ownership of this file to the mail group with 0660 permissions. If you would prefer that these mailbox files are not created by useradd, issue the following command:
sed -i 's/yes/no/' /etc/default/useradd
6.25.3. Setting the root password
Choose a password for user root and set it by running:
passwd root
root:~/lfs/shadow-4.2.1# passwd root
Changing password for root
Enter the new password (minimum of 5 characters)
Please use a combination of upper and lower case letters and numbers.
New password: shc522.,.
Re-enter new password: *********
passwd: password changed.
6.26.1. Installation of Psmisc
./configure --prefix=/usr
make
make install
mv -v /usr/bin/fuser /bin
mv -v /usr/bin/killall /bin
6.27. Procps-ng-3.3.11
lfs:/monster/sources$ wget -c http://sourceforge.net/projects/procps-ng/files/Production/procps-ng-3.3.11.tar.xz
root:~/lfs# tar xf /sources/procps-ng-3.3.11.tar.xz
./configure --prefix=/usr \
--exec-prefix= \
--libdir=/usr/lib \
--docdir=/usr/share/doc/procps-ng-3.3.11 \
--disable-static \
--disable-kill
Compile the package:
make
The test suite needs some custom modifications for LFS. Remove the test that fails when scripting does not use a tty device. To run the test suite, run the following commands:
sed -i -r 's|(pmap_initname)\\\$|\1|' testsuite/pmap.test/pmap.exp
make check
Install the package:
make install
Finally, move essential libraries to a location that can be found if /usr is not mounted.
mv -v /usr/lib/libprocps.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so
6.28.1. Installation of E2fsprogs
root:~# tar xf /sources/e2fsprogs-1.42.13.tar.gz
root:~# cd e2fsprogs-1.42.13/
mkdir -v build
Prepare E2fsprogs for compilation:
LIBS=-L/tools/lib \
CFLAGS=-I/tools/include \
PKG_CONFIG_PATH=/tools/lib/pkgconfig \
../configure --prefix=/usr \
--bindir=/bin \
--with-root-prefix="" \
--enable-elf-shlibs \
--disable-libblkid \
--disable-libuuid \
--disable-uuidd \
--disable-fsck
make
ln -sfv /tools/lib/lib{blk,uu}id.so.1 lib
make LD_LIBRARY_PATH=/tools/lib check
make install
make install-libs
chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
gunzip -v /usr/share/info/libext2fs.info.gz
install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info
makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo
install -v -m644 doc/com_err.info /usr/share/info
install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info
6.29.1. Installation of Iana-Etc
root:~/lfs# tar xf /sources/iana-etc-2.30.tar.bz2
root:~/lfs# cd iana-etc-2.30/
root:~/lfs/iana-etc-2.30# make
ln -f -s protocol-numbers.dist protocol-numbers
gawk --re-interval -f protocols.gawk -v strip=no \
protocol-numbers > protocols
ln -f -s port-numbers.dist port-numbers
gawk -f services.gawk -v strip=no port-numbers > services
root:~/lfs/iana-etc-2.30# make install
install -d /etc
install -m 644 protocols /etc
install -m 644 services /etc
6.30.1. Installation of M4
root:~/lfs# tar xf /sources/m4-1.4.17.tar.xz
./configure --prefix=/usr
make
make check
make install
6.31.1. Installation of Bison
root:~/lfs# tar xf /sources/bison-3.0.4.tar.xz
./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.0.4
make
make install
6.32.1. Installation of Flex
root:~/lfs# tar xf /sources/flex-2.6.0.tar.xz
./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.6.0
make check
make install
ln -sv flex /usr/bin/lex
6.33.1. Installation of Grep
root:~/lfs# tar xf /sources/grep-2.23.tar.xz
./configure --prefix=/usr --bindir=/bin
make
make check
make install
6.34.1. Installation of Readline
root:~/lfs# tar xf /sources/readline-6.3.tar.gz
root:~/lfs# cd readline-6.3/
patch -Np1 -i ../readline-6.3-upstream_fixes-3.patch
patching file display.c
patching file input.c
patching file misc.c
patching file patchlevel
patching file readline.c
patching file rltypedefs.h
patching file util.c
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/readline-6.3
make SHLIB_LIBS=-lncurses
make SHLIB_LIBS=-lncurses install
mv -v /usr/lib/lib{readline,history}.so.* /lib
ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so
ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so
6.35.1. Installation of Bash
root:~/lfs# tar xf /sources/bash-4.3.30.tar.gz
root:~/lfs# cp -a /sources/bash-4.3.30-upstream_fixes-3.patch .
Skip down to “Install the package” if not running the test suite.
To prepare the tests, ensure that the nobody user can write to the sources tree:
chown -Rv nobody .
Now, run the tests as the nobody user:
su nobody -s /bin/bash -c "PATH=$PATH make tests"
***********************************************************
* *
/bin/sh: /root/lfs/bash-4.3.30/bashversion: Permission denied
*
* *
***********************************************************
/bin/sh: line 0: cd: ./tests: Not a directory
Makefile:863: recipe for target 'tests' failed
make: *** [tests] Error 1
Now, run the tests as the nobody user:
su nobody -s /bin/bash -c "PATH=$PATH make tests"
Install the package and move the main executable to /bin:
make install
mv -vf /usr/bin/bash /bin
Run the newly compiled bash program (replacing the one that is currently being executed):
exec /bin/bash --login +h
6.36.1. Installation of Bc
root:~/lfs# tar xf /sources/bc-1.06.95.tar.bz2
root:~/lfs# cp -a /sources/bc-1.06.95-memory_leak-1.patch .
./configure --prefix=/usr \
--with-readline \
--mandir=/usr/share/man \
--infodir=/usr/share/info
make
echo "quit" | ./bc/bc -l Test/checklib.b
6.37.1. Installation of Libtool
./configure --prefix=/usr
# make
# make check
root:~/lfs/libtool-2.4.6# make install
6.38.1. Installation of GDBM
root:~/lfs# tar xf /sources/gdbm-1.11.tar.gz
./configure --prefix=/usr \
--disable-static \
--enable-libgdbm-compat
make
make check
make install
6.39.1. Installation of Expat
root:~/lfs# tar xf /sources/expat-2.1.0.tar.gz
./configure --prefix=/usr --disable-static
make
make check
make install
Libraries have been installed in:
/usr/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
install -v -dm755 /usr/share/doc/expat-2.1.0
install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.1.0
6.40.1. Installation of Inetutils
./configure --prefix=/usr \
--localstatedir=/var \
--disable-logger \
--disable-whois \
--disable-rcp \
--disable-rexec \
--disable-rlogin \
--disable-rsh \
--disable-servers
Summary of build decisions:
Clients:
dnsdomainname yes
ftp yes /usr/lib/libreadline.so -Wl,-rpath -Wl,/usr/lib
hostname yes
ifconfig yes
logger no
ping yes
ping6 yes
rcp no
rexec no
rlogin no
rsh no
talk yes -lcurses
telnet yes -lcurses
tftp yes
traceroute yes
whois no
Servers:
ftpd no
inetd no
rexecd no
rlogind no
rshd no
syslogd no
talkd no
telnetd no
tftpd no
uucpd no
make
make check
make install
mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin
'/usr/bin/hostname' -> '/bin/hostname'
'/usr/bin/ping' -> '/bin/ping'
'/usr/bin/ping6' -> '/bin/ping6'
'/usr/bin/traceroute' -> '/bin/traceroute'
mv -v /usr/bin/ifconfig /sbin
'/usr/bin/ifconfig' -> '/sbin/ifconfig'
6.41.1. Installation of Perl
root:~/lfs# tar xf /sources/perl-5.22.1.tar.bz2
First create a basic /etc/hosts file to be referenced in one of Perl's configuration files as well as the optional test suite:
echo "127.0.0.1 localhost $(hostname)" > /etc/hosts
export BUILD_ZLIB=False
export BUILD_BZIP2=0
sh Configure -des -Dprefix=/usr \
-Dvendorprefix=/usr \
-Dman1dir=/usr/share/man/man1 \
-Dman3dir=/usr/share/man/man3 \
-Dpager="/usr/bin/less -isR" \
-Duseshrplib
6.42.1. Installation of XML::Parser
root:~/lfs# tar xf /sources/XML-Parser-2.44.tar.gz
root:~/lfs# cd XML-Parser-2.44
perl Makefile.PL
make
make test
make install
6.43.1. Installation of Autoconf
# tar xf /sources/autoconf-2.69.tar.xz
./configure --prefix=/usr
make
make check
make install
6.44.1. Installation of Automake
root:~/lfs# tar xf /sources/automake-1.15.tar.xz
First fix a warning that is caused by perl-5.22 and later:
sed -i 's:/\\\${:/\\\$\\{:' bin/automake.in
./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.15
make
sed -i "s:./configure:LEXLIB=/usr/lib/libfl.a &:" t/lex-{clean,depend}-cxx.sh
make -j4 check
make install
6.45.1. Installation of Coreutils
root:~/lfs# tar xf /sources/coreutils-8.25.tar.xz
root:~/lfs# cp -a /sources/coreutils-8.25-i18n-2.patch .
root:~/lfs# cd coreutils-8.25
patch -Np1 -i ../coreutils-8.25-i18n-2.patch
Now prepare Coreutils for compilation:
FORCE_UNSAFE_CONFIGURE=1 ./configure \
--prefix=/usr \
--enable-no-install-program=kill,uptime
FORCE_UNSAFE_CONFIGURE=1 make
make NON_ROOT_USERNAME=nobody check-root
testing:
echo "dummy:x:1000:nobody" >> /etc/group
chown -Rv nobody .
Now run the tests. Make sure the PATH in the su environment includes /tools/bin.
su nobody -s /bin/bash \
-c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"
Remove the temporary group:
sed -i '/dummy/d' /etc/group
Install the package:
make install
Move programs to the locations specified by the FHS:
mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
mv -v /usr/bin/chroot /usr/sbin
mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8
mv -v /usr/bin/{head,sleep,nice,test,[} /bin
6.46.1. Installation of Diffutils
root:~/lfs# tar xf /sources/diffutils-3.3.tar.xz
sed -i 's:= @mkdir_p@:= /bin/mkdir -p:' po/Makefile.in.in
./configure --prefix=/usr
make
make check
make install
6.47.1. Installation of Gawk
root:~/lfs# tar xf /sources/gawk-4.1.3.tar.xz
./configure --prefix=/usr
make
make check
make install
mkdir -v /usr/share/doc/gawk-4.1.3
cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-4.1.3
6.48.1. Installation of Findutils
root:~/lfs# tar xf /sources/findutils-4.6.0.tar.gz
./configure --prefix=/usr --localstatedir=/var/lib/locate
make
make check
make install
mv -v /usr/bin/find /bin
sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb
6.49.1. Installation of Gettext
root:~/lfs# tar xf /sources/gettext-0.19.7.tar.xz
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/gettext-0.19.7
make
make check
make install
chmod -v 0755 /usr/lib/preloadable_libintl.so
6.50.1. Installation of Intltool
lfs:/monster/sources$ wget -c http://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz
root:~/lfs# tar xf /sources/intltool-0.51.0.tar.gz
sed -i 's:\\\${:\\\$\\{:' intltool-update.in
./configure --prefix=/usr
make
make check
make install
6.51.1. Installation of Gperf
./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.0.4
make
make -j1 check
make install
6.52.1. Installation of Groff
root:~/lfs/groff-1.22.3# PAGE=letter ./configure --prefix=/usr
PAGE=<paper_size> ./configure --prefix=/usr
make
make install
6.53.1. Installation of Xz
root:~/lfs# tar xf /sources/xz-5.2.2.tar.xz
sed -e '/mf\.buffer = NULL/a next->coder->mf.size = 0;' \
-i src/liblzma/lz/lz_encoder.c
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/xz-5.2.2
make
make check
make install
mv -v /usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} /bin
mv -v /usr/lib/liblzma.so.* /lib
ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so
6.54.1. Installation of GRUB
root:~/lfs# tar xf /sources/grub-2.02~beta2.tar.xz
./configure --prefix=/usr \
--sbindir=/sbin \
--sysconfdir=/etc \
--disable-grub-emu-usb \
--disable-efiemu \
--disable-werror
*******************************************************
GRUB2 will be compiled with following components:
Platform: i386-pc
With devmapper support: No (need libdevmapper header)
With memory debugging: No
With disk cache statistics: No
With boot time statistics: No
efiemu runtime: No (explicitly disabled)
grub-mkfont: No (need freetype2 library)
grub-mount: No (need FUSE library)
starfield theme: No (No build-time grub-mkfont)
With libzfs support: No (need zfs library)
Build-time grub-mkfont: No (need freetype2 library)
Without unifont (no build-time grub-mkfont)
With liblzma from -llzma (support for XZ-compressed mips images)
*******************************************************
make
make install
6.55.1. Installation of Less
# tar xf /sources/less-481.tar.gz
./configure --prefix=/usr --sysconfdir=/etc
make
make install
6.56.1. Installation of Gzip
root:~/lfs# tar xf /sources/gzip-1.6.tar.xz
./configure --prefix=/usr --bindir=/bin
make
make check
make install
mv -v /bin/{gzexe,uncompress,zcmp,zdiff,zegrep} /usr/bin
mv -v /bin/{zfgrep,zforce,zgrep,zless,zmore,znew} /usr/bin
6.57.1. Installation of IPRoute2
lfs:/monster/sources$ wget -c https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.4.0.tar.xz
The arpd program included in this package will not be built since it is dependent on Berkeley DB, which is not installed in LFS. However, documentation files and a directory for arpd will still be installed. Prevent this by running the commands below. If the arpd binary is needed, instructions for compiling Berkeley DB can be found in the BLFS Book at http://www.linuxfromscratch.org/blfs/view/7.9/server/databases.html#db.
sed -i /ARPD/d Makefile
sed -i 's/arpd.8//' man/man8/Makefile
rm -v doc/arpd.sgml
Compile the package:
make
This package comes with a test suite, but due to assumptions it makes, it is not possible to reliably run these tests from within the chroot environment. If you wish to run these tests after booting into your new LFS system, ensure you enable /proc/config.gz support in your kernel ("General setup" -> "Enable access to .config through /proc/config.gz" [CONFIG_IKCONFIG_PROC]), then run 'make alltests' from the testsuite/ subdirectory.
Install the package:
make DOCDIR=/usr/share/doc/iproute2-4.4.0 install
6.58.1. Installation of Kbd
lfs:/monster/sources$ wget -c https://www.kernel.org/pub/linux/utils/kbd/kbd-2.0.3.tar.xz
root:~/lfs# tar xf /sources/kbd-2.0.3.tar.xz
root:~/lfs# cp -a /sources/kbd-2.0.3-backspace-1.patch .
root:~/lfs/kbd-2.0.3# PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure --prefix=/usr --disable-vlock
kbd 2.0.3
======
prefix: /usr
libdir: ${exec_prefix}/lib
bindir: ${exec_prefix}/bin
datadir: ${datarootdir}
compiler: gcc
cflags: -g -O2 -Wall -Wextra -Wmissing-noreturn -Wdisabled-optimization -Wcast-align -Wshadow -Wmissing-format-attribute -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
{get,set}keycodes: yes
resizecons: no
optional progs: no
vlock: no
libkeymap: no
make
make check
make install
mkdir -v /usr/share/doc/kbd-2.0.3
cp -R -v docs/doc/* /usr/share/doc/kbd-2.0.3
6.59.1. Installation of Kmod
lfs:/monster/sources$ wget -c https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-22.tar.xz
root:~/lfs# tar xf /sources/kmod-22.tar.xz
./configure --prefix=/usr \
--bindir=/bin \
--sysconfdir=/etc \
--with-rootlibdir=/lib \
--with-xz \
--with-zlib
make
make install
root:~/lfs/kmod-22# for target in depmod insmod lsmod modinfo modprobe rmmod; do
> ln -sv ../bin/kmod /sbin/$target
> done
'/sbin/depmod' -> '../bin/kmod'
'/sbin/insmod' -> '../bin/kmod'
'/sbin/lsmod' -> '../bin/kmod'
'/sbin/modinfo' -> '../bin/kmod'
'/sbin/modprobe' -> '../bin/kmod'
'/sbin/rmmod' -> '../bin/kmod'
6.60. Libpipeline-1.4.1
root:~/lfs# tar xf /sources/libpipeline-1.4.1.tar.gz
PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure --prefix=/usr
make
make check
make install
6.61.1. Installation of Make
root:~/lfs# tar xf /sources/make-4.1.tar.bz2
./configure --prefix=/usr
make
make check
make install
6.62.1. Installation of Patch
root:~/lfs# tar xf /sources/patch-2.7.5.tar.xz
./configure --prefix=/usr
make
make check
make install
6.63.1. Installation of Sysklogd
root:~/lfs# tar xf /sources/sysklogd-1.5.1.tar.gz
sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c
make
make BINDIR=/sbin install
/usr/bin/install -o root -g root -m 644 sysklogd.8 /usr/share/man/man8/sysklogd.8
/usr/bin/install -o root -g root -m 644 syslogd.8 /usr/share/man/man8/syslogd.8
/usr/bin/install -o root -g root -m 644 syslog.conf.5 /usr/share/man/man5/syslog.conf.5
/usr/bin/install -o root -g root -m 644 klogd.8 /usr/share/man/man8/klogd.8
/usr/bin/install -m 500 -s syslogd /sbin/syslogd
/usr/bin/install -m 500 -s klogd /sbin/klogd
6.63.2. Configuring Sysklogd
Create a new /etc/syslog.conf file by running the following:
cat > /etc/syslog.conf << "EOF"
# Begin /etc/syslog.conf
auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *
# End /etc/syslog.conf
EOF
6.64.1. Installation of Sysvinit
root:~/lfs# tar xf /sources/sysvinit-2.88dsf.tar.bz2
root:~/lfs# cp -a /sources/sysvinit-2.88dsf-consolidated-1.patch .
patch -Np1 -i ../sysvinit-2.88dsf-consolidated-1.patch
make -C src
make -C src install
6.65.1. Installation of Tar
root:~/lfs# tar xf /sources/tar-1.28.tar.xz
Prepare Tar for compilation:
FORCE_UNSAFE_CONFIGURE=1 \
./configure --prefix=/usr \
--bindir=/bin
make
make check
make install
make -C doc install-html docdir=/usr/share/doc/tar-1.28
6.66.1. Installation of Texinfo
root:~/lfs# tar xf /sources/texinfo-6.1.tar.xz
./configure --prefix=/usr --disable-static
make
make check
make install
make TEXMF=/usr/share/texmf install-tex
The Info documentation system uses a plain text file to hold its list of menu entries. The file is located at /usr/share/info/dir. Unfortunately, due to occasional problems in the Makefiles of various packages, it can sometimes get out of sync with the info pages installed on the system. If the /usr/share/info/dir file ever needs to be recreated, the following optional commands will accomplish the task:
pushd /usr/share/info
rm -v dir
for f in *
do install-info $f dir 2>/dev/null
done
popd
6.67.1. Installation of Eudev
root:~/lfs# tar xf /sources/eudev-3.1.5.tar.gz
First, fix a test script:
sed -r -i 's|/usr(/bin/test)|\1|' test/udev-test.pl
Next, add a workaround to prevent the /tools directory from being hard coded into Eudev binary files library locations:
cat > config.cache << "EOF"
HAVE_BLKID=1
BLKID_LIBS="-lblkid"
BLKID_CFLAGS="-I/tools/include"
EOF
./configure --prefix=/usr \
--bindir=/sbin \
--sbindir=/sbin \
--libdir=/usr/lib \
--sysconfdir=/etc \
--libexecdir=/lib \
--with-rootprefix= \
--with-rootlibdir=/lib \
--enable-manpages \
--disable-static \
--config-cache
LIBRARY_PATH=/tools/lib make
mkdir -pv /lib/udev/rules.d
mkdir -pv /etc/udev/rules.d
make LD_LIBRARY_PATH=/tools/lib check
make LD_LIBRARY_PATH=/tools/lib install
root:~/lfs/eudev-3.1.5# tar -xvf /sources/udev-lfs-20140408.tar.bz2
udev-lfs-20140408/
udev-lfs-20140408/Makefile.lfs
udev-lfs-20140408/init-net-rules.sh
udev-lfs-20140408/83-cdrom-symlinks.rules
udev-lfs-20140408/contrib/
udev-lfs-20140408/contrib/debian/
udev-lfs-20140408/contrib/debian/83-cdrom-symlinks.rules
udev-lfs-20140408/contrib/debian/81-cdrom.rules
udev-lfs-20140408/contrib/debian/write_cd_aliases
udev-lfs-20140408/81-cdrom.rules
udev-lfs-20140408/55-lfs.rules
udev-lfs-20140408/write_cd_rules
udev-lfs-20140408/ChangeLog
udev-lfs-20140408/README
udev-lfs-20140408/write_net_rules
udev-lfs-20140408/rule_generator.functions
udev-lfs-20140408/55-lfs.txt
root:~/lfs/eudev-3.1.5# make -f udev-lfs-20140408/Makefile.lfs install
6.67.2. Configuring Eudev
LD_LIBRARY_PATH=/tools/lib udevadm hwdb --update
6.68.2. Installation of Util-linux
6.68.1. FHS compliance notes
mkdir -pv /var/lib/hwclock
root:~/lfs# tar xf /sources/util-linux-2.27.1.tar.xz
6.68.2. Installation of Util-linux
Prepare Util-linux for compilation:
./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
--docdir=/usr/share/doc/util-linux-2.27.1 \
--disable-chfn-chsh \
--disable-login \
--disable-nologin \
--disable-su \
--disable-setpriv \
--disable-runuser \
--disable-pylibmount \
--disable-static \
--without-python \
--without-systemd \
--without-systemdsystemunitdir
make
make install
6.69.1. Installation of Man-DB
root:~/lfs# tar xf /sources/man-db-2.7.5.tar.xz
./configure --prefix=/usr \
--docdir=/usr/share/doc/man-db-2.7.5 \
--sysconfdir=/etc \
--disable-setuid \
--with-browser=/usr/bin/lynx \
--with-vgrind=/usr/bin/vgrind \
--with-grap=/usr/bin/grap
make
make check
make install
6.70.1. Installation of Vim
root:~/lfs# tar xf /sources/vim-7.4.tar.bz2
First, change the default location of the vimrc configuration file to /etc:
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
./configure --prefix=/usr
make
make -j1 test
make install
Many users are used to using vi instead of vim. To allow execution of vim when users habitually enter vi, create a symlink for both the binary and the man page in the provided languages:
ln -sv vim /usr/bin/vi
for L in /usr/share/man/{,*/}man1/vim.1; do
ln -sv vim.1 $(dirname $L)/vi.1
done
By default, Vim's documentation is installed in /usr/share/vim. The following symlink allows the documentation to be accessed via /usr/share/doc/vim-7.4, making it consistent with the location of documentation for other packages:
ln -sv ../vim/vim74/doc /usr/share/doc/vim-7.4
6.72. Stripping Again (20160504)
If the intended user is not a programmer and does not plan to do any debugging on the system software, the system size can be decreased by about 90 MB by removing the debugging symbols from binaries and libraries. This causes no inconvenience other than not being able to debug the software fully anymore.
Most people who use the command mentioned below do not experience any difficulties. However, it is easy to make a typo and render the new system unusable, so before running the strip command, it is a good idea to make a backup of the LFS system in its current state.
Before performing the stripping, take special care to ensure that none of the binaries that are about to be stripped are running. If unsure whether the user entered chroot with the command given in Section 6.4, “Entering the Chroot Environment,” first exit from chroot:
Then reenter it with:
chroot $LFS /tools/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/tools/bin/bash --login
Now the binaries and libraries can be safely stripped:
/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
-exec /tools/bin/strip --strip-debug '{}' ';'
6.73. Cleaning Up
Finally, clean up some extra files left around from running tests:
rm -rf /tmp/*
From now on, when reentering the chroot environment after exiting, use the following modified chroot command:
chroot "$LFS" /usr/bin/env -i \
HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/bin/bash --login
The reason for this is that the programs in /tools are no longer needed. Since they are no longer needed you can delete the /tools directory if so desired.
Finally, there were several static libraries that were not suppressed earlier in the chapter in order to satisfy the regression tests in several packages. These libraries are from binutils, bzip2, e2fsprogs, flex, libtool, and zlib. If desired, remove them now:
rm -f /usr/lib/lib{bfd,opcodes}.a
rm -f /usr/lib/libbz2.a
rm -f /usr/lib/lib{com_err,e2p,ext2fs,ss}.a
rm -f /usr/lib/libltdl.a
rm -f /usr/lib/libfl.a
rm -f /usr/lib/libfl_pic.a
rm -f /usr/lib/libz.a
7.2.1. Installation of LFS-Bootscripts
root:/sources# tar xf /sources/lfs-bootscripts-20150222.tar.bz2
================================================================================================================================
II. Parte
backup /tools into lfs userspace
$ mkdir tools.ori
lfs:~/tools.ori$ rsync -avP /tools/ .
Compilación de fuentes linkeados a toolchain:
root:/opt# mkdir lfs/{usr,bin,sbin}
root:/opt# chown -R lfs:lfs lfs
6.2. Preparing Virtual Kernel File Systems
lfs:~/sources/gcc-5.3.0/build$ export LFS=/opt/lfs
lfs:~/sources/gcc-5.3.0/build$ mkdir -pv $LFS/{dev,proc,sys,run}
mkdir: created directory '/opt/lfs/dev'
mkdir: created directory '/opt/lfs/proc'
mkdir: created directory '/opt/lfs/sys'
mkdir: created directory '/opt/lfs/run'
6.5. Creating Directories
lfs:/$ mkdir -pv $LFS/{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt}
mkdir: created directory '/opt/lfs/boot'
mkdir: created directory '/opt/lfs/etc'
mkdir: created directory '/opt/lfs/etc/opt'
mkdir: created directory '/opt/lfs/etc/sysconfig'
mkdir: created directory '/opt/lfs/home'
mkdir: created directory '/opt/lfs/lib'
mkdir: created directory '/opt/lfs/lib/firmware'
mkdir: created directory '/opt/lfs/mnt'
mkdir: created directory '/opt/lfs/opt'
lfs:/$ mkdir -pv $LFS/{media/{floppy,cdrom},sbin,srv,var}
mkdir: created directory '/opt/lfs/media'
mkdir: created directory '/opt/lfs/media/floppy'
mkdir: created directory '/opt/lfs/media/cdrom'
mkdir: created directory '/opt/lfs/srv'
mkdir: created directory '/opt/lfs/var'
lfs:/$ install -dv -m 0750 $LFS/root
lfs:/$ install -dv -m 1777 $LFS/tmp $LFS/var/tmp
install: creating directory '/opt/lfs/tmp'
install: creating directory '/opt/lfs/var/tmp'
lfs:/$ mkdir -pv $LFS/usr/{,local/}{bin,include,lib,sbin,src}
mkdir: created directory '/opt/lfs/usr/bin'
mkdir: created directory '/opt/lfs/usr/include'
mkdir: created directory '/opt/lfs/usr/lib'
mkdir: created directory '/opt/lfs/usr/sbin'
mkdir: created directory '/opt/lfs/usr/src'
mkdir: created directory '/opt/lfs/usr/local'
mkdir: created directory '/opt/lfs/usr/local/bin'
mkdir: created directory '/opt/lfs/usr/local/include'
mkdir: created directory '/opt/lfs/usr/local/lib'
mkdir: created directory '/opt/lfs/usr/local/sbin'
mkdir: created directory '/opt/lfs/usr/local/src'
lfs:/$ mkdir -pv $LFS/usr/{,local/}share/{color,dict,doc,info,locale,man}
mkdir: created directory '/opt/lfs/usr/share'
mkdir: created directory '/opt/lfs/usr/share/color'
mkdir: created directory '/opt/lfs/usr/share/dict'
mkdir: created directory '/opt/lfs/usr/share/doc'
mkdir: created directory '/opt/lfs/usr/share/info'
mkdir: created directory '/opt/lfs/usr/share/locale'
mkdir: created directory '/opt/lfs/usr/share/man'
mkdir: created directory '/opt/lfs/usr/local/share'
mkdir: created directory '/opt/lfs/usr/local/share/color'
mkdir: created directory '/opt/lfs/usr/local/share/dict'
mkdir: created directory '/opt/lfs/usr/local/share/doc'
mkdir: created directory '/opt/lfs/usr/local/share/info'
mkdir: created directory '/opt/lfs/usr/local/share/locale'
mkdir: created directory '/opt/lfs/usr/local/share/man'
lfs:/$ mkdir -v $LFS/usr/{,local/}share/{misc,terminfo,zoneinfo}
mkdir: created directory '/opt/lfs/usr/share/misc'
mkdir: created directory '/opt/lfs/usr/share/terminfo'
mkdir: created directory '/opt/lfs/usr/share/zoneinfo'
mkdir: created directory '/opt/lfs/usr/local/share/misc'
mkdir: created directory '/opt/lfs/usr/local/share/terminfo'
mkdir: created directory '/opt/lfs/usr/local/share/zoneinfo'
lfs:/$ mkdir -v $LFS/usr/libexec
mkdir: created directory '/opt/lfs/usr/libexec'
lfs:/$ mkdir -pv $LFS/usr/{,local/}share/man/man{1..8}
mkdir: created directory '/opt/lfs/usr/share/man/man1'
mkdir: created directory '/opt/lfs/usr/share/man/man2'
mkdir: created directory '/opt/lfs/usr/share/man/man3'
mkdir: created directory '/opt/lfs/usr/share/man/man4'
mkdir: created directory '/opt/lfs/usr/share/man/man5'
mkdir: created directory '/opt/lfs/usr/share/man/man6'
mkdir: created directory '/opt/lfs/usr/share/man/man7'
mkdir: created directory '/opt/lfs/usr/share/man/man8'
mkdir: created directory '/opt/lfs/usr/local/share/man/man1'
mkdir: created directory '/opt/lfs/usr/local/share/man/man2'
mkdir: created directory '/opt/lfs/usr/local/share/man/man3'
mkdir: created directory '/opt/lfs/usr/local/share/man/man4'
mkdir: created directory '/opt/lfs/usr/local/share/man/man5'
mkdir: created directory '/opt/lfs/usr/local/share/man/man6'
mkdir: created directory '/opt/lfs/usr/local/share/man/man7'
mkdir: created directory '/opt/lfs/usr/local/share/man/man8'
root:/home/lfs# mkdir /opt/lfs/usr/local/lib64
root:/home/lfs# chown lfs:lfs /opt/lfs/usr/local/lib64
'/opt/lfs/usr/local/lib64/lib' -> 'lib'
'/opt/lfs/usr/local/lib64/lib64' -> '/opt/lfs/lib64'
'/opt/lfs/usr/local/lib64/ln' -> 'ln'
ln: failed to create symbolic link '/opt/lfs/usr/local/lib64/lib': File exists
ln: failed to create symbolic link '/opt/lfs/usr/local/lib64/lib64': File exists
ln: failed to create symbolic link '/opt/lfs/usr/local/lib64/ln': File exists
ln: failed to create symbolic link '/opt/lfs/usr/local/lib64/lib': File exists
lfs:~$ case $(uname -m) in x86_64) \
ln -sv lib $LFS/lib64; \
ln -sv lib $LFS/usr/lib64; \
ln -sv lib $LFS/usr/local/lib64 ;; esac
'/opt/lfs/lib64' -> 'lib'
'/opt/lfs/usr/lib64' -> 'lib'
'/opt/lfs/usr/local/lib64/lib' -> 'lib'
lfs:~$ mkdir -v $LFS/var/{log,mail,spool}
mkdir: created directory '/opt/lfs/var/log'
mkdir: created directory '/opt/lfs/var/mail'
mkdir: created directory '/opt/lfs/var/spool'
lfs:~$ ln -sv $LFS/run/lock $LFS/var/lock
'/opt/lfs/var/lock' -> '/opt/lfs/run/lock'
lfs:~$ mkdir -pv $LFS/var/{opt,cache,lib/{color,misc,locate},local}
mkdir: created directory '/opt/lfs/var/opt'
mkdir: created directory '/opt/lfs/var/cache'
mkdir: created directory '/opt/lfs/var/lib'
mkdir: created directory '/opt/lfs/var/lib/color'
mkdir: created directory '/opt/lfs/var/lib/misc'
mkdir: created directory '/opt/lfs/var/lib/locate'
mkdir: created directory '/opt/lfs/var/local'
6.6. Creating Essential Files and Symlinks
lfs:~$ ln -sv /tools/bin/{bash,cat,echo,pwd,stty} $LFS/bin
'/opt/lfs/bin/bash' -> '/tools/bin/bash'
'/opt/lfs/bin/cat' -> '/tools/bin/cat'
'/opt/lfs/bin/echo' -> '/tools/bin/echo'
'/opt/lfs/bin/pwd' -> '/tools/bin/pwd'
'/opt/lfs/bin/stty' -> '/tools/bin/stty'
lfs:~$ ln -sv /tools/lib/libgcc_s.so{,.1} $LFS/usr/lib
'/opt/lfs/usr/lib/libgcc_s.so' -> '/tools/lib/libgcc_s.so'
'/opt/lfs/usr/lib/libgcc_s.so.1' -> '/tools/lib/libgcc_s.so.1'
lfs:~$ ln -sv /tools/lib/libstdc++.so{,.6} $LFS/usr/lib
'/opt/lfs/usr/lib/libstdc++.so' -> '/tools/lib/libstdc++.so'
'/opt/lfs/usr/lib/libstdc++.so.6' -> '/tools/lib/libstdc++.so.6'
lfs:~$ sed 's/tools/opt\/lfs\/usr/' /tools/lib/libstdc++.la > $LFS/usr/lib/libstdc++.la
lfs:~$ ln -sv bash $LFS/bin/sh
'/opt/lfs/bin/sh' -> 'bash'
lfs:~$ touch $LFS/var/log/{btmp,lastlog,wtmp}
lfs:~$ sudo chgrp -v utmp $LFS/var/log/lastlog
changed group of '/opt/lfs/var/log/lastlog' from lfs to utmp
lfs:~$ sudo chmod -v 664 /var/log/lastlog
mode of '/var/log/lastlog' changed from 0644 (rw-r--r--) to 0664 (rw-rw-r--)
lfs:~$ sudo chmod -v 600 /var/log/btmp
mode of '/var/log/btmp' retained as 0600 (rw-------)
6.7.1. Installation of Linux API Headers
make mrproper
make INSTALL_HDR_PATH=dest headers_install
find dest/include \( -name .install -o -name ..install.cmd \) -delete
cp -rv dest/include/* /usr/include
6.9.1. Installation of Glibc
lfs:~/sources/glibc-2.23$ rm -fR *
lfs:~/sources/glibc-2.23$ cd ..
lfs:~/sources$ tar -xf /monster/sources/glibc-2.23.tar.xz
lfs:~/sources$ cd glibc-2.23/
lfs:~/sources/glibc-2.23$ mkdir -v build
mkdir: created directory 'build'
lfs:~/sources/glibc-2.23/build$ ../configure --prefix=/opt/lfs/usr --disable-profile --enable-kernel=2.6.32 --enable-obsolete-rpc
lfs:~/sources/glibc-2.23/build$ make
lfs:~/sources/glibc-2.23/build$ make check
lfs:~/sources/glibc-2.23/build$ touch $LFS/etc/ld.so.conf
lfs:~/sources/glibc-2.23/build$ cp -v ../nscd/nscd.conf $LFS/etc/nscd.conf
'../nscd/nscd.conf' -> '/opt/lfs/etc/nscd.conf'
lfs:~/sources/glibc-2.23/build$ mkdir -pv $LFS/var/cache/nscd
lfs:~/sources/glibc-2.23/build$ mkdir -pv $LFS/usr/lib/locale
mkdir: created directory '/opt/lfs/usr/lib/locale'
lfs:/tools/lib$ mkdir locale
lfs:~$ localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
lfs:~$ localedef -i de_DE -f ISO-8859-1 de_DE
lfs:~$ localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
lfs:~$ localedef -i de_DE -f UTF-8 de_DE.UTF-8
lfs:~$ localedef -i en_GB -f UTF-8 en_GB.UTF-8
lfs:~$ localedef -i en_HK -f ISO-8859-1 en_HK
lfs:~$ localedef -i en_PH -f ISO-8859-1 en_PH
lfs:~$ localedef -i en_US -f ISO-8859-1 en_US
lfs:~$ localedef -i en_US -f UTF-8 en_US.UTF-8
lfs:~$ localedef -i es_MX -f ISO-8859-1 es_MX
lfs:~$ localedef -i fa_IR -f UTF-8 fa_IR
lfs:~$ localedef -i fr_FR -f ISO-8859-1 fr_FR
lfs:~$ localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
lfs:~$ localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
lfs:~$ localedef -i it_IT -f ISO-8859-1 it_IT
lfs:~$ localedef -i it_IT -f UTF-8 it_IT.UTF-8
lfs:~$ localedef -i ja_JP -f EUC-JP ja_JP
lfs:~$ localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
lfs:~$ localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
lfs:~$ localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
lfs:~$ localedef -i zh_CN -f GB18030 zh_CN.GB18030
6.9.2.3. Configuring the Dynamic Loader
$ cat > $LFS/etc/ld.so.conf << "EOF"
> # Begin /etc/ld.so.conf
> /opt/lfs/usr/local/lib
> /opt/lfs/opt/lib
lfs:~/sources/glibc-2.23/build$ mkdir -pv $LFS/etc/ld.so.conf.d
lfs:~/sources/glibc-2.23/build$ cp $LFS/etc/ld.so.conf /opt/lfs/usr/etc/
lfs:~/sources/glibc-2.23/build$ make install
==========================================================================================
6.10. Adjusting the Toolchain
First, backup the /tools linker, and replace it with the adjusted linker we made in chapter 5. We'll also create a link to its counterpart in /tools/$(uname -m)-pc-linux-gnu/bin:
lfs:~$ mv -v /tools/bin/{ld,ld-old}
'/tools/bin/ld' -> '/tools/bin/ld-old'
lfs:~$ mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
'/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/x86_64-pc-linux-gnu/bin/ld-old'
lfs:~$ mv -v /tools/bin/{ld-new,ld}
'/tools/bin/ld-new' -> '/tools/bin/ld'
lfs:~$ ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld
'/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/bin/ld'
Next, amend the GCC specs file so that it points to the new dynamic linker. Simply deleting all instances of “/tools” should leave us with the correct path to the dynamic linker. Also adjust the specs file so that GCC knows where to find the correct headers and Glibc start files. A sed command accomplishes this:
gcc -dumpspecs | sed -e 's@/tools@@g' \
-e '/\*startfile_prefix_spec:/{n;s@.*@/opt/lfs/usr/lib/ @}' \
-e '/\*cpp:/{n;s@$@ -isystem /opt/lfs/usr/include@}' > \
`dirname $(gcc --print-libgcc-file-name)`/specs
editar gcc::specs:
lfs:~/sources/binutils-2.26/build$ vi /monster/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/specs
en *link::%{m16|m32|mx32:;:-dynamic-linker
ajustar /lib64/ld-linux-x86-64.so.2 por /opt/lfs/lib64/ld-linux-x86-64.so.2
%{m16|m32|mx32:;:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:/opt/lfs/lib64/ld-linux-x86-64.so.2}}}
%{m16|m32|mx32:;:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:/opt/lfs/lib64/ld-linux-x86-64.so.2}}}
lfs:~/sources/binutils-2.26/build$ cp -a /tools/lib64/ld-linux-x86-64.so.2 /opt/lfs/lib64/
lfs:~/sources/binutils-2.26/build$ cp -a /tools/lib64/ld-2.23.so /opt/lfs/lib64/
lfs:~/sources/binutils-2.26/build$ ldd a.out
linux-vdso.so.1 (0x00007fff2fbde000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007f1694619000)
/opt/lfs/lib64/ld-linux-x86-64.so.2 (0x00007f16949ba000)
copiar libc.so.6 tambien a esa ruta:
lfs:~/sources/binutils-2.26/build$ cp -a /tools/lib64/libc.so.6 /opt/lfs/lib64/
lfs:~/sources/binutils-2.26/build$ cp -a /tools/lib64/libc-2.23.so /opt/lfs/lib64/
================================================================================================
6.11.1. Installation of Zlib
6.12.1. Installation of File
lfs:~/sources/file-5.25$ ./configure --prefix=/opt/lfs/usr
6.13.1. Installation of Binutils
lfs:~/sources/binutils-2.26/build$ ../configure --prefix=/opt/lfs/usr --enable-shared --disable-werror
lfs:~/sources/binutils-2.26/build$ make tooldir=/opt/lfs/usr
lfs:~/sources/binutils-2.26/build$ make check
lfs:~/sources/binutils-2.26/build$ make tooldir=/opt/lfs/usr install
lfs:~/sources/binutils-2.26/build$ /opt/lfs/usr/bin/ldd /opt/lfs/usr/bin/readelf
linux-vdso.so.1 (0x00007ffdb2180000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fb704b65000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007fb7047c4000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007fb704d69000)
6.14.1. Installation of GMP
./configure --prefix=/opt/lfs/usr \
--enable-cxx \
--disable-static \
--docdir=/opt/lfs/usr/share/doc/gmp-6.1.0
configure: summary of build options:
Version: GNU MP 6.1.0
Host type: haswell-pc-linux-gnu
ABI: 64
Install prefix: /opt/lfs/usr
Compiler: gcc
Static libraries: no
Shared libraries: yes
make
make html
make check 2>&1 | tee gmp-check-log
lfs:~/sources/gmp-6.1.0$ awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
190
make install
make install-html
6.15.1. Installation of MPFR
lfs:~/sources$ tar -xf /monster/sources/mpfr-3.1.3.tar.xz
lfs:~/sources/mpfr-3.1.3$ patch -Np1 -i /monster/sources/mpfr-3.1.3-upstream_fixes-2.patch
patching file doc/mpfr.info
patching file doc/mpfr.texi
patching file PATCHES
patching file src/div_2si.c
patching file src/div_2ui.c
patching file src/div.c
patching file src/div_ui.c
patching file src/fits_intmax.c
patching file src/fits_s.h
patching file src/fits_u.h
patching file src/frexp.c
patching file src/jyn_asympt.c
patching file src/lngamma.c
patching file src/mpfr.h
patching file src/mul_2si.c
patching file src/mulders.c
patching file src/mul_ui.c
patching file src/root.c
patching file src/round_p.c
patching file src/round_prec.c
patching file src/si_op.c
patching file src/sqrt.c
patching file src/ui_div.c
patching file src/version.c
patching file src/zeta.c
patching file tests/tcan_round.c
patching file tests/tdiv.c
patching file tests/tfits.c
patching file tests/tfrexp.c
patching file tests/tj0.c
patching file tests/tlngamma.c
patching file tests/tmul_2exp.c
patching file tests/troot.c
patching file tests/tsqrt.c
patching file tests/tzeta.c
patching file VERSION
./configure --prefix=/opt/lfs/usr \
--disable-static \
--enable-thread-safe \
--docdir=/opt/lfs/usr/share/doc/mpfr-3.1.3
error:
configure: error: gmp.h can't be found, or is unusable.
fix: agregar:
--with-gmp=/opt/lfs/usr
make
make html
make check
make install
make install-html
=====================================================
OpenMPI:
lfs:~/sources/openmpi-1.10.2/build$ ../configure --build=x86_64-unknown-linux-gnu --prefix=/opt/lfs/usr
lfs:~/sources/openmpi-1.10.2/build$ make all install
Munge
https://github.com/dun/munge/wiki/Installation-Guide#starting-the-daemon
lfs:~/sources/munge-0.5.12$ ./configure --prefix=/opt/lfs/usr --with-openssl-prefix=/opt/lfs/usr --sysconfdir=/etc
May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: Starting MUNGE authentication service...
May 19 14:06:32 sullivan.dimar.mil.co munged[3682]: Running on "sullivan.dimar.mil.co" (10.0.3.2)
May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: munge.service: control process exited, code=exited status=1
May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: Failed to start MUNGE authentication service.
May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: Unit munge.service entered failed state.
May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: munge.service failed.
generar munge.key:
[root@sullivan wilderman]# dd if=/dev/random bs=1 count=1024 >/etc/munge/munge.key
[root@sullivan wilderman]# chown munge:munge /etc/munge/munge.key
[root@sullivan wilderman]# chmod 0400 /etc/munge/munge.key
systemctl start munge
systemctl edit --system --full munge
This command will perform the following actions:
Copy munge.service to /etc/systemd/system/munge.service
Invoke an editor on this new munge.service file
Reload the systemd configuration afterwards
While in the editor, append either --syslog or --force to the ExecStart line:
ExecStart=/usr/sbin/munged --syslog
errores
[root@sullivan wilderman]# ccze | tail -f /var/log/munge/munged.log
2016-05-19 15:20:50 -0500 Error: Keyfile must be at least 32 bytes
2016-05-19 15:26:43 -0500 Notice: Running on "sullivan.dimar.mil.co" (10.0.3.2)
2016-05-19 15:26:43 -0500 Info: PRNG seeded with 1024 bytes from "/dev/urandom"
2016-05-19 15:26:43 -0500 Error: Keyfile must be at least 32 bytes
2016-05-19 16:22:29 -0500 Notice: Running on "sullivan.dimar.mil.co" (10.0.3.2)
2016-05-19 16:22:29 -0500 Info: PRNG seeded with 1024 bytes from "/dev/urandom"
2016-05-19 16:22:29 -0500 Error: Keyfile must be at least 32 bytes
2016-05-19 16:22:31 -0500 Notice: Running on "sullivan.dimar.mil.co" (10.0.3.2)
2016-05-19 16:22:31 -0500 Info: PRNG seeded with 1024 bytes from "/dev/urandom"
2016-05-19 16:22:31 -0500 Error: Keyfile must be at least 32 bytes
compilacion MUNGE:
lfs:~/sources/munge-0.5.12$ ./configure --prefix=/opt/lfs/usr --with-openssl-prefix=/opt/lfs/usr --sysconfdir=/etc
Edit src/libcommon/munge_defs.h to customize values if necessary. To compile the software, execute the following command; note that "make install" will require root privileges:
$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && make && sudo make install
lfs:~/sources/munge-0.5.12$ sudo systemctl start munge.service
* munge.service - MUNGE authentication service
Loaded: loaded (/etc/systemd/system/munge.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2016-05-19 18:23:42 COT; 2s ago
Docs: man:munged(8)
Process: 13179 ExecStart=/opt/lfs/usr/sbin/munged (code=exited, status=0/SUCCESS)
Main PID: 13181 (munged)
CGroup: /system.slice/munge.service
`-13181 /opt/lfs/usr/sbin/munged
May 19 18:23:42 sullivan.dimar.mil.co systemd[1]: Starting MUNGE authentication service...
May 19 18:23:42 sullivan.dimar.mil.co systemd[1]: Started MUNGE authentication service.
lfs:~/sources/munge-0.5.12$ which munge
/opt/lfs/usr/bin/munge
lfs:~/sources/munge-0.5.12$ which munged
/opt/lfs/usr/sbin/munged
Grab some pseudorandom data (recommended for the impatient):
root:/etc/munge# dd if=/dev/urandom bs=1 count=1024 >/etc/munge/munge.key
root:/etc/munge# systemctl status munge.service
* munge.service - MUNGE authentication service
Loaded: loaded (/etc/systemd/system/munge.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2016-05-19 18:08:26 COT; 26s ago
Docs: man:munged(8)
Process: 8720 ExecStart=/opt/lfs/usr/sbin/munged (code=exited, status=1/FAILURE)
May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: Starting MUNGE authentication service...
May 19 18:08:26 sullivan.dimar.mil.co munged[8720]: munged: Error: Failed to check logfile "/opt/lfs/usr/var/log/munge/munged.log": Permission denied
May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: munge.service: control process exited, code=exited status=1
May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: Failed to start MUNGE authentication service.
May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: Unit munge.service entered failed state.
May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: munge.service failed.
root:/etc/munge# systemctl start munge.service
!!!finalmente corriendo munged
root:/etc/munge# systemctl status munge.service
* munge.service - MUNGE authentication service
Loaded: loaded (/etc/systemd/system/munge.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2016-05-19 18:11:56 COT; 13s ago
Docs: man:munged(8)
Process: 8756 ExecStart=/usr/sbin/munged (code=exited, status=0/SUCCESS)
Main PID: 8758 (munged)
CGroup: /system.slice/munge.service
`-8758 /usr/sbin/munged
May 19 18:11:56 sullivan.dimar.mil.co systemd[1]: Starting MUNGE authentication service...
May 19 18:11:56 sullivan.dimar.mil.co systemd[1]: Started MUNGE authentication service.
verifica PID:
root:/etc/munge# ps aux | grep munged
munge 8758 0.0 0.0 175836 1984 ? Sl 18:11 0:00 /usr/sbin/munged
Check if a credential can be locally decoded:
root:/etc/munge# /usr/bin/munge -n | /usr/bin/unmunge
STATUS: Success (0)
ENCODE_HOST: sullivan.dimar.mil.co (10.0.3.2)
ENCODE_TIME: 2016-05-19 18:16:11 -0500 (1463699771)
DECODE_TIME: 2016-05-19 18:16:11 -0500 (1463699771)
TTL: 300
CIPHER: aes128 (4)
MAC: sha1 (3)
ZIP: none (0)
UID: root (0)
GID: root (0)
LENGTH: 0
======================================================================================================
========================================================================
Scalable Checkpoint / Restart (SCR) Library
========================================================================
The Scalable Checkpoint / Restart (SCR) library enables MPI applications
to utilize distributed storage on Linux clusters to attain high file I/O
bandwidth for checkpointing and restarting large-scale jobs. With SCR,
jobs run more efficiently, recompute less work upon a failure, and reduce
load on critical shared resources such as the parallel file system.
Detailed usage is provided in the user manual:
doc/scr_users_manual.pdf
-----------------------------
Dependencies
-----------------------------
SCR depends on a number of other software packages.
Required:
pdsh -- parallel remote shell command (pdsh, dshbak)
http://sourceforge.net/projects/pdsh
e.g.,
wget http://downloads.sourceforge.net/project/pdsh/pdsh/pdsh-2.18/pdsh-2.18.tar.bz2
bunzip2 pdsh-2.18.tar.bz2
tar -xf pdsh-2.18.tar
pushd pdsh-2.18
./configure --prefix=/tmp
make
make install
Date::Manip -- Perl module for date/time interpretation
http://search.cpan.org/~sbeck/Date-Manip-5.54/lib/Date/Manip.pod
SLURM -- resource manager
http://sourceforge.net/projects/slurm
Optional:
libyogrt -- your one get remaining time library
Not currently available outside of LLNL.
Enables a running job to determine how much time it has left
in its resource allocation.
io-watchdog -- tool to catch and terminate hanging jobs
http://code.google.com/p/io-watchdog
PDSH:
lfs:~/sources$ tar xf ../spoa.new/pdsh-2.18.tar.bz2
lfs:~/sources/pdsh-2.18$ ./configure --build=x86_64-unknown-linux-gnu --prefix=/opt/lfs --with-ssh --with-slurm
Instalacion de librerias y desarrollo MariaDB:
lfs:~/sources/pdsh-2.18$ sudo yum install mariadb-libs mariadb-devel
CPAN::Date::Manip
lfs:~$ cpan Date::Manip
...
..
.
Appending installation info to /tools/lib/perl5/5.22.1/x86_64-linux/perllocal.pod
SBECK/Date-Manip-6.53.tar.gz
/tools/bin/make install -- OK
JSON:
https://github.com/json-c/json-c/wiki
json-c
Building on Unix with git, gcc and autotools
Home page for json-c: https://github.com/json-c/json-c/wiki
Caution: do NOT use sources from svn.metaparadigm.com, they are old.
Prerequisites:
gcc, clang, or another C compiler
libtool
If you're not using a release tarball, you'll also need:
autoconf (autoreconf)
automake
Make sure you have a complete libtool install, including libtoolize.
json-c GitHub repo: https://github.com/json-c/json-c
$ git clone https://github.com/json-c/json-c.git
$ cd json-c
$ sh autogen.sh
followed by
$ ./configure
$ make
$ make install
To build and run the test programs:
$ make check
lfs:~/git/json-c$ sh autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal -I autoconf-archive/m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /tools/bin/autoconf --include=autoconf-archive/m4
autoreconf: running: /tools/bin/autoheader --include=autoconf-archive/m4
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:32: installing './compile'
configure.ac:78: installing './config.guess'
configure.ac:78: installing './config.sub'
configure.ac:6: installing './install-sh'
configure.ac:6: installing './missing'
Makefile.am: installing './INSTALL'
Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
autoreconf: Leaving directory `.'
lfs:~/sources/json-c$ CFLAGS=-Wno-error=unused-but-set-variable ./configure --prefix=/opt/lfs --build=x86_64-unknown-linux-gnu
SLURM WEB:
lfs:~/git$ git clone https://github.com/edf-hpc/slurm-web.git
LBNL Node Health Check (NHC)
https://github.com/mej/nhc
lfs:~/spoa.new$ wget -c https://github.com/mej/nhc/archive/1.4.2.tar.gz
lfs:~/sources/nhc-1.4.2$ sh autogen.sh
lfs:~/sources/nhc-1.4.2$ make
lfs:~/sources/nhc-1.4.2$ sudo make install
/etc/nhc/nhc.conf
# Set these to your correct socket, core, and thread counts.
* || check_hw_cpuinfo 2 32 64
SLURM:
Get the Slurm source code
You can obtain the latest bleeding-edge SchedMD source code by anonymous Git access.
git clone git://github.com/SchedMD/slurm.git
o
lfs:~/spoa.new$ wget -c http://www.schedmd.com/download/latest/slurm-15.08.11.tar.bz2
lfs:~/sources$ tar xf ../spoa.new/slurm-15.08.11.tar.bz2
checking for GLIB - version >= 2.7.1... Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Package gthread-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gthread-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gthread-2.0' found
no
*** Could not run GLIB test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GLIB is incorrectly installed.
checking for pkg-config... /tools/bin/pkg-config
checking for GTK+ - version >= 2.7.1... Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
Package gthread-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gthread-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gthread-2.0' found
no
*** Could not run GTK+ test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GTK+ is incorrectly installed.
configure: WARNING: cannot build sview without gtk library
GLIB
http://www.linuxfromscratch.org/blfs/view/stable/general/glib2.html
GLib-2.46.2
GLib Dependencies
Required
libffi-3.2.1 and Python-2.7.11 or Python-3.5.1
libffi-3.2.1
Python-2.7.11
lfs:~/spoa.new$ wget -c https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz
lfs:~/sources$ tar xf ../spoa.new/Python-2.7.11.tar.xz
fs:~/sources/Python-2.7.11$ ./configure --prefix=/opt/lfs --enable-shared --with-system-expat --with-system-ffi --enable-unicode=ucs4 LDFLAGS='-L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib'
Python build finished, but the necessary bits to build these modules were not found:
_bsddb _curses _curses_panel
_sqlite3 _tkinter bsddb185
bz2 dbm dl
gdbm imageop readline
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
_hashlib _ssl
GLIB-2.46:
lfs:~/sources/glib-2.46.2$ ./configure --prefix=/opt/lfs --with-pcre=system LIBFFI_LIBS='-L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib' LIBFFI_CFLAGS='-I/opt/lfs/include' PCRE_LIBS='-L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib' PCRE_CFLAGS='-I/opt/lfs/include'
Better config: (using PKG_CONFIG_PATH)
lfs:~/sources/glib-2.46.2$ PKG_CONFIG_PATH=/opt/lfs/lib/pkgconfig ./configure --prefix=/opt/lfs --with-pcre=system --disable-selinux LDFLAGS="-L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib" CFLAGS='-I/opt/lfs/include'
OpenMPI
https://www.open-mpi.org/
lfs:~/sources$ tar xf ../spoa.new/openmpi-1.10.2.tar.bz2
libPSL setup:
lfs:~/sources/libpsl$ PKG_CONFIG_PATH="/opt/lfs/usr/lib/pkgconfig" ./configure --prefix=/opt/lfs/usr LDFLAGS="-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib" CFLAGS="-I/opt/lfs/usr/include"
OpenLDAP:
lfs:~/sources/openldap-2.4.44$ ./configure --prefix=/opt/lfs/usr --exec-prefix=/opt/lfs/usr --sysconfdir=/opt/lfs/etc --disable-static --enable-dynamic --disable-debug --disable-slapd
Curl:
x86_64-unknown-linux-gnu-gcc
lfs:~/sources/curl-7.47.1$ CC=x86_64-unknown-linux-gnu-gcc PKG_CONFIG_PATH="/opt/lfs/usr/lib/pkgconfig;/opt/lfs/lib/pkgconfig" ./configure --prefix=/opt/lfs/usr --disable-static --enable-threaded-resolver LDFLAGS="-L/opt/lfs/lib -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/lib" CFLAGS="-I/opt/lfs/usr/include -I/opt/lfs/include"
curl version: 7.47.1
Host setup: x86_64-pc-linux-gnu
Install prefix: /opt/lfs/usr
Compiler: x86_64-unknown-linux-gnu-gcc
SSL support: enabled (OpenSSL)
SSH support: enabled (libSSH2)
zlib support: enabled
GSS-API support: no (--with-gssapi)
TLS-SRP support: enabled
resolver: POSIX threaded
IPv6 support: enabled
Unix sockets support: enabled
IDN support: enabled
Build libcurl: Shared=yes, Static=no
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
SSPI support: no (--enable-sspi)
ca cert bundle: /etc/pki/tls/certs/ca-bundle.crt
ca cert path: no
LDAP support: enabled (OpenLDAP)
LDAPS support: enabled
RTSP support: enabled
RTMP support: no (--with-librtmp)
metalink support: no (--with-libmetalink)
PSL support: yes
HTTP2 support: disabled (--with-nghttp2)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP
Cracklib:
lfs:~/sources/cracklib-2.9.6$ ./configure --prefix=/opt/lfs/usr --exec-prefix=/opt/lfs/usr --disable-static --with-default-dict=/opt/lfs/usr/lib/cracklibw_dict
PAM:
lfs:~/sources/Linux-PAM-1.2.1$ ./configure --prefix=/opt/lfs/usr --sysconfdir=/opt/lfs/etc --exec-prefix=/opt/lfs -enable-securedir=/opt/lfs/l/lib/security CC=x86_64-unknown-linuxnu-gcc
===========================================================================================================================
HDF5 (intel):
SZIP:
lfs:~/sources/szip-2.1$ ./configure --prefix=/opt/lfs/opt/intel CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' FC='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CFLAGS='-O3 -xHost -ip' CXXFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip'
errores:
icc: command line warning #10006: ignoring unknown option '-Wbad-function-cast'
icc: command line warning #10006: ignoring unknown option '-Wcast-align'
icc: command line warning #10006: ignoring unknown option '-Waggregate-return'
icc: command line warning #10006: ignoring unknown option '-Wredundant-decls'
icc: command line warning #10006: ignoring unknown option '-Wnested-externs'
ld: warning: libimf.so, needed by ../src/.libs/libsz.so, not found (try using -rpath or -rpath-link)
ld: warning: libsvml.so, needed by ../src/.libs/libsz.so, not found (try using -rpath or -rpath-link)
ld: warning: libirng.so, needed by ../src/.libs/libsz.so, not found (try using -rpath or -rpath-link)
ld: warning: libintlc.so.5, needed by ../src/.libs/libsz.so, not found (try using -rpath or -rpath-link)
fix:
lfs:~/sources/szip-2.1$ ./configure --prefix=/opt/lfs/opt/intel CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' FC='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CFLAGS='-O3 -xHost -ip' CXXFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
ZLIB:
lfs:~/sources/zlib-1.2.8$ ./configure --prefix=/opt/lfs/opt/intel CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' FC='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CFLAGS='-O3 -xHost -ip' CXXFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
make
make check
make install
Intel + HDF5
./configure --prefix=/opt/lfs/opt/intel --enable-shared --enable-fortran --enable-cxx CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-g++' LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -L/opt/intel/compilers_and_libraries_2016.1.150/linux/compiler/lib/intel64_lin -Wl,-rpath -Wl,/opt/intel/compilers_and_libraries_2016.1.150/linux/compiler/lib/intel64_lin'
Intel2016 + HDF5 2nd. config
lfs:~/sources/hdf5-1.8.17$ ./configure --prefix=/opt/lfs/opt/intel --enable-shared --enable-fortran --enable-cxx CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gxx-name=/tools/bin/x86_64-unknown-linux-gnu-g++' FC='ifort' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
Intel 2015 + HDF5
lfs:~/sources/hdf5-1.8.17$ ./configure --prefix=/opt/lfs/opt/intel --enable-shared --enable-fortran --enable-cxx CC=icc CXX=icpc FC=ifort LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
lfs:~/sources/hdf5-1.8.17$ ldd /opt/lfs/opt/intel/lib/libhdf5hl_fortran.so.10.0.3
linux-vdso.so.1 (0x00007ffdf45b8000)
libhdf5_hl.so.10 => /opt/lfs/opt/intel/lib/libhdf5_hl.so.10 (0x00007f134898f000)
libhdf5_fortran.so.10 => /opt/lfs/opt/intel/lib/libhdf5_fortran.so.10 (0x00007f13486cb000)
libhdf5.so.10 => /opt/lfs/opt/intel/lib/libhdf5.so.10 (0x00007f134812b000)
libz.so.1 => /opt/lfs/opt/intel/lib/libz.so.1 (0x00007f1347f12000)
libifport.so.5 => /opt/intel/lib/intel64/libifport.so.5 (0x00007f1347ce5000)
libimf.so => /opt/intel/lib/intel64/libimf.so (0x00007f1347829000)
libm.so.6 => /tools/lib/libm.so.6 (0x00007f1347521000)
libintlc.so.5 => /opt/intel/lib/intel64/libintlc.so.5 (0x00007f13472c6000)
libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007f13470a8000)
libsvml.so => /opt/intel/lib/intel64/libsvml.so (0x00007f13461ca000)
libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f1345fb4000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f1345daf000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007f1345a0e000)
libirng.so => /opt/intel/lib/intel64/libirng.so (0x00007f1345807000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007f1348dca000)
SUMMARY OF THE HDF5 CONFIGURATION
=================================
General Information:
-------------------
HDF5 Version: 1.8.17
Configured on: Wed Jun 15 18:04:24 UTC 2016
Configured by: [email protected]
Configure mode: production
Host system: x86_64-unknown-linux-gnu
Uname information: Linux sullivan.dimar.mil.co 3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016 x86_64 GNU/Linux
Byte sex: little-endian
Libraries: static, shared
Installation point: /opt/lfs/opt/intel
Compiling Options:
------------------
Compilation Mode: production
C Compiler: /opt/intel/bin/icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc
CFLAGS:
H5_CFLAGS: -std=c99 -O3
AM_CFLAGS:
CPPFLAGS:
H5_CPPFLAGS: -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L -DNDEBUG -UH5_DEBUG_API
AM_CPPFLAGS:
Shared C Library: yes
Static C Library: yes
Statically Linked Executables: no
LDFLAGS: -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64
H5_LDFLAGS:
AM_LDFLAGS:
Extra libraries: -lz -ldl -lm
Archiver: ar
Ranlib: ranlib
Debugged Packages:
API Tracing: no
Languages:
----------
Fortran: yes
Fortran Compiler: /opt/intel/bin/ifort ( Intel(R) Fortran Intel(R) 64 Compiler Version 16.0.1.150 Build 20151021)
Fortran 2003 Compiler:
Fortran Flags:
H5 Fortran Flags: -O3
AM Fortran Flags:
Shared Fortran Library: yes
Static Fortran Library: yes
C++: yes
C++ Compiler: /opt/intel/bin/icpc -gxx-name=/tools/bin/x86_64-unknown-linux-gnu-g++
C++ Flags:
H5 C++ Flags:
AM C++ Flags:
Shared C++ Library: yes
Static C++ Library: yes
Features:
---------
Parallel HDF5: no
High Level library: yes
Threadsafety: no
Default API Mapping: v18
With Deprecated Public Symbols: yes
I/O filters (external): deflate(zlib)
MPE: no
Direct VFD: no
dmalloc: no
Clear file buffers before write: yes
Using memory checker: no
Function Stack Tracing: no
Strict File Format Checks: no
Optimization Instrumentation: no
=============
OpenLDAP
lfs:~/sources/openldap-2.4.44$ ./configure --prefix=/opt/lfs/opt/intel --exec-prefix=/opt/lfs/opt/intel --sysconfdir=/opt/lfs/opt/intel/etc --disable-static --enable-dynamic --disable-debug --disable-slapd CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gxx-name=/tools/bin/x86_64-unknown-linux-gnu-g++' FC='ifort' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
NETCDF 4.4.0 - Intel (disable OpenDAP)
lfs:~/sources/netcdf-4.4.0$ ./configure --prefix=/opt/lfs/opt/intel CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gxx-name=/tools/bin/x86_64-unknown-linux-gnu-g++' FC='ifort' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib/' --disable-dap
NetCDF 4.4.0 with HDF4 support (GCC)
http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#build_hdf4
HDF-4 (GCC)
lfs:~/sources/hdf-4.2.11$ ./configure --prefix=/opt/lfs/usr CC='x86_64-unknown-linux-gnu-gcc' --enable CXX='x86_64-unknown-linux-gnu-g++' LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
ó
lfs:~/sources/hdf-4.2.11$ ./configure --prefix=/opt/lfs/usr --enable-shared --disable-netcdf --disable-fortran LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -Wl,-rpath -Wl,/tools/lib -Wl,-rpath -Wl,/opt/lfs/lib'
HDF-4 (Intel)
lfs:~/sources/hdf-4.2.11$ ./configure --prefix=/opt/lfs/opt/intel --enable-shared --disable-netcdf --disable-fortran CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
libjpeg-turbo:
lfs:~/sources/libjpeg-turbo-1.4.2$ ./configure --prefix=/opt/lfs/opt/intel CC='icc' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
lfs:~/sources/libjpeg-turbo-1.4.2$ ldd /opt/lfs/opt/intel/bin/tjbench
linux-vdso.so.1 (0x00007fff35fb6000)
libturbojpeg.so.0 => /opt/lfs/usr/lib/libturbojpeg.so.0 (0x00007ff88f7bf000)
libjpeg.so.62 => /opt/lfs/usr/lib/libjpeg.so.62 (0x00007ff88f553000)
libm.so.6 => /opt/lfs/usr/lib/libm.so.6 (0x00007ff88f24e000)
libgcc_s.so.1 => /opt/lfs/usr/lib/libgcc_s.so.1 (0x00007ff88f038000)
libc.so.6 => /opt/lfs/usr/lib/libc.so.6 (0x00007ff88ec97000)
libdl.so.2 => /opt/lfs/usr/lib/libdl.so.2 (0x00007ff88ea93000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007ff88fa3f000)
Then from the top-level netCDF directory:
lfs:~/sources/netcdf-4.4.0$ ./configure --prefix=/opt/lfs/usr --enable-hdf4 --enable-hdf4-file-tests CC='x86_64-unknown-linux-gnu-gcc' CPPFLAGS='-I/opt/lfs/usr/include' LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
$ # Build and install netCDF-4 with HDF4 access enabled
$ CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
./configure --enable-hdf4 --enable-hdf4-file-tests
$ make check
$ make install
# NetCDF C Configuration Summary
==============================
# General
-------
NetCDF Version: 4.4.0
Configured On: Thu Jun 16 14:15:45 UTC 2016
Host System: x86_64-unknown-linux-gnu
Build Directory: /home/lfs/sources/netcdf-4.4.0
Install Prefix: /opt/lfs/usr
# Compiling Options
-----------------
C Compiler: /tools/bin/x86_64-unknown-linux-gnu-gcc
CFLAGS: -g -O2
CPPFLAGS: -I/opt/lfs/usr/include
LDFLAGS: -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib
AM_CFLAGS:
AM_CPPFLAGS:
AM_LDFLAGS:
Shared Library: yes
Static Library: yes
Extra libraries: -ljpeg -lmfhdf -ldf -lhdf5_hl -lhdf5 -ldl -lm -lz -lcurl
# Features
--------
NetCDF-2 API: yes
HDF4 Support: yes
NetCDF-4 API: yes
NC-4 Parallel Support: no
PNetCDF Support: no
DAP Support: yes
Diskless Support: yes
MMap Support: no
JNA Support: no
NetCDF-44 (intel)
lfs:~/sources/netcdf-4.4.0$ ./configure --prefix=/opt/lfs/opt/intel --disable-dap --enable-hdf4 --enable-hdf4-file-tests CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CPPFLAGS='-I/opt/lfs/opt/intel/include' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
===============
OpenSSL with Intel C/C++ Compiler
export CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc'
export CXX='icpc -gxx-name=/tools/bin/x86_64-unknown-linux-gnu-g++'
export FC='ifort'
zlib:
lfs:~/sources/zlib-1.2.8$ CC='icc' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' ./configure --prefix=/opt/lfs/opt/intel
lfs:~/sources/openssl-1.0.2g$ ./Configure linux-x86_64-icc
Configuring for linux-x86_64-icc
no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
no-gmp [default] OPENSSL_NO_GMP (skip dir)
no-jpake [experimental] OPENSSL_NO_JPAKE (skip dir)
no-krb5 [krb5-flavor not specified] OPENSSL_NO_KRB5
no-libunbound [experimental] OPENSSL_NO_LIBUNBOUND (skip dir)
no-md2 [default] OPENSSL_NO_MD2 (skip dir)
no-rc5 [default] OPENSSL_NO_RC5 (skip dir)
no-rfc3779 [default] OPENSSL_NO_RFC3779 (skip dir)
no-sctp [default] OPENSSL_NO_SCTP (skip dir)
no-shared [default]
no-ssl-trace [default] OPENSSL_NO_SSL_TRACE (skip dir)
no-ssl2 [default] OPENSSL_NO_SSL2 (skip dir)
no-store [experimental] OPENSSL_NO_STORE (skip dir)
no-unit-test [default] OPENSSL_NO_UNIT_TEST (skip dir)
no-weak-ssl-ciphers [default] OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)
no-zlib [default]
no-zlib-dynamic [default]
OpenSSL shared libraries have been installed in:
/opt/lfs/opt/intel
If this directory is not in a standard system path for dynamic/shared
libraries, then you will have problems linking and executing
applications that use OpenSSL libraries UNLESS:
* you link with static (archive) libraries. If you are truly
paranoid about security, you should use static libraries.
* you use the GNU libtool code during linking
(http://www.gnu.org/software/libtool/libtool.html)
* you use pkg-config during linking (this requires that
PKG_CONFIG_PATH includes the path to the OpenSSL shared
library directory), and make use of -R or -rpath.
(http://www.freedesktop.org/software/pkgconfig/)
* you specify the system-wide link path via a command such
as crle(1) on Solaris systems.
* you add the OpenSSL shared library directory to /etc/ld.so.conf
and run ldconfig(8) on Linux systems.
* you define the LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH (HP),
DYLD_LIBRARY_PATH (MacOS X) or PATH (Cygwin and DJGPP)
environment variable and add the OpenSSL shared library
directory to it.
One common tool to check the dynamic dependencies of an executable
or dynamic library is ldd(1) on most UNIX systems.
See any operating system documentation and manpages about shared
libraries for your version of UNIX. The following manpages may be
helpful: ld(1), ld.so(1), ld.so.1(1) [Solaris], dld.sl(1) [HP],
ldd(1), crle(1) [Solaris], pldd(1) [Solaris], ldconfig(8) [Linux],
If this directory is not in a standard system path for dynamic/shared
libraries, then you will have problems linking and executing
applications that use OpenSSL libraries UNLESS:
* you link with static (archive) libraries. If you are truly
paranoid about security, you should use static libraries.
* you use the GNU libtool code during linking
(http://www.gnu.org/software/libtool/libtool.html)
* you use pkg-config during linking (this requires that
PKG_CONFIG_PATH includes the path to the OpenSSL shared
library directory), and make use of -R or -rpath.
(http://www.freedesktop.org/software/pkgconfig/)
* you specify the system-wide link path via a command such
as crle(1) on Solaris systems.
* you add the OpenSSL shared library directory to /etc/ld.so.conf
and run ldconfig(8) on Linux systems.
* you define the LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH (HP),
DYLD_LIBRARY_PATH (MacOS X) or PATH (Cygwin and DJGPP)
environment variable and add the OpenSSL shared library
directory to it.
One common tool to check the dynamic dependencies of an executable
or dynamic library is ldd(1) on most UNIX systems.
See any operating system documentation and manpages about shared
libraries for your version of UNIX. The following manpages may be
helpful: ld(1), ld.so(1), ld.so.1(1) [Solaris], dld.sl(1) [HP],
ldd(1), crle(1) [Solaris], pldd(1) [Solaris], ldconfig(8) [Linux],
chatr(1) [HP].
lfs:~/sources/openssl-1.0.2g$ ./config --prefix=/opt/lfs/opt/intel --openssldir=/opt/lfs/opt/intel/etc --libdir=lib shared zlib-dynamic -Wl,-rpath=/opt/intel/lib/intel64
otra forma:
lfs:~/sources/openssl-1.0.2g$ ./Configure linux-x86_64-icc --prefix=/opt/lfs/opt/intel --openssldir=/opt/lfs/opt/intel/etc --libdir=lib shared zlib-dynamic -Wl,-rpath=/opt/intel/lib/intel64
fs:~/sources/openssl-1.0.2g$ ldd /opt/lfs/opt/intel/bin/openssl
linux-vdso.so.1 (0x00007ffd4d7dd000)
libssl.so.1.0.0 => /opt/lfs/opt/intel/lib/libssl.so.1.0.0 (0x00007f095a502000)
libcrypto.so.1.0.0 => /opt/lfs/opt/intel/lib/libcrypto.so.1.0.0 (0x00007f095a076000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f0959e72000)
libm.so.6 => /tools/lib/libm.so.6 (0x00007f0959b6d000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007f09597cc000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007f095a77a000)
lfs:~/sources/openssl-1.0.2g$ CC='icc' ./config --prefix=/opt/lfs/opt/intel --openssldir=/opt/lfs/opt/intel/etc --libdir=lib shared zlib-dynamic -Wl,-rpath -Wl,/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib
$ ldd /opt/lfs/opt/intel/bin/openssl
linux-vdso.so.1 (0x00007fffe8f48000)
libssl.so.1.0.0 => /opt/lfs/opt/intel/lib/libssl.so.1.0.0 (0x00007fb17a30a000)
libcrypto.so.1.0.0 => /opt/lfs/opt/intel/lib/libcrypto.so.1.0.0 (0x00007fb179e8c000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fb179c88000)
libm.so.6 => /tools/lib/libm.so.6 (0x00007fb179983000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007fb1795e2000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007fb17a580000)
+info: https://wiki.openssl.org/index.php/Compilation_and_Installation
NetCDF (Intel):
errores:
lfs:~/sources/netcdf-4.4.0/h5_test$ ./tst_h_atts
*** Checking HDF5 attribute functions.
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.8.12, library is 1.8.17
correccion: especificar CFLAGS='-I/opt/lfs/opt/intel/include' CXXFLAGS='-I/opt/lfs/opt/intel/include' en configure:
lfs:~/sources/netcdf-4.4.0$ ./configure --prefix=/opt/lfs/opt/intel CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gxx-name=/tools/bin/x86_64-unknown-linux-gnu-g++' FC='ifort' CFLAGS='-I/opt/lfs/opt/intel/include' CXXFLAGS='-I/opt/lfs/opt/intel/include' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib' --disable-dap
make
make check
make install
NetCDF-4-40 (Intel)
lfs:~/sources/netcdf-4.4.0$ ./configure --prefix=/opt/lfs/opt/intel --disable-dap --enable-hdf4 --enable-hdf4-file-tests CC="icc" FC="ifort" CPPFLAGS="-I/opt/lfs/opt/intel/include" LDFLAGS="-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib"
make 2>&1 | tee make.log
make check 2>&1 | tee make.log
make install
/opt/lfs/opt/intel/bin/ncdump: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /tools/lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=69ba41cbe4eb728adaa1f094a733acb79ec21a72, not stripped
lfs:~/sources/netcdf-4.4.0$ ldd /opt/lfs/opt/intel/bin/ncdump
linux-vdso.so.1 (0x00007ffc943fc000)
libnetcdf.so.11 => /opt/lfs/opt/intel/lib/libnetcdf.so.11 (0x00007f57e9f51000)
libhdf5_hl.so.10 => /opt/lfs/opt/intel/lib/libhdf5_hl.so.10 (0x00007f57e9d2a000)
libhdf5.so.10 => /opt/lfs/opt/intel/lib/libhdf5.so.10 (0x00007f57e9782000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f57e957e000)
libm.so.6 => /tools/lib/libm.so.6 (0x00007f57e9279000)
libz.so.1 => /opt/lfs/opt/intel/lib/libz.so.1 (0x00007f57e905e000)
libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f57e8e48000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007f57e8aa7000)
libimf.so => /opt/intel/lib/intel64/libimf.so (0x00007f57e85ab000)
libsvml.so => /opt/intel/lib/intel64/libsvml.so (0x00007f57e76ec000)
libirng.so => /opt/intel/lib/intel64/libirng.so (0x00007f57e74e4000)
libintlc.so.5 => /opt/intel/lib/intel64/libintlc.so.5 (0x00007f57e7278000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007f57ea2c5000)
NetCDF-4.4 Fortran:
lfs:~/sources/netcdf-fortran-4.4.4$ ./configure --prefix=/opt/lfs/opt/intel CC='icc' FC='ifort' LDFLAGS="-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib"
lfs:~/sources/netcdf-fortran-4.4.4$ /opt/lfs/opt/intel/bin/nf-config --all
This netCDF-Fortran 4.4.4 has been built with the following features:
--cc -> icc
--cflags -> -I/opt/lfs/opt/intel/include
--fc -> ifort
--fflags -> -I/opt/lfs/opt/intel/include
--flibs -> -L/opt/lfs/opt/intel/lib -lnetcdff -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -lnetcdf -lnetcdf
--has-f90 -> no
--has-f03 -> yes
--has-nc2 -> yes
--has-nc4 -> yes
--prefix -> /opt/lfs/opt/intel
--includedir-> /opt/lfs/opt/intel/include
--version -> netCDF-Fortran 4.4.4
======
libxml2-2.9.3
$ wget -c http://xmlsoft.org/sources/libxml2-2.9.3.tar.gz
LZO:
lfs:~/sources$ tar xf lzo-2.09.tar.gz
lfs:~/sources/lzo-2.09$ ./configure --prefix=/opt/lfs/usr --enable-shared --disable-static
LZO configuration summary
-------------------------
LZO version : 2.09
configured for host : x86_64-unknown-linux-gnu
source code location : .
compiler : gcc
preprocessor definitions : -DLZO_HAVE_CONFIG_H=1
preprocessor flags :
compiler flags : -g -O2
build static library : no
build shared library : yes
enable i386 assembly code : no
LZO 2.09 configured.
Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Markus F.X.J. Oberhumer
<[email protected]>
http://www.oberhumer.com/opensource/lzo/
Type 'make' to build LZO.
Type 'make check' and 'make test' to test LZO.
Type 'make install' to install LZO.
After installing LZO, please have a look at 'examples/simple.c'.
make check:
lfs:~/sources/lzo-2.09$ make check
make check-local
make[1]: Entering directory '/home/lfs/sources/lzo-2.09'
./lzotest/lzotest -mlzo -n2 -q ./COPYING
LZO real-time data compression library (v2.09, Feb 04 2015).
Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
262144 block-size
LZO1B-1 | COPYING 18092 1 9981 55.2 0.000 0.000 |
LZO1B-2 | COPYING 18092 1 9768 54.0 0.000 0.000 |
LZO1B-3 | COPYING 18092 1 9600 53.1 0.000 0.000 |
LZO1B-4 | COPYING 18092 1 9552 52.8 0.000 0.000 |
LZO1B-5 | COPYING 18092 1 9377 51.8 0.000 0.000 |
LZO1B-6 | COPYING 18092 1 9347 51.7 0.000 0.000 |
LZO1B-7 | COPYING 18092 1 9149 50.6 0.000 0.000 |
LZO1B-8 | COPYING 18092 1 9087 50.2 0.000 0.000 |
LZO1B-9 | COPYING 18092 1 9036 49.9 0.000 0.000 |
LZO1C-1 | COPYING 18092 1 9927 54.9 0.000 0.000 |
LZO1C-2 | COPYING 18092 1 9739 53.8 0.000 0.000 |
LZO1C-3 | COPYING 18092 1 9573 52.9 0.000 0.000 |
LZO1C-4 | COPYING 18092 1 9538 52.7 0.000 0.000 |
LZO1C-5 | COPYING 18092 1 9399 52.0 0.000 0.000 |
LZO1C-6 | COPYING 18092 1 9317 51.5 0.000 0.000 |
LZO1C-7 | COPYING 18092 1 9123 50.4 0.000 0.000 |
LZO1C-8 | COPYING 18092 1 9015 49.8 0.000 0.000 |
LZO1C-9 | COPYING 18092 1 8978 49.6 0.000 0.000 |
LZO1-1 | COPYING 18092 1 10498 58.0 0.000 0.000 |
LZO1A-1 | COPYING 18092 1 10405 57.5 0.000 0.000 |
LZO1F-1 | COPYING 18092 1 10073 55.7 0.000 0.000 |
LZO1X-1 | COPYING 18092 1 10102 55.8 0.000 0.000 |
LZO1Y-1 | COPYING 18092 1 10261 56.7 0.000 0.000 |
LZO1X-1(11) | COPYING 18092 1 10554 58.3 0.000 0.000 |
LZO1X-1(12) | COPYING 18092 1 10286 56.9 0.000 0.000 |
LZO1X-1(15) | COPYING 18092 1 10145 56.1 0.000 0.000 |
LZO1B-99 | COPYING 18092 1 8814 48.7 0.000 0.000 |
LZO1B-999 | COPYING 18092 1 8127 44.9 15.212 0.000 |
LZO1C-99 | COPYING 18092 1 8790 48.6 0.000 0.000 |
LZO1C-999 | COPYING 18092 1 8071 44.6 13.970 0.000 |
LZO1-99 | COPYING 18092 1 9083 50.2 35.901 0.000 |
LZO1A-99 | COPYING 18092 1 90lfs:~/sources/lzo-2.09$ make check
make check-local
make[1]: Entering directory '/home/lfs/sources/lzo-2.09'
./lzotest/lzotest -mlzo -n2 -q ./COPYING
LZO real-time data compression library (v2.09, Feb 04 2015).
Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
262144 block-size
LZO1B-1 | COPYING 18092 1 9981 55.2 0.000 0.000 |
LZO1B-2 | COPYING 18092 1 9768 54.0 0.000 0.000 |
LZO1B-3 | COPYING 18092 1 9600 53.1 0.000 0.000 |
LZO1B-4 | COPYING 18092 1 9552 52.8 0.000 0.000 |
LZO1B-5 | COPYING 18092 1 9377 51.8 0.000 0.000 |
LZO1B-6 | COPYING 18092 1 9347 51.7 0.000 0.000 |
LZO1B-7 | COPYING 18092 1 9149 50.6 0.000 0.000 |
LZO1B-8 | COPYING 18092 1 9087 50.2 0.000 0.000 |
LZO1B-9 | COPYING 18092 1 9036 49.9 0.000 0.000 |
LZO1C-1 | COPYING 18092 1 9927 54.9 0.000 0.000 |
LZO1C-2 | COPYING 18092 1 9739 53.8 0.000 0.000 |
LZO1C-3 | COPYING 18092 1 9573 52.9 0.000 0.000 |
LZO1C-4 | COPYING 18092 1 9538 52.7 0.000 0.000 |
LZO1C-5 | COPYING 18092 1 9399 52.0 0.000 0.000 |
LZO1C-6 | COPYING 18092 1 9317 51.5 0.000 0.000 |
LZO1C-7 | COPYING 18092 1 9123 50.4 0.000 0.000 |
LZO1C-8 | COPYING 18092 1 9015 49.8 0.000 0.000 |
LZO1C-9 | COPYING 18092 1 8978 49.6 0.000 0.000 |
LZO1-1 | COPYING 18092 1 10498 58.0 0.000 0.000 |
LZO1A-1 | COPYING 18092 1 10405 57.5 0.000 0.000 |
LZO1F-1 | COPYING 18092 1 10073 55.7 0.000 0.000 |
LZO1X-1 | COPYING 18092 1 10102 55.8 0.000 0.000 |
LZO1Y-1 | COPYING 18092 1 10261 56.7 0.000 0.000 |
LZO1X-1(11) | COPYING 18092 1 10554 58.3 0.000 0.000 |
LZO1X-1(12) | COPYING 18092 1 10286 56.9 0.000 0.000 |
LZO1X-1(15) | COPYING 18092 1 10145 56.1 0.000 0.000 |
LZO1B-99 | COPYING 18092 1 8814 48.7 0.000 0.000 |
LZO1B-999 | COPYING 18092 1 8127 44.9 15.212 0.000 |
LZO1C-99 | COPYING 18092 1 8790 48.6 0.000 0.000 |
LZO1C-999 | COPYING 18092 1 8071 44.6 13.970 0.000 |
LZO1-99 | COPYING 18092 1 9083 50.2 35.901 0.000 |
LZO1A-99 | COPYING 18092 1 9031 49.9 36.176 0.000 |
LZO2A-999 | COPYING 18092 1 7853 43.4 12.931 0.000 |
LZO1F-999 | COPYING 18092 1 8079 44.7 12.740 0.000 |
LZO1X-999 | COPYING 18092 1 7848 43.4 7.220 0.000 |
LZO1Y-999 | COPYING 18092 1 7944 43.9 7.549 0.000 |
LZO1Z-999 | COPYING 18092 1 7893 43.6 7.463 0.000 |
memcpy() | COPYING 18092 1 18092 100 0.000 0.000 |
lt-lzotest: execution time: 0 seconds
===== All checks passed. Type 'make test' for more exhaustive testing. =====
31 49.9 36.176 0.000 |
LZO2A-999 | COPYING 18092 1 7853 43.4 12.931 0.000 |
LZO1F-999 | COPYING 18092 1 8079 44.7 12.740 0.000 |
LZO1X-999 | COPYING 18092 1 7848 43.4 7.220 0.000 |
LZO1Y-999 | COPYING 18092 1 7944 43.9 7.549 0.000 |
LZO1Z-999 | COPYING 18092 1 7893 43.6 7.463 0.000 |
memcpy() | COPYING 18092 1 18092 100 0.000 0.000 |
lt-lzotest: execution time: 0 seconds
===== All checks passed. Type 'make test' for more exhaustive testing. =====
----------------------------------------------------------------------
Libraries have been installed in:
/opt/lfs/usr/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
lfs:~/sources$ tar xf libxml2-2.9.3.tar.gz
lfs:~/sources/libxml2-2.9.3$ ./configure --prefix=/opt/lfs/usr --disable-static --with-history --with-python=/opt/lfs LDFLAGS='-L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib'
lfs:~/sources/libxml2-2.9.3$ ldd /opt/lfs/usr/bin/xmllint
linux-vdso.so.1 (0x00007fffe9593000)
libreadline.so.6 => /tools/lib/libreadline.so.6 (0x00007f0fcb2d3000)
libhistory.so.6 => /tools/lib/libhistory.so.6 (0x00007f0fcb0c9000)
libncursesw.so.6 => /tools/lib/libncursesw.so.6 (0x00007f0fcae5f000)
libxml2.so.2 => /opt/lfs/usr/lib/libxml2.so.2 (0x00007f0fcaaf9000)
libdl.so.2 => /opt/lfs/usr/lib/libdl.so.2 (0x00007f0fca8f5000)
libz.so.1 => /opt/lfs/lib/libz.so.1 (0x00007f0fca6dc000)
liblzma.so.5 => /tools/lib/liblzma.so.5 (0x00007f0fca4b7000)
libm.so.6 => /opt/lfs/usr/lib/libm.so.6 (0x00007f0fca1b2000)
libpthread.so.0 => /opt/lfs/usr/lib/libpthread.so.0 (0x00007f0fc9f95000)
libc.so.6 => /opt/lfs/lib/libc.so.6 (0x00007f0fc9bf4000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007f0fcb523000)
libarchive:
lfs:~/sources$ tar xf libarchive-3.1.2.tar.gz
lfs:~/sources/libarchive-3.1.2$ patch -Np1 -i ../libarchive-3.1.2-upstream_fixes-1.patch
lfs:~/sources/libarchive-3.1.2$ ./configure --prefix=/opt/lfs/usr LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
lfs:~/sources/libarchive-3.1.2$ ldd /opt/lfs/usr/bin/bsdcpio
linux-vdso.so.1 (0x00007fffd13d5000)
libcrypto.so.1.0.0 => /opt/lfs/usr/lib/libcrypto.so.1.0.0 (0x00007fa05fc2c000)
libacl.so.1 => /tools/lib/libacl.so.1 (0x00007fa05fa24000)
libattr.so.1 => /tools/lib/libattr.so.1 (0x00007fa05f820000)
liblzo2.so.2 => /opt/lfs/usr/lib/liblzo2.so.2 (0x00007fa05f5ff000)
libbz2.so.1.0 => /tools/lib/libbz2.so.1.0 (0x00007fa05f3ef000)
libxml2.so.2 => /opt/lfs/usr/lib/libxml2.so.2 (0x00007fa05f089000)
liblzma.so.5 => /tools/lib/liblzma.so.5 (0x00007fa05ee64000)
libz.so.1 => /tools/lib/libz.so.1 (0x00007fa05ec4b000)
libm.so.6 => /opt/lfs/usr/lib/libm.so.6 (0x00007fa05e946000)
libdl.so.2 => /opt/lfs/usr/lib/libdl.so.2 (0x00007fa05e742000)
libpthread.so.0 => /opt/lfs/usr/lib/libpthread.so.0 (0x00007fa05e525000)
libc.so.6 => /opt/lfs/usr/lib/libc.so.6 (0x00007fa05e184000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007fa06007f000)
CMake-3.4.3 (GNU)
lfs:~/sources/cmake-3.4.3$ ./bootstrap --prefix=/opt/lfs/usr --system-libs --mandir=/opt/lfs/usr/man --no-system-jsoncpp
---------------------------------------------
CMake 3.4.3, Copyright 2000-2015 Kitware, Inc.
Found GNU toolchain
C compiler on this system is: gcc
C++ compiler on this system is: g++
Makefile processor on this system is: gmake
g++ is GNU compiler
g++ has setenv
g++ has unsetenv
g++ does not have environ in stdlib.h
g++ has stl wstring
g++ has struct stat with st_mtim member
---------------------------------------------
gmake: `cmake' is up to date.
loading initial cache file /home/lfs/sources/cmake-3.4.3/Bootstrap.cmk/InitialCacheFlags.cmake
-- Using system-installed BZIP2
-- Using system-installed CURL
-- Using system-installed EXPAT
-- Using system-installed FORM
-- Using system-installed LIBARCHIVE
-- Using system-installed LIBLZMA
-- Using system-installed ZLIB
-- Found LibArchive: /opt/lfs/usr/lib64/libarchive.so (found suitable version "3.1.2", minimum required is "3.0.0")
-- Found EXPAT: /tools/lib64/libexpat.so (found version "2.1.0")
-- Looking for cbreak in /tools/lib64/libncurses.so
-- Looking for cbreak in /tools/lib64/libncurses.so - found
-- Looking for elf.h
-- Looking for elf.h - found
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /usr/bin/f95
-- Performing Test run_pic_test
-- Performing Test run_pic_test - Success
-- Performing Test run_inlines_hidden_test
-- Performing Test run_inlines_hidden_test - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lfs/sources/cmake-3.4.3
---------------------------------------------
CMake has bootstrapped. Now run gmake.
lfs:~/sources/cmake-3.4.3$ gmake
lfs:~/sources/cmake-3.4.3$ gmake install
lfs:~/sources/cmake-3.4.3$ ldd `which ccmake`
linux-vdso.so.1 (0x00007ffdf19d7000)
libformw.so.6 => /tools/lib/libformw.so.6 (0x00007f86a8746000)
libncursesw.so.6 => /tools/lib/libncursesw.so.6 (0x00007f86a84dc000)
libdl.so.2 => /opt/lfs/usr/lib64/libdl.so.2 (0x00007f86a82d8000)
libexpat.so.1 => /tools/lib/libexpat.so.1 (0x00007f86a80af000)
libz.so.1 => /tools/lib/libz.so.1 (0x00007f86a7e96000)
libarchive.so.13 => /opt/lfs/usr/lib64/libarchive.so.13 (0x00007f86a7bf6000)
libcurl.so.4 => /opt/lfs/usr/lib64/libcurl.so.4 (0x00007f86a7987000)
libstdc++.so.6 => /opt/lfs/usr/lib64/libstdc++.so.6 (0x00007f86a760d000)
libm.so.6 => /opt/lfs/usr/lib64/libm.so.6 (0x00007f86a7308000)
libgcc_s.so.1 => /opt/lfs/usr/lib64/libgcc_s.so.1 (0x00007f86a70f2000)
libc.so.6 => /opt/lfs/usr/lib64/libc.so.6 (0x00007f86a6d51000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007f86a8957000)
libcrypto.so.1.0.0 => /opt/lfs/usr/lib/libcrypto.so.1.0.0 (0x00007f86a68fe000)
libacl.so.1 => /tools/lib/libacl.so.1 (0x00007f86a66f6000)
libattr.so.1 => /tools/lib/libattr.so.1 (0x00007f86a64f2000)
liblzo2.so.2 => /opt/lfs/usr/lib/liblzo2.so.2 (0x00007f86a62d1000)
liblzma.so.5 => /tools/lib/liblzma.so.5 (0x00007f86a60ac000)
libbz2.so.1.0 => /tools/lib/libbz2.so.1.0 (0x00007f86a5e9c000)
libxml2.so.2 => /opt/lfs/usr/lib/libxml2.so.2 (0x00007f86a5b36000)
libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007f86a5919000)
libidn.so.11 => /opt/lfs/usr/lib/libidn.so.11 (0x00007f86a56e6000)
libssh2.so.1 => /opt/lfs/usr/lib/libssh2.so.1 (0x00007f86a54b9000)
libpsl.so.5 => /opt/lfs/usr/lib/libpsl.so.5 (0x00007f86a52ad000)
libssl.so.1.0.0 => /opt/lfs/usr/lib/libssl.so.1.0.0 (0x00007f86a503c000)
liblber-2.4.so.2 => /opt/lfs/usr/lib/liblber-2.4.so.2 (0x00007f86a4e30000)
libldap-2.4.so.2 => /opt/lfs/usr/lib/libldap-2.4.so.2 (0x00007f86a4bf1000)
libicuuc.so.57 => /opt/lfs/usr/lib/libicuuc.so.57 (0x00007f86a484e000)
libicudata.so.57 => /opt/lfs/usr/lib/libicudata.so.57 (0x00007f86a2dd2000)
libresolv.so.2 => /opt/lfs/usr/lib/libresolv.so.2 (0x00007f86a2bbb000)
libsasl2.so.3 => /opt/lfs/lib/libsasl2.so.3 (0x00007f86a29a1000)
=================
UnZip-6.0
lfs:~/sources$ wget -c http://downloads.sourceforge.net/infozip/unzip60.tar.gz
libJasper (GCC):
lfs:~/sources/jasper-1.900.1$ ./configure --prefix=/opt/lfs/usr LDFLAGS='-Wl,-rpath -Wl,/opt/lfs/usr/lib'
libJasper (Intel)
lfs:~/sources/jasper-1.900.1$ ./configure --prefix=/opt/lfs/opt/intel CC='icc' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib'
libPNG (intel)
lfs:~/sources/libpng-1.6.21$ ./configure --prefix=/opt/lfs/opt/intel --disable-static CC='icc' FC='ifort' CXX='icpc' LDFLAGS="-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64"
======
WRFV3.3
Will use NETCDF in dir: /opt/lfs/opt/intel
PHDF5 not set in environment. Will configure WRF for use without.
which: no timex
$JASPERLIB or $JASPERINC not found in environment, configuring to build without grib2 I/O...
WRFV3.8
vi arch/Config_new.pl
$I_really_want_to_output_grib2_from_WRF = "TRUE" ;
configure.wrf (32. GCC):
LDFLAGS_LOCAL = -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib
WRFV3.8+INTEL:
[wilderman@sullivan bin]$ source ifortvars.sh intel64
[wilderman@sullivan bin]$ source iccvars.sh intel64
$ export DM_CC=/opt/lfs/opt/intel/bin/mpicc
$ export DM_FC=/opt/lfs/opt/intel/bin/mpifort
$ export JASPERINC=/opt/lfs/opt/intel/include
$ export JASPERLIB=/opt/lfs/opt/intel/lib
$ export HDF5=/opt/lfs/opt/intel
$ export NETCDF=/opt/lfs/opt/intel
$ export DM_CC=/opt/lfs/opt/intel/bin/mpicc && export DM_FC=/opt/lfs/opt/intel/bin/mpifort && export JASPERINC=/opt/lfs/opt/intel/include && JASPERLIB=/opt/lfs/opt/intel/lib && export HDF5=/opt/lfs/opt/intel && export NETCDF=/opt/lfs/opt/intel
:configure.wrf:
LDFLAGS_LOCAL = -ip -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64
[wilderman@sullivan WRFV3]$ ./compile em_real > build.log 2>&1
WRFV3.8+GCC:
$ export DM_CC=/opt/lfs/usr/bin/mpicc && export export DM_FC=/opt/lfs/usr/bin/mpif90 && export JASPERINC=/opt/lfs/usr/include && JASPERLIB=/opt/lfs/usr/lib && export HDF5=/opt/lfs/usr && export NETCDF=/opt/lfs/usr
[wilderman@sullivan WRFV3]$ ldd main/wrf.exe
linux-vdso.so.1 (0x00007ffecf5c6000)
libnetcdff.so.6 => /opt/lfs/opt/intel/lib/libnetcdff.so.6 (0x00007f0500d38000)
libnetcdf.so.11 => /opt/lfs/opt/intel/lib/libnetcdf.so.11 (0x00007f05009b3000)
libhdf5_fortran.so.10 => /opt/lfs/opt/intel/lib/libhdf5_fortran.so.10 (0x00007f05006ef000)
libhdf5.so.10 => /opt/lfs/opt/intel/lib/libhdf5.so.10 (0x00007f0500150000)
libm.so.6 => /tools/lib/libm.so.6 (0x00007f04ffe4b000)
libz.so.1 => /opt/lfs/opt/intel/lib/libz.so.1 (0x00007f04ffc32000)
libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007f04ffa15000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007f04ff674000)
libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f04ff45e000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f04ff25a000)
libifport.so.5 => /opt/intel/lib/intel64/libifport.so.5 (0x00007f04ff02d000)
libifcoremt.so.5 => /opt/intel/lib/intel64/libifcoremt.so.5 (0x00007f04fecca000)
libimf.so => /opt/intel/lib/intel64/libimf.so (0x00007f04fe80f000)
libsvml.so => /opt/intel/lib/intel64/libsvml.so (0x00007f04fd931000)
libintlc.so.5 => /opt/intel/lib/intel64/libintlc.so.5 (0x00007f04fd6d6000)
libmfhdf.so.0 => /opt/lfs/usr/lib/libmfhdf.so.0 (0x00007f04fd4ad000)
libdf.so.0 => /opt/lfs/usr/lib/libdf.so.0 (0x00007f04fd1f9000)
libjpeg.so.62 => /opt/lfs/usr/lib/libjpeg.so.62 (0x00007f04fcf8d000)
libhdf5_hl.so.10 => /opt/lfs/usr/lib/libhdf5_hl.so.10 (0x00007f04fcd6c000)
libirng.so => /opt/intel/lib/intel64/libirng.so (0x00007f04fcb65000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007f050120e000)
[wilderman@sullivan WRFV3]$ main/./real.exe
Segmentation fault
[wilderman@sullivan WRFV3]$ main/./wrf.exe
Segmentation fault
:compile02.log:
SKIPPING PIO BUILD make -i -r NETCDFPATH= FC=ifort -ip -fp-model precise -w -ftz -align all -fno-alias -FR -convert big_endian RANLIB=ranlib CPP=/lib/cpp -P LDFLAGS=-openmp -fpp -auto -O3 -ip -fp-model precise -w -ftz -align all -fno-alias -FR -convert big_endian -ip -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 TRADFLAG=-traditional ESMF_IO_LIB_EXT=-L/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90 -lesmf_time LIB_LOCAL= ESMF_MOD_DEPENDENCE=/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90/module_utility.o AR=INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR
make[2]: Entering directory '/home/wilderman/sources/WRFV3.8/WRFV3/external/io_int'
if [ -f ../../frame/pack_utils.o -a -f ../../frame/clog.o ] ; then \
ifort -ip -fp-model precise -w -ftz -align all -fno-alias -FR -convert big_endian -I../ioapi_share -o diffwrf diffwrf.f \
../../frame/pack_utils.o ../../frame/module_internal_header_util.o ../../frame/module_driver_constants.o ../../frame/module_machine.o ../../frame/module_wrf_error.o ../../frame/wrf_debug.o -L/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90 -lesmf_time libwrfio_int.a ; \
fi
../../frame/module_wrf_error.o: In function `wrf_message_':
module_wrf_error.f90:(.text+0x1b): undefined reference to `__kmpc_global_thread_num'
module_wrf_error.f90:(.text+0x2f): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0x125): undefined reference to `__kmpc_end_master'
../../frame/module_wrf_error.o: In function `wrf_message2_':
module_wrf_error.f90:(.text+0x15a): undefined reference to `__kmpc_global_thread_num'
module_wrf_error.f90:(.text+0x16b): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0x1c1): undefined reference to `__kmpc_end_master'
../../frame/module_wrf_error.o: In function `wrf_check_error_':
module_wrf_error.f90:(.text+0x200): undefined reference to `__kmpc_global_thread_num'
module_wrf_error.f90:(.text+0x380): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0x489): undefined reference to `__kmpc_end_master'
module_wrf_error.f90:(.text+0x55d): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0x66f): undefined reference to `__kmpc_end_master'
module_wrf_error.f90:(.text+0x695): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0x794): undefined reference to `__kmpc_end_master'
module_wrf_error.f90:(.text+0x7b4): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0x8bd): undefined reference to `__kmpc_end_master'
module_wrf_error.f90:(.text+0x8e6): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0x941): undefined reference to `__kmpc_end_master'
module_wrf_error.f90:(.text+0xa08): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0xa5b): undefined reference to `__kmpc_end_master'
module_wrf_error.f90:(.text+0xa9f): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0xaf5): undefined reference to `__kmpc_end_master'
module_wrf_error.f90:(.text+0xb0d): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0xb68): undefined reference to `__kmpc_end_master'
../../frame/module_wrf_error.o: In function `wrf_error_fatal_':
module_wrf_error.f90:(.text+0xbf0): undefined reference to `__kmpc_global_thread_num'
module_wrf_error.f90:(.text+0xc53): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0xd56): undefined reference to `__kmpc_end_master'
module_wrf_error.f90:(.text+0xd72): undefined reference to `__kmpc_master'
module_wrf_error.f90:(.text+0xe81): undefined reference to `__kmpc_end_master'
[wilderman@sullivan intel64]$ nm | grep __kmpc_global_thread_num *
grep: crt: Is a directory
grep: irml: Is a directory
nm: 'a.out': No such file
Binary file libiomp5.a matches
Binary file libiomp5.dbg matches
Binary file libiomp5.so matches
Binary file libmatmul.a matches
Error: WRFV3.8::GCC (smpar)
SKIPPING PIO BUILD make -i -r NETCDFPATH= FC=gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 RANLIB=ranlib CPP=/lib/cpp -P LDFLAGS=-fopenmp -O2 -ftree-vectorize -funroll-loops -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib TRADFLAG=-traditional ESMF_IO_LIB_EXT=-L/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90 -lesmf_time LIB_LOCAL= ESMF_MOD_DEPENDENCE=/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90/module_utility.o AR=INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR
make[2]: Entering directory '/home/wilderman/sources/WRFV3.8/WRFV3/external/io_int'
if [ -f ../../frame/pack_utils.o -a -f ../../frame/clog.o ] ; then \
gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -I../ioapi_share -o diffwrf diffwrf.f \
../../frame/pack_utils.o ../../frame/module_internal_header_util.o ../../frame/module_driver_constants.o ../../frame/module_machine.o ../../frame/module_wrf_error.o ../../frame/wrf_debug.o -L/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90 -lesmf_time libwrfio_int.a ; \
fi
../../frame/module_wrf_error.o: In function `wrf_error_fatal3_':
module_wrf_error.f90:(.text+0x50d): undefined reference to `omp_get_thread_num'
../../frame/module_wrf_error.o: In function `wrf_message2_':
module_wrf_error.f90:(.text+0x94c): undefined reference to `omp_get_thread_num'
../../frame/module_wrf_error.o: In function `wrf_message_':
module_wrf_error.f90:(.text+0x97c): undefined reference to `omp_get_thread_num'
collect2: error: ld returned 1 exit status
makefile:76: recipe for target 'diffwrf' failed
make[2]: [diffwrf] Error 1 (ignored)
FIX (GCC):
en configure.wrf agregar "-Wl,-rpath -Wl,/tools/lib -lgomp" a ESMF_IO_LIB y ESMF_IO_LIB_EXT
FIX (Intel):
en configure.wrf agregar "-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -liomp5" a ESMF_IO_LIB y ESMF_IO_LIB_EXT
SKIPPING PIO BUILD make -i -r NETCDFPATH= FC=gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 RANLIB=ranlib CPP=/lib/cpp -P LDFLAGS=-fopenmp -O2 -ftree-vectorize -funroll-loops -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib TRADFLAG=-traditional ESMF_IO_LIB_EXT=-L/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90 -Wl,-rpath -Wl,/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90 -lesmf_time -Wl,-rpath -Wl,/tools/lib -lgomp LIB_LOCAL= ESMF_MOD_DEPENDENCE=/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90/module_utility.o AR=INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR
make[2]: Entering directory '/home/wilderman/sources/WRFV3.8/WRFV3/external/io_int'
if [ -f ../../frame/pack_utils.o -a -f ../../frame/clog.o ] ; then \
gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -I../ioapi_share -o diffwrf diffwrf.f \
../../frame/pack_utils.o ../../frame/module_internal_header_util.o ../../frame/module_driver_constants.o ../../frame/module_machine.o ../../frame/module_wrf_error.o ../../frame/wrf_debug.o -L/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90 -Wl,-rpath -Wl,/home/wilderman/sources/WRFV3.8/WRFV3/external/esmf_time_f90 -lesmf_time -Wl,-rpath -Wl,/tools/lib -lgomp libwrfio_int.a ; \
fi
f951: Warning: Nonexistent include directory �~@~Xg2lib�~@~Y [-Wmissing-include-dirs]
7.2 Example Debugging Session: Segmentation Fault Example
http://www.unknownroad.com/rtfm/gdbtut/gdbsegfault.html
[wilderman@sullivan main]$ gdb ndown.exe
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/wilderman/sources/WRFV3.8/WRFV3/main/ndown.exe...done.
(gdb) run
Starting program: /home/wilderman/sources/WRFV3.8/WRFV3/main/ndown.exe
warning: File "/monster/tools/lib/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py".
To enable execution of this file add
add-auto-load-safe-path /monster/tools/lib/libthread_db-1.0.so
line to your configuration file "/home/wilderman/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/wilderman/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Program received signal SIGSEGV, Segmentation fault.
0x0000000002afb5e4 in init_resource ()
(WRFV3.8::Intel opcion 13 (serial))
$ ldd main/ndown.exe
linux-vdso.so.1 (0x00007ffe04d3c000)
libnetcdff.so.6 => /opt/lfs/opt/intel/lib/libnetcdff.so.6 (0x00007fa9d9285000)
libnetcdf.so.11 => /opt/lfs/opt/intel/lib/libnetcdf.so.11 (0x00007fa9d8f00000)
libhdf5_fortran.so.10 => /opt/lfs/opt/intel/lib/libhdf5_fortran.so.10 (0x00007fa9d8c3c000)
libhdf5.so.10 => /opt/lfs/opt/intel/lib/libhdf5.so.10 (0x00007fa9d869d000)
libm.so.6 => /tools/lib/libm.so.6 (0x00007fa9d8398000)
libz.so.1 => /opt/lfs/opt/intel/lib/libz.so.1 (0x00007fa9d817f000)
libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007fa9d7f62000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007fa9d7bc1000)
libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007fa9d79ab000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fa9d77a7000)
libifport.so.5 => /opt/intel/lib/intel64/libifport.so.5 (0x00007fa9d757a000)
libifcoremt.so.5 => /opt/intel/lib/intel64/libifcoremt.so.5 (0x00007fa9d7217000)
libimf.so => /opt/intel/lib/intel64/libimf.so (0x00007fa9d6d5c000)
libsvml.so => /opt/intel/lib/intel64/libsvml.so (0x00007fa9d5e7e000)
libintlc.so.5 => /opt/intel/lib/intel64/libintlc.so.5 (0x00007fa9d5c23000)
libmfhdf.so.0 => /opt/lfs/usr/lib/libmfhdf.so.0 (0x00007fa9d59fa000)
libdf.so.0 => /opt/lfs/usr/lib/libdf.so.0 (0x00007fa9d5746000)
libjpeg.so.62 => /opt/lfs/usr/lib/libjpeg.so.62 (0x00007fa9d54da000)
libhdf5_hl.so.10 => /opt/lfs/usr/lib/libhdf5_hl.so.10 (0x00007fa9d52b9000)
libirng.so => /opt/intel/lib/intel64/libirng.so (0x00007fa9d50b2000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007fa9d975b000)
===============
LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/opt/lfs/opt/intel/lib -lnetcdff -lnetcdf -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -lhdf5_fortran -lhdf5 -lhdf5_hl -lmfhdf -ldf -lm -lz
zlib::intel
$ CC='icc' CXX='icpc' FC='ifort' CFLAGS='-O3 -xHost -ip' CXXFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' LDFLAGS='-L/opt/intelxe/lib/intel64 -Wl,-rpath -Wl,/opt/intelxe/lib/intel64' ./configure --prefix=/usr/local/intel
$ ./configure --prefix=/opt/lfs/opt/intel --disable-dap --enable-hdf4 --enable-hdf4-file-tests CC=icc FC=ifort F90=ifort F77=ifort FFLAGS='-I/opt/lfs/usr/include -O3 -xHost -ip -no-prec-div -static-intel' CPPFLAGS='-I/opt/lfs/usr/include -O3 -xHost -ip -no-prec-div -static-intel' LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib'
SZIP:
original:
./configure --disable-static --prefix=/opt/lfs/opt/intel CC=icc CXX=icpc FC=ifort LDFLAGS=-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64
nueva:
lfs:~/sources/szip-2.1$ ./configure --prefix=/opt/lfs/opt/intel CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc' CXX='icpc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-g++' FC='ifort -gcc-name=tools/bin/x86_64-unknown-linux-gnu-gfortran' CFLAGS='-O3 -xHost -ip' CXXFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
HDF5:
original:
./configure --prefix=/opt/lfs/opt/intel --enable-shared --enable-fortran --enable-cxx CC=icc CXX=icpc FC=ifort LDFLAGS=-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64
lfs:~/sources/hdf5-1.8.17$ export LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib'
[wilderman@sullivan build-intel]$ .././configure --prefix=/usr/local/intel --enable-shared --enable-fortran --enable-cxx CC=icc CXX=icpc FC=ifort CFLAGS='-O3 -xHost -ip' CXXFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/usr/local/intel/lib -Wl,-rpath -Wl,/usr/local/intel/lib'
NetCDF 4.4:
$ export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
$ export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export CPPFLAGS='-O3 -xHost -ip -no-prec-div -static-intel -I/opt/lfs/opt/intel/include'
$ export F77='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gfortran'
$ export F90='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gfortran'
$ export FC='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gfortran'
$ export CPP='icc -E'
$ export CXXCPP='icpc -E'
$ echo $FFLAGS
$ export FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
$ ./configure --disable-dap --prefix=/opt/lfs/opt/intel
Error:
/bin/sh ../libtool --tag=CC --mode=link icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc -O3 -xHost -ip -no-prec-div -static-intel -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -o nccopy nccopy.o nciter.o chunkspec.o utils.o dimmap.o ../liblib/libnetcdf.la -lhdf5_hl -lhdf5 -ldl -lm -lz
libtool: link: icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc -O3 -xHost -ip -no-prec-div -static-intel -Wl,-rpath -Wl,/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -o .libs/nccopy nccopy.o nciter.o chunkspec.o utils.o dimmap.o -L/opt/intel/lib/intel64 -L/opt/lfs/opt/intel/lib ../liblib/.libs/libnetcdf.so /opt/lfs/opt/intel/lib/libhdf5_hl.so /opt/lfs/opt/intel/lib/libhdf5.so -ldl -lm -lz -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib
icc: warning #10237: -lcilkrts linked in dynamically, static library not available
*** Testing netCDF-4 user-defined types and groups.
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.8.12, library is 1.8.17
$ export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel -I/opt/lfs/opt/intel/include'
$ export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel -I/opt/lfs/opt/intel/include'
icc: warning #10237: -lcilkrts linked in dynamically, static library not available
$ unset CFLAGS CXXFLAGS CPPFLAGS F77 F90 FC CPP CXXCPP FFLAGS FCFLAGS
Fix:
desinstalar librerias/binarios anteriores de sus carpetas :
fs:~/sources/hdf5-1.8.17/build$ .././configure --prefix=/opt/lfs/usr --enable-shared --enable-fortran --enable-cxx CC=gcc CXX=g++ CFLAGS='-O3 -march=native -funroll-loops' CPPFLAGS='-O3 -march=native -funroll-loops' CXXFLAGS='-O3 -march=native -funroll-loops' FC=gfortran LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
lfs:~/sources/hdf5-1.8.17/build-intel$ .././configure --prefix=/opt/lfs/opt/intel --enable-shared --enable-fortran --enable-cxx CC=icc CXX=icpc CFLAGS='-O3 -xHost -ip' CPPFLAGS='-O3 -xHost -ip' CXXFLAGS='-O3 -xHost -ip' FFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' FC=ifort LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
=============================================================
NETCDF-4.4 (intel):
.././configure --disable-dap --prefix=/usr/local/intel CC=icc CXX=icpc FC=ifort CFLAGS='-O3 -xHost -ip' CPPFLAGS='-O3 -xHost -ip' FFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' LDFLAGS='-L/usr/local/intel/lib -Wl,-rpath -Wl,/usr/local/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
NetCDF-4.4 (gnu):
lfs:~/sources/netcdf-4.4.0/build-gnu$ .././configure --disable-dap --prefix=/opt/lfs/usr CC='x86_64-unknown-linux-gnu-gcc' CPPFLAGS='-I/opt/lfs/usr/include' LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
NetCDF-fortran-4.4 (intel)
lfs:~/sources/netcdf-fortran-4.4.4/build-intel$ .././configure --prefix=/opt/lfs/opt/intel CC=icc CXX=icpc FC=ifort CPPFLAGS='-I. -I.. -I/opt/lfs/opt/intel/include -O3 -xHost -ip' CFLAGS='-O3 -xHost -ip' FFLAGS='-O3 -xHost -ip' LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
[wilderman@sullivan build-intel]$ .././configure --disable-dap --prefix=/usr/local/intel CC=icc CXX=icpc FC=ifort CFLAGS='-O3 -xHost -ip -I. -I.. -I/usr/local/intel/include' CPPFLAGS='-I. -I.. -I/usr/local/intel/include -O3 -xHost -ip' FFLAGS='-O3 -xHost -ip -I. -I.. -I/usr/local/intel/include' FCFLAGS='-O3 -xHost -ip -I. -I.. -I/usr/local/intel/include' LDFLAGS='-L/usr/local/intel/lib -Wl,-rpath -Wl,/usr/local/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
libpng(intel)
[wilderman@sullivan libpng-1.6.21]$ ./configure --prefix=/usr/local/intel CC=icc FC=ifort CFLAGS='-O3 -ip -xHost' LDFLAGS='-L/opt/intelxe/lib/intel64 -Wl,-rpath -Wl,/opt/intelxe/lib/intel64 -L/usr/local/intelxe/lib -Wl,-rpath -Wl,/usr/local/intelxe/lib'
NetCDF-fortran-4.4 (gnu):
WRFV3.8::intel
intelxe::intel 2016.Update1
configure.wrf (opcion 14 (sm))
LDFLAGS_LOCAL = -ip -L/opt/intelxe/lib/intel64 -Wl,-rpath -Wl,/opt/intelxe/lib/intel64 -L/usr/local/intel/lib -Wl,-rpath -Wl,/usr/local/intel/lib
ESMF_IO_LIB = -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -Wl,-rpath -Wl,$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -lesmf_time -Wl,-rpath -Wl,/opt/intelxe/lib/intel64 -liomp5
ESMF_IO_LIB_EXT = -L$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -Wl,$(WRF_SRC_ROOT_DIR)/external/esmf_time_f90 -lesmf_time -Wl,-rpath -Wl,/opt/intel/libxe/intel64 -liomp5
LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/usr/local/intel/lib -lnetcdff -lnetcdf -L$(WRF_SRC_ROOT_DIR)/external/io_grib2 -lio_grib2 -L/usr/local/intel/lib -ljasper -L/usr/local/intel/lib -lhdf5_fortran -lhdf5 -lm -lz
NETCDFPATH = /usr/local/intel
HDF5PATH = /usr/local/intel
[wilderman@sullivan WRFV3]$ ldd main/wrf.exe
linux-vdso.so.1 (0x00007ffdbcafe000)
libiomp5.so => /opt/intelxe/lib/intel64/libiomp5.so (0x00007f7770405000)
libnetcdff.so.6 => /usr/local/intel/lib/libnetcdff.so.6 (0x00007f776ff66000)
libnetcdf.so.11 => /usr/local/intel/lib/libnetcdf.so.11 (0x00007f776fbef000)
libhdf5_fortran.so.10 => /usr/local/intel/lib/libhdf5_fortran.so.10 (0x00007f776f9a7000)
libhdf5.so.10 => /usr/local/intel/lib/libhdf5.so.10 (0x00007f776f3f3000)
libm.so.6 => /tools/lib/libm.so.6 (0x00007f776f0ee000)
libz.so.1 => /usr/local/intel/lib/libz.so.1 (0x00007f776eed3000)
libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007f776ecb6000)
libc.so.6 => /tools/lib/libc.so.6 (0x00007f776e915000)
libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f776e6ff000)
libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f776e4fb000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00007f7770747000)
libifport.so.5 => /opt/intelxe/lib/intel64/libifport.so.5 (0x00007f776e2cc000)
libifcore.so.5 => /opt/intelxe/lib/intel64/libifcore.so.5 (0x00007f776df68000)
libimf.so => /opt/intelxe/lib/intel64/libimf.so (0x00007f776da6c000)
libsvml.so => /opt/intelxe/lib/intel64/libsvml.so (0x00007f776cbad000)
libintlc.so.5 => /opt/intelxe/lib/intel64/libintlc.so.5 (0x00007f776c941000)
libhdf5_hl.so.10 => /usr/local/intel/lib/libhdf5_hl.so.10 (0x00007f776c719000)
libirng.so => /opt/intelxe/lib/intel64/libirng.so (0x00007f776c511000)
WPS::intel
configure.wps
COMPRESSION_LIBS = -L/usr/local/intel/lib -Wl,-rpath -Wl,/usr/local/intel/lib -ljasper -lpng -lz
COMPRESSION_INC = -I/usr/local/intel/include
LDFLAGS = -Wl,-rpath -Wl,/usr/local/intel/lib -Wl,-rpath -Wl,/opt/intelxe/lib/intel64 -liomp5
[wilderman@sullivan WPS]$ ./compile 2>&1 | tee compile.log
buscar un simbolo en una libreria
[wilderman@sullivan intel64_lin]$ nm -o * | grep __kmpc_global_thread_num
libioffload_target.so.5: U __kmpc_global_thread_num@@VERSION
libiomp5.a:kmp_csupport.o:0000000000000040 T __kmpc_global_thread_num
libiomp5.dbg:000000000004b050 T __kmpc_global_thread_num
libiomp5.so:000000000004b050 T __kmpc_global_thread_num
libmatmul.a:s__gemm_omp_v1_drv.o: U __kmpc_global_thread_num
libmatmul.a:s__gemm_drv.o: U __kmpc_global_thread_num
libmatmul.a:d__gemm_omp_v1_drv.o: U __kmpc_global_thread_num
libmatmul.a:d__gemm_drv.o: U __kmpc_global_thread_num
libmatmul.a:z__gemm_omp_v1_drv.o: U __kmpc_global_thread_num
libmatmul.a:z__gemm_drv.o: U __kmpc_global_thread_num
libmatmul.a:c__gemm_omp_v1_drv.o: U __kmpc_global_thread_num
libmatmul.a:c__gemm_drv.o: U __kmpc_global_thread_num
libmatmul.a:cgemv_omp_matmul.o: U __kmpc_global_thread_num
libmatmul.a:zgemv_omp_matmul.o: U __kmpc_global_thread_num
libmatmul.a:sgemv_omp_matmul.o: U __kmpc_global_thread_num
libmatmul.a:dgemv_omp_matmul.o: U __kmpc_global_thread_num
===========0000000=======
WRFV3.8 (GCC/GFortran 5.3 toolchain)
environment
JASPERINC=/opt/lfs/usr/include
JASPERLIB=/opt/lfs/usr/lib
HDF5=/opt/lfs/usr
NETCDF=/opt/lfs/usr
export JASPERINC JASPERLIB HDF5 NETCDF
configure.wrf:
SFC = /tools/bin/gfortran
SCC = /tools/bin/gcc
CCOMP = /tools/bin/gcc
DM_FC = mpif90
DM_CC = mpicc -DMPI2_SUPPORT
FC = time $(DM_FC) -I/opt/lfs/include
CFLAGS_LOCAL = -w -O3 -c -I/opt/lfs/include
LDFLAGS_LOCAL = -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib
LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -lnetcdff -lnetcdf -L$(WRF_SRC_ROOT_DIR)/external/io_grib2 -lio_grib2 -L/opt/lfs/usr/lib -ljasper -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -lhdf5_fortran -lhdf5 -lm -lz -L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib
WRFV3.8 (Intel 2014 + toolchain)
environment
JASPERINC=/opt/lfs/opt/intel/include
JASPERLIB=/opt/lfs/opt/intel/lib
HDF5=/opt/lfs/opt/intel
NETCDF=/opt/lfs/usr #GNU-Toolchain
DM_FC = /opt/lfs/opt/intel/bin/mpif90
DM_CC = /opt/lfs/opt/intel/bin/mpicc -DMPI2_SUPPORT
FC = time $(DM_FC) -I/opt/lfs/opt/intel/include
LDFLAGS_LOCAL = -ip -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64 -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib
LIB_EXTERNAL = \
-L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -lnetcdff -lnetcdf -L$(WRF_SRC_ROOT_DIR)/external/io_grib2 -lio_grib2 -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -ljasper -L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -lhdf5_fortran -lhdf5 -lm -lz -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64
NETCDFPATH = /opt/lfs/opt/intel
HDF5PATH = /opt/lfs/opt/intel
export JASPERINC JASPERLIB HDF5 NETCDF
[wilderman@sullivan main]$ ./real.exe
[sullivan.dimar.mil.co:12219] mca: base: component_find: unable to open /opt/lfs/usr/lib/openmpi/mca_btl_scif: libscif.so.0: cannot open shared object file: No such file or directory (ignored)
error en openmpi-1.10.2 (gcc):
[wilderman@sullivan main]$ ldd /opt/lfs/usr/lib/openmpi/mca_btl_scif.so
linux-vdso.so.1 (0x00007fff66136000)
libscif.so.0 => not found
librt.so.1 => /tools/lib/librt.so.1 (0x00002ba717312000)
libm.so.6 => /tools/lib/libm.so.6 (0x00002ba71751a000)
libutil.so.1 => /tools/lib/libutil.so.1 (0x00002ba71781f000)
libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00002ba717a22000)
libc.so.6 => /tools/lib/libc.so.6 (0x00002ba717c3f000)
/tools/lib64/ld-linux-x86-64.so.2 (0x00002ba716ee6000)
Recompilar OpenMPI!!!
GNU:
$ ../configure --build=x86_64-unknown-linux-gnu --prefix=/opt/lfs/usr --without-scif CC=x86_64-unknown-linux-gnu-gcc CXX=x86_64-unknown-linux-gnu-g++ FC=x86_64-unknown-linux-gnu-gfortran CXXFLAGS=-O2 CPPFLAGS=-O2 CFLAGS=-O2 FFLAGS=-O2 LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
[wilderman@sullivan build.xeon]$ make LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib' 2>&1 | tee make.log
Intel:
--without-scif = deshabilita el uso de aceleradores Phi.
[wilderman@sullivan build.intel]$ ../configure --build=x86_64-unknown-linux-gnu --prefix=/opt/lfs/opt/intel --without-scif CC=icc CXX=icpc FC=ifort CFLAGS='-O3 -xHost -ip' CPPFLAGS='-O3 -xHost -ip' FFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
[wilderman@sullivan build.intel]$ make LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' 2>&1 | tee make.log
Parallel HDF5:
[wilderman@sullivan build.intel]$ ../configure --prefix=/opt/lfs/opt/intel --enable-parallel --enable-shared --enable-fortran CC=/opt/lfs/opt/intel/bin/mpicc CXX=/opt/lfs/opt/intel/bin/mpic++ FC=/opt/lfs/opt/intel/bin/mpif90 LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
$ make LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' 2>&1 | tee make.log
[wilderman@sullivan build.intel]$ HDF5_PARAPREFIX=pfs:/tmp
[wilderman@sullivan build.intel]$ export HDF5_PARAPREFIX
[wilderman@sullivan build.intel]$ make LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' check
errors:
===Parallel tests in testpar begin Tue Jul 26 23:41:31 UTC 2016===
**** Hint ****
Parallel test files reside in the current directory by default.
Set HDF5_PARAPREFIX to use another directory. E.g.,
HDF5_PARAPREFIX=/PFS/user/me
export HDF5_PARAPREFIX
make check
**** end of Hint ****
make[4]: Entering directory '/home/wilderman/sources/hdf5-1.8.17/build.intel/testpar'
============================
Testing t_mpi
============================
t_mpi Test Log
============================
===================================
MPI functionality tests
===================================
Proc 2: hostname=sullivan.dimar.mil.co
Proc 3: hostname=sullivan.dimar.mil.co
Proc 4: hostname=sullivan.dimar.mil.co
Proc 5: hostname=sullivan.dimar.mil.co
--------------------------------
Proc 0: *** MPIO 1 write Many read test...
--------------------------------
Proc 0: hostname=sullivan.dimar.mil.co
Proc 1: hostname=sullivan.dimar.mil.co
Proc 5: MPI_File_open failed (MPI_ERR_IO: input/output error)
Proc 2: MPI_File_open failed (MPI_ERR_IO: input/output error)
Proc 3: MPI_File_open failed (MPI_ERR_IO: input/output error)
Proc 4: MPI_File_open failed (MPI_ERR_IO: input/output error)
Proc 1: MPI_File_open failed (MPI_ERR_IO: input/output error)
Proc 0: MPI_File_open failed (MPI_ERR_IO: input/output error)
***FAILED with 6 total errors
--------------------------------
Proc 0: *** MPIO File size range test...
--------------------------------
MPI_Offset is signed 8 bytes integeral type
Proc 2: *** Parallel ERROR ***
VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
aborting MPI processes
Proc 3: *** Parallel ERROR ***
VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
aborting MPI processes
Proc 0: *** Parallel ERROR ***
VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
aborting MPI processes
Proc 1: *** Parallel ERROR ***
VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
aborting MPI processes
Proc 4: *** Parallel ERROR ***
VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
aborting MPI processes
Proc 5: *** Parallel ERROR ***
VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
aborting MPI processes
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.
OpenMPI with -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
[wilderman@sullivan build.intel]$ ../configure --build=x86_64-unknown-linux-gnu --prefix=/opt/lfs/opt/intel --without-scif CC=icc CXX=icpc FC=ifort CFLAGS='-O3 -xHost -ip -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' CPPFLAGS='-O3 -xHost -ip' FCFLAGS='-O3 -xHost -ip' LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
[wilderman@sullivan build.intel]$ make LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' 2>&1 | tee make.log
[wilderman@sullivan build.intel]$ make LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' check 2>&1 | tee make.log
=======
Parallel NetCDF:
export CC=icc
export CXX=icpc
export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export F77=ifort
export FC=ifort
export F90=ifort
export FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
export CPP='icc -E'
export CXXCPP='icpc -E'
wilderman@sullivan build-intel]$ .././configure --disable-dap --prefix=/opt/lfs/opt/intel --disable-shared --enable-parallel-tests CC=/opt/lfs/opt/intel/bin/mpicc CXX=/opt/lfs/opt/intel/bin/mpic++ FC=/opt/lfs/opt/intel/bin/mpif90 LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
ó
[wilderman@sullivan build-intel]$ .././configure --disable-dap --prefix=/opt/lfs/opt/intel --enable-parallel-tests CC=/opt/lfs/opt/intel/bin/mpicc CXX=/opt/lfs/opt/intel/bin/mpic++ CFLAGS='-xHost -ip -no-prec-div -static-intel' CXXFLAGS='-xHost -ip -no-prec-div -static-intel' FC=/opt/lfs/opt/intel/bin/mpif90 FFFLAGS='-xHost -ip -no-prec-div -static-intel' LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64'
[wilderman@sullivan build-intel]$ make LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' 2>&1 | tee make.log
[wilderman@sullivan build-intel]$ make LDFLAGS='-L/opt/lfs/opt/intel/lib -Wl,-rpath -Wl,/opt/lfs/opt/intel/lib -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' check 2>&1 | tee make.log
===========
[wilderman@sullivan run]$ time mpirun -np 22 ./wrf.exe
real 147m49.293s
user 3245m12.477s
sys 3m33.565s
slonin@deleyva:~/spoa/scripts/matlab/gfs$ diff -u GFS_area51.m GFS.m
--- GFS_area51.m 2017-09-19 14:55:30.000000000 -0500
+++ GFS.m 2017-09-12 16:43:54.739817483 -0500
@@ -5,19 +5,22 @@
clear all
clc
-addpath('/spoa/scripts/matlab/gfs/nctoolbox2.0')
-addpath('/spoa/scripts/matlab/gfs/mexcdf')
+%addpath('/home/slonin/spoa/scripts/matlab/gfs/nctoolbox2.0')
+addpath('/home/slonin/spoa/scripts/matlab/gfs/nctoolbox-1.1.3')
+addpath('/home/slonin/spoa/scripts/matlab/gfs/mexcdf/netcdf_toolbox/netcdf')
+addpath('/home/slonin/spoa/scripts/matlab/gfs/mexcdf/netcdf_toolbox/netcdf/nctype')
+addpath('/home/slonin/spoa/scripts/matlab/gfs/mexcdf/netcdf_toolbox/netcdf/ncutility')
setup_nctoolbox
-punto=xlsread('puntos.xls');
+punto=xlsread('puntos02.xls');
punto(:,3)=punto(:,2)+360;
-PATH ='/home/slonin/WRFV33/WPS/GFS_DATA/';
-PATH_H = '/spoa/data/caribwam/';
+PATH ='/home/slonin/spoa/data/wrf/gfs/';
+PATH_H = '/home/slonin/spoa/data/caribwam/';
load lat_mtlb.dat
load lon_mtlb.dat
fecha =datevec(now);
-horas = 12:6:54;
+horas = [12,18,24,30];
mTEM=[];mHUM=[];mdir=[];mspd=[];mPRE=[];mNUB=[];
for j=1:size(horas,2)
@@ -29,16 +32,16 @@
ds=ncgeodataset(grib);
% ds.variables
%Precipitacion
-PRE = 'Total_precipitation';
+PRE = 'Total_precipitation_surface_6_Hour_Accumulation';
%Cobertura nubosa
-NUB = 'Total_cloud_cover_entire_atmosphere';
+NUB = 'Total_cloud_cover_entire_atmosphere_6_Hour_Average';
%Temperatura
TEM = 'Temperature_surface';
%Humedad
HUM = 'Relative_humidity_height_above_ground';
%Viento
-Uw = 'U-component_of_wind_height_above_ground';
-Vw = 'V-component_of_wind_height_above_ground';
+Uw = 'u-component_of_wind_height_above_ground';
+Vw = 'v-component_of_wind_height_above_ground';
%Niv = 'height_above_ground5';
%LECTURA DE VARIABLES
@@ -80,14 +83,16 @@
clear lat lon u10 v10 HUM TEM PRE NUB ur vr dir spd Uw Vw
end
-tiempo=[7,13,19,25,31,37,43,49]';tim =repmat(tiempo,6,1);
+tiempo=[7,13,19,1]';tim =repmat(tiempo,6,1);
M = [mNUB;mPRE;mTEM;mHUM;mdir;mspd];M= [tim M];
+
clear mNUB mPRE mTEM mHUM mdir mspd tim ind ind1 i grib
clear pTEM pHUM pdir pspd pPRE pNUB
-tpron=['012';'024';'036';'048'];mph=[];mpd=[];
-for j=1:length(tpron)
+tpron=['012';'024';'036'];mph=[];mpd=[];
+
+for j=1:3
file=[PATH_H 'hw' tpron(j,:) '_mtlb.dat'];
hw=load(file);%abro archivo
%Separo la altura de la ola de la direccion
@@ -103,52 +108,53 @@
end
end
- for l=1:6
+ for l=1:6
hind = find(lon_mtlb>=punto(l,2)-0.09 & lon_mtlb<=punto(l,2)+0.09 & lat_mtlb>=punto(l,1)-0.09 & lat_mtlb<=punto(l,1)+0.09);
- if isempty(hind)
+ if isempty(hind)
else
ph = hw(hind);
dir = direc(hind);
mpd=[mpd dir];
mph=[mph ph];
- end
+ end
end
end
-clear i j l tpron hw horas hind ftime direc lon_mtlb lat_mtlb ds ph dir
-ze = zeros(8,18);
+clear i j l tpron hw horas hind ftime direc lon_mtlb lat_mtlb ds ph dir
-mph=[mph(:,1:6);mph(:,1:6);mph(:,7:12);mph(:,7:12);mph(:,13:18);mph(:,13:18);...
- mph(:,19:end);mph(:,19:end)];mph=[mph ze];
+ze = zeros(4,21);
-mpd=[mpd(:,1:6);mpd(:,1:6);mpd(:,7:12);mpd(:,7:12);mpd(:,13:18);mpd(:,13:18);...
- mpd(:,19:end);mpd(:,19:end)];mpd=[mpd ze];
+mph=[mph(:,1:6);mph(:,1:6);mph(:,7:12);mph(:,13:end)];mph=[mph ze];
+mpd=[mpd(:,1:6);mpd(:,1:6);mpd(:,7:12);mpd(:,13:end)];mpd=[mpd ze];
-%p = (0:1:24);VAR = {'PUNTOS','NUBOSIDAD','PRECIPITA','TEMPERATU','HUMEDAD','DIRVIENTO','MAGVIENTO','ALTURAOLA','DIROLA'}';
-p = (0:1:24);VAR = {'FEC','PUNT','NUBO','PREC','TEMP','HUME','DIRV','MAGV','ALTU','DIRO'}';
+p = (0:1:27);VAR = {'FEC','PUNTOS','NUBOSIDAD','PRECIPITA','TEMPERATU','HUMEDAD','DIRVIENTO','MAGVIENTO','ALTURAOLA','DIROLA'}';
+%p = (0:1:27);VAR = {'FEC','PUNT','NUBO','PREC','TEMP','HUME','DIRV','MAGV','ALTU','DIRO'}';
con=2;
NAME={VAR{1:2,1}};NAME=(NAME)';
for i=3:10
-
- for j=1:8
- con=con+1;
+ for j=1:4
+ con=con+1
NAME{con,1} = VAR{i,1};
end
end
-NAME = char(NAME); Mfe = zeros(1,25);Mfe(1,1:3)= fecha(1,1:3);
+NAME = char(NAME); Mfe = zeros(1,28);Mfe(1,1:3)= fecha(1,1:3); %24 rows from puntos.xls
+%NAME = char(NAME); Mfe = zeros(1,28);Mfe(1,1:3)= fecha(1,1:3);
-M = [M; tiempo mph;tiempo mpd];M=[p;M];M=[Mfe;M];
+M = [M; tiempo mph;tiempo mpd];
+M=[p;M];M=[Mfe;M];
MF = [NAME num2str(M)];
for i=1:size(MF,1)
-FID = fopen('datapronarc.dat','a');
+
+ FID = fopen('datapronarc.dat','a');
fprintf(FID,'%s \r\n',MF(i,:));
end
- fclose(FID);
+
+fclose(FID);
Comments