m0n0lithic

LFS 7.9: pre-toolchain,toolchain,builds

Apr 28th, 2016
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 187.43 KB | None | 0 0
  1. http://www.linuxfromscratch.org/lfs/view/stable/chapter05/introduction.html
  2. http://www.linuxfromscratch.org/lfs/view/stable/chapter04/creatingtoolsdir.html
  3.  
  4. 2.4. Setting The $LFS Variable
  5. $ sudo mkdir /monster
  6.  
  7. $ sudo su
  8. # export LFS=/monster
  9.  
  10. $ sudo mkdir -v $LFS/sources
  11. $ sudo chmod -v a+wt $LFS/sources
  12. mode of ‘/monster/sources’ changed from 0755 (rwxr-xr-x) to 1777 (rwxrwxrwt)
  13.  
  14.  
  15. An easy way to download all of the packages and patches is by using wget-list as an input to wget. For example:
  16. wget --input-file=wget-list --continue --directory-prefix=$LFS/sources
  17.  
  18. wget -c http://www.linuxfromscratch.org/lfs/view/stable/md5sums
  19.  
  20. mkdir -v $LFS/tools
  21.  
  22. $ sudo ln -sv $LFS/tools /
  23. [sudo] password for wilderman:
  24. ‘/tools’ -> ‘/monster/tools’
  25.  
  26. $ sudo groupadd lfs
  27. $ sudo useradd -s /bin/bash -g lfs -m -k /dev/null lfs
  28.  
  29. $ sudo passwd lfs
  30. Changing password for user lfs.
  31. New password: 73575981.,.
  32. Retype new password: 73575981.,.
  33. passwd: all authentication tokens updated successfully.
  34.  
  35. $ sudo chown -v lfs $LFS/tools
  36. changed ownership of ‘/monster/tools’ from wilderman to lfs
  37.  
  38. $ sudo sudo chown -v lfs $LFS/sources
  39. changed ownership of ‘/monster/sources’ from root to lfs
  40.  
  41. $ su - lfs
  42. Password:
  43. -bash-4.2$
  44.  
  45.  
  46. 4.5. About SBUs
  47. http://www.linuxfromscratch.org/lfs/view/stable/chapter04/aboutsbus.html
  48. lfs:~$ export MAKEFLAGS='-j 64'
  49.  
  50. http://www.linuxfromscratch.org/lfs/view/stable/chapter05/chapter05.html
  51. lfs:~/sources/binutils-2.26$ ./config.guess
  52. x86_64-pc-linux-gnu
  53.  
  54. 5.4. Binutils-2.26 - Pass 1
  55. 5.4.1. Installation of Cross Binutils
  56. http://www.linuxfromscratch.org/lfs/view/stable/chapter05/binutils-pass1.html
  57. mkdir -v build
  58. cd build
  59. lfs:~/sources/binutils-2.26$ mkdir build
  60. lfs:~/sources/binutils-2.26$ cd build/
  61.  
  62. ../configure --prefix=/tools --with-sysroot=$LFS --target=$LFS_TGT --disable-nls --disable-werror
  63.  
  64. If building on x86_64, create a symlink to ensure the sanity of the toolchain:
  65. $ case $(uname -m) in
  66. > x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;;
  67. > esac
  68. mkdir: created directory '/tools/lib'
  69. '/tools/lib64' -> 'lib'
  70.  
  71. 5.5. GCC-5.3.0 - Pass 1
  72. 5.5.1. Installation of Cross GCC
  73. lfs:~/sources$ tar xjf /monster/sources/gcc-5.3.0.tar.bz2
  74. lfs:~/sources/gcc-5.3.0$ tar -xf /monster/sources/mpfr-3.1.3.tar.xz
  75. $ mv -v mpfr-3.1.3 mpfr
  76. 'mpfr-3.1.3' -> 'mpfr'
  77. $ tar -xf /monster/sources/gmp-6.1.0.tar.xz
  78. lfs:~/sources/gcc-5.3.0$ mv -v gmp-6.1.0 gmp
  79. 'gmp-6.1.0' -> 'gmp'
  80. $ tar -xf /monster/sources/mpc-1.0.3.tar.gz
  81. $ mv mpc-1.0.3 mpc
  82.  
  83. 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:
  84.  
  85. for file in \
  86. $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
  87. do
  88. cp -uv $file{,.orig}
  89. sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
  90. -e 's@/usr@/tools@g' $file.orig > $file
  91. echo '
  92. #undef STANDARD_STARTFILE_PREFIX_1
  93. #undef STANDARD_STARTFILE_PREFIX_2
  94. #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
  95. #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
  96. touch $file.orig
  97.  
  98. 'gcc/config/tilepro/linux.h' -> 'gcc/config/tilepro/linux.h.orig'
  99. 'gcc/config/ia64/sysv4.h' -> 'gcc/config/ia64/sysv4.h.orig'
  100. 'gcc/config/ia64/linux.h' -> 'gcc/config/ia64/linux.h.orig'
  101. 'gcc/config/nios2/linux.h' -> 'gcc/config/nios2/linux.h.orig'
  102. 'gcc/config/frv/linux.h' -> 'gcc/config/frv/linux.h.orig'
  103. 'gcc/config/mn10300/linux.h' -> 'gcc/config/mn10300/linux.h.orig'
  104. 'gcc/config/sparc/linux64.h' -> 'gcc/config/sparc/linux64.h.orig'
  105. 'gcc/config/sparc/sysv4.h' -> 'gcc/config/sparc/sysv4.h.orig'
  106. 'gcc/config/sparc/linux.h' -> 'gcc/config/sparc/linux.h.orig'
  107. 'gcc/config/microblaze/linux.h' -> 'gcc/config/microblaze/linux.h.orig'
  108. 'gcc/config/m68k/linux.h' -> 'gcc/config/m68k/linux.h.orig'
  109. 'gcc/config/sh/linux.h' -> 'gcc/config/sh/linux.h.orig'
  110. 'gcc/config/tilegx/linux.h' -> 'gcc/config/tilegx/linux.h.orig'
  111. 'gcc/config/s390/linux.h' -> 'gcc/config/s390/linux.h.orig'
  112. 'gcc/config/alpha/linux.h' -> 'gcc/config/alpha/linux.h.orig'
  113. 'gcc/config/i386/linux64.h' -> 'gcc/config/i386/linux64.h.orig'
  114. 'gcc/config/i386/sysv4.h' -> 'gcc/config/i386/sysv4.h.orig'
  115. 'gcc/config/i386/linux.h' -> 'gcc/config/i386/linux.h.orig'
  116. 'gcc/config/vax/linux.h' -> 'gcc/config/vax/linux.h.orig'
  117. 'gcc/config/m32r/linux.h' -> 'gcc/config/m32r/linux.h.orig'
  118. 'gcc/config/cris/linux.h' -> 'gcc/config/cris/linux.h.orig'
  119. 'gcc/config/mips/linux.h' -> 'gcc/config/mips/linux.h.orig'
  120. 'gcc/config/xtensa/linux.h' -> 'gcc/config/xtensa/linux.h.orig'
  121. 'gcc/config/bfin/linux.h' -> 'gcc/config/bfin/linux.h.orig'
  122. 'gcc/config/linux.h' -> 'gcc/config/linux.h.orig'
  123. 'gcc/config/rs6000/linux64.h' -> 'gcc/config/rs6000/linux64.h.orig'
  124. 'gcc/config/rs6000/sysv4.h' -> 'gcc/config/rs6000/sysv4.h.orig'
  125. 'gcc/config/rs6000/linux.h' -> 'gcc/config/rs6000/linux.h.orig'
  126.  
  127. lfs:~/sources/gcc-5.3.0$ mkdir -v build
  128. mkdir: created directory 'build'
  129.  
  130. lfs:~/sources/gcc-5.3.0$ mkdir -v build
  131. mkdir: created directory 'build'
  132. $ cd build
  133.  
  134. ../configure \
  135. --target=$LFS_TGT \
  136. --prefix=/tools \
  137. --with-glibc-version=2.11 \
  138. --with-sysroot=$LFS \
  139. --with-newlib \
  140. --without-headers \
  141. --with-local-prefix=/tools \
  142. --with-native-system-header-dir=/tools/include \
  143. --disable-nls \
  144. --disable-shared \
  145. --disable-multilib \
  146. --disable-decimal-float \
  147. --disable-threads \
  148. --disable-libatomic \
  149. --disable-libgomp \
  150. --disable-libquadmath \
  151. --disable-libssp \
  152. --disable-libvtv \
  153. --disable-libstdcxx \
  154. --enable-languages=c,c++
  155.  
  156. Compile GCC by running:
  157. time make
  158. real 2m3.648s
  159. user 20m55.263s
  160. sys 2m31.014s
  161.  
  162. Install the package:
  163. make install
  164.  
  165. 5.6.1. Installation of Linux API Headers
  166. Make sure there are no stale files embedded in the package:
  167.  
  168. make mrproper
  169. 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.
  170.  
  171. make INSTALL_HDR_PATH=dest headers_install
  172. cp -rv dest/include/* /tools/include
  173.  
  174. 5.7.1. Installation of Glibc
  175. $ tar -xf /monster/sources/glibc-2.23.tar.xz
  176. lfs:~/sources$ cd glibc-2.23/
  177. lfs:~/sources/glibc-2.23$ mkdir -v build
  178. mkdir: created directory 'build'
  179. ../configure \
  180. --prefix=/tools \
  181. --host=$LFS_TGT \
  182. --build=$(../scripts/config.guess) \
  183. --disable-profile \
  184. --enable-kernel=2.6.32 \
  185. --enable-obsolete-rpc \
  186. --with-headers=/tools/include \
  187. libc_cv_forced_unwind=yes \
  188. libc_cv_ctors_header=yes \
  189. libc_cv_c_cleanup=yes
  190.  
  191. Compile the package:
  192. make -j64
  193. Install the package:
  194. make install
  195.  
  196. Caution
  197. 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:
  198.  
  199. echo 'int main(){}' > dummy.c
  200. $LFS_TGT-gcc dummy.c
  201. readelf -l a.out | grep ': /tools'
  202.  
  203. lfs:~/sources/glibc-2.23/build$ readelf -l a.out | grep ': /tools'
  204. [Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
  205.  
  206. $ rm -v dummy.c a.out
  207. removed 'dummy.c'
  208. removed 'a.out'
  209.  
  210. 5.8.1. Installation of Target Libstdc++
  211. lfs:~/sources/gcc-5.3.0$ cd libstdc++-v3/
  212. lfs:~/sources/gcc-5.3.0/libstdc++-v3$ mkdir -v build
  213.  
  214. ../libstdc++-v3/configure \
  215. --host=$LFS_TGT \
  216. --prefix=/tools \
  217. --disable-multilib \
  218. --disable-nls \
  219. --disable-libstdcxx-threads \
  220. --disable-libstdcxx-pch \
  221. --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/5.3.0
  222.  
  223. $ make
  224. $ make install
  225.  
  226. 5.9. Binutils-2.26 - Pass 2
  227. CC=$LFS_TGT-gcc \
  228. AR=$LFS_TGT-ar \
  229. RANLIB=$LFS_TGT-ranlib \
  230. ../configure \
  231. --prefix=/tools \
  232. --disable-nls \
  233. --disable-werror \
  234. --with-lib-path=/tools/lib \
  235. --with-sysroot
  236.  
  237. lfs:~/sources/binutils-2.26/build$ make
  238.  
  239. Install the package:
  240. make install
  241.  
  242. Now prepare the linker for the “Re-adjusting” phase in the next chapter:
  243. make -C ld clean
  244. make -C ld LIB_PATH=/usr/lib:/lib
  245. cp -v ld/ld-new /tools/bin
  246.  
  247. 5.10. GCC-5.3.0 - Pass 2
  248. 5.10.1. Installation of GCC
  249. lfs:~/sources$ tar xjf /monster/sources/gcc-5.3.0.tar.bz2
  250. lfs:~/sources/gcc-5.3.0$ cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
  251. > `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/include-fixed/limits.h
  252.  
  253.  
  254. Once again, change the location of GCC's default dynamic linker to use the one installed in /tools.
  255.  
  256. for file in \
  257. $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
  258. do
  259. cp -uv $file{,.orig}
  260. sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
  261. -e 's@/usr@/tools@g' $file.orig > $file
  262. echo '
  263. #undef STANDARD_STARTFILE_PREFIX_1
  264. #undef STANDARD_STARTFILE_PREFIX_2
  265. #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
  266. #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
  267. touch $file.orig
  268. done
  269.  
  270. 'gcc/config/tilepro/linux.h' -> 'gcc/config/tilepro/linux.h.orig'
  271. 'gcc/config/ia64/sysv4.h' -> 'gcc/config/ia64/sysv4.h.orig'
  272. 'gcc/config/ia64/linux.h' -> 'gcc/config/ia64/linux.h.orig'
  273. 'gcc/config/nios2/linux.h' -> 'gcc/config/nios2/linux.h.orig'
  274. 'gcc/config/frv/linux.h' -> 'gcc/config/frv/linux.h.orig'
  275. 'gcc/config/mn10300/linux.h' -> 'gcc/config/mn10300/linux.h.orig'
  276. 'gcc/config/sparc/linux64.h' -> 'gcc/config/sparc/linux64.h.orig'
  277. 'gcc/config/sparc/sysv4.h' -> 'gcc/config/sparc/sysv4.h.orig'
  278. 'gcc/config/sparc/linux.h' -> 'gcc/config/sparc/linux.h.orig'
  279. 'gcc/config/microblaze/linux.h' -> 'gcc/config/microblaze/linux.h.orig'
  280. 'gcc/config/m68k/linux.h' -> 'gcc/config/m68k/linux.h.orig'
  281. 'gcc/config/sh/linux.h' -> 'gcc/config/sh/linux.h.orig'
  282. 'gcc/config/tilegx/linux.h' -> 'gcc/config/tilegx/linux.h.orig'
  283. 'gcc/config/s390/linux.h' -> 'gcc/config/s390/linux.h.orig'
  284. 'gcc/config/alpha/linux.h' -> 'gcc/config/alpha/linux.h.orig'
  285. 'gcc/config/i386/linux64.h' -> 'gcc/config/i386/linux64.h.orig'
  286. 'gcc/config/i386/sysv4.h' -> 'gcc/config/i386/sysv4.h.orig'
  287. 'gcc/config/i386/linux.h' -> 'gcc/config/i386/linux.h.orig'
  288. 'gcc/config/vax/linux.h' -> 'gcc/config/vax/linux.h.orig'
  289. 'gcc/config/m32r/linux.h' -> 'gcc/config/m32r/linux.h.orig'
  290. 'gcc/config/cris/linux.h' -> 'gcc/config/cris/linux.h.orig'
  291. 'gcc/config/mips/linux.h' -> 'gcc/config/mips/linux.h.orig'
  292. 'gcc/config/xtensa/linux.h' -> 'gcc/config/xtensa/linux.h.orig'
  293. 'gcc/config/bfin/linux.h' -> 'gcc/config/bfin/linux.h.orig'
  294. 'gcc/config/linux.h' -> 'gcc/config/linux.h.orig'
  295. 'gcc/config/rs6000/linux64.h' -> 'gcc/config/rs6000/linux64.h.orig'
  296. 'gcc/config/rs6000/sysv4.h' -> 'gcc/config/rs6000/sysv4.h.orig'
  297. 'gcc/config/rs6000/linux.h' -> 'gcc/config/rs6000/linux.h.orig'
  298.  
  299. lfs:~/sources/gcc-5.3.0$ tar -xf /monster/sources/mpfr-3.1.3.tar.xz
  300. mv -v mpfr-3.1.3 mpfr
  301. tar -xf ../gmp-6.1.0.tar.xz
  302. mv -v gmp-6.1.0 gmp
  303. tar -xf ../mpc-1.0.3.tar.gz
  304. mv -v mpc-1.0.3 mpc
  305.  
  306. lfs:~/sources/gcc-5.3.0$ mkdir -v build
  307. lfs:~/sources/gcc-5.3.0$ cd build
  308. Before starting to build GCC, remember to unset any environment variables that override the default optimization flags.
  309.  
  310. Now prepare GCC for compilation:
  311.  
  312. CC=$LFS_TGT-gcc \
  313. CXX=$LFS_TGT-g++ \
  314. AR=$LFS_TGT-ar \
  315. RANLIB=$LFS_TGT-ranlib \
  316. ../configure \
  317. --prefix=/tools \
  318. --with-local-prefix=/tools \
  319. --with-native-system-header-dir=/tools/include \
  320. --enable-languages=c,c++ \
  321. --disable-libstdcxx-pch \
  322. --disable-multilib \
  323. --disable-bootstrap \
  324. --disable-libgomp
  325.  
  326. lfs:~/sources/gcc-5.3.0/build$ time make
  327. real 21m45.295s
  328. user 17m54.075s
  329. sys 3m18.301s
  330.  
  331. Install the package:
  332. make install
  333.  
  334. 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:
  335. lfs:~/sources/gcc-5.3.0/build$ ln -sv gcc /tools/bin/cc
  336. '/tools/bin/cc' -> 'gcc'
  337.  
  338. Caution
  339. 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:
  340. lfs:~/sources/gcc-5.3.0/build$ echo 'int main(){}' > dummy.c
  341. lfs:~/sources/gcc-5.3.0/build$ cc dummy.c
  342. lfs:~/sources/gcc-5.3.0/build$ readelf -l a.out | grep ': /tools'
  343. [Requesting program interpreter: /tools/lib64/ld-linux-x86-64.so.2]
  344.  
  345. Once all is well, clean up the test files:
  346. rm -v dummy.c a.out
  347.  
  348. 5.11. Tcl-core-8.6.4
  349. 5.11.1. Installation of Tcl-core
  350. Prepare Tcl for compilation:
  351. cd unix
  352. ./configure --prefix=/tools
  353. Build the package:
  354. make
  355.  
  356. 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:
  357. TZ=UTC make test
  358.  
  359. Install the package:
  360.  
  361. make install
  362. Make the installed library writable so debugging symbols can be removed later:
  363.  
  364. chmod -v u+w /tools/lib/libtcl8.6.so
  365.  
  366. Install Tcl's headers. The next package, Expect, requires them to build.
  367.  
  368. $ make install-private-headers
  369. Installing private header files to /tools/include/
  370.  
  371. Now make a necessary symbolic link:
  372. lfs:~/sources/tcl8.6.4/unix$ ln -sv tclsh8.6 /tools/bin/tclsh
  373. '/tools/bin/tclsh' -> 'tclsh8.6'
  374.  
  375. 5.12.1. Installation of Expect
  376. lfs:~/sources/expect5.45$ cp -v configure{,.orig}
  377. 'configure' -> 'configure.orig'
  378.  
  379. lfs:~/sources/expect5.45$ cp -v configure{,.orig}
  380. 'configure' -> 'configure.orig'
  381. lfs:~/sources/expect5.45$ sed 's:/usr/local/bin:/bin:' configure.orig > configure
  382.  
  383. Now prepare Expect for compilation:
  384. ./configure --prefix=/tools \
  385. --with-tcl=/tools/lib \
  386. --with-tclinclude=/tools/include
  387.  
  388. Build the package:
  389. make
  390.  
  391. Install the package:
  392. make SCRIPTS="" install
  393.  
  394. lfs:~/sources/expect5.45$ ldd /tools/bin/expect
  395. linux-vdso.so.1 (0x00007ffe7df51000)
  396. libexpect5.45.so => /tools/lib/expect5.45/libexpect5.45.so (0x00007fe8e6af4000)
  397. libtcl8.6.so => /tools/lib/libtcl8.6.so (0x00007fe8e6734000)
  398. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fe8e6530000)
  399. libm.so.6 => /tools/lib/libm.so.6 (0x00007fe8e622b000)
  400. libc.so.6 => /tools/lib/libc.so.6 (0x00007fe8e5e8a000)
  401. libutil.so.1 => /tools/lib/libutil.so.1 (0x00007fe8e5c87000)
  402. libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007fe8e5a6a000)
  403. /tools/lib64/ld-linux-x86-64.so.2 (0x00007fe8e6d25000)
  404.  
  405. 5.13.1. Installation of DejaGNU
  406. lfs:~/sources$ tar xzf /monster/sources/dejagnu-1.5.3.tar.gz
  407. Prepare DejaGNU for compilation:
  408. ./configure --prefix=/tools
  409.  
  410. 5.14.1. Installation of Check
  411. lfs:~/sources$ tar xzf /monster/sources/check-0.10.0.tar.gz
  412.  
  413. PKG_CONFIG= ./configure --prefix=/tools
  414.  
  415. Build the package:
  416. make
  417.  
  418. lfs:~/sources/check-0.10.0$ make check
  419. make install
  420.  
  421. 5.15.1. Installation of Ncurses
  422. lfs:~/sources$ tar xzf /monster/sources/ncurses-6.0.tar.gz
  423. lfs:~/sources/ncurses-6.0$ sed -i s/mawk// configure
  424. ./configure --prefix=/tools \
  425. --with-shared \
  426. --without-debug \
  427. --without-ada \
  428. --enable-widec \
  429. --enable-overwrite
  430.  
  431. ** Configuration summary for NCURSES 6.0 20150808:
  432.  
  433. extended funcs: yes
  434. xterm terminfo: xterm-new
  435.  
  436. bin directory: /tools/bin
  437. lib directory: /tools/lib
  438. include directory: /tools/include
  439. man directory: /tools/share/man
  440. terminfo directory: /tools/share/terminfo
  441.  
  442. Compile the package:
  443. make
  444. Install the package:
  445. make install
  446.  
  447. 5.16.1. Installation of Bash
  448. lfs:~/sources$ tar xzf /monster/sources/bash-4.3.30.tar.gz
  449.  
  450. HowTo Apply a Patch File To My Linux / UNIX Source Code
  451. http://www.cyberciti.biz/faq/appy-patch-file-using-patch-command/
  452. patch command syntax
  453.  
  454. The basic syntax is as follows:
  455. $ patch < patch.file $ patch source.code.file < patch.file $ patch -p LEVEL < {/path/to/patch/file}
  456.  
  457. To apply a patch, one could run the following command in a shell:
  458. $ patch < /path/to/file
  459.  
  460. ./configure --prefix=/tools --without-bash-malloc
  461. Compile the package:
  462. make
  463. make tests
  464. make install
  465. $ ln -sv bash /tools/bin/sh
  466. '/tools/bin/sh' -> 'bash'
  467.  
  468. 5.17.1. Installation of Bzip2
  469. $ tar xzf /monster/sources/bzip2-1.0.6.tar.gz
  470. lfs:~/sources/bzip2-1.0.6$ patch -p1 < /monster/sources/bzip2-1.0.6-install_docs-1.patch
  471. patching file Makefile
  472. make
  473. make PREFIX=/tools install
  474.  
  475. 5.18.1. Installation of Coreutils
  476. lfs:~/sources$ tar xf /monster/sources/coreutils-8.25.tar.xz
  477. lfs:~/sources/coreutils-8.25$ make
  478. make RUN_EXPENSIVE_TESTS=yes check
  479. make install
  480.  
  481. 5.19.1. Installation of Diffutils
  482. ./configure --prefix=/tools
  483. make
  484. make check
  485. make install
  486.  
  487. 5.20.1. Installation of File
  488. lfs:~/sources$ tar xf /monster/sources/file-5.25.tar.gz
  489. lfs:~/sources$ ./configure --prefix=/tools
  490. lfs:~/sources$ make
  491. lfs:~/sources$ make check
  492. lfs:~/sources$ make install
  493.  
  494. 5.21.1. Installation of Findutils
  495. lfs:~/sources$ tar xf /monster/sources/findutils-4.6.0.tar.gz
  496. $ ./configure --prefix=/tools
  497. $ make
  498. $ make check
  499. $ make install
  500.  
  501. 5.22.1. Installation of Gawk
  502. lfs:~/sources$ tar xf /monster/sources/gawk-4.1.3.tar.xz
  503. lfs:~/sources/gawk-4.1.3$ ./configure --prefix=/tools
  504. $ make
  505. $ make check
  506. $ make install
  507.  
  508. 5.23.1. Installation of Gettext
  509. lfs:~/sources$ tar xf /monster/sources/gettext-0.19.7.tar.xz
  510. lfs:~/sources$ cd gettext-0.19.7/gettext-tools/
  511. EMACS="no" ./configure --prefix=/tools --disable-shared
  512. make -C gnulib-lib
  513. make -C intl pluralx.c
  514. make -C src msgfmt
  515. make -C src msgmerge
  516. make -C src xgettext
  517.  
  518. Install the msgfmt, msgmerge and xgettext programs:
  519. cp -v src/{msgfmt,msgmerge,xgettext} /tools/bin
  520. 'src/msgfmt' -> '/tools/bin/msgfmt'
  521. 'src/msgmerge' -> '/tools/bin/msgmerge'
  522. 'src/xgettext' -> '/tools/bin/xgettext'
  523.  
  524. 5.24.1. Installation of Grep
  525. lfs:~/sources$ tar xf /monster/sources/grep-2.23.tar.xz
  526. ./configure --prefix=/tools
  527. make
  528. make check
  529. make install
  530.  
  531. 5.25.1. Installation of Gzip
  532. lfs:~/sources$ tar xf /monster/sources/gzip-1.6.tar.xz
  533. ./configure --prefix=/tools
  534. make
  535. make check
  536. make install
  537.  
  538. 5.26.1. Installation of M4
  539. lfs:~/sources$ tar xf /monster/sources/m4-1.4.17.tar.xz
  540. ./configure --prefix=/tools
  541. make
  542. make check
  543. make install
  544.  
  545. 5.27.1. Installation of Make
  546. $ tar xf /monster/sources/make-4.1.tar.bz2
  547. make
  548. make check
  549. ------------------------------------------------------------------------------
  550. Running tests for GNU make on Linux sullivan.dimar.mil.co 3.10.0-327.13.1.el7.x86_64 x86_64
  551. GNU Make 4.1
  552. ------------------------------------------------------------------------------
  553.  
  554. Finding tests...
  555.  
  556. ===========================================================================
  557. Regression PASSED: GNU Make 4.1 (x86_64-unknown-linux-gnu) built with gcc
  558. ===========================================================================
  559.  
  560. make install
  561.  
  562. 5.28.1. Installation of Patch
  563. lfs:~/sources$ tar xf /monster/sources/patch-2.7.5.tar.xz
  564.  
  565. 5.29.1. Installation of Perl
  566. lfs:~/sources$ tar xf /monster/sources/perl-5.22.1.tar.bz2
  567. make
  568. $ cp -v perl cpan/podlators/pod2man /tools/bin
  569. 'perl' -> '/tools/bin/perl'
  570. 'cpan/podlators/pod2man' -> '/tools/bin/pod2man'
  571. $ mkdir -pv /tools/lib/perl5/5.22.1
  572. mkdir: created directory '/tools/lib/perl5'
  573. mkdir: created directory '/tools/lib/perl5/5.22.1'
  574. cp -Rv lib/* /tools/lib/perl5/5.22.1
  575.  
  576. 5.30.1. Installation of Sed
  577. lfs:~/sources$ tar xf /monster/sources/sed-4.2.2.tar.bz2
  578. ./configure --prefix=/tools
  579. $ make
  580. $ make check
  581. $ make install
  582.  
  583.  
  584. 5.31.1. Installation of Tar
  585. lfs:~/sources$ tar xf /monster/sources/tar-1.28.tar.xz
  586. $ cd tar-1.28/
  587. ./configure --prefix=/tools
  588. make
  589. make check
  590. make install
  591.  
  592. 5.32.1. Installation of Texinfo
  593. $ tar xf /monster/sources/texinfo-6.1.tar.xz
  594. ./configure --prefix=/tools
  595. make
  596. make check
  597. make install
  598.  
  599. 5.33.1. Installation of Util-linux
  600. $ wget -c https://www.kernel.org/pub/linux/utils/util-linux/v2.27/util-linux-2.27.1.tar.xz
  601. $ tar xf /monster/sources/util-linux-2.27.1.tar.xz
  602. ./configure --prefix=/tools \
  603. --without-python \
  604. --disable-makeinstall-chown \
  605. --without-systemdsystemunitdir \
  606. PKG_CONFIG=""
  607.  
  608. make
  609. make install
  610.  
  611. 5.34.1. Installation of Xz
  612. lfs:~/sources$ tar xf /monster/sources/xz-5.2.2.tar.xz
  613. ./configure --prefix=/tools
  614. make
  615. make check
  616. make install
  617.  
  618. 5.35. Stripping
  619. lfs:~/sources$ strip --strip-debug /tools/lib/*
  620. strip: Warning: '/tools/lib/audit' is not an ordinary file
  621. strip: Warning: '/tools/lib/expect5.45' is not an ordinary file
  622. strip: Warning: '/tools/lib/gawk' is not an ordinary file
  623. strip: Warning: '/tools/lib/gcc' is not an ordinary file
  624. strip: Warning: '/tools/lib/gconv' is not an ordinary file
  625. strip: Warning: '/tools/lib/itcl4.0.3' is not an ordinary file
  626. strip:/tools/lib/libasan.la: File format not recognized
  627. strip:/tools/lib/libatomic.la: File format not recognized
  628. strip:/tools/lib/libbfd.la: File format not recognized
  629. strip:/tools/lib/libblkid.la: File format not recognized
  630. strip:/tools/lib/libc.so: File format not recognized
  631. strip:/tools/lib/libcc1.la: File format not recognized
  632. strip:/tools/lib/libcheck.la: File format not recognized
  633. strip:/tools/lib/libcilkrts.la: File format not recognized
  634. strip:/tools/lib/libcilkrts.spec: File format not recognized
  635. strip:/tools/lib/libfdisk.la: File format not recognized
  636.  
  637. 5.36. Changing Ownership
  638. chown -R root:root $LFS/tools
  639.  
  640. ===========================================================================
  641. III. Building the LFS System
  642. ===========================================================================
  643.  
  644. 6.2. Preparing Virtual Kernel File Systems
  645.  
  646. [wilderman@sullivan sources]$ mkdir -pv $LFS/{dev,proc,sys,run}
  647. mkdir: created directory ‘/monster/dev’
  648. mkdir: created directory ‘/monster/proc’
  649. mkdir: created directory ‘/monster/sys’
  650. mkdir: created directory ‘/monster/run’
  651.  
  652. 6.2.1. Creating Initial Device Nodes
  653. [wilderman@sullivan sources]$ sudo mknod -m 600 $LFS/dev/console c 5 1
  654. [wilderman@sullivan sources]$ sudo mknod -m 666 $LFS/dev/null c 1 3
  655.  
  656. 6.2.2. Mounting and Populating /dev
  657. [wilderman@sullivan sources]$ sudo mount -v --bind /dev $LFS/dev
  658. mount: /dev bound on /monster/dev
  659.  
  660. 6.2.3. Mounting Virtual Kernel File Systems
  661. [wilderman@sullivan sources]$ sudo mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
  662. mount: devpts mounted on /monster/dev/pts.
  663.  
  664. [wilderman@sullivan sources]$ sudo mount -vt proc proc $LFS/proc
  665. mount: proc mounted on /monster/proc.
  666. [wilderman@sullivan sources]$ sudo mount -vt sysfs sysfs $LFS/sys
  667. mount: sysfs mounted on /monster/sys.
  668. [wilderman@sullivan sources]$ sudo mount -vt tmpfs tmpfs $LFS/run
  669. mount: tmpfs mounted on /monster/run.
  670.  
  671. 6.4. Entering the Chroot Environment
  672. 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:
  673.  
  674. chroot "$LFS" /tools/bin/env -i \
  675. HOME=/root \
  676. TERM="$TERM" \
  677. PS1='\u:\w\$ ' \
  678. PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
  679. /tools/bin/bash --login +h
  680.  
  681. 6.5. Creating Directories
  682. I have no name!:/# mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt}
  683. mkdir: created directory '/bin'
  684. mkdir: created directory '/boot'
  685. mkdir: created directory '/etc'
  686. mkdir: created directory '/etc/opt'
  687. mkdir: created directory '/etc/sysconfig'
  688. mkdir: created directory '/home'
  689. mkdir: created directory '/lib'
  690. mkdir: created directory '/lib/firmware'
  691. mkdir: created directory '/mnt'
  692. mkdir: created directory '/opt'
  693.  
  694. mkdir -pv /{media/{floppy,cdrom},sbin,srv,var}
  695. install -dv -m 0750 /root
  696. install -dv -m 1777 /tmp /var/tmp
  697. mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src}
  698. mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man}
  699. mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo}
  700. mkdir -v /usr/libexec
  701. mkdir -pv /usr/{,local/}share/man/man{1..8}
  702.  
  703. case $(uname -m) in
  704. x86_64) ln -sv lib /lib64
  705. ln -sv lib /usr/lib64
  706. ln -sv lib /usr/local/lib64 ;;
  707. esac
  708.  
  709. mkdir -v /var/{log,mail,spool}
  710. ln -sv /run /var/run
  711. ln -sv /run/lock /var/lock
  712. mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local}
  713.  
  714. 6.6. Creating Essential Files and Symlinks
  715. ln -sv /tools/bin/{bash,cat,echo,pwd,stty} /bin
  716. ln -sv /tools/bin/perl /usr/bin
  717. ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
  718. ln -sv /tools/lib/libstdc++.so{,.6} /usr/lib
  719. sed 's/tools/usr/' /tools/lib/libstdc++.la > /usr/lib/libstdc++.la
  720. ln -sv bash /bin/sh
  721.  
  722. ln -sv /proc/self/mounts /etc/mtab
  723.  
  724. Create the /etc/passwd file by running the following command:
  725.  
  726. cat > /etc/passwd << "EOF"
  727. root:x:0:0:root:/root:/bin/bash
  728. bin:x:1:1:bin:/dev/null:/bin/false
  729. daemon:x:6:6:Daemon User:/dev/null:/bin/false
  730. messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false
  731. nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
  732. EOF
  733.  
  734. Create the /etc/group file by running the following command:
  735. cat > /etc/group << "EOF"
  736. root:x:0:
  737. bin:x:1:daemon
  738. sys:x:2:
  739. kmem:x:3:
  740. tape:x:4:
  741. tty:x:5:
  742. daemon:x:6:
  743. floppy:x:7:
  744. disk:x:8:
  745. lp:x:9:
  746. dialout:x:10:
  747. audio:x:11:
  748. video:x:12:
  749. utmp:x:13:
  750. usb:x:14:
  751. cdrom:x:15:
  752. adm:x:16:
  753. messagebus:x:18:
  754. systemd-journal:x:23:
  755. input:x:24:
  756. mail:x:34:
  757. nogroup:x:99:
  758. users:x:999:
  759. EOF
  760.  
  761. 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:
  762.  
  763. exec /tools/bin/bash --login +h
  764.  
  765. touch /var/log/{btmp,lastlog,wtmp}
  766. chgrp -v utmp /var/log/lastlog
  767. chmod -v 664 /var/log/lastlog
  768. chmod -v 600 /var/log/btmp
  769.  
  770. 6.7.1. Installation of Linux API Headers
  771. # tar xf /sources/linux-4.4.2.tar.xz
  772. root:~/lfs/linux-4.4.2# make mrproper
  773.  
  774. 6.8. Man-pages-4.04
  775. root:~/lfs# tar xf /sources/man-pages-4.04.tar.xz
  776. root:~/lfs/man-pages-4.04# make install
  777. for i in man?; do \
  778. install -d -m 755 /usr/share/man/"$i" || exit $?; \
  779. install -m 644 "$i"/* /usr/share/man/"$i" || exit $?; \
  780. done; \
  781.  
  782. 6.9. Glibc-2.23
  783. 6.9.1. Installation of Glibc
  784. root:~/lfs# tar xf /sources/glibc-2.23.tar.xz
  785. 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:
  786.  
  787. patch -Np1 -i ../glibc-2.23-fhs-1.patch
  788.  
  789. root:~/lfs/glibc-2.23# patch -Np1 -i ../glibc-2.23-fhs-1.patch
  790. patching file Makeconfig
  791. Hunk #1 succeeded at 260 (offset 10 lines).
  792. patching file nscd/nscd.h
  793. Hunk #1 succeeded at 161 (offset 49 lines).
  794. patching file nss/db-Makefile
  795. patching file sysdeps/generic/paths.h
  796. patching file sysdeps/unix/sysv/linux/paths.h
  797.  
  798. The Glibc documentation recommends building Glibc in a dedicated build directory:
  799.  
  800. mkdir -v build
  801. cd build
  802. Prepare Glibc for compilation:
  803.  
  804. ../configure --prefix=/usr \
  805. --disable-profile \
  806. --enable-kernel=2.6.32 \
  807. --enable-obsolete-rpc
  808.  
  809.  
  810. Compile the package:
  811. make
  812.  
  813. Important
  814. In this section, the test suite for Glibc is considered critical. Do not skip it under any circumstance.
  815. Generally a few tests do not pass, but you can generally ignore any of the test failures listed below. Now test the build results:
  816. make check
  817. XPASS: elf/tst-protected1a
  818. XPASS: elf/tst-protected1b
  819. FAIL: posix/tst-getaddrinfo4
  820. FAIL: posix/tst-getaddrinfo5
  821. Summary of test results:
  822. 2 FAIL
  823. 2401 PASS
  824. 84 XFAIL
  825. 2 XPASS
  826.  
  827. 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:
  828.  
  829. touch /etc/ld.so.conf
  830. Install the package:
  831. make install
  832.  
  833. Install the configuration file and runtime directory for nscd:
  834.  
  835. cp -v ../nscd/nscd.conf /etc/nscd.conf
  836. mkdir -pv /var/cache/nscd
  837.  
  838. 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.
  839.  
  840. mkdir -pv /usr/lib/locale
  841. localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
  842. localedef -i de_DE -f ISO-8859-1 de_DE
  843. localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
  844. localedef -i de_DE -f UTF-8 de_DE.UTF-8
  845. localedef -i en_GB -f UTF-8 en_GB.UTF-8
  846. localedef -i en_HK -f ISO-8859-1 en_HK
  847. localedef -i en_PH -f ISO-8859-1 en_PH
  848. localedef -i en_US -f ISO-8859-1 en_US
  849. localedef -i en_US -f UTF-8 en_US.UTF-8
  850. localedef -i es_MX -f ISO-8859-1 es_MX
  851. localedef -i fa_IR -f UTF-8 fa_IR
  852. localedef -i fr_FR -f ISO-8859-1 fr_FR
  853. localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
  854. localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
  855. localedef -i it_IT -f ISO-8859-1 it_IT
  856. localedef -i it_IT -f UTF-8 it_IT.UTF-8
  857. localedef -i ja_JP -f EUC-JP ja_JP
  858. localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
  859. localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
  860. localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
  861. localedef -i zh_CN -f GB18030 zh_CN.GB18030
  862.  
  863. In addition, install the locale for your own country, language and character set.
  864.  
  865. 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:
  866.  
  867. make localedata/install-locales
  868.  
  869. 6.9.2. Configuring Glibc
  870.  
  871. 6.9.2.1. Adding nsswitch.conf
  872.  
  873. The /etc/nsswitch.conf file needs to be created because the Glibc defaults do not work well in a networked environment.
  874.  
  875. Create a new file /etc/nsswitch.conf by running the following:
  876.  
  877. cat > /etc/nsswitch.conf << "EOF"
  878. # Begin /etc/nsswitch.conf
  879.  
  880. passwd: files
  881. group: files
  882. shadow: files
  883.  
  884. hosts: files dns
  885. networks: files
  886.  
  887. protocols: files
  888. services: files
  889. ethers: files
  890. rpc: files
  891.  
  892. # End /etc/nsswitch.conf
  893. EOF
  894.  
  895.  
  896. 6.9.2.2. Adding time zone data
  897. tar -xf ../../tzdata2016a.tar.gz
  898.  
  899. ZONEINFO=/usr/share/zoneinfo
  900. mkdir -pv $ZONEINFO/{posix,right}
  901.  
  902. for tz in etcetera southamerica northamerica europe africa antarctica \
  903. asia australasia backward pacificnew systemv; do
  904. zic -L /dev/null -d $ZONEINFO -y "sh yearistype.sh" ${tz}
  905. zic -L /dev/null -d $ZONEINFO/posix -y "sh yearistype.sh" ${tz}
  906. zic -L leapseconds -d $ZONEINFO/right -y "sh yearistype.sh" ${tz}
  907. done
  908.  
  909. cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO
  910. zic -d $ZONEINFO -p America/New_York
  911. unset ZONEINFO
  912.  
  913. root:~/lfs/glibc-2.23/build# tzselect
  914. You can make this change permanent for yourself by appending the line
  915. TZ='UTC-5'; export TZ
  916. to the file '.profile' in your home directory; then log out and log in again.
  917.  
  918. Here is that TZ value again, this time on standard output so that you
  919. can use the /usr/bin/tzselect command in shell scripts:
  920. UTC-5
  921.  
  922. Then create the /etc/localtime file by running:
  923.  
  924. root:~/lfs/glibc-2.23/build# cp -v /usr/share/zoneinfo/UTC /etc/localtime
  925. '/usr/share/zoneinfo/UTC' -> '/etc/localtime'
  926.  
  927. 6.9.2.3. Configuring the Dynamic Loader
  928.  
  929. Create a new file /etc/ld.so.conf by running the following:
  930.  
  931. cat > /etc/ld.so.conf << "EOF"
  932. # Begin /etc/ld.so.conf
  933. /usr/local/lib
  934. /opt/lib
  935.  
  936. EOF
  937.  
  938. cat >> /etc/ld.so.conf << "EOF"
  939. # Add an include directory
  940. include /etc/ld.so.conf.d/*.conf
  941.  
  942. EOF
  943. mkdir -pv /etc/ld.so.conf.d
  944.  
  945.  
  946. 6.9.3. Contents of Glibc
  947. Installed programs:
  948. 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
  949. Installed libraries:
  950. 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}
  951. Installed directories:
  952. /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
  953.  
  954.  
  955. 6.10. Adjusting the Toolchain
  956.  
  957. 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.
  958.  
  959. 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:
  960.  
  961. root:~/lfs/glibc-2.23/build# mv -v /tools/bin/{ld,ld-old}
  962. '/tools/bin/ld' -> '/tools/bin/ld-old'
  963.  
  964. # mv -v /tools/bin/{ld,ld-old}
  965. '/tools/bin/ld' -> '/tools/bin/ld-old'
  966.  
  967. root:~/lfs/glibc-2.23/build# mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
  968. '/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/x86_64-pc-linux-gnu/bin/ld-old'
  969.  
  970. root:~/lfs/glibc-2.23/build# mv -v /tools/bin/{ld-new,ld}
  971. '/tools/bin/ld-new' -> '/tools/bin/ld'
  972.  
  973. root:~/lfs/glibc-2.23/build# ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld
  974. '/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/bin/ld'
  975.  
  976. 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:
  977.  
  978. gcc -dumpspecs | sed -e 's@/tools@@g' \
  979. -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
  980. -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
  981. `dirname $(gcc --print-libgcc-file-name)`/specs
  982.  
  983.  
  984. It is a good idea to visually inspect the specs file to verify the intended change was actually made.
  985.  
  986. 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:
  987.  
  988.  
  989. echo 'int main(){}' > dummy.c
  990. cc dummy.c -v -Wl,--verbose &> dummy.log
  991. root:~# readelf -l a.out | grep ': /lib'
  992. [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
  993.  
  994. There should be no errors, and the output of the last command will be (allowing for platform-specific differences in dynamic linker name):
  995. [Requesting program interpreter: /lib/ld-linux.so.2]
  996.  
  997. Now make sure that we're setup to use the correct start files:
  998. # grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
  999. /usr/lib/../lib64/crt1.o succeeded
  1000. /usr/lib/../lib64/crti.o succeeded
  1001. /usr/lib/../lib64/crtn.o succeeded
  1002.  
  1003. Verify that the compiler is searching for the correct header files:
  1004. grep -B1 '^ /usr/include' dummy.log
  1005. #include <...> search starts here:
  1006. /usr/include
  1007.  
  1008. Next, verify that the new linker is being used with the correct search paths:
  1009.  
  1010. # grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
  1011. SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib64")
  1012. SEARCH_DIR("/usr/lib")
  1013. SEARCH_DIR("/lib")
  1014. SEARCH_DIR("=/tools/x86_64-pc-linux-gnu/lib");
  1015.  
  1016. Next make sure that we're using the correct libc:
  1017. # grep "/lib.*/libc.so.6 " dummy.log
  1018. attempt to open /lib64/libc.so.6 succeeded
  1019.  
  1020. Lastly, make sure GCC is using the correct dynamic linker:
  1021. # grep found dummy.log
  1022. found ld-linux-x86-64.so.2 at /lib64/ld-linux-x86-64.so.2
  1023.  
  1024.  
  1025. 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.
  1026.  
  1027. Once everything is working correctly, clean up the test files:
  1028.  
  1029. rm -v dummy.c a.out dummy.log
  1030.  
  1031. 6.11.1. Installation of Zlib
  1032. root:~/lfs# tar xf /sources/zlib-1.2.8.tar.xz
  1033. root:~/lfs# cd zlib-1.2.8/
  1034. root:~/lfs/zlib-1.2.8# make
  1035. root:~/lfs/zlib-1.2.8# make check
  1036. root:~/lfs/zlib-1.2.8# make install
  1037.  
  1038. The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:
  1039. mv -v /usr/lib/libz.so.* /lib
  1040. '/usr/lib/libz.so.1' -> '/lib/libz.so.1'
  1041. '/usr/lib/libz.so.1.2.8' -> '/lib/libz.so.1.2.8'
  1042.  
  1043. ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so
  1044. '/usr/lib/libz.so' -> '../../lib/libz.so.1.2.8'
  1045.  
  1046. 6.12.1. Installation of File
  1047. ./configure --prefix=/usr
  1048. make
  1049. make check
  1050. make install
  1051.  
  1052. 6.13. Binutils-2.26
  1053. 6.13.1. Installation of Binutils
  1054. Verify that the PTYs are working properly inside the chroot environment by performing a simple test:
  1055. expect -c "spawn ls"
  1056. This command should output the following:
  1057. spawn ls
  1058.  
  1059. # tar xf /sources/binutils-2.26.tar.bz2
  1060. root:~/lfs/binutils-2.26# mkdir -v build
  1061. mkdir: created directory 'build'
  1062.  
  1063. root:~/lfs/binutils-2.26# patch -Np1 -i ../binutils-2.26-upstream_fix-2.patch
  1064. patching file bfd/elf32-i386.c
  1065. patching file bfd/elf64-x86-64.c
  1066. patching file gas/config/tc-i386.c
  1067. patching file gas/config.in
  1068. patching file gas/configure
  1069. patching file gas/configure.ac
  1070. patching file ld/configure
  1071. patching file ld/configure.ac
  1072. patching file ld/lexsup.c
  1073. patching file opcodes/i386-dis.c
  1074.  
  1075. Prepare Binutils for compilation:
  1076. ../configure --prefix=/usr \
  1077. --enable-shared \
  1078. --disable-werror
  1079. make check
  1080.  
  1081. The test 'Link with zlib-gabi compressed debug output' is known to fail.
  1082.  
  1083. Install the package:
  1084.  
  1085. make tooldir=/usr install
  1086.  
  1087. 6.14.1. Installation of GMP
  1088. root:~/lfs# tar xf /sources/gmp-6.1.0.tar.xz
  1089.  
  1090. Prepare GMP for compilation:
  1091. ./configure --prefix=/usr \
  1092. --enable-cxx \
  1093. --disable-static \
  1094. --docdir=/usr/share/doc/gmp-6.1.0
  1095.  
  1096. configure: summary of build options:
  1097.  
  1098. Version: GNU MP 6.1.0
  1099. Host type: haswell-pc-linux-gnu
  1100. ABI: 64
  1101. Install prefix: /usr
  1102. Compiler: gcc
  1103. Static libraries: no
  1104. Shared libraries: yes
  1105.  
  1106. # make
  1107. # make html
  1108.  
  1109. Test the results:
  1110. make check 2>&1 | tee gmp-check-log
  1111.  
  1112. Ensure that all 190 tests in the test suite passed. Check the results by issuing the following command:
  1113. awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
  1114. 190
  1115.  
  1116. Install the package and its documentation:
  1117. root:~/lfs/gmp-6.1.0# make install
  1118. +-------------------------------------------------------------+
  1119. | CAUTION: |
  1120. | |
  1121. | If you have not already run "make check", then we strongly |
  1122. | recommend you do so. |
  1123. | |
  1124. | GMP has been carefully tested by its authors, but compilers |
  1125. | are all too often released with serious bugs. GMP tends to |
  1126. | explore interesting corners in compilers and has hit bugs |
  1127. | on quite a few occasions. |
  1128. | |
  1129. +-------------------------------------------------------------+
  1130.  
  1131. make install-html
  1132.  
  1133.  
  1134. 6.15.1. Installation of MPFR
  1135. root:~/lfs# tar xf /sources/mpfr-3.1.3.tar.xz
  1136. root:~/lfs# cp -a /sources/mpfr-3.1.3-upstream_fixes-2.patch .
  1137. root:~/lfs# cd mpfr-3.1.3
  1138. ./configure --prefix=/usr \
  1139. --disable-static \
  1140. --enable-thread-safe \
  1141. make
  1142. make html
  1143. make check
  1144. ============================================================================
  1145. Testsuite summary for MPFR 3.1.3
  1146. ============================================================================
  1147. # TOTAL: 160
  1148. # PASS: 159
  1149. # SKIP: 1
  1150. # XFAIL: 0
  1151. # FAIL: 0
  1152. # XPASS: 0
  1153. # ERROR: 0
  1154. ============================================================================
  1155. make install
  1156. make install-html
  1157.  
  1158. 6.16.1. Installation of MPC
  1159. root:~/lfs# tar xf /sources/mpc-1.0.3.tar.gz
  1160. ./configure --prefix=/usr \
  1161. --disable-static \
  1162. --docdir=/usr/share/doc/mpc-1.0.3
  1163. make
  1164. make html
  1165.  
  1166. make check
  1167. ============================================================================
  1168. Testsuite summary for mpc 1.0.3
  1169. ============================================================================
  1170. # TOTAL: 64
  1171. # PASS: 64
  1172. # SKIP: 0
  1173. # XFAIL: 0
  1174. # FAIL: 0
  1175. # XPASS: 0
  1176. # ERROR: 0
  1177. ============================================================================
  1178.  
  1179.  
  1180.  
  1181. 6.17.1. Installation of GCC
  1182. root:~/lfs# tar xf /sources/gcc-5.3.0.tar.bz2
  1183. root:~/lfs/gcc-5.3.0# mkdir -v build
  1184. mkdir: created directory 'build'
  1185.  
  1186. Prepare GCC for compilation:
  1187.  
  1188. SED=sed \
  1189. ../configure --prefix=/usr \
  1190. --enable-languages=c,c++ \
  1191. --disable-multilib \
  1192. --disable-bootstrap \
  1193. --with-system-zlib
  1194.  
  1195. make
  1196.  
  1197. 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:
  1198. ulimit -s 32768
  1199.  
  1200. make -k check
  1201. WARNING: Couldn't find the global config file.
  1202. Test Run By root on Mon May 2 16:48:03 2016
  1203. Native configuration is x86_64-unknown-linux-gnu
  1204.  
  1205. === gcc tests ===
  1206.  
  1207. Schedule of variations:
  1208. unix
  1209.  
  1210. To receive a summary of the test suite results, run:
  1211.  
  1212. ../contrib/test_summary
  1213.  
  1214. Install the package:
  1215. make install
  1216.  
  1217. Some packages expect the C preprocessor to be installed in the /lib directory. To support those packages, create this symlink:
  1218. ln -sv ../usr/bin/cpp /lib
  1219. ln -sv gcc /usr/bin/cc
  1220.  
  1221. Add a compatibility symlink to enable building programs with Link Time Optimization (LTO):
  1222. # install -v -dm755 /usr/lib/bfd-plugins
  1223. install: creating directory '/usr/lib/bfd-plugins'
  1224.  
  1225. Add a compatibility symlink to enable building programs with Link Time Optimization (LTO):
  1226.  
  1227. install -v -dm755 /usr/lib/bfd-plugins
  1228. # ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/5.3.0/liblto_plugin.so \
  1229. > /usr/lib/bfd-plugins/
  1230. '/usr/lib/bfd-plugins/liblto_plugin.so' -> '../../libexec/gcc/x86_64-unknown-linux-gnu/5.3.0/liblto_plugin.so'
  1231.  
  1232. 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:
  1233. root:~/lfs/gcc-5.3.0/build# echo 'int main(){}' > dummy.c
  1234. root:~/lfs/gcc-5.3.0/build# cc dummy.c -v -Wl,--verbose &> dummy.log
  1235. root:~/lfs/gcc-5.3.0/build# readelf -l a.out | grep ': /lib'
  1236. [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
  1237.  
  1238. Now make sure that we're setup to use the correct start files:
  1239. root:~/lfs/gcc-5.3.0/build# grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log
  1240. /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/crt1.o succeeded
  1241. /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/crti.o succeeded
  1242. /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/../../../../lib64/crtn.o succeeded
  1243.  
  1244. Verify that the compiler is searching for the correct header files:
  1245. root:~/lfs/gcc-5.3.0/build# grep -B4 '^ /usr/include' dummy.log
  1246. #include <...> search starts here:
  1247. /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include
  1248. /usr/local/include
  1249. /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include-fixed
  1250. /usr/include
  1251.  
  1252. Next, verify that the new linker is being used with the correct search paths:
  1253.  
  1254. root:~/lfs/gcc-5.3.0/build# grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'
  1255. SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64")
  1256. SEARCH_DIR("/usr/local/lib64")
  1257. SEARCH_DIR("/lib64")
  1258. SEARCH_DIR("/usr/lib64")
  1259. SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib")
  1260. SEARCH_DIR("/usr/local/lib")
  1261. SEARCH_DIR("/lib")
  1262. SEARCH_DIR("/usr/lib");
  1263.  
  1264. Next make sure that we're using the correct libc:
  1265. root:~/lfs/gcc-5.3.0/build# grep "/lib.*/libc.so.6 " dummy.log
  1266. attempt to open /lib64/libc.so.6 succeeded
  1267.  
  1268. Lastly, make sure GCC is using the correct dynamic linker:
  1269. root:~/lfs/gcc-5.3.0/build# grep found dummy.log
  1270. found ld-linux-x86-64.so.2 at /lib64/ld-linux-x86-64.so.2
  1271.  
  1272. Finally, move a misplaced file:
  1273. root:~/lfs/gcc-5.3.0/build# mkdir -pv /usr/share/gdb/auto-load/usr/lib
  1274. mkdir: created directory '/usr/share/gdb'
  1275. mkdir: created directory '/usr/share/gdb/auto-load'
  1276. mkdir: created directory '/usr/share/gdb/auto-load/usr'
  1277. mkdir: created directory '/usr/share/gdb/auto-load/usr/lib'
  1278.  
  1279. root:~/lfs/gcc-5.3.0/build# mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib
  1280. '/usr/lib/libstdc++.so.6.0.21-gdb.py' -> '/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.21-gdb.py'
  1281.  
  1282. 6.18.1. Installation of Bzip2
  1283. root:~/lfs# tar xf /sources/bzip2-1.0.6.tar.gz
  1284. Apply a patch that will install the documentation for this package:
  1285. patch -Np1 -i ../bzip2-1.0.6-install_docs-1.patch
  1286. patching file Makefile
  1287.  
  1288. The following command ensures installation of symbolic links are relative:
  1289. sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
  1290.  
  1291. Ensure the man pages are installed into the correct location:
  1292. sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
  1293.  
  1294. Prepare Bzip2 for compilation with:
  1295. make -f Makefile-libbz2_so
  1296. make clean
  1297.  
  1298. Compile and test the package:
  1299. make
  1300.  
  1301. Install the programs:
  1302. make PREFIX=/usr install
  1303.  
  1304. Install the shared bzip2 binary into the /bin directory, make some necessary symbolic links, and clean up:
  1305. cp -v bzip2-shared /bin/bzip2
  1306. cp -av libbz2.so* /lib
  1307. ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so
  1308. rm -v /usr/bin/{bunzip2,bzcat,bzip2}
  1309. ln -sv bzip2 /bin/bunzip2
  1310. ln -sv bzip2 /bin/bzcat
  1311.  
  1312. 6.19.1. Installation of Pkg-config
  1313. root:~/lfs# tar xf /sources/pkg-config-0.29.tar.gz
  1314.  
  1315. Prepare Pkg-config for compilation:
  1316. ./configure --prefix=/usr \
  1317. --with-internal-glib \
  1318. --disable-host-tool \
  1319. --docdir=/usr/share/doc/pkg-config-0.29
  1320.  
  1321. make
  1322. make check
  1323. make install
  1324.  
  1325. 6.20.1. Installation of Ncurses
  1326. root:~/lfs/ncurses-6.0# sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in
  1327.  
  1328. ./configure --prefix=/usr \
  1329. --mandir=/usr/share/man \
  1330. --with-shared \
  1331. --without-debug \
  1332. --without-normal \
  1333. --enable-pc-files \
  1334. --enable-widec
  1335. ** Configuration summary for NCURSES 6.0 20150808:
  1336.  
  1337. extended funcs: yes
  1338. xterm terminfo: xterm-new
  1339.  
  1340. bin directory: /usr/bin
  1341. lib directory: /usr/lib
  1342. include directory: /usr/include
  1343. man directory: /usr/share/man
  1344. terminfo directory: /usr/share/terminfo
  1345. pkg-config directory: /usr/lib/pkgconfig
  1346.  
  1347. make
  1348. make install
  1349.  
  1350. root:~/lfs/ncurses-6.0# mv -v /usr/lib/libncursesw.so.6* /lib
  1351. '/usr/lib/libncursesw.so.6' -> '/lib/libncursesw.so.6'
  1352. '/usr/lib/libncursesw.so.6.0' -> '/lib/libncursesw.so.6.0'
  1353.  
  1354. root:~/lfs/ncurses-6.0# ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so
  1355. '/usr/lib/libncursesw.so' -> '../../lib/libncursesw.so.6'
  1356.  
  1357. # for lib in ncurses form panel menu ; do
  1358. > rm -vf /usr/lib/lib${lib}.so
  1359. > echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so
  1360. > ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc
  1361.  
  1362. Finally, make sure that old applications that look for -lcurses at build time are still buildable:
  1363.  
  1364. rm -vf /usr/lib/libcursesw.so
  1365. echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so
  1366. ln -sfv libncurses.so /usr/lib/libcurses.so
  1367.  
  1368.  
  1369. Finally, make sure that old applications that look for -lcurses at build time are still buildable:
  1370.  
  1371. rm -vf /usr/lib/libcursesw.so
  1372. echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so
  1373. ln -sfv libncurses.so /usr/lib/libcurses.so
  1374.  
  1375. If desired, install the Ncurses documentation:
  1376. mkdir -v /usr/share/doc/ncurses-6.0
  1377. cp -v -R doc/* /usr/share/doc/ncurses-6.0
  1378.  
  1379. root:~/lfs/ncurses-6.0# make distclean
  1380.  
  1381. 6.21.1. Installation of Attr
  1382. root:~/lfs# tar xf /sources/attr-2.4.47.src.tar.gz
  1383. root:~/lfs# cd attr-2.4.47/
  1384.  
  1385. Modify the documentation directory so that it is a versioned directory:
  1386. # sed -i -e 's|/@pkg_name@|&-@pkg_version@|' include/builddefs.in
  1387. Prevent installation of manual pages that were already installed by the man pages package:
  1388. sed -i -e "/SUBDIRS/s|man[25]||g" man/Makefile
  1389. Prepare Attr for compilation:
  1390.  
  1391. ./configure --prefix=/usr \
  1392. --bindir=/bin \
  1393. --disable-static
  1394.  
  1395. make
  1396. 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:
  1397. make -j1 tests root-tests
  1398.  
  1399. Install the package:
  1400.  
  1401. make install install-dev install-lib
  1402. chmod -v 755 /usr/lib/libattr.so
  1403.  
  1404. The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:
  1405. mv -v /usr/lib/libattr.so.* /lib
  1406. ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so
  1407.  
  1408. 6.22.1. Installation of Acl
  1409. root:~/lfs# tar xf /sources/acl-2.2.52.src.tar.gz
  1410. Modify the documentation directory so that it is a versioned directory:
  1411. sed -i -e 's|/@pkg_name@|&-@pkg_version@|' include/builddefs.in
  1412.  
  1413. Fix some broken tests:
  1414. sed -i "s:| sed.*::g" test/{sbits-restore,cp,misc}.test
  1415. Additionally, fix a bug that causes getfacl -e to segfault on overly long group name:
  1416. sed -i -e "/TABS-1;/a if (x > (TABS-1)) x = (TABS-1);" \
  1417. libacl/__acl_to_any_text.c
  1418.  
  1419. Prepare Acl for compilation:
  1420.  
  1421. ./configure --prefix=/usr \
  1422. --bindir=/bin \
  1423. --disable-static \
  1424. --libexecdir=/usr/lib
  1425.  
  1426. Compile the package:
  1427. make
  1428.  
  1429. Install the package:
  1430. make install install-dev install-lib
  1431. chmod -v 755 /usr/lib/libacl.so
  1432.  
  1433. The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:
  1434. mv -v /usr/lib/libacl.so.* /lib
  1435. ln -sfv ../../lib/$(readlink /usr/lib/libacl.so) /usr/lib/libacl.so
  1436.  
  1437. 6.23. Libcap-2.25
  1438. lfs:/monster/sources$ wget -c https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.25.tar.xz
  1439. root:~/lfs# tar xf /sources/libcap-2.25.tar.xz
  1440.  
  1441. Prevent a static library from being installed:
  1442. sed -i '/install.*STALIBNAME/d' libcap/Makefile
  1443.  
  1444. Install the package:
  1445. make RAISE_SETFCAP=no prefix=/usr install
  1446. chmod -v 755 /usr/lib/libcap.so
  1447.  
  1448. The shared library needs to be moved to /lib, and as a result the .so file in /usr/lib will need to be recreated:
  1449.  
  1450. mv -v /usr/lib/libcap.so.* /lib
  1451. ln -sfv ../../lib/$(readlink /usr/lib/libcap.so) /usr/lib/libcap.so
  1452.  
  1453. 6.24.1. Installation of Sed
  1454. root:~/lfs# tar xf /sources/sed-4.2.2.tar.bz2
  1455. ./configure --prefix=/usr --bindir=/bin --htmldir=/usr/share/doc/sed-4.2.2
  1456.  
  1457. Compile the package and generate the HTML documentation:
  1458. make
  1459. make html
  1460.  
  1461. To test the results, issue:
  1462. make check
  1463.  
  1464. Install the package and its documentation:
  1465. make install
  1466.  
  1467. # make -C doc install-html
  1468. make: Entering directory '/root/lfs/sed-4.2.2/doc'
  1469. /tools/bin/mkdir -p '/usr/share/doc/sed-4.2.2'
  1470. /tools/bin/install -c -m 644 sed.html '/usr/share/doc/sed-4.2.2'
  1471. make: Leaving directory '/root/lfs/sed-4.2.2/doc'
  1472.  
  1473. 6.25.1. Installation of Shadow
  1474. root:~/lfs# tar xf /sources/shadow-4.2.1.tar.xz
  1475. 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:
  1476.  
  1477. sed -i 's/groups$(EXEEXT) //' src/Makefile.in
  1478. find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \;
  1479. find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \;
  1480. find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;
  1481. 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:
  1482.  
  1483. Make a minor change to make the default useradd consistent with the LFS groups file:
  1484. sed -i 's/1000/999/' etc/useradd
  1485.  
  1486. Prepare Shadow for compilation:
  1487. root:~/lfs/shadow-4.2.1# ./configure --sysconfdir=/etc --with-group-name-max-length=32
  1488. shadow will be compiled with the following features:
  1489.  
  1490. auditing support: no
  1491. CrackLib support: no
  1492. PAM support: no
  1493. SELinux support: no
  1494. ACL support: yes
  1495. Extended Attributes support: yes
  1496. tcb support (incomplete): no
  1497. shadow group support: yes
  1498. S/Key support: no
  1499. SHA passwords encryption: yes
  1500. nscd support: yes
  1501. subordinate IDs support: yes
  1502.  
  1503. Compile the package:
  1504. make
  1505. Install the package:
  1506. make install
  1507. Move a misplaced program to its proper location:
  1508. mv -v /usr/bin/passwd /bin
  1509.  
  1510. 6.25.2. Configuring Shadow
  1511. root:~/lfs/shadow-4.2.1# pwconv
  1512. root:~/lfs/shadow-4.2.1# grpconv
  1513.  
  1514. CREATE_MAIL_SPOOL=yes
  1515. 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:
  1516. sed -i 's/yes/no/' /etc/default/useradd
  1517.  
  1518. 6.25.3. Setting the root password
  1519. Choose a password for user root and set it by running:
  1520. passwd root
  1521. root:~/lfs/shadow-4.2.1# passwd root
  1522. Changing password for root
  1523. Enter the new password (minimum of 5 characters)
  1524. Please use a combination of upper and lower case letters and numbers.
  1525. New password: shc522.,.
  1526. Re-enter new password: *********
  1527. passwd: password changed.
  1528.  
  1529. 6.26.1. Installation of Psmisc
  1530. ./configure --prefix=/usr
  1531. make
  1532. make install
  1533. mv -v /usr/bin/fuser /bin
  1534. mv -v /usr/bin/killall /bin
  1535.  
  1536. 6.27. Procps-ng-3.3.11
  1537. lfs:/monster/sources$ wget -c http://sourceforge.net/projects/procps-ng/files/Production/procps-ng-3.3.11.tar.xz
  1538. root:~/lfs# tar xf /sources/procps-ng-3.3.11.tar.xz
  1539.  
  1540. ./configure --prefix=/usr \
  1541. --exec-prefix= \
  1542. --libdir=/usr/lib \
  1543. --docdir=/usr/share/doc/procps-ng-3.3.11 \
  1544. --disable-static \
  1545. --disable-kill
  1546.  
  1547. Compile the package:
  1548. make
  1549.  
  1550. 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:
  1551.  
  1552. sed -i -r 's|(pmap_initname)\\\$|\1|' testsuite/pmap.test/pmap.exp
  1553. make check
  1554.  
  1555. Install the package:
  1556. make install
  1557.  
  1558. Finally, move essential libraries to a location that can be found if /usr is not mounted.
  1559.  
  1560. mv -v /usr/lib/libprocps.so.* /lib
  1561. ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so
  1562.  
  1563. 6.28.1. Installation of E2fsprogs
  1564. root:~# tar xf /sources/e2fsprogs-1.42.13.tar.gz
  1565. root:~# cd e2fsprogs-1.42.13/
  1566. mkdir -v build
  1567. Prepare E2fsprogs for compilation:
  1568.  
  1569. LIBS=-L/tools/lib \
  1570. CFLAGS=-I/tools/include \
  1571. PKG_CONFIG_PATH=/tools/lib/pkgconfig \
  1572. ../configure --prefix=/usr \
  1573. --bindir=/bin \
  1574. --with-root-prefix="" \
  1575. --enable-elf-shlibs \
  1576. --disable-libblkid \
  1577. --disable-libuuid \
  1578. --disable-uuidd \
  1579. --disable-fsck
  1580.  
  1581. make
  1582. ln -sfv /tools/lib/lib{blk,uu}id.so.1 lib
  1583. make LD_LIBRARY_PATH=/tools/lib check
  1584. make install
  1585. make install-libs
  1586. chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a
  1587. gunzip -v /usr/share/info/libext2fs.info.gz
  1588. install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info
  1589. makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo
  1590. install -v -m644 doc/com_err.info /usr/share/info
  1591. install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info
  1592.  
  1593. 6.29.1. Installation of Iana-Etc
  1594. root:~/lfs# tar xf /sources/iana-etc-2.30.tar.bz2
  1595. root:~/lfs# cd iana-etc-2.30/
  1596. root:~/lfs/iana-etc-2.30# make
  1597. ln -f -s protocol-numbers.dist protocol-numbers
  1598. gawk --re-interval -f protocols.gawk -v strip=no \
  1599. protocol-numbers > protocols
  1600. ln -f -s port-numbers.dist port-numbers
  1601. gawk -f services.gawk -v strip=no port-numbers > services
  1602.  
  1603. root:~/lfs/iana-etc-2.30# make install
  1604. install -d /etc
  1605. install -m 644 protocols /etc
  1606. install -m 644 services /etc
  1607.  
  1608. 6.30.1. Installation of M4
  1609. root:~/lfs# tar xf /sources/m4-1.4.17.tar.xz
  1610. ./configure --prefix=/usr
  1611. make
  1612. make check
  1613. make install
  1614.  
  1615. 6.31.1. Installation of Bison
  1616. root:~/lfs# tar xf /sources/bison-3.0.4.tar.xz
  1617. ./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.0.4
  1618. make
  1619. make install
  1620.  
  1621. 6.32.1. Installation of Flex
  1622. root:~/lfs# tar xf /sources/flex-2.6.0.tar.xz
  1623. ./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.6.0
  1624. make check
  1625. make install
  1626. ln -sv flex /usr/bin/lex
  1627.  
  1628. 6.33.1. Installation of Grep
  1629. root:~/lfs# tar xf /sources/grep-2.23.tar.xz
  1630. ./configure --prefix=/usr --bindir=/bin
  1631. make
  1632. make check
  1633. make install
  1634.  
  1635. 6.34.1. Installation of Readline
  1636. root:~/lfs# tar xf /sources/readline-6.3.tar.gz
  1637. root:~/lfs# cd readline-6.3/
  1638. patch -Np1 -i ../readline-6.3-upstream_fixes-3.patch
  1639. patching file display.c
  1640. patching file input.c
  1641. patching file misc.c
  1642. patching file patchlevel
  1643. patching file readline.c
  1644. patching file rltypedefs.h
  1645. patching file util.c
  1646.  
  1647. ./configure --prefix=/usr \
  1648. --disable-static \
  1649. --docdir=/usr/share/doc/readline-6.3
  1650.  
  1651. make SHLIB_LIBS=-lncurses
  1652. make SHLIB_LIBS=-lncurses install
  1653. mv -v /usr/lib/lib{readline,history}.so.* /lib
  1654. ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so
  1655. ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so
  1656.  
  1657. 6.35.1. Installation of Bash
  1658. root:~/lfs# tar xf /sources/bash-4.3.30.tar.gz
  1659. root:~/lfs# cp -a /sources/bash-4.3.30-upstream_fixes-3.patch .
  1660. Skip down to “Install the package” if not running the test suite.
  1661.  
  1662. To prepare the tests, ensure that the nobody user can write to the sources tree:
  1663.  
  1664. chown -Rv nobody .
  1665. Now, run the tests as the nobody user:
  1666.  
  1667. su nobody -s /bin/bash -c "PATH=$PATH make tests"
  1668. ***********************************************************
  1669. * *
  1670. /bin/sh: /root/lfs/bash-4.3.30/bashversion: Permission denied
  1671. *
  1672. * *
  1673. ***********************************************************
  1674.  
  1675. /bin/sh: line 0: cd: ./tests: Not a directory
  1676. Makefile:863: recipe for target 'tests' failed
  1677. make: *** [tests] Error 1
  1678.  
  1679. Now, run the tests as the nobody user:
  1680.  
  1681. su nobody -s /bin/bash -c "PATH=$PATH make tests"
  1682. Install the package and move the main executable to /bin:
  1683.  
  1684. make install
  1685. mv -vf /usr/bin/bash /bin
  1686. Run the newly compiled bash program (replacing the one that is currently being executed):
  1687.  
  1688. exec /bin/bash --login +h
  1689.  
  1690. 6.36.1. Installation of Bc
  1691. root:~/lfs# tar xf /sources/bc-1.06.95.tar.bz2
  1692. root:~/lfs# cp -a /sources/bc-1.06.95-memory_leak-1.patch .
  1693. ./configure --prefix=/usr \
  1694. --with-readline \
  1695. --mandir=/usr/share/man \
  1696. --infodir=/usr/share/info
  1697.  
  1698. make
  1699. echo "quit" | ./bc/bc -l Test/checklib.b
  1700.  
  1701. 6.37.1. Installation of Libtool
  1702. ./configure --prefix=/usr
  1703. # make
  1704. # make check
  1705. root:~/lfs/libtool-2.4.6# make install
  1706.  
  1707. 6.38.1. Installation of GDBM
  1708. root:~/lfs# tar xf /sources/gdbm-1.11.tar.gz
  1709. ./configure --prefix=/usr \
  1710. --disable-static \
  1711. --enable-libgdbm-compat
  1712. make
  1713. make check
  1714. make install
  1715.  
  1716. 6.39.1. Installation of Expat
  1717. root:~/lfs# tar xf /sources/expat-2.1.0.tar.gz
  1718. ./configure --prefix=/usr --disable-static
  1719. make
  1720. make check
  1721. make install
  1722.  
  1723. Libraries have been installed in:
  1724. /usr/lib
  1725.  
  1726. If you ever happen to want to link against installed libraries
  1727. in a given directory, LIBDIR, you must either use libtool, and
  1728. specify the full pathname of the library, or use the `-LLIBDIR'
  1729. flag during linking and do at least one of the following:
  1730. - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
  1731. during execution
  1732. - add LIBDIR to the `LD_RUN_PATH' environment variable
  1733. during linking
  1734. - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
  1735. - have your system administrator add LIBDIR to `/etc/ld.so.conf'
  1736.  
  1737. See any operating system documentation about shared libraries for
  1738. more information, such as the ld(1) and ld.so(8) manual pages.
  1739.  
  1740. install -v -dm755 /usr/share/doc/expat-2.1.0
  1741. install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.1.0
  1742.  
  1743. 6.40.1. Installation of Inetutils
  1744. ./configure --prefix=/usr \
  1745. --localstatedir=/var \
  1746. --disable-logger \
  1747. --disable-whois \
  1748. --disable-rcp \
  1749. --disable-rexec \
  1750. --disable-rlogin \
  1751. --disable-rsh \
  1752. --disable-servers
  1753.  
  1754. Summary of build decisions:
  1755.  
  1756. Clients:
  1757.  
  1758. dnsdomainname yes
  1759. ftp yes /usr/lib/libreadline.so -Wl,-rpath -Wl,/usr/lib
  1760. hostname yes
  1761. ifconfig yes
  1762. logger no
  1763. ping yes
  1764. ping6 yes
  1765. rcp no
  1766. rexec no
  1767. rlogin no
  1768. rsh no
  1769. talk yes -lcurses
  1770. telnet yes -lcurses
  1771. tftp yes
  1772. traceroute yes
  1773. whois no
  1774.  
  1775. Servers:
  1776.  
  1777. ftpd no
  1778. inetd no
  1779. rexecd no
  1780. rlogind no
  1781. rshd no
  1782. syslogd no
  1783. talkd no
  1784. telnetd no
  1785. tftpd no
  1786. uucpd no
  1787.  
  1788. make
  1789. make check
  1790. make install
  1791. mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin
  1792. '/usr/bin/hostname' -> '/bin/hostname'
  1793. '/usr/bin/ping' -> '/bin/ping'
  1794. '/usr/bin/ping6' -> '/bin/ping6'
  1795. '/usr/bin/traceroute' -> '/bin/traceroute'
  1796. mv -v /usr/bin/ifconfig /sbin
  1797. '/usr/bin/ifconfig' -> '/sbin/ifconfig'
  1798.  
  1799. 6.41.1. Installation of Perl
  1800. root:~/lfs# tar xf /sources/perl-5.22.1.tar.bz2
  1801.  
  1802. First create a basic /etc/hosts file to be referenced in one of Perl's configuration files as well as the optional test suite:
  1803. echo "127.0.0.1 localhost $(hostname)" > /etc/hosts
  1804. export BUILD_ZLIB=False
  1805. export BUILD_BZIP2=0
  1806. sh Configure -des -Dprefix=/usr \
  1807. -Dvendorprefix=/usr \
  1808. -Dman1dir=/usr/share/man/man1 \
  1809. -Dman3dir=/usr/share/man/man3 \
  1810. -Dpager="/usr/bin/less -isR" \
  1811. -Duseshrplib
  1812.  
  1813. 6.42.1. Installation of XML::Parser
  1814. root:~/lfs# tar xf /sources/XML-Parser-2.44.tar.gz
  1815. root:~/lfs# cd XML-Parser-2.44
  1816. perl Makefile.PL
  1817. make
  1818. make test
  1819. make install
  1820.  
  1821. 6.43.1. Installation of Autoconf
  1822. # tar xf /sources/autoconf-2.69.tar.xz
  1823. ./configure --prefix=/usr
  1824. make
  1825. make check
  1826. make install
  1827.  
  1828. 6.44.1. Installation of Automake
  1829. root:~/lfs# tar xf /sources/automake-1.15.tar.xz
  1830. First fix a warning that is caused by perl-5.22 and later:
  1831. sed -i 's:/\\\${:/\\\$\\{:' bin/automake.in
  1832. ./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.15
  1833. make
  1834. sed -i "s:./configure:LEXLIB=/usr/lib/libfl.a &:" t/lex-{clean,depend}-cxx.sh
  1835. make -j4 check
  1836. make install
  1837.  
  1838. 6.45.1. Installation of Coreutils
  1839. root:~/lfs# tar xf /sources/coreutils-8.25.tar.xz
  1840. root:~/lfs# cp -a /sources/coreutils-8.25-i18n-2.patch .
  1841. root:~/lfs# cd coreutils-8.25
  1842. patch -Np1 -i ../coreutils-8.25-i18n-2.patch
  1843.  
  1844. Now prepare Coreutils for compilation:
  1845.  
  1846. FORCE_UNSAFE_CONFIGURE=1 ./configure \
  1847. --prefix=/usr \
  1848. --enable-no-install-program=kill,uptime
  1849.  
  1850. FORCE_UNSAFE_CONFIGURE=1 make
  1851. make NON_ROOT_USERNAME=nobody check-root
  1852. testing:
  1853. echo "dummy:x:1000:nobody" >> /etc/group
  1854. chown -Rv nobody .
  1855. Now run the tests. Make sure the PATH in the su environment includes /tools/bin.
  1856. su nobody -s /bin/bash \
  1857. -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check"
  1858. Remove the temporary group:
  1859. sed -i '/dummy/d' /etc/group
  1860. Install the package:
  1861. make install
  1862.  
  1863. Move programs to the locations specified by the FHS:
  1864.  
  1865. mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin
  1866. mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin
  1867. mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin
  1868. mv -v /usr/bin/chroot /usr/sbin
  1869. mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8
  1870. sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8
  1871.  
  1872. mv -v /usr/bin/{head,sleep,nice,test,[} /bin
  1873.  
  1874. 6.46.1. Installation of Diffutils
  1875. root:~/lfs# tar xf /sources/diffutils-3.3.tar.xz
  1876. sed -i 's:= @mkdir_p@:= /bin/mkdir -p:' po/Makefile.in.in
  1877. ./configure --prefix=/usr
  1878. make
  1879. make check
  1880. make install
  1881.  
  1882. 6.47.1. Installation of Gawk
  1883. root:~/lfs# tar xf /sources/gawk-4.1.3.tar.xz
  1884. ./configure --prefix=/usr
  1885. make
  1886. make check
  1887. make install
  1888. mkdir -v /usr/share/doc/gawk-4.1.3
  1889. cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-4.1.3
  1890.  
  1891. 6.48.1. Installation of Findutils
  1892. root:~/lfs# tar xf /sources/findutils-4.6.0.tar.gz
  1893. ./configure --prefix=/usr --localstatedir=/var/lib/locate
  1894. make
  1895. make check
  1896. make install
  1897. mv -v /usr/bin/find /bin
  1898. sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb
  1899.  
  1900.  
  1901. 6.49.1. Installation of Gettext
  1902. root:~/lfs# tar xf /sources/gettext-0.19.7.tar.xz
  1903. ./configure --prefix=/usr \
  1904. --disable-static \
  1905. --docdir=/usr/share/doc/gettext-0.19.7
  1906. make
  1907. make check
  1908. make install
  1909. chmod -v 0755 /usr/lib/preloadable_libintl.so
  1910.  
  1911. 6.50.1. Installation of Intltool
  1912. lfs:/monster/sources$ wget -c http://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz
  1913. root:~/lfs# tar xf /sources/intltool-0.51.0.tar.gz
  1914. sed -i 's:\\\${:\\\$\\{:' intltool-update.in
  1915. ./configure --prefix=/usr
  1916. make
  1917. make check
  1918. make install
  1919.  
  1920. 6.51.1. Installation of Gperf
  1921. ./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.0.4
  1922. make
  1923. make -j1 check
  1924. make install
  1925.  
  1926. 6.52.1. Installation of Groff
  1927. root:~/lfs/groff-1.22.3# PAGE=letter ./configure --prefix=/usr
  1928. PAGE=<paper_size> ./configure --prefix=/usr
  1929. make
  1930. make install
  1931.  
  1932. 6.53.1. Installation of Xz
  1933. root:~/lfs# tar xf /sources/xz-5.2.2.tar.xz
  1934. sed -e '/mf\.buffer = NULL/a next->coder->mf.size = 0;' \
  1935. -i src/liblzma/lz/lz_encoder.c
  1936. ./configure --prefix=/usr \
  1937. --disable-static \
  1938. --docdir=/usr/share/doc/xz-5.2.2
  1939. make
  1940. make check
  1941. make install
  1942. mv -v /usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} /bin
  1943. mv -v /usr/lib/liblzma.so.* /lib
  1944. ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so
  1945.  
  1946. 6.54.1. Installation of GRUB
  1947. root:~/lfs# tar xf /sources/grub-2.02~beta2.tar.xz
  1948. ./configure --prefix=/usr \
  1949. --sbindir=/sbin \
  1950. --sysconfdir=/etc \
  1951. --disable-grub-emu-usb \
  1952. --disable-efiemu \
  1953. --disable-werror
  1954. *******************************************************
  1955. GRUB2 will be compiled with following components:
  1956. Platform: i386-pc
  1957. With devmapper support: No (need libdevmapper header)
  1958. With memory debugging: No
  1959. With disk cache statistics: No
  1960. With boot time statistics: No
  1961. efiemu runtime: No (explicitly disabled)
  1962. grub-mkfont: No (need freetype2 library)
  1963. grub-mount: No (need FUSE library)
  1964. starfield theme: No (No build-time grub-mkfont)
  1965. With libzfs support: No (need zfs library)
  1966. Build-time grub-mkfont: No (need freetype2 library)
  1967. Without unifont (no build-time grub-mkfont)
  1968. With liblzma from -llzma (support for XZ-compressed mips images)
  1969. *******************************************************
  1970. make
  1971. make install
  1972.  
  1973. 6.55.1. Installation of Less
  1974. # tar xf /sources/less-481.tar.gz
  1975. ./configure --prefix=/usr --sysconfdir=/etc
  1976. make
  1977. make install
  1978.  
  1979. 6.56.1. Installation of Gzip
  1980. root:~/lfs# tar xf /sources/gzip-1.6.tar.xz
  1981. ./configure --prefix=/usr --bindir=/bin
  1982. make
  1983. make check
  1984. make install
  1985. mv -v /bin/{gzexe,uncompress,zcmp,zdiff,zegrep} /usr/bin
  1986. mv -v /bin/{zfgrep,zforce,zgrep,zless,zmore,znew} /usr/bin
  1987.  
  1988. 6.57.1. Installation of IPRoute2
  1989. lfs:/monster/sources$ wget -c https://www.kernel.org/pub/linux/utils/net/iproute2/iproute2-4.4.0.tar.xz
  1990. 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.
  1991.  
  1992. sed -i /ARPD/d Makefile
  1993. sed -i 's/arpd.8//' man/man8/Makefile
  1994. rm -v doc/arpd.sgml
  1995. Compile the package:
  1996.  
  1997. make
  1998. 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.
  1999.  
  2000. Install the package:
  2001. make DOCDIR=/usr/share/doc/iproute2-4.4.0 install
  2002.  
  2003. 6.58.1. Installation of Kbd
  2004. lfs:/monster/sources$ wget -c https://www.kernel.org/pub/linux/utils/kbd/kbd-2.0.3.tar.xz
  2005. root:~/lfs# tar xf /sources/kbd-2.0.3.tar.xz
  2006. root:~/lfs# cp -a /sources/kbd-2.0.3-backspace-1.patch .
  2007. root:~/lfs/kbd-2.0.3# PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure --prefix=/usr --disable-vlock
  2008.  
  2009. kbd 2.0.3
  2010. ======
  2011.  
  2012. prefix: /usr
  2013. libdir: ${exec_prefix}/lib
  2014. bindir: ${exec_prefix}/bin
  2015. datadir: ${datarootdir}
  2016.  
  2017. compiler: gcc
  2018. cflags: -g -O2 -Wall -Wextra -Wmissing-noreturn -Wdisabled-optimization -Wcast-align -Wshadow -Wmissing-format-attribute -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
  2019.  
  2020. {get,set}keycodes: yes
  2021. resizecons: no
  2022. optional progs: no
  2023. vlock: no
  2024. libkeymap: no
  2025.  
  2026. make
  2027. make check
  2028. make install
  2029. mkdir -v /usr/share/doc/kbd-2.0.3
  2030. cp -R -v docs/doc/* /usr/share/doc/kbd-2.0.3
  2031.  
  2032. 6.59.1. Installation of Kmod
  2033. lfs:/monster/sources$ wget -c https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-22.tar.xz
  2034. root:~/lfs# tar xf /sources/kmod-22.tar.xz
  2035. ./configure --prefix=/usr \
  2036. --bindir=/bin \
  2037. --sysconfdir=/etc \
  2038. --with-rootlibdir=/lib \
  2039. --with-xz \
  2040. --with-zlib
  2041. make
  2042. make install
  2043. root:~/lfs/kmod-22# for target in depmod insmod lsmod modinfo modprobe rmmod; do
  2044. > ln -sv ../bin/kmod /sbin/$target
  2045. > done
  2046. '/sbin/depmod' -> '../bin/kmod'
  2047. '/sbin/insmod' -> '../bin/kmod'
  2048. '/sbin/lsmod' -> '../bin/kmod'
  2049. '/sbin/modinfo' -> '../bin/kmod'
  2050. '/sbin/modprobe' -> '../bin/kmod'
  2051. '/sbin/rmmod' -> '../bin/kmod'
  2052.  
  2053. 6.60. Libpipeline-1.4.1
  2054. root:~/lfs# tar xf /sources/libpipeline-1.4.1.tar.gz
  2055. PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure --prefix=/usr
  2056. make
  2057. make check
  2058. make install
  2059.  
  2060. 6.61.1. Installation of Make
  2061. root:~/lfs# tar xf /sources/make-4.1.tar.bz2
  2062. ./configure --prefix=/usr
  2063. make
  2064. make check
  2065. make install
  2066.  
  2067. 6.62.1. Installation of Patch
  2068. root:~/lfs# tar xf /sources/patch-2.7.5.tar.xz
  2069. ./configure --prefix=/usr
  2070. make
  2071. make check
  2072. make install
  2073.  
  2074. 6.63.1. Installation of Sysklogd
  2075. root:~/lfs# tar xf /sources/sysklogd-1.5.1.tar.gz
  2076. sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c
  2077. make
  2078. make BINDIR=/sbin install
  2079. /usr/bin/install -o root -g root -m 644 sysklogd.8 /usr/share/man/man8/sysklogd.8
  2080. /usr/bin/install -o root -g root -m 644 syslogd.8 /usr/share/man/man8/syslogd.8
  2081. /usr/bin/install -o root -g root -m 644 syslog.conf.5 /usr/share/man/man5/syslog.conf.5
  2082. /usr/bin/install -o root -g root -m 644 klogd.8 /usr/share/man/man8/klogd.8
  2083. /usr/bin/install -m 500 -s syslogd /sbin/syslogd
  2084. /usr/bin/install -m 500 -s klogd /sbin/klogd
  2085.  
  2086.  
  2087. 6.63.2. Configuring Sysklogd
  2088. Create a new /etc/syslog.conf file by running the following:
  2089.  
  2090. cat > /etc/syslog.conf << "EOF"
  2091. # Begin /etc/syslog.conf
  2092.  
  2093. auth,authpriv.* -/var/log/auth.log
  2094. *.*;auth,authpriv.none -/var/log/sys.log
  2095. daemon.* -/var/log/daemon.log
  2096. kern.* -/var/log/kern.log
  2097. mail.* -/var/log/mail.log
  2098. user.* -/var/log/user.log
  2099. *.emerg *
  2100.  
  2101. # End /etc/syslog.conf
  2102. EOF
  2103.  
  2104. 6.64.1. Installation of Sysvinit
  2105. root:~/lfs# tar xf /sources/sysvinit-2.88dsf.tar.bz2
  2106. root:~/lfs# cp -a /sources/sysvinit-2.88dsf-consolidated-1.patch .
  2107. patch -Np1 -i ../sysvinit-2.88dsf-consolidated-1.patch
  2108. make -C src
  2109. make -C src install
  2110.  
  2111. 6.65.1. Installation of Tar
  2112. root:~/lfs# tar xf /sources/tar-1.28.tar.xz
  2113. Prepare Tar for compilation:
  2114.  
  2115. FORCE_UNSAFE_CONFIGURE=1 \
  2116. ./configure --prefix=/usr \
  2117. --bindir=/bin
  2118.  
  2119. make
  2120. make check
  2121. make install
  2122. make -C doc install-html docdir=/usr/share/doc/tar-1.28
  2123.  
  2124.  
  2125. 6.66.1. Installation of Texinfo
  2126. root:~/lfs# tar xf /sources/texinfo-6.1.tar.xz
  2127. ./configure --prefix=/usr --disable-static
  2128. make
  2129. make check
  2130. make install
  2131. make TEXMF=/usr/share/texmf install-tex
  2132. 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:
  2133.  
  2134. pushd /usr/share/info
  2135. rm -v dir
  2136. for f in *
  2137. do install-info $f dir 2>/dev/null
  2138. done
  2139. popd
  2140.  
  2141. 6.67.1. Installation of Eudev
  2142. root:~/lfs# tar xf /sources/eudev-3.1.5.tar.gz
  2143. First, fix a test script:
  2144.  
  2145. sed -r -i 's|/usr(/bin/test)|\1|' test/udev-test.pl
  2146. Next, add a workaround to prevent the /tools directory from being hard coded into Eudev binary files library locations:
  2147.  
  2148. cat > config.cache << "EOF"
  2149. HAVE_BLKID=1
  2150. BLKID_LIBS="-lblkid"
  2151. BLKID_CFLAGS="-I/tools/include"
  2152. EOF
  2153.  
  2154. ./configure --prefix=/usr \
  2155. --bindir=/sbin \
  2156. --sbindir=/sbin \
  2157. --libdir=/usr/lib \
  2158. --sysconfdir=/etc \
  2159. --libexecdir=/lib \
  2160. --with-rootprefix= \
  2161. --with-rootlibdir=/lib \
  2162. --enable-manpages \
  2163. --disable-static \
  2164. --config-cache
  2165. LIBRARY_PATH=/tools/lib make
  2166. mkdir -pv /lib/udev/rules.d
  2167. mkdir -pv /etc/udev/rules.d
  2168. make LD_LIBRARY_PATH=/tools/lib check
  2169. make LD_LIBRARY_PATH=/tools/lib install
  2170.  
  2171. root:~/lfs/eudev-3.1.5# tar -xvf /sources/udev-lfs-20140408.tar.bz2
  2172. udev-lfs-20140408/
  2173. udev-lfs-20140408/Makefile.lfs
  2174. udev-lfs-20140408/init-net-rules.sh
  2175. udev-lfs-20140408/83-cdrom-symlinks.rules
  2176. udev-lfs-20140408/contrib/
  2177. udev-lfs-20140408/contrib/debian/
  2178. udev-lfs-20140408/contrib/debian/83-cdrom-symlinks.rules
  2179. udev-lfs-20140408/contrib/debian/81-cdrom.rules
  2180. udev-lfs-20140408/contrib/debian/write_cd_aliases
  2181. udev-lfs-20140408/81-cdrom.rules
  2182. udev-lfs-20140408/55-lfs.rules
  2183. udev-lfs-20140408/write_cd_rules
  2184. udev-lfs-20140408/ChangeLog
  2185. udev-lfs-20140408/README
  2186. udev-lfs-20140408/write_net_rules
  2187. udev-lfs-20140408/rule_generator.functions
  2188. udev-lfs-20140408/55-lfs.txt
  2189. root:~/lfs/eudev-3.1.5# make -f udev-lfs-20140408/Makefile.lfs install
  2190.  
  2191. 6.67.2. Configuring Eudev
  2192. LD_LIBRARY_PATH=/tools/lib udevadm hwdb --update
  2193.  
  2194.  
  2195. 6.68.2. Installation of Util-linux
  2196. 6.68.1. FHS compliance notes
  2197. mkdir -pv /var/lib/hwclock
  2198. root:~/lfs# tar xf /sources/util-linux-2.27.1.tar.xz
  2199.  
  2200. 6.68.2. Installation of Util-linux
  2201. Prepare Util-linux for compilation:
  2202. ./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \
  2203. --docdir=/usr/share/doc/util-linux-2.27.1 \
  2204. --disable-chfn-chsh \
  2205. --disable-login \
  2206. --disable-nologin \
  2207. --disable-su \
  2208. --disable-setpriv \
  2209. --disable-runuser \
  2210. --disable-pylibmount \
  2211. --disable-static \
  2212. --without-python \
  2213. --without-systemd \
  2214. --without-systemdsystemunitdir
  2215.  
  2216. make
  2217. make install
  2218.  
  2219. 6.69.1. Installation of Man-DB
  2220. root:~/lfs# tar xf /sources/man-db-2.7.5.tar.xz
  2221. ./configure --prefix=/usr \
  2222. --docdir=/usr/share/doc/man-db-2.7.5 \
  2223. --sysconfdir=/etc \
  2224. --disable-setuid \
  2225. --with-browser=/usr/bin/lynx \
  2226. --with-vgrind=/usr/bin/vgrind \
  2227. --with-grap=/usr/bin/grap
  2228. make
  2229. make check
  2230. make install
  2231.  
  2232. 6.70.1. Installation of Vim
  2233. root:~/lfs# tar xf /sources/vim-7.4.tar.bz2
  2234. First, change the default location of the vimrc configuration file to /etc:
  2235. echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
  2236. ./configure --prefix=/usr
  2237. make
  2238. make -j1 test
  2239. make install
  2240. 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:
  2241.  
  2242. ln -sv vim /usr/bin/vi
  2243. for L in /usr/share/man/{,*/}man1/vim.1; do
  2244. ln -sv vim.1 $(dirname $L)/vi.1
  2245. done
  2246.  
  2247. 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:
  2248.  
  2249. ln -sv ../vim/vim74/doc /usr/share/doc/vim-7.4
  2250.  
  2251. 6.72. Stripping Again (20160504)
  2252.  
  2253. 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.
  2254.  
  2255. 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.
  2256.  
  2257. 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:
  2258.  
  2259. Then reenter it with:
  2260.  
  2261. chroot $LFS /tools/bin/env -i \
  2262. HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
  2263. PATH=/bin:/usr/bin:/sbin:/usr/sbin \
  2264. /tools/bin/bash --login
  2265. Now the binaries and libraries can be safely stripped:
  2266.  
  2267. /tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
  2268. -exec /tools/bin/strip --strip-debug '{}' ';'
  2269.  
  2270. 6.73. Cleaning Up
  2271. Finally, clean up some extra files left around from running tests:
  2272.  
  2273. rm -rf /tmp/*
  2274. From now on, when reentering the chroot environment after exiting, use the following modified chroot command:
  2275.  
  2276. chroot "$LFS" /usr/bin/env -i \
  2277. HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
  2278. PATH=/bin:/usr/bin:/sbin:/usr/sbin \
  2279. /bin/bash --login
  2280. 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.
  2281.  
  2282.  
  2283. 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:
  2284.  
  2285. rm -f /usr/lib/lib{bfd,opcodes}.a
  2286. rm -f /usr/lib/libbz2.a
  2287. rm -f /usr/lib/lib{com_err,e2p,ext2fs,ss}.a
  2288. rm -f /usr/lib/libltdl.a
  2289. rm -f /usr/lib/libfl.a
  2290. rm -f /usr/lib/libfl_pic.a
  2291. rm -f /usr/lib/libz.a
  2292.  
  2293. 7.2.1. Installation of LFS-Bootscripts
  2294. root:/sources# tar xf /sources/lfs-bootscripts-20150222.tar.bz2
  2295.  
  2296.  
  2297. ================================================================================================================================
  2298. II. Parte
  2299.  
  2300. backup /tools into lfs userspace
  2301. $ mkdir tools.ori
  2302. lfs:~/tools.ori$ rsync -avP /tools/ .
  2303.  
  2304. Compilación de fuentes linkeados a toolchain:
  2305. root:/opt# mkdir lfs/{usr,bin,sbin}
  2306. root:/opt# chown -R lfs:lfs lfs
  2307.  
  2308. 6.2. Preparing Virtual Kernel File Systems
  2309. lfs:~/sources/gcc-5.3.0/build$ export LFS=/opt/lfs
  2310. lfs:~/sources/gcc-5.3.0/build$ mkdir -pv $LFS/{dev,proc,sys,run}
  2311. mkdir: created directory '/opt/lfs/dev'
  2312. mkdir: created directory '/opt/lfs/proc'
  2313. mkdir: created directory '/opt/lfs/sys'
  2314. mkdir: created directory '/opt/lfs/run'
  2315.  
  2316. 6.5. Creating Directories
  2317. lfs:/$ mkdir -pv $LFS/{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt}
  2318. mkdir: created directory '/opt/lfs/boot'
  2319. mkdir: created directory '/opt/lfs/etc'
  2320. mkdir: created directory '/opt/lfs/etc/opt'
  2321. mkdir: created directory '/opt/lfs/etc/sysconfig'
  2322. mkdir: created directory '/opt/lfs/home'
  2323. mkdir: created directory '/opt/lfs/lib'
  2324. mkdir: created directory '/opt/lfs/lib/firmware'
  2325. mkdir: created directory '/opt/lfs/mnt'
  2326. mkdir: created directory '/opt/lfs/opt'
  2327.  
  2328. lfs:/$ mkdir -pv $LFS/{media/{floppy,cdrom},sbin,srv,var}
  2329. mkdir: created directory '/opt/lfs/media'
  2330. mkdir: created directory '/opt/lfs/media/floppy'
  2331. mkdir: created directory '/opt/lfs/media/cdrom'
  2332. mkdir: created directory '/opt/lfs/srv'
  2333. mkdir: created directory '/opt/lfs/var'
  2334.  
  2335. lfs:/$ install -dv -m 0750 $LFS/root
  2336.  
  2337. lfs:/$ install -dv -m 1777 $LFS/tmp $LFS/var/tmp
  2338. install: creating directory '/opt/lfs/tmp'
  2339. install: creating directory '/opt/lfs/var/tmp'
  2340.  
  2341. lfs:/$ mkdir -pv $LFS/usr/{,local/}{bin,include,lib,sbin,src}
  2342. mkdir: created directory '/opt/lfs/usr/bin'
  2343. mkdir: created directory '/opt/lfs/usr/include'
  2344. mkdir: created directory '/opt/lfs/usr/lib'
  2345. mkdir: created directory '/opt/lfs/usr/sbin'
  2346. mkdir: created directory '/opt/lfs/usr/src'
  2347. mkdir: created directory '/opt/lfs/usr/local'
  2348. mkdir: created directory '/opt/lfs/usr/local/bin'
  2349. mkdir: created directory '/opt/lfs/usr/local/include'
  2350. mkdir: created directory '/opt/lfs/usr/local/lib'
  2351. mkdir: created directory '/opt/lfs/usr/local/sbin'
  2352. mkdir: created directory '/opt/lfs/usr/local/src'
  2353.  
  2354. lfs:/$ mkdir -pv $LFS/usr/{,local/}share/{color,dict,doc,info,locale,man}
  2355. mkdir: created directory '/opt/lfs/usr/share'
  2356. mkdir: created directory '/opt/lfs/usr/share/color'
  2357. mkdir: created directory '/opt/lfs/usr/share/dict'
  2358. mkdir: created directory '/opt/lfs/usr/share/doc'
  2359. mkdir: created directory '/opt/lfs/usr/share/info'
  2360. mkdir: created directory '/opt/lfs/usr/share/locale'
  2361. mkdir: created directory '/opt/lfs/usr/share/man'
  2362. mkdir: created directory '/opt/lfs/usr/local/share'
  2363. mkdir: created directory '/opt/lfs/usr/local/share/color'
  2364. mkdir: created directory '/opt/lfs/usr/local/share/dict'
  2365. mkdir: created directory '/opt/lfs/usr/local/share/doc'
  2366. mkdir: created directory '/opt/lfs/usr/local/share/info'
  2367. mkdir: created directory '/opt/lfs/usr/local/share/locale'
  2368. mkdir: created directory '/opt/lfs/usr/local/share/man'
  2369.  
  2370. lfs:/$ mkdir -v $LFS/usr/{,local/}share/{misc,terminfo,zoneinfo}
  2371. mkdir: created directory '/opt/lfs/usr/share/misc'
  2372. mkdir: created directory '/opt/lfs/usr/share/terminfo'
  2373. mkdir: created directory '/opt/lfs/usr/share/zoneinfo'
  2374. mkdir: created directory '/opt/lfs/usr/local/share/misc'
  2375. mkdir: created directory '/opt/lfs/usr/local/share/terminfo'
  2376. mkdir: created directory '/opt/lfs/usr/local/share/zoneinfo'
  2377.  
  2378. lfs:/$ mkdir -v $LFS/usr/libexec
  2379. mkdir: created directory '/opt/lfs/usr/libexec'
  2380.  
  2381. lfs:/$ mkdir -pv $LFS/usr/{,local/}share/man/man{1..8}
  2382. mkdir: created directory '/opt/lfs/usr/share/man/man1'
  2383. mkdir: created directory '/opt/lfs/usr/share/man/man2'
  2384. mkdir: created directory '/opt/lfs/usr/share/man/man3'
  2385. mkdir: created directory '/opt/lfs/usr/share/man/man4'
  2386. mkdir: created directory '/opt/lfs/usr/share/man/man5'
  2387. mkdir: created directory '/opt/lfs/usr/share/man/man6'
  2388. mkdir: created directory '/opt/lfs/usr/share/man/man7'
  2389. mkdir: created directory '/opt/lfs/usr/share/man/man8'
  2390. mkdir: created directory '/opt/lfs/usr/local/share/man/man1'
  2391. mkdir: created directory '/opt/lfs/usr/local/share/man/man2'
  2392. mkdir: created directory '/opt/lfs/usr/local/share/man/man3'
  2393. mkdir: created directory '/opt/lfs/usr/local/share/man/man4'
  2394. mkdir: created directory '/opt/lfs/usr/local/share/man/man5'
  2395. mkdir: created directory '/opt/lfs/usr/local/share/man/man6'
  2396. mkdir: created directory '/opt/lfs/usr/local/share/man/man7'
  2397. mkdir: created directory '/opt/lfs/usr/local/share/man/man8'
  2398.  
  2399.  
  2400. root:/home/lfs# mkdir /opt/lfs/usr/local/lib64
  2401. root:/home/lfs# chown lfs:lfs /opt/lfs/usr/local/lib64
  2402.  
  2403.  
  2404. '/opt/lfs/usr/local/lib64/lib' -> 'lib'
  2405. '/opt/lfs/usr/local/lib64/lib64' -> '/opt/lfs/lib64'
  2406. '/opt/lfs/usr/local/lib64/ln' -> 'ln'
  2407. ln: failed to create symbolic link '/opt/lfs/usr/local/lib64/lib': File exists
  2408. ln: failed to create symbolic link '/opt/lfs/usr/local/lib64/lib64': File exists
  2409. ln: failed to create symbolic link '/opt/lfs/usr/local/lib64/ln': File exists
  2410. ln: failed to create symbolic link '/opt/lfs/usr/local/lib64/lib': File exists
  2411.  
  2412. lfs:~$ case $(uname -m) in x86_64) \
  2413. ln -sv lib $LFS/lib64; \
  2414. ln -sv lib $LFS/usr/lib64; \
  2415. ln -sv lib $LFS/usr/local/lib64 ;; esac
  2416.  
  2417. '/opt/lfs/lib64' -> 'lib'
  2418. '/opt/lfs/usr/lib64' -> 'lib'
  2419. '/opt/lfs/usr/local/lib64/lib' -> 'lib'
  2420.  
  2421. lfs:~$ mkdir -v $LFS/var/{log,mail,spool}
  2422. mkdir: created directory '/opt/lfs/var/log'
  2423. mkdir: created directory '/opt/lfs/var/mail'
  2424. mkdir: created directory '/opt/lfs/var/spool'
  2425.  
  2426. lfs:~$ ln -sv $LFS/run/lock $LFS/var/lock
  2427. '/opt/lfs/var/lock' -> '/opt/lfs/run/lock'
  2428.  
  2429. lfs:~$ mkdir -pv $LFS/var/{opt,cache,lib/{color,misc,locate},local}
  2430. mkdir: created directory '/opt/lfs/var/opt'
  2431. mkdir: created directory '/opt/lfs/var/cache'
  2432. mkdir: created directory '/opt/lfs/var/lib'
  2433. mkdir: created directory '/opt/lfs/var/lib/color'
  2434. mkdir: created directory '/opt/lfs/var/lib/misc'
  2435. mkdir: created directory '/opt/lfs/var/lib/locate'
  2436. mkdir: created directory '/opt/lfs/var/local'
  2437.  
  2438. 6.6. Creating Essential Files and Symlinks
  2439. lfs:~$ ln -sv /tools/bin/{bash,cat,echo,pwd,stty} $LFS/bin
  2440. '/opt/lfs/bin/bash' -> '/tools/bin/bash'
  2441. '/opt/lfs/bin/cat' -> '/tools/bin/cat'
  2442. '/opt/lfs/bin/echo' -> '/tools/bin/echo'
  2443. '/opt/lfs/bin/pwd' -> '/tools/bin/pwd'
  2444. '/opt/lfs/bin/stty' -> '/tools/bin/stty'
  2445.  
  2446. lfs:~$ ln -sv /tools/lib/libgcc_s.so{,.1} $LFS/usr/lib
  2447. '/opt/lfs/usr/lib/libgcc_s.so' -> '/tools/lib/libgcc_s.so'
  2448. '/opt/lfs/usr/lib/libgcc_s.so.1' -> '/tools/lib/libgcc_s.so.1'
  2449.  
  2450. lfs:~$ ln -sv /tools/lib/libstdc++.so{,.6} $LFS/usr/lib
  2451. '/opt/lfs/usr/lib/libstdc++.so' -> '/tools/lib/libstdc++.so'
  2452. '/opt/lfs/usr/lib/libstdc++.so.6' -> '/tools/lib/libstdc++.so.6'
  2453.  
  2454. lfs:~$ sed 's/tools/opt\/lfs\/usr/' /tools/lib/libstdc++.la > $LFS/usr/lib/libstdc++.la
  2455.  
  2456. lfs:~$ ln -sv bash $LFS/bin/sh
  2457. '/opt/lfs/bin/sh' -> 'bash'
  2458.  
  2459. lfs:~$ touch $LFS/var/log/{btmp,lastlog,wtmp}
  2460. lfs:~$ sudo chgrp -v utmp $LFS/var/log/lastlog
  2461. changed group of '/opt/lfs/var/log/lastlog' from lfs to utmp
  2462. lfs:~$ sudo chmod -v 664 /var/log/lastlog
  2463. mode of '/var/log/lastlog' changed from 0644 (rw-r--r--) to 0664 (rw-rw-r--)
  2464. lfs:~$ sudo chmod -v 600 /var/log/btmp
  2465. mode of '/var/log/btmp' retained as 0600 (rw-------)
  2466.  
  2467. 6.7.1. Installation of Linux API Headers
  2468. make mrproper
  2469. make INSTALL_HDR_PATH=dest headers_install
  2470. find dest/include \( -name .install -o -name ..install.cmd \) -delete
  2471. cp -rv dest/include/* /usr/include
  2472.  
  2473. 6.9.1. Installation of Glibc
  2474. lfs:~/sources/glibc-2.23$ rm -fR *
  2475. lfs:~/sources/glibc-2.23$ cd ..
  2476. lfs:~/sources$ tar -xf /monster/sources/glibc-2.23.tar.xz
  2477. lfs:~/sources$ cd glibc-2.23/
  2478.  
  2479. lfs:~/sources/glibc-2.23$ mkdir -v build
  2480. mkdir: created directory 'build'
  2481. lfs:~/sources/glibc-2.23/build$ ../configure --prefix=/opt/lfs/usr --disable-profile --enable-kernel=2.6.32 --enable-obsolete-rpc
  2482. lfs:~/sources/glibc-2.23/build$ make
  2483. lfs:~/sources/glibc-2.23/build$ make check
  2484. lfs:~/sources/glibc-2.23/build$ touch $LFS/etc/ld.so.conf
  2485.  
  2486. lfs:~/sources/glibc-2.23/build$ cp -v ../nscd/nscd.conf $LFS/etc/nscd.conf
  2487. '../nscd/nscd.conf' -> '/opt/lfs/etc/nscd.conf'
  2488.  
  2489. lfs:~/sources/glibc-2.23/build$ mkdir -pv $LFS/var/cache/nscd
  2490. lfs:~/sources/glibc-2.23/build$ mkdir -pv $LFS/usr/lib/locale
  2491. mkdir: created directory '/opt/lfs/usr/lib/locale'
  2492.  
  2493. lfs:/tools/lib$ mkdir locale
  2494. lfs:~$ localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8
  2495. lfs:~$ localedef -i de_DE -f ISO-8859-1 de_DE
  2496. lfs:~$ localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
  2497. lfs:~$ localedef -i de_DE -f UTF-8 de_DE.UTF-8
  2498. lfs:~$ localedef -i en_GB -f UTF-8 en_GB.UTF-8
  2499. lfs:~$ localedef -i en_HK -f ISO-8859-1 en_HK
  2500. lfs:~$ localedef -i en_PH -f ISO-8859-1 en_PH
  2501. lfs:~$ localedef -i en_US -f ISO-8859-1 en_US
  2502. lfs:~$ localedef -i en_US -f UTF-8 en_US.UTF-8
  2503. lfs:~$ localedef -i es_MX -f ISO-8859-1 es_MX
  2504. lfs:~$ localedef -i fa_IR -f UTF-8 fa_IR
  2505. lfs:~$ localedef -i fr_FR -f ISO-8859-1 fr_FR
  2506. lfs:~$ localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro
  2507. lfs:~$ localedef -i fr_FR -f UTF-8 fr_FR.UTF-8
  2508. lfs:~$ localedef -i it_IT -f ISO-8859-1 it_IT
  2509. lfs:~$ localedef -i it_IT -f UTF-8 it_IT.UTF-8
  2510. lfs:~$ localedef -i ja_JP -f EUC-JP ja_JP
  2511. lfs:~$ localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
  2512. lfs:~$ localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
  2513. lfs:~$ localedef -i tr_TR -f UTF-8 tr_TR.UTF-8
  2514. lfs:~$ localedef -i zh_CN -f GB18030 zh_CN.GB18030
  2515.  
  2516. 6.9.2.3. Configuring the Dynamic Loader
  2517. $ cat > $LFS/etc/ld.so.conf << "EOF"
  2518. > # Begin /etc/ld.so.conf
  2519. > /opt/lfs/usr/local/lib
  2520. > /opt/lfs/opt/lib
  2521.  
  2522. lfs:~/sources/glibc-2.23/build$ mkdir -pv $LFS/etc/ld.so.conf.d
  2523. lfs:~/sources/glibc-2.23/build$ cp $LFS/etc/ld.so.conf /opt/lfs/usr/etc/
  2524. lfs:~/sources/glibc-2.23/build$ make install
  2525.  
  2526. ==========================================================================================
  2527. 6.10. Adjusting the Toolchain
  2528. 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:
  2529.  
  2530. lfs:~$ mv -v /tools/bin/{ld,ld-old}
  2531. '/tools/bin/ld' -> '/tools/bin/ld-old'
  2532. lfs:~$ mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old}
  2533. '/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/x86_64-pc-linux-gnu/bin/ld-old'
  2534. lfs:~$ mv -v /tools/bin/{ld-new,ld}
  2535. '/tools/bin/ld-new' -> '/tools/bin/ld'
  2536. lfs:~$ ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld
  2537. '/tools/x86_64-pc-linux-gnu/bin/ld' -> '/tools/bin/ld'
  2538.  
  2539. 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:
  2540.  
  2541. gcc -dumpspecs | sed -e 's@/tools@@g' \
  2542. -e '/\*startfile_prefix_spec:/{n;s@.*@/opt/lfs/usr/lib/ @}' \
  2543. -e '/\*cpp:/{n;s@$@ -isystem /opt/lfs/usr/include@}' > \
  2544. `dirname $(gcc --print-libgcc-file-name)`/specs
  2545.  
  2546. editar gcc::specs:
  2547. lfs:~/sources/binutils-2.26/build$ vi /monster/tools/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0/specs
  2548.  
  2549.  
  2550. en *link::%{m16|m32|mx32:;:-dynamic-linker
  2551. ajustar /lib64/ld-linux-x86-64.so.2 por /opt/lfs/lib64/ld-linux-x86-64.so.2
  2552. %{m16|m32|mx32:;:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:/opt/lfs/lib64/ld-linux-x86-64.so.2}}}
  2553. %{m16|m32|mx32:;:-dynamic-linker %{muclibc:/lib/ld64-uClibc.so.0;:%{mbionic:/system/bin/linker64;:/opt/lfs/lib64/ld-linux-x86-64.so.2}}}
  2554.  
  2555. lfs:~/sources/binutils-2.26/build$ cp -a /tools/lib64/ld-linux-x86-64.so.2 /opt/lfs/lib64/
  2556. lfs:~/sources/binutils-2.26/build$ cp -a /tools/lib64/ld-2.23.so /opt/lfs/lib64/
  2557.  
  2558. lfs:~/sources/binutils-2.26/build$ ldd a.out
  2559. linux-vdso.so.1 (0x00007fff2fbde000)
  2560. libc.so.6 => /tools/lib/libc.so.6 (0x00007f1694619000)
  2561. /opt/lfs/lib64/ld-linux-x86-64.so.2 (0x00007f16949ba000)
  2562.  
  2563. copiar libc.so.6 tambien a esa ruta:
  2564. lfs:~/sources/binutils-2.26/build$ cp -a /tools/lib64/libc.so.6 /opt/lfs/lib64/
  2565. lfs:~/sources/binutils-2.26/build$ cp -a /tools/lib64/libc-2.23.so /opt/lfs/lib64/
  2566.  
  2567. ================================================================================================
  2568. 6.11.1. Installation of Zlib
  2569. 6.12.1. Installation of File
  2570. lfs:~/sources/file-5.25$ ./configure --prefix=/opt/lfs/usr
  2571.  
  2572. 6.13.1. Installation of Binutils
  2573. lfs:~/sources/binutils-2.26/build$ ../configure --prefix=/opt/lfs/usr --enable-shared --disable-werror
  2574. lfs:~/sources/binutils-2.26/build$ make tooldir=/opt/lfs/usr
  2575. lfs:~/sources/binutils-2.26/build$ make check
  2576. lfs:~/sources/binutils-2.26/build$ make tooldir=/opt/lfs/usr install
  2577.  
  2578. lfs:~/sources/binutils-2.26/build$ /opt/lfs/usr/bin/ldd /opt/lfs/usr/bin/readelf
  2579. linux-vdso.so.1 (0x00007ffdb2180000)
  2580. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fb704b65000)
  2581. libc.so.6 => /tools/lib/libc.so.6 (0x00007fb7047c4000)
  2582. /tools/lib64/ld-linux-x86-64.so.2 (0x00007fb704d69000)
  2583.  
  2584. 6.14.1. Installation of GMP
  2585. ./configure --prefix=/opt/lfs/usr \
  2586. --enable-cxx \
  2587. --disable-static \
  2588. --docdir=/opt/lfs/usr/share/doc/gmp-6.1.0
  2589. configure: summary of build options:
  2590.  
  2591. Version: GNU MP 6.1.0
  2592. Host type: haswell-pc-linux-gnu
  2593. ABI: 64
  2594. Install prefix: /opt/lfs/usr
  2595. Compiler: gcc
  2596. Static libraries: no
  2597. Shared libraries: yes
  2598.  
  2599. make
  2600. make html
  2601. make check 2>&1 | tee gmp-check-log
  2602. lfs:~/sources/gmp-6.1.0$ awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
  2603. 190
  2604. make install
  2605. make install-html
  2606.  
  2607. 6.15.1. Installation of MPFR
  2608. lfs:~/sources$ tar -xf /monster/sources/mpfr-3.1.3.tar.xz
  2609. lfs:~/sources/mpfr-3.1.3$ patch -Np1 -i /monster/sources/mpfr-3.1.3-upstream_fixes-2.patch
  2610. patching file doc/mpfr.info
  2611. patching file doc/mpfr.texi
  2612. patching file PATCHES
  2613. patching file src/div_2si.c
  2614. patching file src/div_2ui.c
  2615. patching file src/div.c
  2616. patching file src/div_ui.c
  2617. patching file src/fits_intmax.c
  2618. patching file src/fits_s.h
  2619. patching file src/fits_u.h
  2620. patching file src/frexp.c
  2621. patching file src/jyn_asympt.c
  2622. patching file src/lngamma.c
  2623. patching file src/mpfr.h
  2624. patching file src/mul_2si.c
  2625. patching file src/mulders.c
  2626. patching file src/mul_ui.c
  2627. patching file src/root.c
  2628. patching file src/round_p.c
  2629. patching file src/round_prec.c
  2630. patching file src/si_op.c
  2631. patching file src/sqrt.c
  2632. patching file src/ui_div.c
  2633. patching file src/version.c
  2634. patching file src/zeta.c
  2635. patching file tests/tcan_round.c
  2636. patching file tests/tdiv.c
  2637. patching file tests/tfits.c
  2638. patching file tests/tfrexp.c
  2639. patching file tests/tj0.c
  2640. patching file tests/tlngamma.c
  2641. patching file tests/tmul_2exp.c
  2642. patching file tests/troot.c
  2643. patching file tests/tsqrt.c
  2644. patching file tests/tzeta.c
  2645. patching file VERSION
  2646.  
  2647. ./configure --prefix=/opt/lfs/usr \
  2648. --disable-static \
  2649. --enable-thread-safe \
  2650. --docdir=/opt/lfs/usr/share/doc/mpfr-3.1.3
  2651. error:
  2652. configure: error: gmp.h can't be found, or is unusable.
  2653. fix: agregar:
  2654. --with-gmp=/opt/lfs/usr
  2655.  
  2656. make
  2657. make html
  2658. make check
  2659. make install
  2660. make install-html
  2661.  
  2662.  
  2663. =====================================================
  2664. OpenMPI:
  2665. lfs:~/sources/openmpi-1.10.2/build$ ../configure --build=x86_64-unknown-linux-gnu --prefix=/opt/lfs/usr
  2666. lfs:~/sources/openmpi-1.10.2/build$ make all install
  2667.  
  2668. Munge
  2669. https://github.com/dun/munge/wiki/Installation-Guide#starting-the-daemon
  2670. lfs:~/sources/munge-0.5.12$ ./configure --prefix=/opt/lfs/usr --with-openssl-prefix=/opt/lfs/usr --sysconfdir=/etc
  2671.  
  2672.  
  2673. May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: Starting MUNGE authentication service...
  2674. May 19 14:06:32 sullivan.dimar.mil.co munged[3682]: Running on "sullivan.dimar.mil.co" (10.0.3.2)
  2675. May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: munge.service: control process exited, code=exited status=1
  2676. May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: Failed to start MUNGE authentication service.
  2677. May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: Unit munge.service entered failed state.
  2678. May 19 14:06:32 sullivan.dimar.mil.co systemd[1]: munge.service failed.
  2679.  
  2680.  
  2681. generar munge.key:
  2682. [root@sullivan wilderman]# dd if=/dev/random bs=1 count=1024 >/etc/munge/munge.key
  2683. [root@sullivan wilderman]# chown munge:munge /etc/munge/munge.key
  2684. [root@sullivan wilderman]# chmod 0400 /etc/munge/munge.key
  2685. systemctl start munge
  2686.  
  2687. systemctl edit --system --full munge
  2688.  
  2689. This command will perform the following actions:
  2690.  
  2691. Copy munge.service to /etc/systemd/system/munge.service
  2692. Invoke an editor on this new munge.service file
  2693. Reload the systemd configuration afterwards
  2694. While in the editor, append either --syslog or --force to the ExecStart line:
  2695.  
  2696. ExecStart=/usr/sbin/munged --syslog
  2697.  
  2698. errores
  2699. [root@sullivan wilderman]# ccze | tail -f /var/log/munge/munged.log
  2700. 2016-05-19 15:20:50 -0500 Error: Keyfile must be at least 32 bytes
  2701. 2016-05-19 15:26:43 -0500 Notice: Running on "sullivan.dimar.mil.co" (10.0.3.2)
  2702. 2016-05-19 15:26:43 -0500 Info: PRNG seeded with 1024 bytes from "/dev/urandom"
  2703. 2016-05-19 15:26:43 -0500 Error: Keyfile must be at least 32 bytes
  2704. 2016-05-19 16:22:29 -0500 Notice: Running on "sullivan.dimar.mil.co" (10.0.3.2)
  2705. 2016-05-19 16:22:29 -0500 Info: PRNG seeded with 1024 bytes from "/dev/urandom"
  2706. 2016-05-19 16:22:29 -0500 Error: Keyfile must be at least 32 bytes
  2707. 2016-05-19 16:22:31 -0500 Notice: Running on "sullivan.dimar.mil.co" (10.0.3.2)
  2708. 2016-05-19 16:22:31 -0500 Info: PRNG seeded with 1024 bytes from "/dev/urandom"
  2709. 2016-05-19 16:22:31 -0500 Error: Keyfile must be at least 32 bytes
  2710.  
  2711. compilacion MUNGE:
  2712. lfs:~/sources/munge-0.5.12$ ./configure --prefix=/opt/lfs/usr --with-openssl-prefix=/opt/lfs/usr --sysconfdir=/etc
  2713.  
  2714. 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:
  2715.  
  2716. $ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && make && sudo make install
  2717.  
  2718. lfs:~/sources/munge-0.5.12$ sudo systemctl start munge.service
  2719. * munge.service - MUNGE authentication service
  2720. Loaded: loaded (/etc/systemd/system/munge.service; disabled; vendor preset: disabled)
  2721. Active: active (running) since Thu 2016-05-19 18:23:42 COT; 2s ago
  2722. Docs: man:munged(8)
  2723. Process: 13179 ExecStart=/opt/lfs/usr/sbin/munged (code=exited, status=0/SUCCESS)
  2724. Main PID: 13181 (munged)
  2725. CGroup: /system.slice/munge.service
  2726. `-13181 /opt/lfs/usr/sbin/munged
  2727.  
  2728. May 19 18:23:42 sullivan.dimar.mil.co systemd[1]: Starting MUNGE authentication service...
  2729. May 19 18:23:42 sullivan.dimar.mil.co systemd[1]: Started MUNGE authentication service.
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736. lfs:~/sources/munge-0.5.12$ which munge
  2737. /opt/lfs/usr/bin/munge
  2738. lfs:~/sources/munge-0.5.12$ which munged
  2739. /opt/lfs/usr/sbin/munged
  2740.  
  2741. Grab some pseudorandom data (recommended for the impatient):
  2742. root:/etc/munge# dd if=/dev/urandom bs=1 count=1024 >/etc/munge/munge.key
  2743.  
  2744. root:/etc/munge# systemctl status munge.service
  2745. * munge.service - MUNGE authentication service
  2746. Loaded: loaded (/etc/systemd/system/munge.service; disabled; vendor preset: disabled)
  2747. Active: failed (Result: exit-code) since Thu 2016-05-19 18:08:26 COT; 26s ago
  2748. Docs: man:munged(8)
  2749. Process: 8720 ExecStart=/opt/lfs/usr/sbin/munged (code=exited, status=1/FAILURE)
  2750.  
  2751. May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: Starting MUNGE authentication service...
  2752. 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
  2753. May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: munge.service: control process exited, code=exited status=1
  2754. May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: Failed to start MUNGE authentication service.
  2755. May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: Unit munge.service entered failed state.
  2756. May 19 18:08:26 sullivan.dimar.mil.co systemd[1]: munge.service failed.
  2757.  
  2758. root:/etc/munge# systemctl start munge.service
  2759.  
  2760. !!!finalmente corriendo munged
  2761.  
  2762. root:/etc/munge# systemctl status munge.service
  2763. * munge.service - MUNGE authentication service
  2764. Loaded: loaded (/etc/systemd/system/munge.service; disabled; vendor preset: disabled)
  2765. Active: active (running) since Thu 2016-05-19 18:11:56 COT; 13s ago
  2766. Docs: man:munged(8)
  2767. Process: 8756 ExecStart=/usr/sbin/munged (code=exited, status=0/SUCCESS)
  2768. Main PID: 8758 (munged)
  2769. CGroup: /system.slice/munge.service
  2770. `-8758 /usr/sbin/munged
  2771.  
  2772. May 19 18:11:56 sullivan.dimar.mil.co systemd[1]: Starting MUNGE authentication service...
  2773. May 19 18:11:56 sullivan.dimar.mil.co systemd[1]: Started MUNGE authentication service.
  2774.  
  2775. verifica PID:
  2776. root:/etc/munge# ps aux | grep munged
  2777. munge 8758 0.0 0.0 175836 1984 ? Sl 18:11 0:00 /usr/sbin/munged
  2778.  
  2779. Check if a credential can be locally decoded:
  2780. root:/etc/munge# /usr/bin/munge -n | /usr/bin/unmunge
  2781. STATUS: Success (0)
  2782. ENCODE_HOST: sullivan.dimar.mil.co (10.0.3.2)
  2783. ENCODE_TIME: 2016-05-19 18:16:11 -0500 (1463699771)
  2784. DECODE_TIME: 2016-05-19 18:16:11 -0500 (1463699771)
  2785. TTL: 300
  2786. CIPHER: aes128 (4)
  2787. MAC: sha1 (3)
  2788. ZIP: none (0)
  2789. UID: root (0)
  2790. GID: root (0)
  2791. LENGTH: 0
  2792.  
  2793. ======================================================================================================
  2794. ========================================================================
  2795. Scalable Checkpoint / Restart (SCR) Library
  2796. ========================================================================
  2797.  
  2798. The Scalable Checkpoint / Restart (SCR) library enables MPI applications
  2799. to utilize distributed storage on Linux clusters to attain high file I/O
  2800. bandwidth for checkpointing and restarting large-scale jobs. With SCR,
  2801. jobs run more efficiently, recompute less work upon a failure, and reduce
  2802. load on critical shared resources such as the parallel file system.
  2803.  
  2804. Detailed usage is provided in the user manual:
  2805.  
  2806. doc/scr_users_manual.pdf
  2807.  
  2808. -----------------------------
  2809. Dependencies
  2810. -----------------------------
  2811.  
  2812. SCR depends on a number of other software packages.
  2813.  
  2814. Required:
  2815.  
  2816. pdsh -- parallel remote shell command (pdsh, dshbak)
  2817. http://sourceforge.net/projects/pdsh
  2818. e.g.,
  2819. wget http://downloads.sourceforge.net/project/pdsh/pdsh/pdsh-2.18/pdsh-2.18.tar.bz2
  2820. bunzip2 pdsh-2.18.tar.bz2
  2821. tar -xf pdsh-2.18.tar
  2822. pushd pdsh-2.18
  2823. ./configure --prefix=/tmp
  2824. make
  2825. make install
  2826.  
  2827. Date::Manip -- Perl module for date/time interpretation
  2828. http://search.cpan.org/~sbeck/Date-Manip-5.54/lib/Date/Manip.pod
  2829.  
  2830. SLURM -- resource manager
  2831. http://sourceforge.net/projects/slurm
  2832.  
  2833. Optional:
  2834.  
  2835. libyogrt -- your one get remaining time library
  2836. Not currently available outside of LLNL.
  2837. Enables a running job to determine how much time it has left
  2838. in its resource allocation.
  2839.  
  2840. io-watchdog -- tool to catch and terminate hanging jobs
  2841. http://code.google.com/p/io-watchdog
  2842.  
  2843. PDSH:
  2844. lfs:~/sources$ tar xf ../spoa.new/pdsh-2.18.tar.bz2
  2845. lfs:~/sources/pdsh-2.18$ ./configure --build=x86_64-unknown-linux-gnu --prefix=/opt/lfs --with-ssh --with-slurm
  2846.  
  2847. Instalacion de librerias y desarrollo MariaDB:
  2848. lfs:~/sources/pdsh-2.18$ sudo yum install mariadb-libs mariadb-devel
  2849.  
  2850. CPAN::Date::Manip
  2851. lfs:~$ cpan Date::Manip
  2852. ...
  2853. ..
  2854. .
  2855. Appending installation info to /tools/lib/perl5/5.22.1/x86_64-linux/perllocal.pod
  2856. SBECK/Date-Manip-6.53.tar.gz
  2857. /tools/bin/make install -- OK
  2858.  
  2859.  
  2860. JSON:
  2861. https://github.com/json-c/json-c/wiki
  2862. json-c
  2863. Building on Unix with git, gcc and autotools
  2864.  
  2865. Home page for json-c: https://github.com/json-c/json-c/wiki
  2866.  
  2867. Caution: do NOT use sources from svn.metaparadigm.com, they are old.
  2868.  
  2869. Prerequisites:
  2870.  
  2871. gcc, clang, or another C compiler
  2872. libtool
  2873. If you're not using a release tarball, you'll also need:
  2874.  
  2875. autoconf (autoreconf)
  2876. automake
  2877. Make sure you have a complete libtool install, including libtoolize.
  2878.  
  2879. json-c GitHub repo: https://github.com/json-c/json-c
  2880.  
  2881. $ git clone https://github.com/json-c/json-c.git
  2882. $ cd json-c
  2883. $ sh autogen.sh
  2884. followed by
  2885.  
  2886. $ ./configure
  2887. $ make
  2888. $ make install
  2889. To build and run the test programs:
  2890.  
  2891. $ make check
  2892.  
  2893. lfs:~/git/json-c$ sh autogen.sh
  2894. autoreconf: Entering directory `.'
  2895. autoreconf: configure.ac: not using Gettext
  2896. autoreconf: running: aclocal -I autoconf-archive/m4
  2897. autoreconf: configure.ac: tracing
  2898. autoreconf: running: libtoolize --copy
  2899. libtoolize: putting auxiliary files in '.'.
  2900. libtoolize: copying file './ltmain.sh'
  2901. libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
  2902. libtoolize: and rerunning libtoolize and aclocal.
  2903. libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
  2904. autoreconf: running: /tools/bin/autoconf --include=autoconf-archive/m4
  2905. autoreconf: running: /tools/bin/autoheader --include=autoconf-archive/m4
  2906. autoreconf: running: automake --add-missing --copy --no-force
  2907. configure.ac:32: installing './compile'
  2908. configure.ac:78: installing './config.guess'
  2909. configure.ac:78: installing './config.sub'
  2910. configure.ac:6: installing './install-sh'
  2911. configure.ac:6: installing './missing'
  2912. Makefile.am: installing './INSTALL'
  2913. Makefile.am: installing './depcomp'
  2914. parallel-tests: installing './test-driver'
  2915. autoreconf: Leaving directory `.'
  2916.  
  2917. lfs:~/sources/json-c$ CFLAGS=-Wno-error=unused-but-set-variable ./configure --prefix=/opt/lfs --build=x86_64-unknown-linux-gnu
  2918.  
  2919.  
  2920. SLURM WEB:
  2921. lfs:~/git$ git clone https://github.com/edf-hpc/slurm-web.git
  2922.  
  2923. LBNL Node Health Check (NHC)
  2924. https://github.com/mej/nhc
  2925. lfs:~/spoa.new$ wget -c https://github.com/mej/nhc/archive/1.4.2.tar.gz
  2926. lfs:~/sources/nhc-1.4.2$ sh autogen.sh
  2927. lfs:~/sources/nhc-1.4.2$ make
  2928. lfs:~/sources/nhc-1.4.2$ sudo make install
  2929.  
  2930. /etc/nhc/nhc.conf
  2931. # Set these to your correct socket, core, and thread counts.
  2932. * || check_hw_cpuinfo 2 32 64
  2933.  
  2934. SLURM:
  2935. Get the Slurm source code
  2936. You can obtain the latest bleeding-edge SchedMD source code by anonymous Git access.
  2937. git clone git://github.com/SchedMD/slurm.git
  2938. o
  2939. lfs:~/spoa.new$ wget -c http://www.schedmd.com/download/latest/slurm-15.08.11.tar.bz2
  2940. lfs:~/sources$ tar xf ../spoa.new/slurm-15.08.11.tar.bz2
  2941. checking for GLIB - version >= 2.7.1... Package glib-2.0 was not found in the pkg-config search path.
  2942. Perhaps you should add the directory containing `glib-2.0.pc'
  2943. to the PKG_CONFIG_PATH environment variable
  2944. No package 'glib-2.0' found
  2945. Package gthread-2.0 was not found in the pkg-config search path.
  2946. Perhaps you should add the directory containing `gthread-2.0.pc'
  2947. to the PKG_CONFIG_PATH environment variable
  2948. No package 'gthread-2.0' found
  2949. no
  2950. *** Could not run GLIB test program, checking why...
  2951. *** The test program failed to compile or link. See the file config.log for the
  2952. *** exact error that occured. This usually means GLIB is incorrectly installed.
  2953. checking for pkg-config... /tools/bin/pkg-config
  2954. checking for GTK+ - version >= 2.7.1... Package gtk+-2.0 was not found in the pkg-config search path.
  2955. Perhaps you should add the directory containing `gtk+-2.0.pc'
  2956. to the PKG_CONFIG_PATH environment variable
  2957. No package 'gtk+-2.0' found
  2958. Package gthread-2.0 was not found in the pkg-config search path.
  2959. Perhaps you should add the directory containing `gthread-2.0.pc'
  2960. to the PKG_CONFIG_PATH environment variable
  2961. No package 'gthread-2.0' found
  2962. no
  2963. *** Could not run GTK+ test program, checking why...
  2964. *** The test program failed to compile or link. See the file config.log for the
  2965. *** exact error that occured. This usually means GTK+ is incorrectly installed.
  2966. configure: WARNING: cannot build sview without gtk library
  2967.  
  2968. GLIB
  2969. http://www.linuxfromscratch.org/blfs/view/stable/general/glib2.html
  2970. GLib-2.46.2
  2971. GLib Dependencies
  2972. Required
  2973.  
  2974. libffi-3.2.1 and Python-2.7.11 or Python-3.5.1
  2975.  
  2976. libffi-3.2.1
  2977. Python-2.7.11
  2978. lfs:~/spoa.new$ wget -c https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz
  2979. lfs:~/sources$ tar xf ../spoa.new/Python-2.7.11.tar.xz
  2980. 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'
  2981.  
  2982. Python build finished, but the necessary bits to build these modules were not found:
  2983. _bsddb _curses _curses_panel
  2984. _sqlite3 _tkinter bsddb185
  2985. bz2 dbm dl
  2986. gdbm imageop readline
  2987. sunaudiodev
  2988. To find the necessary bits, look in setup.py in detect_modules() for the module's name.
  2989.  
  2990.  
  2991. Failed to build these modules:
  2992. _hashlib _ssl
  2993.  
  2994.  
  2995. GLIB-2.46:
  2996. 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'
  2997.  
  2998. Better config: (using PKG_CONFIG_PATH)
  2999. 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'
  3000.  
  3001. OpenMPI
  3002. https://www.open-mpi.org/
  3003. lfs:~/sources$ tar xf ../spoa.new/openmpi-1.10.2.tar.bz2
  3004.  
  3005. libPSL setup:
  3006. 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"
  3007.  
  3008. OpenLDAP:
  3009. 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
  3010.  
  3011. Curl:
  3012. x86_64-unknown-linux-gnu-gcc
  3013. 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"
  3014.  
  3015. curl version: 7.47.1
  3016. Host setup: x86_64-pc-linux-gnu
  3017. Install prefix: /opt/lfs/usr
  3018. Compiler: x86_64-unknown-linux-gnu-gcc
  3019. SSL support: enabled (OpenSSL)
  3020. SSH support: enabled (libSSH2)
  3021. zlib support: enabled
  3022. GSS-API support: no (--with-gssapi)
  3023. TLS-SRP support: enabled
  3024. resolver: POSIX threaded
  3025. IPv6 support: enabled
  3026. Unix sockets support: enabled
  3027. IDN support: enabled
  3028. Build libcurl: Shared=yes, Static=no
  3029. Built-in manual: enabled
  3030. --libcurl option: enabled (--disable-libcurl-option)
  3031. Verbose errors: enabled (--disable-verbose)
  3032. SSPI support: no (--enable-sspi)
  3033. ca cert bundle: /etc/pki/tls/certs/ca-bundle.crt
  3034. ca cert path: no
  3035. LDAP support: enabled (OpenLDAP)
  3036. LDAPS support: enabled
  3037. RTSP support: enabled
  3038. RTMP support: no (--with-librtmp)
  3039. metalink support: no (--with-libmetalink)
  3040. PSL support: yes
  3041. HTTP2 support: disabled (--with-nghttp2)
  3042. Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP
  3043.  
  3044. Cracklib:
  3045. 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
  3046.  
  3047. PAM:
  3048. 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
  3049.  
  3050. ===========================================================================================================================
  3051. HDF5 (intel):
  3052.  
  3053. SZIP:
  3054. 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'
  3055.  
  3056. errores:
  3057. icc: command line warning #10006: ignoring unknown option '-Wbad-function-cast'
  3058. icc: command line warning #10006: ignoring unknown option '-Wcast-align'
  3059. icc: command line warning #10006: ignoring unknown option '-Waggregate-return'
  3060. icc: command line warning #10006: ignoring unknown option '-Wredundant-decls'
  3061. icc: command line warning #10006: ignoring unknown option '-Wnested-externs'
  3062. ld: warning: libimf.so, needed by ../src/.libs/libsz.so, not found (try using -rpath or -rpath-link)
  3063. ld: warning: libsvml.so, needed by ../src/.libs/libsz.so, not found (try using -rpath or -rpath-link)
  3064. ld: warning: libirng.so, needed by ../src/.libs/libsz.so, not found (try using -rpath or -rpath-link)
  3065. ld: warning: libintlc.so.5, needed by ../src/.libs/libsz.so, not found (try using -rpath or -rpath-link)
  3066.  
  3067. fix:
  3068. 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'
  3069.  
  3070. ZLIB:
  3071. 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'
  3072. make
  3073. make check
  3074. make install
  3075.  
  3076.  
  3077. Intel + HDF5
  3078. ./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'
  3079.  
  3080. Intel2016 + HDF5 2nd. config
  3081. 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'
  3082.  
  3083. Intel 2015 + HDF5
  3084. 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'
  3085. lfs:~/sources/hdf5-1.8.17$ ldd /opt/lfs/opt/intel/lib/libhdf5hl_fortran.so.10.0.3
  3086. linux-vdso.so.1 (0x00007ffdf45b8000)
  3087. libhdf5_hl.so.10 => /opt/lfs/opt/intel/lib/libhdf5_hl.so.10 (0x00007f134898f000)
  3088. libhdf5_fortran.so.10 => /opt/lfs/opt/intel/lib/libhdf5_fortran.so.10 (0x00007f13486cb000)
  3089. libhdf5.so.10 => /opt/lfs/opt/intel/lib/libhdf5.so.10 (0x00007f134812b000)
  3090. libz.so.1 => /opt/lfs/opt/intel/lib/libz.so.1 (0x00007f1347f12000)
  3091. libifport.so.5 => /opt/intel/lib/intel64/libifport.so.5 (0x00007f1347ce5000)
  3092. libimf.so => /opt/intel/lib/intel64/libimf.so (0x00007f1347829000)
  3093. libm.so.6 => /tools/lib/libm.so.6 (0x00007f1347521000)
  3094. libintlc.so.5 => /opt/intel/lib/intel64/libintlc.so.5 (0x00007f13472c6000)
  3095. libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007f13470a8000)
  3096. libsvml.so => /opt/intel/lib/intel64/libsvml.so (0x00007f13461ca000)
  3097. libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f1345fb4000)
  3098. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f1345daf000)
  3099. libc.so.6 => /tools/lib/libc.so.6 (0x00007f1345a0e000)
  3100. libirng.so => /opt/intel/lib/intel64/libirng.so (0x00007f1345807000)
  3101. /tools/lib64/ld-linux-x86-64.so.2 (0x00007f1348dca000)
  3102.  
  3103.  
  3104.  
  3105.  
  3106. SUMMARY OF THE HDF5 CONFIGURATION
  3107. =================================
  3108.  
  3109. General Information:
  3110. -------------------
  3111. HDF5 Version: 1.8.17
  3112. Configured on: Wed Jun 15 18:04:24 UTC 2016
  3113. Configured by: [email protected]
  3114. Configure mode: production
  3115. Host system: x86_64-unknown-linux-gnu
  3116. 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
  3117. Byte sex: little-endian
  3118. Libraries: static, shared
  3119. Installation point: /opt/lfs/opt/intel
  3120.  
  3121. Compiling Options:
  3122. ------------------
  3123. Compilation Mode: production
  3124. C Compiler: /opt/intel/bin/icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc
  3125. CFLAGS:
  3126. H5_CFLAGS: -std=c99 -O3
  3127. AM_CFLAGS:
  3128. CPPFLAGS:
  3129. H5_CPPFLAGS: -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L -DNDEBUG -UH5_DEBUG_API
  3130. AM_CPPFLAGS:
  3131. Shared C Library: yes
  3132. Static C Library: yes
  3133. Statically Linked Executables: no
  3134. LDFLAGS: -L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64
  3135. H5_LDFLAGS:
  3136. AM_LDFLAGS:
  3137. Extra libraries: -lz -ldl -lm
  3138. Archiver: ar
  3139. Ranlib: ranlib
  3140. Debugged Packages:
  3141. API Tracing: no
  3142.  
  3143. Languages:
  3144. ----------
  3145. Fortran: yes
  3146. Fortran Compiler: /opt/intel/bin/ifort ( Intel(R) Fortran Intel(R) 64 Compiler Version 16.0.1.150 Build 20151021)
  3147. Fortran 2003 Compiler:
  3148. Fortran Flags:
  3149. H5 Fortran Flags: -O3
  3150. AM Fortran Flags:
  3151. Shared Fortran Library: yes
  3152. Static Fortran Library: yes
  3153.  
  3154. C++: yes
  3155. C++ Compiler: /opt/intel/bin/icpc -gxx-name=/tools/bin/x86_64-unknown-linux-gnu-g++
  3156. C++ Flags:
  3157. H5 C++ Flags:
  3158. AM C++ Flags:
  3159. Shared C++ Library: yes
  3160. Static C++ Library: yes
  3161.  
  3162. Features:
  3163. ---------
  3164. Parallel HDF5: no
  3165. High Level library: yes
  3166. Threadsafety: no
  3167. Default API Mapping: v18
  3168. With Deprecated Public Symbols: yes
  3169. I/O filters (external): deflate(zlib)
  3170. MPE: no
  3171. Direct VFD: no
  3172. dmalloc: no
  3173. Clear file buffers before write: yes
  3174. Using memory checker: no
  3175. Function Stack Tracing: no
  3176. Strict File Format Checks: no
  3177. Optimization Instrumentation: no
  3178.  
  3179. =============
  3180. OpenLDAP
  3181. 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'
  3182.  
  3183. NETCDF 4.4.0 - Intel (disable OpenDAP)
  3184. 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
  3185.  
  3186. NetCDF 4.4.0 with HDF4 support (GCC)
  3187. http://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#build_hdf4
  3188.  
  3189. HDF-4 (GCC)
  3190. 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'
  3191. ó
  3192. 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'
  3193.  
  3194. HDF-4 (Intel)
  3195. 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'
  3196.  
  3197. libjpeg-turbo:
  3198. 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'
  3199. lfs:~/sources/libjpeg-turbo-1.4.2$ ldd /opt/lfs/opt/intel/bin/tjbench
  3200. linux-vdso.so.1 (0x00007fff35fb6000)
  3201. libturbojpeg.so.0 => /opt/lfs/usr/lib/libturbojpeg.so.0 (0x00007ff88f7bf000)
  3202. libjpeg.so.62 => /opt/lfs/usr/lib/libjpeg.so.62 (0x00007ff88f553000)
  3203. libm.so.6 => /opt/lfs/usr/lib/libm.so.6 (0x00007ff88f24e000)
  3204. libgcc_s.so.1 => /opt/lfs/usr/lib/libgcc_s.so.1 (0x00007ff88f038000)
  3205. libc.so.6 => /opt/lfs/usr/lib/libc.so.6 (0x00007ff88ec97000)
  3206. libdl.so.2 => /opt/lfs/usr/lib/libdl.so.2 (0x00007ff88ea93000)
  3207. /tools/lib64/ld-linux-x86-64.so.2 (0x00007ff88fa3f000)
  3208.  
  3209.  
  3210. Then from the top-level netCDF directory:
  3211.  
  3212. 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'
  3213.  
  3214. $ # Build and install netCDF-4 with HDF4 access enabled
  3215. $ CPPFLAGS="-I${H5DIR}/include -I${H4DIR}/include" \
  3216. LDFLAGS="-L${H5DIR}/lib -L${H4DIR}/lib" \
  3217. ./configure --enable-hdf4 --enable-hdf4-file-tests
  3218. $ make check
  3219. $ make install
  3220.  
  3221. # NetCDF C Configuration Summary
  3222. ==============================
  3223.  
  3224. # General
  3225. -------
  3226. NetCDF Version: 4.4.0
  3227. Configured On: Thu Jun 16 14:15:45 UTC 2016
  3228. Host System: x86_64-unknown-linux-gnu
  3229. Build Directory: /home/lfs/sources/netcdf-4.4.0
  3230. Install Prefix: /opt/lfs/usr
  3231.  
  3232. # Compiling Options
  3233. -----------------
  3234. C Compiler: /tools/bin/x86_64-unknown-linux-gnu-gcc
  3235. CFLAGS: -g -O2
  3236. CPPFLAGS: -I/opt/lfs/usr/include
  3237. LDFLAGS: -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib
  3238. AM_CFLAGS:
  3239. AM_CPPFLAGS:
  3240. AM_LDFLAGS:
  3241. Shared Library: yes
  3242. Static Library: yes
  3243. Extra libraries: -ljpeg -lmfhdf -ldf -lhdf5_hl -lhdf5 -ldl -lm -lz -lcurl
  3244.  
  3245. # Features
  3246. --------
  3247. NetCDF-2 API: yes
  3248. HDF4 Support: yes
  3249. NetCDF-4 API: yes
  3250. NC-4 Parallel Support: no
  3251. PNetCDF Support: no
  3252. DAP Support: yes
  3253. Diskless Support: yes
  3254. MMap Support: no
  3255. JNA Support: no
  3256.  
  3257.  
  3258. NetCDF-44 (intel)
  3259. 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'
  3260.  
  3261.  
  3262. ===============
  3263.  
  3264. OpenSSL with Intel C/C++ Compiler
  3265.  
  3266. export CC='icc -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gcc'
  3267. export CXX='icpc -gxx-name=/tools/bin/x86_64-unknown-linux-gnu-g++'
  3268. export FC='ifort'
  3269. zlib:
  3270. 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
  3271.  
  3272. lfs:~/sources/openssl-1.0.2g$ ./Configure linux-x86_64-icc
  3273. Configuring for linux-x86_64-icc
  3274. no-ec_nistp_64_gcc_128 [default] OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
  3275. no-gmp [default] OPENSSL_NO_GMP (skip dir)
  3276. no-jpake [experimental] OPENSSL_NO_JPAKE (skip dir)
  3277. no-krb5 [krb5-flavor not specified] OPENSSL_NO_KRB5
  3278. no-libunbound [experimental] OPENSSL_NO_LIBUNBOUND (skip dir)
  3279. no-md2 [default] OPENSSL_NO_MD2 (skip dir)
  3280. no-rc5 [default] OPENSSL_NO_RC5 (skip dir)
  3281. no-rfc3779 [default] OPENSSL_NO_RFC3779 (skip dir)
  3282. no-sctp [default] OPENSSL_NO_SCTP (skip dir)
  3283. no-shared [default]
  3284. no-ssl-trace [default] OPENSSL_NO_SSL_TRACE (skip dir)
  3285. no-ssl2 [default] OPENSSL_NO_SSL2 (skip dir)
  3286. no-store [experimental] OPENSSL_NO_STORE (skip dir)
  3287. no-unit-test [default] OPENSSL_NO_UNIT_TEST (skip dir)
  3288. no-weak-ssl-ciphers [default] OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)
  3289. no-zlib [default]
  3290. no-zlib-dynamic [default]
  3291.  
  3292.  
  3293.  
  3294. OpenSSL shared libraries have been installed in:
  3295. /opt/lfs/opt/intel
  3296.  
  3297. If this directory is not in a standard system path for dynamic/shared
  3298. libraries, then you will have problems linking and executing
  3299. applications that use OpenSSL libraries UNLESS:
  3300.  
  3301. * you link with static (archive) libraries. If you are truly
  3302. paranoid about security, you should use static libraries.
  3303. * you use the GNU libtool code during linking
  3304. (http://www.gnu.org/software/libtool/libtool.html)
  3305. * you use pkg-config during linking (this requires that
  3306. PKG_CONFIG_PATH includes the path to the OpenSSL shared
  3307. library directory), and make use of -R or -rpath.
  3308. (http://www.freedesktop.org/software/pkgconfig/)
  3309. * you specify the system-wide link path via a command such
  3310. as crle(1) on Solaris systems.
  3311. * you add the OpenSSL shared library directory to /etc/ld.so.conf
  3312. and run ldconfig(8) on Linux systems.
  3313. * you define the LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH (HP),
  3314. DYLD_LIBRARY_PATH (MacOS X) or PATH (Cygwin and DJGPP)
  3315. environment variable and add the OpenSSL shared library
  3316. directory to it.
  3317.  
  3318. One common tool to check the dynamic dependencies of an executable
  3319. or dynamic library is ldd(1) on most UNIX systems.
  3320.  
  3321. See any operating system documentation and manpages about shared
  3322. libraries for your version of UNIX. The following manpages may be
  3323. helpful: ld(1), ld.so(1), ld.so.1(1) [Solaris], dld.sl(1) [HP],
  3324. ldd(1), crle(1) [Solaris], pldd(1) [Solaris], ldconfig(8) [Linux],
  3325.  
  3326. If this directory is not in a standard system path for dynamic/shared
  3327. libraries, then you will have problems linking and executing
  3328. applications that use OpenSSL libraries UNLESS:
  3329.  
  3330. * you link with static (archive) libraries. If you are truly
  3331. paranoid about security, you should use static libraries.
  3332. * you use the GNU libtool code during linking
  3333. (http://www.gnu.org/software/libtool/libtool.html)
  3334. * you use pkg-config during linking (this requires that
  3335. PKG_CONFIG_PATH includes the path to the OpenSSL shared
  3336. library directory), and make use of -R or -rpath.
  3337. (http://www.freedesktop.org/software/pkgconfig/)
  3338. * you specify the system-wide link path via a command such
  3339. as crle(1) on Solaris systems.
  3340. * you add the OpenSSL shared library directory to /etc/ld.so.conf
  3341. and run ldconfig(8) on Linux systems.
  3342. * you define the LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH (HP),
  3343. DYLD_LIBRARY_PATH (MacOS X) or PATH (Cygwin and DJGPP)
  3344. environment variable and add the OpenSSL shared library
  3345. directory to it.
  3346.  
  3347. One common tool to check the dynamic dependencies of an executable
  3348. or dynamic library is ldd(1) on most UNIX systems.
  3349.  
  3350. See any operating system documentation and manpages about shared
  3351. libraries for your version of UNIX. The following manpages may be
  3352. helpful: ld(1), ld.so(1), ld.so.1(1) [Solaris], dld.sl(1) [HP],
  3353. ldd(1), crle(1) [Solaris], pldd(1) [Solaris], ldconfig(8) [Linux],
  3354. chatr(1) [HP].
  3355.  
  3356. 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
  3357.  
  3358. otra forma:
  3359. 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
  3360. fs:~/sources/openssl-1.0.2g$ ldd /opt/lfs/opt/intel/bin/openssl
  3361. linux-vdso.so.1 (0x00007ffd4d7dd000)
  3362. libssl.so.1.0.0 => /opt/lfs/opt/intel/lib/libssl.so.1.0.0 (0x00007f095a502000)
  3363. libcrypto.so.1.0.0 => /opt/lfs/opt/intel/lib/libcrypto.so.1.0.0 (0x00007f095a076000)
  3364. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f0959e72000)
  3365. libm.so.6 => /tools/lib/libm.so.6 (0x00007f0959b6d000)
  3366. libc.so.6 => /tools/lib/libc.so.6 (0x00007f09597cc000)
  3367. /tools/lib64/ld-linux-x86-64.so.2 (0x00007f095a77a000)
  3368.  
  3369. 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
  3370.  
  3371. $ ldd /opt/lfs/opt/intel/bin/openssl
  3372. linux-vdso.so.1 (0x00007fffe8f48000)
  3373. libssl.so.1.0.0 => /opt/lfs/opt/intel/lib/libssl.so.1.0.0 (0x00007fb17a30a000)
  3374. libcrypto.so.1.0.0 => /opt/lfs/opt/intel/lib/libcrypto.so.1.0.0 (0x00007fb179e8c000)
  3375. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fb179c88000)
  3376. libm.so.6 => /tools/lib/libm.so.6 (0x00007fb179983000)
  3377. libc.so.6 => /tools/lib/libc.so.6 (0x00007fb1795e2000)
  3378. /tools/lib64/ld-linux-x86-64.so.2 (0x00007fb17a580000)
  3379.  
  3380. +info: https://wiki.openssl.org/index.php/Compilation_and_Installation
  3381.  
  3382. NetCDF (Intel):
  3383. errores:
  3384. lfs:~/sources/netcdf-4.4.0/h5_test$ ./tst_h_atts
  3385.  
  3386. *** Checking HDF5 attribute functions.
  3387. Warning! ***HDF5 library version mismatched error***
  3388. The HDF5 header files used to compile this application do not match
  3389. the version used by the HDF5 library to which this application is linked.
  3390. Data corruption or segmentation faults may occur if the application continues.
  3391. This can happen when an application was compiled by one version of HDF5 but
  3392. linked with a different version of static or shared HDF5 library.
  3393. You should recompile the application or check your shared library related
  3394. settings such as 'LD_LIBRARY_PATH'.
  3395. You can, at your own risk, disable this warning by setting the environment
  3396. variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
  3397. Setting it to 2 or higher will suppress the warning messages totally.
  3398. Headers are 1.8.12, library is 1.8.17
  3399.  
  3400. correccion: especificar CFLAGS='-I/opt/lfs/opt/intel/include' CXXFLAGS='-I/opt/lfs/opt/intel/include' en configure:
  3401.  
  3402. 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
  3403. make
  3404. make check
  3405. make install
  3406.  
  3407. NetCDF-4-40 (Intel)
  3408. 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"
  3409. make 2>&1 | tee make.log
  3410. make check 2>&1 | tee make.log
  3411. make install
  3412.  
  3413.  
  3414.  
  3415. /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
  3416. lfs:~/sources/netcdf-4.4.0$ ldd /opt/lfs/opt/intel/bin/ncdump
  3417. linux-vdso.so.1 (0x00007ffc943fc000)
  3418. libnetcdf.so.11 => /opt/lfs/opt/intel/lib/libnetcdf.so.11 (0x00007f57e9f51000)
  3419. libhdf5_hl.so.10 => /opt/lfs/opt/intel/lib/libhdf5_hl.so.10 (0x00007f57e9d2a000)
  3420. libhdf5.so.10 => /opt/lfs/opt/intel/lib/libhdf5.so.10 (0x00007f57e9782000)
  3421. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f57e957e000)
  3422. libm.so.6 => /tools/lib/libm.so.6 (0x00007f57e9279000)
  3423. libz.so.1 => /opt/lfs/opt/intel/lib/libz.so.1 (0x00007f57e905e000)
  3424. libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f57e8e48000)
  3425. libc.so.6 => /tools/lib/libc.so.6 (0x00007f57e8aa7000)
  3426. libimf.so => /opt/intel/lib/intel64/libimf.so (0x00007f57e85ab000)
  3427. libsvml.so => /opt/intel/lib/intel64/libsvml.so (0x00007f57e76ec000)
  3428. libirng.so => /opt/intel/lib/intel64/libirng.so (0x00007f57e74e4000)
  3429. libintlc.so.5 => /opt/intel/lib/intel64/libintlc.so.5 (0x00007f57e7278000)
  3430. /tools/lib64/ld-linux-x86-64.so.2 (0x00007f57ea2c5000)
  3431.  
  3432. NetCDF-4.4 Fortran:
  3433. 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"
  3434.  
  3435. lfs:~/sources/netcdf-fortran-4.4.4$ /opt/lfs/opt/intel/bin/nf-config --all
  3436.  
  3437. This netCDF-Fortran 4.4.4 has been built with the following features:
  3438.  
  3439. --cc -> icc
  3440. --cflags -> -I/opt/lfs/opt/intel/include
  3441.  
  3442. --fc -> ifort
  3443. --fflags -> -I/opt/lfs/opt/intel/include
  3444. --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
  3445. --has-f90 -> no
  3446. --has-f03 -> yes
  3447.  
  3448. --has-nc2 -> yes
  3449. --has-nc4 -> yes
  3450.  
  3451. --prefix -> /opt/lfs/opt/intel
  3452. --includedir-> /opt/lfs/opt/intel/include
  3453. --version -> netCDF-Fortran 4.4.4
  3454.  
  3455. ======
  3456. libxml2-2.9.3
  3457. $ wget -c http://xmlsoft.org/sources/libxml2-2.9.3.tar.gz
  3458.  
  3459.  
  3460. LZO:
  3461. lfs:~/sources$ tar xf lzo-2.09.tar.gz
  3462. lfs:~/sources/lzo-2.09$ ./configure --prefix=/opt/lfs/usr --enable-shared --disable-static
  3463. LZO configuration summary
  3464. -------------------------
  3465. LZO version : 2.09
  3466. configured for host : x86_64-unknown-linux-gnu
  3467. source code location : .
  3468. compiler : gcc
  3469. preprocessor definitions : -DLZO_HAVE_CONFIG_H=1
  3470. preprocessor flags :
  3471. compiler flags : -g -O2
  3472. build static library : no
  3473. build shared library : yes
  3474. enable i386 assembly code : no
  3475.  
  3476.  
  3477. LZO 2.09 configured.
  3478.  
  3479. Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
  3480. All Rights Reserved.
  3481.  
  3482. The LZO library is free software; you can redistribute it and/or
  3483. modify it under the terms of the GNU General Public License as
  3484. published by the Free Software Foundation; either version 2 of
  3485. the License, or (at your option) any later version.
  3486.  
  3487. The LZO library is distributed in the hope that it will be useful,
  3488. but WITHOUT ANY WARRANTY; without even the implied warranty of
  3489. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  3490. GNU General Public License for more details.
  3491.  
  3492. Markus F.X.J. Oberhumer
  3493. http://www.oberhumer.com/opensource/lzo/
  3494.  
  3495.  
  3496. Type 'make' to build LZO.
  3497. Type 'make check' and 'make test' to test LZO.
  3498. Type 'make install' to install LZO.
  3499. After installing LZO, please have a look at 'examples/simple.c'.
  3500.  
  3501. make check:
  3502. lfs:~/sources/lzo-2.09$ make check
  3503. make check-local
  3504. make[1]: Entering directory '/home/lfs/sources/lzo-2.09'
  3505. ./lzotest/lzotest -mlzo -n2 -q ./COPYING
  3506.  
  3507. LZO real-time data compression library (v2.09, Feb 04 2015).
  3508. Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
  3509. All Rights Reserved.
  3510.  
  3511. 262144 block-size
  3512.  
  3513. LZO1B-1 | COPYING 18092 1 9981 55.2 0.000 0.000 |
  3514. LZO1B-2 | COPYING 18092 1 9768 54.0 0.000 0.000 |
  3515. LZO1B-3 | COPYING 18092 1 9600 53.1 0.000 0.000 |
  3516. LZO1B-4 | COPYING 18092 1 9552 52.8 0.000 0.000 |
  3517. LZO1B-5 | COPYING 18092 1 9377 51.8 0.000 0.000 |
  3518. LZO1B-6 | COPYING 18092 1 9347 51.7 0.000 0.000 |
  3519. LZO1B-7 | COPYING 18092 1 9149 50.6 0.000 0.000 |
  3520. LZO1B-8 | COPYING 18092 1 9087 50.2 0.000 0.000 |
  3521. LZO1B-9 | COPYING 18092 1 9036 49.9 0.000 0.000 |
  3522. LZO1C-1 | COPYING 18092 1 9927 54.9 0.000 0.000 |
  3523. LZO1C-2 | COPYING 18092 1 9739 53.8 0.000 0.000 |
  3524. LZO1C-3 | COPYING 18092 1 9573 52.9 0.000 0.000 |
  3525. LZO1C-4 | COPYING 18092 1 9538 52.7 0.000 0.000 |
  3526. LZO1C-5 | COPYING 18092 1 9399 52.0 0.000 0.000 |
  3527. LZO1C-6 | COPYING 18092 1 9317 51.5 0.000 0.000 |
  3528. LZO1C-7 | COPYING 18092 1 9123 50.4 0.000 0.000 |
  3529. LZO1C-8 | COPYING 18092 1 9015 49.8 0.000 0.000 |
  3530. LZO1C-9 | COPYING 18092 1 8978 49.6 0.000 0.000 |
  3531. LZO1-1 | COPYING 18092 1 10498 58.0 0.000 0.000 |
  3532. LZO1A-1 | COPYING 18092 1 10405 57.5 0.000 0.000 |
  3533. LZO1F-1 | COPYING 18092 1 10073 55.7 0.000 0.000 |
  3534. LZO1X-1 | COPYING 18092 1 10102 55.8 0.000 0.000 |
  3535. LZO1Y-1 | COPYING 18092 1 10261 56.7 0.000 0.000 |
  3536. LZO1X-1(11) | COPYING 18092 1 10554 58.3 0.000 0.000 |
  3537. LZO1X-1(12) | COPYING 18092 1 10286 56.9 0.000 0.000 |
  3538. LZO1X-1(15) | COPYING 18092 1 10145 56.1 0.000 0.000 |
  3539. LZO1B-99 | COPYING 18092 1 8814 48.7 0.000 0.000 |
  3540. LZO1B-999 | COPYING 18092 1 8127 44.9 15.212 0.000 |
  3541. LZO1C-99 | COPYING 18092 1 8790 48.6 0.000 0.000 |
  3542. LZO1C-999 | COPYING 18092 1 8071 44.6 13.970 0.000 |
  3543. LZO1-99 | COPYING 18092 1 9083 50.2 35.901 0.000 |
  3544. LZO1A-99 | COPYING 18092 1 90lfs:~/sources/lzo-2.09$ make check
  3545. make check-local
  3546. make[1]: Entering directory '/home/lfs/sources/lzo-2.09'
  3547. ./lzotest/lzotest -mlzo -n2 -q ./COPYING
  3548.  
  3549. LZO real-time data compression library (v2.09, Feb 04 2015).
  3550. Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
  3551. All Rights Reserved.
  3552.  
  3553. 262144 block-size
  3554.  
  3555. LZO1B-1 | COPYING 18092 1 9981 55.2 0.000 0.000 |
  3556. LZO1B-2 | COPYING 18092 1 9768 54.0 0.000 0.000 |
  3557. LZO1B-3 | COPYING 18092 1 9600 53.1 0.000 0.000 |
  3558. LZO1B-4 | COPYING 18092 1 9552 52.8 0.000 0.000 |
  3559. LZO1B-5 | COPYING 18092 1 9377 51.8 0.000 0.000 |
  3560. LZO1B-6 | COPYING 18092 1 9347 51.7 0.000 0.000 |
  3561. LZO1B-7 | COPYING 18092 1 9149 50.6 0.000 0.000 |
  3562. LZO1B-8 | COPYING 18092 1 9087 50.2 0.000 0.000 |
  3563. LZO1B-9 | COPYING 18092 1 9036 49.9 0.000 0.000 |
  3564. LZO1C-1 | COPYING 18092 1 9927 54.9 0.000 0.000 |
  3565. LZO1C-2 | COPYING 18092 1 9739 53.8 0.000 0.000 |
  3566. LZO1C-3 | COPYING 18092 1 9573 52.9 0.000 0.000 |
  3567. LZO1C-4 | COPYING 18092 1 9538 52.7 0.000 0.000 |
  3568. LZO1C-5 | COPYING 18092 1 9399 52.0 0.000 0.000 |
  3569. LZO1C-6 | COPYING 18092 1 9317 51.5 0.000 0.000 |
  3570. LZO1C-7 | COPYING 18092 1 9123 50.4 0.000 0.000 |
  3571. LZO1C-8 | COPYING 18092 1 9015 49.8 0.000 0.000 |
  3572. LZO1C-9 | COPYING 18092 1 8978 49.6 0.000 0.000 |
  3573. LZO1-1 | COPYING 18092 1 10498 58.0 0.000 0.000 |
  3574. LZO1A-1 | COPYING 18092 1 10405 57.5 0.000 0.000 |
  3575. LZO1F-1 | COPYING 18092 1 10073 55.7 0.000 0.000 |
  3576. LZO1X-1 | COPYING 18092 1 10102 55.8 0.000 0.000 |
  3577. LZO1Y-1 | COPYING 18092 1 10261 56.7 0.000 0.000 |
  3578. LZO1X-1(11) | COPYING 18092 1 10554 58.3 0.000 0.000 |
  3579. LZO1X-1(12) | COPYING 18092 1 10286 56.9 0.000 0.000 |
  3580. LZO1X-1(15) | COPYING 18092 1 10145 56.1 0.000 0.000 |
  3581. LZO1B-99 | COPYING 18092 1 8814 48.7 0.000 0.000 |
  3582. LZO1B-999 | COPYING 18092 1 8127 44.9 15.212 0.000 |
  3583. LZO1C-99 | COPYING 18092 1 8790 48.6 0.000 0.000 |
  3584. LZO1C-999 | COPYING 18092 1 8071 44.6 13.970 0.000 |
  3585. LZO1-99 | COPYING 18092 1 9083 50.2 35.901 0.000 |
  3586. LZO1A-99 | COPYING 18092 1 9031 49.9 36.176 0.000 |
  3587. LZO2A-999 | COPYING 18092 1 7853 43.4 12.931 0.000 |
  3588. LZO1F-999 | COPYING 18092 1 8079 44.7 12.740 0.000 |
  3589. LZO1X-999 | COPYING 18092 1 7848 43.4 7.220 0.000 |
  3590. LZO1Y-999 | COPYING 18092 1 7944 43.9 7.549 0.000 |
  3591. LZO1Z-999 | COPYING 18092 1 7893 43.6 7.463 0.000 |
  3592. memcpy() | COPYING 18092 1 18092 100 0.000 0.000 |
  3593.  
  3594. lt-lzotest: execution time: 0 seconds
  3595.  
  3596. ===== All checks passed. Type 'make test' for more exhaustive testing. =====
  3597. 31 49.9 36.176 0.000 |
  3598. LZO2A-999 | COPYING 18092 1 7853 43.4 12.931 0.000 |
  3599. LZO1F-999 | COPYING 18092 1 8079 44.7 12.740 0.000 |
  3600. LZO1X-999 | COPYING 18092 1 7848 43.4 7.220 0.000 |
  3601. LZO1Y-999 | COPYING 18092 1 7944 43.9 7.549 0.000 |
  3602. LZO1Z-999 | COPYING 18092 1 7893 43.6 7.463 0.000 |
  3603. memcpy() | COPYING 18092 1 18092 100 0.000 0.000 |
  3604.  
  3605. lt-lzotest: execution time: 0 seconds
  3606.  
  3607. ===== All checks passed. Type 'make test' for more exhaustive testing. =====
  3608.  
  3609. ----------------------------------------------------------------------
  3610. Libraries have been installed in:
  3611. /opt/lfs/usr/lib
  3612.  
  3613. If you ever happen to want to link against installed libraries
  3614. in a given directory, LIBDIR, you must either use libtool, and
  3615. specify the full pathname of the library, or use the '-LLIBDIR'
  3616. flag during linking and do at least one of the following:
  3617. - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
  3618. during execution
  3619. - add LIBDIR to the 'LD_RUN_PATH' environment variable
  3620. during linking
  3621. - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
  3622. - have your system administrator add LIBDIR to '/etc/ld.so.conf'
  3623.  
  3624. See any operating system documentation about shared libraries for
  3625. more information, such as the ld(1) and ld.so(8) manual pages.
  3626. ----------------------------------------------------------------------
  3627.  
  3628. lfs:~/sources$ tar xf libxml2-2.9.3.tar.gz
  3629. 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'
  3630.  
  3631. lfs:~/sources/libxml2-2.9.3$ ldd /opt/lfs/usr/bin/xmllint
  3632. linux-vdso.so.1 (0x00007fffe9593000)
  3633. libreadline.so.6 => /tools/lib/libreadline.so.6 (0x00007f0fcb2d3000)
  3634. libhistory.so.6 => /tools/lib/libhistory.so.6 (0x00007f0fcb0c9000)
  3635. libncursesw.so.6 => /tools/lib/libncursesw.so.6 (0x00007f0fcae5f000)
  3636. libxml2.so.2 => /opt/lfs/usr/lib/libxml2.so.2 (0x00007f0fcaaf9000)
  3637. libdl.so.2 => /opt/lfs/usr/lib/libdl.so.2 (0x00007f0fca8f5000)
  3638. libz.so.1 => /opt/lfs/lib/libz.so.1 (0x00007f0fca6dc000)
  3639. liblzma.so.5 => /tools/lib/liblzma.so.5 (0x00007f0fca4b7000)
  3640. libm.so.6 => /opt/lfs/usr/lib/libm.so.6 (0x00007f0fca1b2000)
  3641. libpthread.so.0 => /opt/lfs/usr/lib/libpthread.so.0 (0x00007f0fc9f95000)
  3642. libc.so.6 => /opt/lfs/lib/libc.so.6 (0x00007f0fc9bf4000)
  3643. /tools/lib64/ld-linux-x86-64.so.2 (0x00007f0fcb523000)
  3644.  
  3645.  
  3646. libarchive:
  3647. lfs:~/sources$ tar xf libarchive-3.1.2.tar.gz
  3648. lfs:~/sources/libarchive-3.1.2$ patch -Np1 -i ../libarchive-3.1.2-upstream_fixes-1.patch
  3649. lfs:~/sources/libarchive-3.1.2$ ./configure --prefix=/opt/lfs/usr LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib'
  3650. lfs:~/sources/libarchive-3.1.2$ ldd /opt/lfs/usr/bin/bsdcpio
  3651. linux-vdso.so.1 (0x00007fffd13d5000)
  3652. libcrypto.so.1.0.0 => /opt/lfs/usr/lib/libcrypto.so.1.0.0 (0x00007fa05fc2c000)
  3653. libacl.so.1 => /tools/lib/libacl.so.1 (0x00007fa05fa24000)
  3654. libattr.so.1 => /tools/lib/libattr.so.1 (0x00007fa05f820000)
  3655. liblzo2.so.2 => /opt/lfs/usr/lib/liblzo2.so.2 (0x00007fa05f5ff000)
  3656. libbz2.so.1.0 => /tools/lib/libbz2.so.1.0 (0x00007fa05f3ef000)
  3657. libxml2.so.2 => /opt/lfs/usr/lib/libxml2.so.2 (0x00007fa05f089000)
  3658. liblzma.so.5 => /tools/lib/liblzma.so.5 (0x00007fa05ee64000)
  3659. libz.so.1 => /tools/lib/libz.so.1 (0x00007fa05ec4b000)
  3660. libm.so.6 => /opt/lfs/usr/lib/libm.so.6 (0x00007fa05e946000)
  3661. libdl.so.2 => /opt/lfs/usr/lib/libdl.so.2 (0x00007fa05e742000)
  3662. libpthread.so.0 => /opt/lfs/usr/lib/libpthread.so.0 (0x00007fa05e525000)
  3663. libc.so.6 => /opt/lfs/usr/lib/libc.so.6 (0x00007fa05e184000)
  3664. /tools/lib64/ld-linux-x86-64.so.2 (0x00007fa06007f000)
  3665.  
  3666.  
  3667. CMake-3.4.3 (GNU)
  3668. lfs:~/sources/cmake-3.4.3$ ./bootstrap --prefix=/opt/lfs/usr --system-libs --mandir=/opt/lfs/usr/man --no-system-jsoncpp
  3669. ---------------------------------------------
  3670. CMake 3.4.3, Copyright 2000-2015 Kitware, Inc.
  3671. Found GNU toolchain
  3672. C compiler on this system is: gcc
  3673. C++ compiler on this system is: g++
  3674. Makefile processor on this system is: gmake
  3675. g++ is GNU compiler
  3676. g++ has setenv
  3677. g++ has unsetenv
  3678. g++ does not have environ in stdlib.h
  3679. g++ has stl wstring
  3680. g++ has struct stat with st_mtim member
  3681. ---------------------------------------------
  3682. gmake: `cmake' is up to date.
  3683. loading initial cache file /home/lfs/sources/cmake-3.4.3/Bootstrap.cmk/InitialCacheFlags.cmake
  3684. -- Using system-installed BZIP2
  3685. -- Using system-installed CURL
  3686. -- Using system-installed EXPAT
  3687. -- Using system-installed FORM
  3688. -- Using system-installed LIBARCHIVE
  3689. -- Using system-installed LIBLZMA
  3690. -- Using system-installed ZLIB
  3691. -- Found LibArchive: /opt/lfs/usr/lib64/libarchive.so (found suitable version "3.1.2", minimum required is "3.0.0")
  3692. -- Found EXPAT: /tools/lib64/libexpat.so (found version "2.1.0")
  3693. -- Looking for cbreak in /tools/lib64/libncurses.so
  3694. -- Looking for cbreak in /tools/lib64/libncurses.so - found
  3695. -- Looking for elf.h
  3696. -- Looking for elf.h - found
  3697. -- Looking for a Fortran compiler
  3698. -- Looking for a Fortran compiler - /usr/bin/f95
  3699. -- Performing Test run_pic_test
  3700. -- Performing Test run_pic_test - Success
  3701. -- Performing Test run_inlines_hidden_test
  3702. -- Performing Test run_inlines_hidden_test - Success
  3703. -- Configuring done
  3704. -- Generating done
  3705. -- Build files have been written to: /home/lfs/sources/cmake-3.4.3
  3706. ---------------------------------------------
  3707. CMake has bootstrapped. Now run gmake.
  3708. lfs:~/sources/cmake-3.4.3$ gmake
  3709. lfs:~/sources/cmake-3.4.3$ gmake install
  3710. lfs:~/sources/cmake-3.4.3$ ldd `which ccmake`
  3711. linux-vdso.so.1 (0x00007ffdf19d7000)
  3712. libformw.so.6 => /tools/lib/libformw.so.6 (0x00007f86a8746000)
  3713. libncursesw.so.6 => /tools/lib/libncursesw.so.6 (0x00007f86a84dc000)
  3714. libdl.so.2 => /opt/lfs/usr/lib64/libdl.so.2 (0x00007f86a82d8000)
  3715. libexpat.so.1 => /tools/lib/libexpat.so.1 (0x00007f86a80af000)
  3716. libz.so.1 => /tools/lib/libz.so.1 (0x00007f86a7e96000)
  3717. libarchive.so.13 => /opt/lfs/usr/lib64/libarchive.so.13 (0x00007f86a7bf6000)
  3718. libcurl.so.4 => /opt/lfs/usr/lib64/libcurl.so.4 (0x00007f86a7987000)
  3719. libstdc++.so.6 => /opt/lfs/usr/lib64/libstdc++.so.6 (0x00007f86a760d000)
  3720. libm.so.6 => /opt/lfs/usr/lib64/libm.so.6 (0x00007f86a7308000)
  3721. libgcc_s.so.1 => /opt/lfs/usr/lib64/libgcc_s.so.1 (0x00007f86a70f2000)
  3722. libc.so.6 => /opt/lfs/usr/lib64/libc.so.6 (0x00007f86a6d51000)
  3723. /tools/lib64/ld-linux-x86-64.so.2 (0x00007f86a8957000)
  3724. libcrypto.so.1.0.0 => /opt/lfs/usr/lib/libcrypto.so.1.0.0 (0x00007f86a68fe000)
  3725. libacl.so.1 => /tools/lib/libacl.so.1 (0x00007f86a66f6000)
  3726. libattr.so.1 => /tools/lib/libattr.so.1 (0x00007f86a64f2000)
  3727. liblzo2.so.2 => /opt/lfs/usr/lib/liblzo2.so.2 (0x00007f86a62d1000)
  3728. liblzma.so.5 => /tools/lib/liblzma.so.5 (0x00007f86a60ac000)
  3729. libbz2.so.1.0 => /tools/lib/libbz2.so.1.0 (0x00007f86a5e9c000)
  3730. libxml2.so.2 => /opt/lfs/usr/lib/libxml2.so.2 (0x00007f86a5b36000)
  3731. libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007f86a5919000)
  3732. libidn.so.11 => /opt/lfs/usr/lib/libidn.so.11 (0x00007f86a56e6000)
  3733. libssh2.so.1 => /opt/lfs/usr/lib/libssh2.so.1 (0x00007f86a54b9000)
  3734. libpsl.so.5 => /opt/lfs/usr/lib/libpsl.so.5 (0x00007f86a52ad000)
  3735. libssl.so.1.0.0 => /opt/lfs/usr/lib/libssl.so.1.0.0 (0x00007f86a503c000)
  3736. liblber-2.4.so.2 => /opt/lfs/usr/lib/liblber-2.4.so.2 (0x00007f86a4e30000)
  3737. libldap-2.4.so.2 => /opt/lfs/usr/lib/libldap-2.4.so.2 (0x00007f86a4bf1000)
  3738. libicuuc.so.57 => /opt/lfs/usr/lib/libicuuc.so.57 (0x00007f86a484e000)
  3739. libicudata.so.57 => /opt/lfs/usr/lib/libicudata.so.57 (0x00007f86a2dd2000)
  3740. libresolv.so.2 => /opt/lfs/usr/lib/libresolv.so.2 (0x00007f86a2bbb000)
  3741. libsasl2.so.3 => /opt/lfs/lib/libsasl2.so.3 (0x00007f86a29a1000)
  3742.  
  3743. =================
  3744. UnZip-6.0
  3745. lfs:~/sources$ wget -c http://downloads.sourceforge.net/infozip/unzip60.tar.gz
  3746.  
  3747. libJasper (GCC):
  3748. lfs:~/sources/jasper-1.900.1$ ./configure --prefix=/opt/lfs/usr LDFLAGS='-Wl,-rpath -Wl,/opt/lfs/usr/lib'
  3749.  
  3750. libJasper (Intel)
  3751. 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'
  3752.  
  3753. libPNG (intel)
  3754. 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"
  3755.  
  3756. ======
  3757. WRFV3.3
  3758. Will use NETCDF in dir: /opt/lfs/opt/intel
  3759. PHDF5 not set in environment. Will configure WRF for use without.
  3760. which: no timex
  3761. $JASPERLIB or $JASPERINC not found in environment, configuring to build without grib2 I/O...
  3762.  
  3763. WRFV3.8
  3764. vi arch/Config_new.pl
  3765. $I_really_want_to_output_grib2_from_WRF = "TRUE" ;
  3766. configure.wrf (32. GCC):
  3767. LDFLAGS_LOCAL = -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib
  3768.  
  3769.  
  3770. WRFV3.8+INTEL:
  3771. [wilderman@sullivan bin]$ source ifortvars.sh intel64
  3772. [wilderman@sullivan bin]$ source iccvars.sh intel64
  3773.  
  3774. $ export DM_CC=/opt/lfs/opt/intel/bin/mpicc
  3775. $ export DM_FC=/opt/lfs/opt/intel/bin/mpifort
  3776. $ export JASPERINC=/opt/lfs/opt/intel/include
  3777. $ export JASPERLIB=/opt/lfs/opt/intel/lib
  3778. $ export HDF5=/opt/lfs/opt/intel
  3779. $ export NETCDF=/opt/lfs/opt/intel
  3780.  
  3781. $ 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
  3782.  
  3783. :configure.wrf:
  3784. 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
  3785.  
  3786. [wilderman@sullivan WRFV3]$ ./compile em_real > build.log 2>&1
  3787.  
  3788.  
  3789. WRFV3.8+GCC:
  3790. $ 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
  3791.  
  3792.  
  3793. [wilderman@sullivan WRFV3]$ ldd main/wrf.exe
  3794. linux-vdso.so.1 (0x00007ffecf5c6000)
  3795. libnetcdff.so.6 => /opt/lfs/opt/intel/lib/libnetcdff.so.6 (0x00007f0500d38000)
  3796. libnetcdf.so.11 => /opt/lfs/opt/intel/lib/libnetcdf.so.11 (0x00007f05009b3000)
  3797. libhdf5_fortran.so.10 => /opt/lfs/opt/intel/lib/libhdf5_fortran.so.10 (0x00007f05006ef000)
  3798. libhdf5.so.10 => /opt/lfs/opt/intel/lib/libhdf5.so.10 (0x00007f0500150000)
  3799. libm.so.6 => /tools/lib/libm.so.6 (0x00007f04ffe4b000)
  3800. libz.so.1 => /opt/lfs/opt/intel/lib/libz.so.1 (0x00007f04ffc32000)
  3801. libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007f04ffa15000)
  3802. libc.so.6 => /tools/lib/libc.so.6 (0x00007f04ff674000)
  3803. libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f04ff45e000)
  3804. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f04ff25a000)
  3805. libifport.so.5 => /opt/intel/lib/intel64/libifport.so.5 (0x00007f04ff02d000)
  3806. libifcoremt.so.5 => /opt/intel/lib/intel64/libifcoremt.so.5 (0x00007f04fecca000)
  3807. libimf.so => /opt/intel/lib/intel64/libimf.so (0x00007f04fe80f000)
  3808. libsvml.so => /opt/intel/lib/intel64/libsvml.so (0x00007f04fd931000)
  3809. libintlc.so.5 => /opt/intel/lib/intel64/libintlc.so.5 (0x00007f04fd6d6000)
  3810. libmfhdf.so.0 => /opt/lfs/usr/lib/libmfhdf.so.0 (0x00007f04fd4ad000)
  3811. libdf.so.0 => /opt/lfs/usr/lib/libdf.so.0 (0x00007f04fd1f9000)
  3812. libjpeg.so.62 => /opt/lfs/usr/lib/libjpeg.so.62 (0x00007f04fcf8d000)
  3813. libhdf5_hl.so.10 => /opt/lfs/usr/lib/libhdf5_hl.so.10 (0x00007f04fcd6c000)
  3814. libirng.so => /opt/intel/lib/intel64/libirng.so (0x00007f04fcb65000)
  3815. /tools/lib64/ld-linux-x86-64.so.2 (0x00007f050120e000)
  3816.  
  3817.  
  3818. [wilderman@sullivan WRFV3]$ main/./real.exe
  3819. Segmentation fault
  3820. [wilderman@sullivan WRFV3]$ main/./wrf.exe
  3821. Segmentation fault
  3822.  
  3823. :compile02.log:
  3824. 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
  3825. make[2]: Entering directory '/home/wilderman/sources/WRFV3.8/WRFV3/external/io_int'
  3826. if [ -f ../../frame/pack_utils.o -a -f ../../frame/clog.o ] ; then \
  3827. ifort -ip -fp-model precise -w -ftz -align all -fno-alias -FR -convert big_endian -I../ioapi_share -o diffwrf diffwrf.f \
  3828. ../../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 ; \
  3829. fi
  3830. ../../frame/module_wrf_error.o: In function `wrf_message_':
  3831. module_wrf_error.f90:(.text+0x1b): undefined reference to `__kmpc_global_thread_num'
  3832. module_wrf_error.f90:(.text+0x2f): undefined reference to `__kmpc_master'
  3833. module_wrf_error.f90:(.text+0x125): undefined reference to `__kmpc_end_master'
  3834. ../../frame/module_wrf_error.o: In function `wrf_message2_':
  3835. module_wrf_error.f90:(.text+0x15a): undefined reference to `__kmpc_global_thread_num'
  3836. module_wrf_error.f90:(.text+0x16b): undefined reference to `__kmpc_master'
  3837. module_wrf_error.f90:(.text+0x1c1): undefined reference to `__kmpc_end_master'
  3838. ../../frame/module_wrf_error.o: In function `wrf_check_error_':
  3839. module_wrf_error.f90:(.text+0x200): undefined reference to `__kmpc_global_thread_num'
  3840. module_wrf_error.f90:(.text+0x380): undefined reference to `__kmpc_master'
  3841. module_wrf_error.f90:(.text+0x489): undefined reference to `__kmpc_end_master'
  3842. module_wrf_error.f90:(.text+0x55d): undefined reference to `__kmpc_master'
  3843. module_wrf_error.f90:(.text+0x66f): undefined reference to `__kmpc_end_master'
  3844. module_wrf_error.f90:(.text+0x695): undefined reference to `__kmpc_master'
  3845. module_wrf_error.f90:(.text+0x794): undefined reference to `__kmpc_end_master'
  3846. module_wrf_error.f90:(.text+0x7b4): undefined reference to `__kmpc_master'
  3847. module_wrf_error.f90:(.text+0x8bd): undefined reference to `__kmpc_end_master'
  3848. module_wrf_error.f90:(.text+0x8e6): undefined reference to `__kmpc_master'
  3849. module_wrf_error.f90:(.text+0x941): undefined reference to `__kmpc_end_master'
  3850. module_wrf_error.f90:(.text+0xa08): undefined reference to `__kmpc_master'
  3851. module_wrf_error.f90:(.text+0xa5b): undefined reference to `__kmpc_end_master'
  3852. module_wrf_error.f90:(.text+0xa9f): undefined reference to `__kmpc_master'
  3853. module_wrf_error.f90:(.text+0xaf5): undefined reference to `__kmpc_end_master'
  3854. module_wrf_error.f90:(.text+0xb0d): undefined reference to `__kmpc_master'
  3855. module_wrf_error.f90:(.text+0xb68): undefined reference to `__kmpc_end_master'
  3856. ../../frame/module_wrf_error.o: In function `wrf_error_fatal_':
  3857. module_wrf_error.f90:(.text+0xbf0): undefined reference to `__kmpc_global_thread_num'
  3858. module_wrf_error.f90:(.text+0xc53): undefined reference to `__kmpc_master'
  3859. module_wrf_error.f90:(.text+0xd56): undefined reference to `__kmpc_end_master'
  3860. module_wrf_error.f90:(.text+0xd72): undefined reference to `__kmpc_master'
  3861. module_wrf_error.f90:(.text+0xe81): undefined reference to `__kmpc_end_master'
  3862.  
  3863.  
  3864. [wilderman@sullivan intel64]$ nm | grep __kmpc_global_thread_num *
  3865. grep: crt: Is a directory
  3866. grep: irml: Is a directory
  3867. nm: 'a.out': No such file
  3868. Binary file libiomp5.a matches
  3869. Binary file libiomp5.dbg matches
  3870. Binary file libiomp5.so matches
  3871. Binary file libmatmul.a matches
  3872.  
  3873. Error: WRFV3.8::GCC (smpar)
  3874. 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
  3875. make[2]: Entering directory '/home/wilderman/sources/WRFV3.8/WRFV3/external/io_int'
  3876. if [ -f ../../frame/pack_utils.o -a -f ../../frame/clog.o ] ; then \
  3877. gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -I../ioapi_share -o diffwrf diffwrf.f \
  3878. ../../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 ; \
  3879. fi
  3880. ../../frame/module_wrf_error.o: In function `wrf_error_fatal3_':
  3881. module_wrf_error.f90:(.text+0x50d): undefined reference to `omp_get_thread_num'
  3882. ../../frame/module_wrf_error.o: In function `wrf_message2_':
  3883. module_wrf_error.f90:(.text+0x94c): undefined reference to `omp_get_thread_num'
  3884. ../../frame/module_wrf_error.o: In function `wrf_message_':
  3885. module_wrf_error.f90:(.text+0x97c): undefined reference to `omp_get_thread_num'
  3886. collect2: error: ld returned 1 exit status
  3887. makefile:76: recipe for target 'diffwrf' failed
  3888. make[2]: [diffwrf] Error 1 (ignored)
  3889.  
  3890. FIX (GCC):
  3891. en configure.wrf agregar "-Wl,-rpath -Wl,/tools/lib -lgomp" a ESMF_IO_LIB y ESMF_IO_LIB_EXT
  3892. FIX (Intel):
  3893. 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
  3894.  
  3895. 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
  3896. make[2]: Entering directory '/home/wilderman/sources/WRFV3.8/WRFV3/external/io_int'
  3897. if [ -f ../../frame/pack_utils.o -a -f ../../frame/clog.o ] ; then \
  3898. gfortran -w -ffree-form -ffree-line-length-none -fconvert=big-endian -frecord-marker=4 -I../ioapi_share -o diffwrf diffwrf.f \
  3899. ../../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 ; \
  3900. fi
  3901.  
  3902.  
  3903. f951: Warning: Nonexistent include directory �~@~Xg2lib�~@~Y [-Wmissing-include-dirs]
  3904.  
  3905. 7.2 Example Debugging Session: Segmentation Fault Example
  3906. http://www.unknownroad.com/rtfm/gdbtut/gdbsegfault.html
  3907.  
  3908. [wilderman@sullivan main]$ gdb ndown.exe
  3909. GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-80.el7
  3910. Copyright (C) 2013 Free Software Foundation, Inc.
  3911. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  3912. This is free software: you are free to change and redistribute it.
  3913. There is NO WARRANTY, to the extent permitted by law. Type "show copying"
  3914. and "show warranty" for details.
  3915. This GDB was configured as "x86_64-redhat-linux-gnu".
  3916. For bug reporting instructions, please see:
  3917. <http://www.gnu.org/software/gdb/bugs/>...
  3918. Reading symbols from /home/wilderman/sources/WRFV3.8/WRFV3/main/ndown.exe...done.
  3919. (gdb) run
  3920. Starting program: /home/wilderman/sources/WRFV3.8/WRFV3/main/ndown.exe
  3921. 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".
  3922. To enable execution of this file add
  3923. add-auto-load-safe-path /monster/tools/lib/libthread_db-1.0.so
  3924. line to your configuration file "/home/wilderman/.gdbinit".
  3925. To completely disable this security protection add
  3926. set auto-load safe-path /
  3927. line to your configuration file "/home/wilderman/.gdbinit".
  3928. For more information about this security protection see the
  3929. "Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
  3930. info "(gdb)Auto-loading safe path"
  3931. warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
  3932.  
  3933. Program received signal SIGSEGV, Segmentation fault.
  3934. 0x0000000002afb5e4 in init_resource ()
  3935.  
  3936. (WRFV3.8::Intel opcion 13 (serial))
  3937. $ ldd main/ndown.exe
  3938. linux-vdso.so.1 (0x00007ffe04d3c000)
  3939. libnetcdff.so.6 => /opt/lfs/opt/intel/lib/libnetcdff.so.6 (0x00007fa9d9285000)
  3940. libnetcdf.so.11 => /opt/lfs/opt/intel/lib/libnetcdf.so.11 (0x00007fa9d8f00000)
  3941. libhdf5_fortran.so.10 => /opt/lfs/opt/intel/lib/libhdf5_fortran.so.10 (0x00007fa9d8c3c000)
  3942. libhdf5.so.10 => /opt/lfs/opt/intel/lib/libhdf5.so.10 (0x00007fa9d869d000)
  3943. libm.so.6 => /tools/lib/libm.so.6 (0x00007fa9d8398000)
  3944. libz.so.1 => /opt/lfs/opt/intel/lib/libz.so.1 (0x00007fa9d817f000)
  3945. libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007fa9d7f62000)
  3946. libc.so.6 => /tools/lib/libc.so.6 (0x00007fa9d7bc1000)
  3947. libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007fa9d79ab000)
  3948. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007fa9d77a7000)
  3949. libifport.so.5 => /opt/intel/lib/intel64/libifport.so.5 (0x00007fa9d757a000)
  3950. libifcoremt.so.5 => /opt/intel/lib/intel64/libifcoremt.so.5 (0x00007fa9d7217000)
  3951. libimf.so => /opt/intel/lib/intel64/libimf.so (0x00007fa9d6d5c000)
  3952. libsvml.so => /opt/intel/lib/intel64/libsvml.so (0x00007fa9d5e7e000)
  3953. libintlc.so.5 => /opt/intel/lib/intel64/libintlc.so.5 (0x00007fa9d5c23000)
  3954. libmfhdf.so.0 => /opt/lfs/usr/lib/libmfhdf.so.0 (0x00007fa9d59fa000)
  3955. libdf.so.0 => /opt/lfs/usr/lib/libdf.so.0 (0x00007fa9d5746000)
  3956. libjpeg.so.62 => /opt/lfs/usr/lib/libjpeg.so.62 (0x00007fa9d54da000)
  3957. libhdf5_hl.so.10 => /opt/lfs/usr/lib/libhdf5_hl.so.10 (0x00007fa9d52b9000)
  3958. libirng.so => /opt/intel/lib/intel64/libirng.so (0x00007fa9d50b2000)
  3959. /tools/lib64/ld-linux-x86-64.so.2 (0x00007fa9d975b000)
  3960.  
  3961.  
  3962. ===============
  3963. LIB_EXTERNAL = \
  3964. -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
  3965.  
  3966. zlib::intel
  3967. $ 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
  3968.  
  3969.  
  3970. $ ./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'
  3971.  
  3972.  
  3973. SZIP:
  3974. original:
  3975. ./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
  3976.  
  3977. nueva:
  3978. 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'
  3979.  
  3980.  
  3981.  
  3982. HDF5:
  3983. original:
  3984. ./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
  3985.  
  3986. 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'
  3987.  
  3988. [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'
  3989.  
  3990.  
  3991.  
  3992. NetCDF 4.4:
  3993. $ export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
  3994. $ export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
  3995. export CPPFLAGS='-O3 -xHost -ip -no-prec-div -static-intel -I/opt/lfs/opt/intel/include'
  3996. $ export F77='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gfortran'
  3997. $ export F90='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gfortran'
  3998. $ export FC='ifort -gcc-name=/tools/bin/x86_64-unknown-linux-gnu-gfortran'
  3999. $ export CPP='icc -E'
  4000. $ export CXXCPP='icpc -E'
  4001. $ echo $FFLAGS
  4002. $ export FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
  4003. $ ./configure --disable-dap --prefix=/opt/lfs/opt/intel
  4004.  
  4005. Error:
  4006. /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
  4007. 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
  4008. icc: warning #10237: -lcilkrts linked in dynamically, static library not available
  4009.  
  4010.  
  4011. *** Testing netCDF-4 user-defined types and groups.
  4012. Warning! ***HDF5 library version mismatched error***
  4013. The HDF5 header files used to compile this application do not match
  4014. the version used by the HDF5 library to which this application is linked.
  4015. Data corruption or segmentation faults may occur if the application continues.
  4016. This can happen when an application was compiled by one version of HDF5 but
  4017. linked with a different version of static or shared HDF5 library.
  4018. You should recompile the application or check your shared library related
  4019. settings such as 'LD_LIBRARY_PATH'.
  4020. You can, at your own risk, disable this warning by setting the environment
  4021. variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
  4022. Setting it to 2 or higher will suppress the warning messages totally.
  4023. Headers are 1.8.12, library is 1.8.17
  4024. $ export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel -I/opt/lfs/opt/intel/include'
  4025. $ export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel -I/opt/lfs/opt/intel/include'
  4026.  
  4027. icc: warning #10237: -lcilkrts linked in dynamically, static library not available
  4028.  
  4029.  
  4030. $ unset CFLAGS CXXFLAGS CPPFLAGS F77 F90 FC CPP CXXCPP FFLAGS FCFLAGS
  4031.  
  4032. Fix:
  4033. desinstalar librerias/binarios anteriores de sus carpetas :
  4034.  
  4035. 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'
  4036.  
  4037.  
  4038. 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'
  4039.  
  4040.  
  4041. =============================================================
  4042. NETCDF-4.4 (intel):
  4043. .././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'
  4044.  
  4045. NetCDF-4.4 (gnu):
  4046. 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'
  4047.  
  4048. NetCDF-fortran-4.4 (intel)
  4049. 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'
  4050.  
  4051. [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'
  4052.  
  4053. libpng(intel)
  4054. [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'
  4055.  
  4056.  
  4057. NetCDF-fortran-4.4 (gnu):
  4058.  
  4059.  
  4060. WRFV3.8::intel
  4061. intelxe::intel 2016.Update1
  4062. configure.wrf (opcion 14 (sm))
  4063. 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
  4064. 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
  4065. 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
  4066. LIB_EXTERNAL = \
  4067. -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
  4068. NETCDFPATH = /usr/local/intel
  4069. HDF5PATH = /usr/local/intel
  4070.  
  4071. [wilderman@sullivan WRFV3]$ ldd main/wrf.exe
  4072. linux-vdso.so.1 (0x00007ffdbcafe000)
  4073. libiomp5.so => /opt/intelxe/lib/intel64/libiomp5.so (0x00007f7770405000)
  4074. libnetcdff.so.6 => /usr/local/intel/lib/libnetcdff.so.6 (0x00007f776ff66000)
  4075. libnetcdf.so.11 => /usr/local/intel/lib/libnetcdf.so.11 (0x00007f776fbef000)
  4076. libhdf5_fortran.so.10 => /usr/local/intel/lib/libhdf5_fortran.so.10 (0x00007f776f9a7000)
  4077. libhdf5.so.10 => /usr/local/intel/lib/libhdf5.so.10 (0x00007f776f3f3000)
  4078. libm.so.6 => /tools/lib/libm.so.6 (0x00007f776f0ee000)
  4079. libz.so.1 => /usr/local/intel/lib/libz.so.1 (0x00007f776eed3000)
  4080. libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00007f776ecb6000)
  4081. libc.so.6 => /tools/lib/libc.so.6 (0x00007f776e915000)
  4082. libgcc_s.so.1 => /tools/lib/libgcc_s.so.1 (0x00007f776e6ff000)
  4083. libdl.so.2 => /tools/lib/libdl.so.2 (0x00007f776e4fb000)
  4084. /tools/lib64/ld-linux-x86-64.so.2 (0x00007f7770747000)
  4085. libifport.so.5 => /opt/intelxe/lib/intel64/libifport.so.5 (0x00007f776e2cc000)
  4086. libifcore.so.5 => /opt/intelxe/lib/intel64/libifcore.so.5 (0x00007f776df68000)
  4087. libimf.so => /opt/intelxe/lib/intel64/libimf.so (0x00007f776da6c000)
  4088. libsvml.so => /opt/intelxe/lib/intel64/libsvml.so (0x00007f776cbad000)
  4089. libintlc.so.5 => /opt/intelxe/lib/intel64/libintlc.so.5 (0x00007f776c941000)
  4090. libhdf5_hl.so.10 => /usr/local/intel/lib/libhdf5_hl.so.10 (0x00007f776c719000)
  4091. libirng.so => /opt/intelxe/lib/intel64/libirng.so (0x00007f776c511000)
  4092.  
  4093. WPS::intel
  4094. configure.wps
  4095. COMPRESSION_LIBS = -L/usr/local/intel/lib -Wl,-rpath -Wl,/usr/local/intel/lib -ljasper -lpng -lz
  4096. COMPRESSION_INC = -I/usr/local/intel/include
  4097. LDFLAGS = -Wl,-rpath -Wl,/usr/local/intel/lib -Wl,-rpath -Wl,/opt/intelxe/lib/intel64 -liomp5
  4098.  
  4099. [wilderman@sullivan WPS]$ ./compile 2>&1 | tee compile.log
  4100.  
  4101.  
  4102.  
  4103. buscar un simbolo en una libreria
  4104. [wilderman@sullivan intel64_lin]$ nm -o * | grep __kmpc_global_thread_num
  4105. libioffload_target.so.5: U __kmpc_global_thread_num@@VERSION
  4106. libiomp5.a:kmp_csupport.o:0000000000000040 T __kmpc_global_thread_num
  4107. libiomp5.dbg:000000000004b050 T __kmpc_global_thread_num
  4108. libiomp5.so:000000000004b050 T __kmpc_global_thread_num
  4109. libmatmul.a:s__gemm_omp_v1_drv.o: U __kmpc_global_thread_num
  4110. libmatmul.a:s__gemm_drv.o: U __kmpc_global_thread_num
  4111. libmatmul.a:d__gemm_omp_v1_drv.o: U __kmpc_global_thread_num
  4112. libmatmul.a:d__gemm_drv.o: U __kmpc_global_thread_num
  4113. libmatmul.a:z__gemm_omp_v1_drv.o: U __kmpc_global_thread_num
  4114. libmatmul.a:z__gemm_drv.o: U __kmpc_global_thread_num
  4115. libmatmul.a:c__gemm_omp_v1_drv.o: U __kmpc_global_thread_num
  4116. libmatmul.a:c__gemm_drv.o: U __kmpc_global_thread_num
  4117. libmatmul.a:cgemv_omp_matmul.o: U __kmpc_global_thread_num
  4118. libmatmul.a:zgemv_omp_matmul.o: U __kmpc_global_thread_num
  4119. libmatmul.a:sgemv_omp_matmul.o: U __kmpc_global_thread_num
  4120. libmatmul.a:dgemv_omp_matmul.o: U __kmpc_global_thread_num
  4121. ===========0000000=======
  4122.  
  4123. WRFV3.8 (GCC/GFortran 5.3 toolchain)
  4124. environment
  4125.  
  4126. JASPERINC=/opt/lfs/usr/include
  4127. JASPERLIB=/opt/lfs/usr/lib
  4128. HDF5=/opt/lfs/usr
  4129. NETCDF=/opt/lfs/usr
  4130. export JASPERINC JASPERLIB HDF5 NETCDF
  4131.  
  4132. configure.wrf:
  4133. SFC = /tools/bin/gfortran
  4134. SCC = /tools/bin/gcc
  4135. CCOMP = /tools/bin/gcc
  4136. DM_FC = mpif90
  4137. DM_CC = mpicc -DMPI2_SUPPORT
  4138. FC = time $(DM_FC) -I/opt/lfs/include
  4139.  
  4140. CFLAGS_LOCAL = -w -O3 -c -I/opt/lfs/include
  4141. LDFLAGS_LOCAL = -L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib -L/opt/lfs/lib -Wl,-rpath -Wl,/opt/lfs/lib
  4142.  
  4143. LIB_EXTERNAL = \
  4144. -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
  4145.  
  4146. WRFV3.8 (Intel 2014 + toolchain)
  4147. environment
  4148. JASPERINC=/opt/lfs/opt/intel/include
  4149. JASPERLIB=/opt/lfs/opt/intel/lib
  4150. HDF5=/opt/lfs/opt/intel
  4151. NETCDF=/opt/lfs/usr #GNU-Toolchain
  4152.  
  4153.  
  4154. DM_FC = /opt/lfs/opt/intel/bin/mpif90
  4155. DM_CC = /opt/lfs/opt/intel/bin/mpicc -DMPI2_SUPPORT
  4156. FC = time $(DM_FC) -I/opt/lfs/opt/intel/include
  4157. 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
  4158. LIB_EXTERNAL = \
  4159. -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
  4160. NETCDFPATH = /opt/lfs/opt/intel
  4161. HDF5PATH = /opt/lfs/opt/intel
  4162.  
  4163. export JASPERINC JASPERLIB HDF5 NETCDF
  4164.  
  4165.  
  4166. [wilderman@sullivan main]$ ./real.exe
  4167. [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)
  4168.  
  4169.  
  4170. error en openmpi-1.10.2 (gcc):
  4171. [wilderman@sullivan main]$ ldd /opt/lfs/usr/lib/openmpi/mca_btl_scif.so
  4172. linux-vdso.so.1 (0x00007fff66136000)
  4173. libscif.so.0 => not found
  4174. librt.so.1 => /tools/lib/librt.so.1 (0x00002ba717312000)
  4175. libm.so.6 => /tools/lib/libm.so.6 (0x00002ba71751a000)
  4176. libutil.so.1 => /tools/lib/libutil.so.1 (0x00002ba71781f000)
  4177. libpthread.so.0 => /tools/lib/libpthread.so.0 (0x00002ba717a22000)
  4178. libc.so.6 => /tools/lib/libc.so.6 (0x00002ba717c3f000)
  4179. /tools/lib64/ld-linux-x86-64.so.2 (0x00002ba716ee6000)
  4180.  
  4181. Recompilar OpenMPI!!!
  4182.  
  4183. GNU:
  4184. $ ../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'
  4185.  
  4186. [wilderman@sullivan build.xeon]$ make LDFLAGS='-L/opt/lfs/usr/lib -Wl,-rpath -Wl,/opt/lfs/usr/lib' 2>&1 | tee make.log
  4187.  
  4188.  
  4189. Intel:
  4190. --without-scif = deshabilita el uso de aceleradores Phi.
  4191.  
  4192. [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'
  4193.  
  4194. [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
  4195.  
  4196.  
  4197. Parallel HDF5:
  4198. [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'
  4199. $ make LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' 2>&1 | tee make.log
  4200.  
  4201. [wilderman@sullivan build.intel]$ HDF5_PARAPREFIX=pfs:/tmp
  4202. [wilderman@sullivan build.intel]$ export HDF5_PARAPREFIX
  4203.  
  4204. [wilderman@sullivan build.intel]$ make LDFLAGS='-L/opt/intel/lib/intel64 -Wl,-rpath -Wl,/opt/intel/lib/intel64' check
  4205. errors:
  4206. ===Parallel tests in testpar begin Tue Jul 26 23:41:31 UTC 2016===
  4207. **** Hint ****
  4208. Parallel test files reside in the current directory by default.
  4209. Set HDF5_PARAPREFIX to use another directory. E.g.,
  4210. HDF5_PARAPREFIX=/PFS/user/me
  4211. export HDF5_PARAPREFIX
  4212. make check
  4213. **** end of Hint ****
  4214. make[4]: Entering directory '/home/wilderman/sources/hdf5-1.8.17/build.intel/testpar'
  4215. ============================
  4216. Testing t_mpi
  4217. ============================
  4218. t_mpi Test Log
  4219. ============================
  4220. ===================================
  4221. MPI functionality tests
  4222. ===================================
  4223. Proc 2: hostname=sullivan.dimar.mil.co
  4224. Proc 3: hostname=sullivan.dimar.mil.co
  4225. Proc 4: hostname=sullivan.dimar.mil.co
  4226. Proc 5: hostname=sullivan.dimar.mil.co
  4227. --------------------------------
  4228. Proc 0: *** MPIO 1 write Many read test...
  4229. --------------------------------
  4230. Proc 0: hostname=sullivan.dimar.mil.co
  4231. Proc 1: hostname=sullivan.dimar.mil.co
  4232. Proc 5: MPI_File_open failed (MPI_ERR_IO: input/output error)
  4233. Proc 2: MPI_File_open failed (MPI_ERR_IO: input/output error)
  4234. Proc 3: MPI_File_open failed (MPI_ERR_IO: input/output error)
  4235. Proc 4: MPI_File_open failed (MPI_ERR_IO: input/output error)
  4236. Proc 1: MPI_File_open failed (MPI_ERR_IO: input/output error)
  4237. Proc 0: MPI_File_open failed (MPI_ERR_IO: input/output error)
  4238. ***FAILED with 6 total errors
  4239. --------------------------------
  4240. Proc 0: *** MPIO File size range test...
  4241. --------------------------------
  4242. MPI_Offset is signed 8 bytes integeral type
  4243. Proc 2: *** Parallel ERROR ***
  4244. VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
  4245. aborting MPI processes
  4246. Proc 3: *** Parallel ERROR ***
  4247. VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
  4248. aborting MPI processes
  4249. Proc 0: *** Parallel ERROR ***
  4250. VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
  4251. aborting MPI processes
  4252. Proc 1: *** Parallel ERROR ***
  4253. VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
  4254. aborting MPI processes
  4255. Proc 4: *** Parallel ERROR ***
  4256. VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
  4257. aborting MPI processes
  4258. Proc 5: *** Parallel ERROR ***
  4259. VRFY (MPI_FILE_OPEN) failed at line 295 in ../../testpar/t_mpi.c
  4260. aborting MPI processes
  4261. --------------------------------------------------------------------------
  4262. MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
  4263. with errorcode 1.
  4264.  
  4265. OpenMPI with -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
  4266. [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'
  4267.  
  4268. [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
  4269.  
  4270.  
  4271. [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
  4272.  
  4273. =======
  4274. Parallel NetCDF:
  4275. export CC=icc
  4276. export CXX=icpc
  4277. export CFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
  4278. export CXXFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
  4279. export F77=ifort
  4280. export FC=ifort
  4281. export F90=ifort
  4282. export FFLAGS='-O3 -xHost -ip -no-prec-div -static-intel'
  4283. export CPP='icc -E'
  4284. export CXXCPP='icpc -E'
  4285.  
  4286. 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'
  4287.  
  4288. ó
  4289.  
  4290. [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'
  4291.  
  4292. [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
  4293.  
  4294. [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
  4295.  
  4296. ===========
  4297. [wilderman@sullivan run]$ time mpirun -np 22 ./wrf.exe
  4298. real 147m49.293s
  4299. user 3245m12.477s
  4300. sys 3m33.565s
  4301.  
  4302.  
  4303.  
  4304. slonin@deleyva:~/spoa/scripts/matlab/gfs$ diff -u GFS_area51.m GFS.m
  4305. --- GFS_area51.m 2017-09-19 14:55:30.000000000 -0500
  4306. +++ GFS.m 2017-09-12 16:43:54.739817483 -0500
  4307. @@ -5,19 +5,22 @@
  4308. clear all
  4309. clc
  4310.  
  4311. -addpath('/spoa/scripts/matlab/gfs/nctoolbox2.0')
  4312. -addpath('/spoa/scripts/matlab/gfs/mexcdf')
  4313. +%addpath('/home/slonin/spoa/scripts/matlab/gfs/nctoolbox2.0')
  4314. +addpath('/home/slonin/spoa/scripts/matlab/gfs/nctoolbox-1.1.3')
  4315. +addpath('/home/slonin/spoa/scripts/matlab/gfs/mexcdf/netcdf_toolbox/netcdf')
  4316. +addpath('/home/slonin/spoa/scripts/matlab/gfs/mexcdf/netcdf_toolbox/netcdf/nctype')
  4317. +addpath('/home/slonin/spoa/scripts/matlab/gfs/mexcdf/netcdf_toolbox/netcdf/ncutility')
  4318. setup_nctoolbox
  4319.  
  4320. -punto=xlsread('puntos.xls');
  4321. +punto=xlsread('puntos02.xls');
  4322. punto(:,3)=punto(:,2)+360;
  4323.  
  4324. -PATH ='/home/slonin/WRFV33/WPS/GFS_DATA/';
  4325. -PATH_H = '/spoa/data/caribwam/';
  4326. +PATH ='/home/slonin/spoa/data/wrf/gfs/';
  4327. +PATH_H = '/home/slonin/spoa/data/caribwam/';
  4328. load lat_mtlb.dat
  4329. load lon_mtlb.dat
  4330. fecha =datevec(now);
  4331. -horas = 12:6:54;
  4332. +horas = [12,18,24,30];
  4333. mTEM=[];mHUM=[];mdir=[];mspd=[];mPRE=[];mNUB=[];
  4334.  
  4335. for j=1:size(horas,2)
  4336. @@ -29,16 +32,16 @@
  4337. ds=ncgeodataset(grib);
  4338. % ds.variables
  4339. %Precipitacion
  4340. -PRE = 'Total_precipitation';
  4341. +PRE = 'Total_precipitation_surface_6_Hour_Accumulation';
  4342. %Cobertura nubosa
  4343. -NUB = 'Total_cloud_cover_entire_atmosphere';
  4344. +NUB = 'Total_cloud_cover_entire_atmosphere_6_Hour_Average';
  4345. %Temperatura
  4346. TEM = 'Temperature_surface';
  4347. %Humedad
  4348. HUM = 'Relative_humidity_height_above_ground';
  4349. %Viento
  4350. -Uw = 'U-component_of_wind_height_above_ground';
  4351. -Vw = 'V-component_of_wind_height_above_ground';
  4352. +Uw = 'u-component_of_wind_height_above_ground';
  4353. +Vw = 'v-component_of_wind_height_above_ground';
  4354. %Niv = 'height_above_ground5';
  4355.  
  4356. %LECTURA DE VARIABLES
  4357. @@ -80,14 +83,16 @@
  4358. clear lat lon u10 v10 HUM TEM PRE NUB ur vr dir spd Uw Vw
  4359. end
  4360.  
  4361. -tiempo=[7,13,19,25,31,37,43,49]';tim =repmat(tiempo,6,1);
  4362. +tiempo=[7,13,19,1]';tim =repmat(tiempo,6,1);
  4363.  
  4364. M = [mNUB;mPRE;mTEM;mHUM;mdir;mspd];M= [tim M];
  4365. +
  4366. clear mNUB mPRE mTEM mHUM mdir mspd tim ind ind1 i grib
  4367. clear pTEM pHUM pdir pspd pPRE pNUB
  4368.  
  4369. -tpron=['012';'024';'036';'048'];mph=[];mpd=[];
  4370. -for j=1:length(tpron)
  4371. +tpron=['012';'024';'036'];mph=[];mpd=[];
  4372. +
  4373. +for j=1:3
  4374. file=[PATH_H 'hw' tpron(j,:) '_mtlb.dat'];
  4375. hw=load(file);%abro archivo
  4376. %Separo la altura de la ola de la direccion
  4377. @@ -103,52 +108,53 @@
  4378. end
  4379. end
  4380.  
  4381. - for l=1:6
  4382. + for l=1:6
  4383.  
  4384. 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);
  4385.  
  4386. - if isempty(hind)
  4387. + if isempty(hind)
  4388.  
  4389. else
  4390. ph = hw(hind);
  4391. dir = direc(hind);
  4392. mpd=[mpd dir];
  4393. mph=[mph ph];
  4394. - end
  4395. + end
  4396. end
  4397.  
  4398. end
  4399. -clear i j l tpron hw horas hind ftime direc lon_mtlb lat_mtlb ds ph dir
  4400.  
  4401. -ze = zeros(8,18);
  4402. +clear i j l tpron hw horas hind ftime direc lon_mtlb lat_mtlb ds ph dir
  4403.  
  4404. -mph=[mph(:,1:6);mph(:,1:6);mph(:,7:12);mph(:,7:12);mph(:,13:18);mph(:,13:18);...
  4405. - mph(:,19:end);mph(:,19:end)];mph=[mph ze];
  4406. +ze = zeros(4,21);
  4407.  
  4408. -mpd=[mpd(:,1:6);mpd(:,1:6);mpd(:,7:12);mpd(:,7:12);mpd(:,13:18);mpd(:,13:18);...
  4409. - mpd(:,19:end);mpd(:,19:end)];mpd=[mpd ze];
  4410. +mph=[mph(:,1:6);mph(:,1:6);mph(:,7:12);mph(:,13:end)];mph=[mph ze];
  4411. +mpd=[mpd(:,1:6);mpd(:,1:6);mpd(:,7:12);mpd(:,13:end)];mpd=[mpd ze];
  4412.  
  4413. -%p = (0:1:24);VAR = {'PUNTOS','NUBOSIDAD','PRECIPITA','TEMPERATU','HUMEDAD','DIRVIENTO','MAGVIENTO','ALTURAOLA','DIROLA'}';
  4414. -p = (0:1:24);VAR = {'FEC','PUNT','NUBO','PREC','TEMP','HUME','DIRV','MAGV','ALTU','DIRO'}';
  4415. +p = (0:1:27);VAR = {'FEC','PUNTOS','NUBOSIDAD','PRECIPITA','TEMPERATU','HUMEDAD','DIRVIENTO','MAGVIENTO','ALTURAOLA','DIROLA'}';
  4416. +%p = (0:1:27);VAR = {'FEC','PUNT','NUBO','PREC','TEMP','HUME','DIRV','MAGV','ALTU','DIRO'}';
  4417.  
  4418. con=2;
  4419. NAME={VAR{1:2,1}};NAME=(NAME)';
  4420.  
  4421. for i=3:10
  4422. -
  4423. - for j=1:8
  4424. - con=con+1;
  4425. + for j=1:4
  4426. + con=con+1
  4427. NAME{con,1} = VAR{i,1};
  4428. end
  4429. end
  4430.  
  4431. -NAME = char(NAME); Mfe = zeros(1,25);Mfe(1,1:3)= fecha(1,1:3);
  4432. +NAME = char(NAME); Mfe = zeros(1,28);Mfe(1,1:3)= fecha(1,1:3); %24 rows from puntos.xls
  4433. +%NAME = char(NAME); Mfe = zeros(1,28);Mfe(1,1:3)= fecha(1,1:3);
  4434.  
  4435. -M = [M; tiempo mph;tiempo mpd];M=[p;M];M=[Mfe;M];
  4436. +M = [M; tiempo mph;tiempo mpd];
  4437. +M=[p;M];M=[Mfe;M];
  4438. MF = [NAME num2str(M)];
  4439. for i=1:size(MF,1)
  4440. -FID = fopen('datapronarc.dat','a');
  4441. +
  4442. + FID = fopen('datapronarc.dat','a');
  4443. fprintf(FID,'%s \r\n',MF(i,:));
  4444.  
  4445. end
  4446. - fclose(FID);
  4447. +
  4448. +fclose(FID);
Advertisement
Add Comment
Please, Sign In to add comment