Membuat Dokumen Laporan dengan texi2any (disertai Templat)

Hari ini, di halaman The Hyang’s Release Info kami telah menambahkan entri baru #RP-DOC002 berupa kode sumber untuk manual panduan developer yang ada sini. Kode sumber tersebut dibuat menggunakan utilitas texi2any dari paket GNU Texinfo. Kode sumber utamanya ada di file .texi, dan melalui alat texi2pdf menghasilkan output utamanya berupa file PDF.

Membuat dokumen laporan dengan texi2any akan memiliki banyak keuntungan, karena dengan satu file kode sumber yang dibuat akan bisa diperoleh file-file dalam berbagai format (baik versi digital/online atau cetak), seperti PDF, HTML, LaTeX, XML, dll). Hanya perlu menginstal GNU Texinfo saja. Kebetulan saya sudah instal versi 6.3.

Bila Anda ingin mencoba, Anda bisa instal. Lalu (bila masih bingung) gunakan templat file .texi yang sudah ada, yang bisa Anda modifikasi sesuai keperluan (lihat juga manualnya di https://www.gnu.org/software/texinfo/manual/info-stnd/).

Pada contoh ini, saya buat file texi2any-test.texi :

Setelah selesai Anda modifikasi, lalu di terminal jalankan

$ texi2any texi2any-test.texi

yang akan menghasilkan file berekstensi .info. Nama file info tersebut bisa diatur dari dalam kode sumber di file .texi tadi (pada baris ketiga) :

@setfilename (nama-file).info

Untuk mendapatkan output dalam format pdf, gunakan

$ texi2pdf texi2any-test.texi

File-file yang dihasilkan dengan perintah texi2pdf : (nama-file).info, texi2any-test.en, texi2any-test.aux, texi2any-test.ens, texi2any-test.toc, texi2any-test.cp, texi2any-test.log, texi2any-test.vr, texi2any-test.cps, texi2any-test.vrs dan output yang diperlukan yaitu texi2any-test.pdf.

Membangun dan Memasang GCC Versi 8.3 di Debian

Dikarenakan GCC yang terpasang di sistem saya sebelumnya belum mendukung kompiler C++17 (yang secara opsional mendukung proses kompilasi dan instalasi Hyang 1.3.0), saya telah mencoba memutahirkan GCC ke versi yang lebih baru (ini setidaknya versi 7.4 ke atas). Kali ini saya akan mencoba membagikan pengalaman saya dalam proses membangun dan menginstal GCC versi 8.3.

Informasi dari sistem yang saya gunakan adalah sebagai berikut :

$ uname -a

System Informations : uname -a

Anda bisa menggunakan SVN untuk mengakses hasil pengembangan terkini dari kode sumber GCC di :

https://gcc.gnu.org/svn.html

Anda juga bisa mendapatkan GCC versi terbaru dengan mengunjungi beberapa mirror GCC di :

https://gcc.gnu.org/mirrors.html

Jika anda ingin mencoba pengalaman baru dengan mengunduhnya dari salah satu mirror, Anda bisa coba netgull.com. Kebetulan karena layanan mirror netgull.com sering saya kunjungi, saya gunakan mirror GCC dari netgull.com (terima kasih kepada admin di netgull.com).

GCC sejak 2017 memiliki snapshot reguler mingguan yang saat ini menggunakan kompresi berkas arsip .tar.xz. Kali ini saya akan mencoba membangun dan menginstal snapshot GCC versi 8.3 dari berkas arsip snapshot .tar.xz yang disediakan di mirror netgull.com :

http://www.netgull.com/gcc/snapshots/LATEST-8/

Unduh berkas gcc-8-20190412.tar.xz dan sha512.sum :

$ wget http://www.netgull.com/gcc/snapshots/LATEST-8/gcc-8-20190412.tar.xz
$ wget http://www.netgull.com/gcc/snapshots/LATEST-8/sha512.sum

GCC 8.3 Checksum

$ tar xvf gcc-8-20190412.tar.xz
$ cd gcc-8-20190412

Sebelum menjalankan ./configure saya perlu memasang dulu beberapa paket pendukung atau prasyarat untuk bisa membangun GCC (seperti GMP 4.2+, MPFR 2.4.0+ dan MPC 0.8.0+). Pada direktori gcc di atas, jalankan perintah:

$ ./contrib/download_prerequisites

Perintah ./contrib/download_prerequisites di atas tidak secara otomatis memasang semua paket yang diperlukan untuk rilis gcc terbaru (lihat pada catatan di bawah). Jika karena alasan tertentu, flex (misalnya, untuk pembangun analisis leksikal di GCC) belum terpasang pada proses di atas, maka flex juga perlu dipasang secara terpisah :

$ sudo apt-get install flex

Setelah itu, GMP, MPFR, MPC dan flex akan siap digunakan pada ./configure. Pada tahap awal setelah ia diisukan, akan muncul pesan kesalahan seperti berikut :

/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
configure: error: I suspect your system does not have 32-bit development 
libraries (libc and headers). If you have them, rerun configure with 
--enable-multilib. If you do not have them, and want to build a 64-bit-only 
compiler, rerun configure with --disable-multilib.

Saya perlu memasang gcc-multilib untuk dukungan 32-bit (meskipun sistem yang saya gunakan 64-bit) :

$ sudo apt-get install gcc-multilib

saya jalankan lagi perintah ./configure seperti di atas, dan hasilnya seperti ini:

$ ./configure
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... gawk
checking for libatomic support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... yes
checking for libmpx support... yes
checking for libhsail-rt support... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ accepts -static-libstdc++ -static-libgcc... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
configure: WARNING: using in-tree isl, disabling version check
The following languages will be built: c,c++,fortran,lto,objc
*** This configuration is not supported in the following subdirectories:
     gnattools gotools target-libada target-libhsail-rt target-libgo target-libffi target-liboffloadmic
    (Any other directories should still work fine.)
checking for default BUILD_CONFIG... bootstrap-debug
checking for --enable-vtable-verify... no
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for bison... no
checking for gm4... no
checking for gnum4... no
checking for m4... m4
checking for flex... no
checking for lex... no
checking for flex... no
checking for makeinfo... makeinfo
checking for expect... no
checking for runtest... no
checking for ar... ar
checking for as... as
checking for dlltool... no
checking for ld... ld
checking for lipo... no
checking for nm... nm
checking for ranlib... ranlib
checking for strip... strip
checking for windres... no
checking for windmc... no
checking for objcopy... objcopy
checking for objdump... objdump
checking for readelf... readelf
checking for cc... cc
checking for c++... c++
checking for gcc... gcc
checking for gfortran... gfortran
checking for gccgo... no
checking for ar... no
checking for ar... ar
checking for as... no
checking for as... as
checking for dlltool... no
checking for dlltool... no
checking for ld... no
checking for ld... ld
checking for lipo... no
checking for lipo... no
checking for nm... no
checking for nm... nm
checking for objcopy... no
checking for objcopy... objcopy
checking for objdump... no
checking for objdump... objdump
checking for ranlib... no
checking for ranlib... ranlib
checking for readelf... no
checking for readelf... readelf
checking for strip... no
checking for strip... strip
checking for windres... no
checking for windres... no
checking for windmc... no
checking for windmc... no
checking where to find the target ar... host tool
checking where to find the target as... host tool
checking where to find the target cc... just compiled
checking where to find the target c++... just compiled
checking where to find the target c++ for libstdc++... just compiled
checking where to find the target dlltool... host tool
checking where to find the target gcc... just compiled
checking where to find the target gfortran... just compiled
checking where to find the target gccgo... host tool
checking where to find the target ld... host tool
checking where to find the target lipo... host tool
checking where to find the target nm... host tool
checking where to find the target objcopy... host tool
checking where to find the target objdump... host tool
checking where to find the target ranlib... host tool
checking where to find the target readelf... host tool
checking where to find the target strip... host tool
checking where to find the target windres... host tool
checking where to find the target windmc... host tool
checking whether to enable maintainer-specific portions of Makefiles... no
configure: creating ./config.status
config.status: creating Makefile

Lalu saya jalankan perintah make.

Proses kompilasi GCC memakan waktu yang lama (pengalaman saya di atas 1 jam). Anda bisa mengerjakan hal-hal lainnya sambil menunggu proses kompilasi selesai.

Catatan : Jika karena alasan tadi (ada beberapa paket pra-syarat yang belum terpasang), perintah make akan memunculkan pesan kesalahan fatal. Misalnya dalam kasus flex yang belum terpasang, muncul pesan kesalahan seperti berikut :

g++: error: gengtype-lex.c: Tidak ada berkas atau direktori seperti itu
g++: fatal error: no input files
compilation terminated.
Makefile:2670: recipe for target 'build/gengtype-lex.o' failed
make[3]: *** [build/gengtype-lex.o] Error 1
make[3]: Meninggalkan direktori '/home/alisabana/build-dir/gcc/gcc-8-20190412/host-x86_64-pc-linux-gnu/gcc'
Makefile:4625: recipe for target 'all-stage1-gcc' failed
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Meninggalkan direktori '/home/alisabana/build-dir/gcc/gcc-8-20190412'
Makefile:27880: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Meninggalkan direktori '/home/alisabana/build-dir/gcc/gcc-8-20190412'
Makefile:952: recipe for target 'all' failed
make: *** [all] Error 2

Itu berarti program flex tadi belum terpasang di sistem. Anda juga perlu memeriksa kembali kelengkapan paket-paket pendukung lain sebagai pra-syarat untuk membangun dan menginstal GCC di manual GCC (misalnya di https://gcc.gnu.org/install/prerequisites.html).

Setelah proses kompilasi selesai, muncul keterangan berikut di akhir proses:

true DO=all multi-do # make

dan keterangan-keterangan lainnya yang menunjukkan proses kompilasi telah berhasil dilakukan. Setelah itu saya jalankan perintah:

$ sudo make install

Setelah proses instalasi selesai, saya bisa cek versi gcc yang telah terpasang barusan :

GCC Version Check

Sekarang GCC versi 8.3 telah siap digunakan.

Referensi :

Alisabana, H. P. (2019). Kitab GNU/LINUX untuk Pemula: Panduan Praktik Dasar untuk Membangun Program Aplikasi Menggunakan GCC (GNU Compiler Collection). Hyang Language Foundation, Jakarta.

Stallman, R. M, et. al. (2018). Using the GNU Compiler Collection (GCC), Version 8.3. Free Software Foundation, MA.

Preparing for the Hyang 1.3.0 Release

[This blog post describes the release plans of Hyang 1.3.0 from the Hyang Programming Language writer and creator, Hilman P. Alisabana. This blog post is licensed under the same license as the license of this blog (Creative Common License Attribution-ShareAlike version 3.0). You can email the writer’s email address <alisabana@hyang.org> for further informations about this blog post.]

Hyang 1.3.0 is planned to be released this year. This is the “heavyweight” version of Hyang because a lot of additions, new features, and some big changes. It will come with so many default packages and libraries (including Abah compiler and a number of base packages) and about 15+ prebuilt packages. The Abah compiler of Hyang and its JIT capabilitias (called Jitabah) will be integrated and natively registered within Hyang 1.3.0 distribution, and it’s used by default when starting Hyang prompt.

Hyang 1.3.0 will also have a version name “Iced Avocado”; the “heavyweight” version of Hyang but with a fruitful and nutritious packages.

What’s really new on the next in this world is that Hyang 1.3.0 will have an interface to deal with Alisabana’s Constant. This is another good news for Alisabana’s Constant fans worldwide. 🙂

Although Hyang 1.3.0 was built under Debian GNU/Linux, as below :

system info

Hyang 1.3.0 source code is being developed for Unix-like machines, so it will configure and build under a number of common platforms including platforms of CPU-linux-gnu for the i386, amd64/x86_64, alpha, arm, arm64, hppa, mips/mipsel, powerpc, s390x and sparc CPUs, i386-hurd-gnu, CPU-kfreebsd-gnu for i386 and amd64, i386-pc-solaris, rs6000-ibm-aix, sparc-sun-solaris, x86_64-apple-darwin, x86_64-unknown-freebsd and x86_64-unknown-openbsd.

In addition to Unix-likes, with helps the GNU Compiler Collection (GCC) manuals, Hyang 1.3.0 source code is also being developed for Windows and Mac OS families of operating systems, although all Hyang developers did not have access to Windows and Mac.

Below is the screenshot of a successful configure result of hyang-devel (Hyang 1.3.0 latest development), after running the ./configure command :

Hyang 1.3.0 Configuration Output

Hyang 1.3.0 will have interfaces to procedures written in the C, C++, Obj-C, Fortran and Java for efficiency. If your installed GCC versions do not support C++17 compiler and Obj-C compiler, try a later version of GCC, at least GCC 7.4, or later. (Update: see my next post on sharing about how to build and install GCC version 8.3 : In bahasa Indonesia).

Below is the screenshot of compilation result (after running the make command) to hyang-devel. When hyang is called from the terminal it’ll look something like this :

Hyang 1.3.0 - Welcome Prompt

With the ./configure and make command, everything should run well. You don’t need to install Hyang 1.3.0 to run Hyang. But for a large sets of project it is recommended to install Hyang with the root access, for instance using the command sudo make install.

Unlike Hyang 1.2.x series which are licensed under the terms of MIT license, Hyang 1.3.0 will be distributed mainly under the terms of GNU General Public License version 3 or later, and some files still use version 2. Below is the screenshot of output to the function license() :

Hyang 1.3.0 Licenses

A copy from above :

Hyang software package is distributed under the terms of GNU
General Public License, either Version 2 or Version 3.
The terms of version 3 of the license are in a file called COPYING
which you should have received with this software package
and which can be displayed using hyangShowDoc("COPYING").
Version 2 can be displayed using hyangShowDoc("GPL-2").

You should have received copies of the licenses along with this
software package. If not, see <http://www.gnu.org/licenses/>.

A small number of files (the API header files listed in the
HYANG_DOC_DIR/COPYRIGHTS) are distributed under the terms of
LESSER GNU GENERAL PUBLIC LICENSE, version 2.1 or later.
This can be displayed using hyangShowDoc("LGPL-2.1").
Version 3 of LGPL can be displayed using hyangShowDoc("LGPL-3").

'Thank you for using Hyang, and enjoy coding!'
>

Hyang 1.3.0 provides a modern interface to mathematical and statistical algorithms, and some modern computational tasks including AI and data sciences. The Hyang 1.3.0 distribution also contains utilities for parallel computations, neural networks, spatial correlation and “monadic” space analysis, genetic algorithms, survival analysis, recursive partitions, some algorithms to deal with lattice stuffs, bootstrapping tools, kernel smoothing, and many more to come later.

On mathematics and statistics, Hyang 1.3.0 has a large sets of functionality for a large number of modern research topics, including linear and generalized linear analysis, nonlinear regression analysis, time series analysis, parametric and nonparametric tests, clustering, smoothing, structural equation modeling (SEM), partial least square (PLS), fuzzy logic, etc etc…, also provides a flexible graphical environment for creating various kinds of data visualization.

Hyang 1.3.0 consists of a language; an interpreter plus a compiler (Abah) with a JIT (Just-In-Time) capabilities (Jitabah); run-time environment with graphics, a debugger, access to certain system functions, and the ability to run programs within script files.

Hyang 1.3.0 is a programming and scripting language that is influenced by GNU software projects, and inspired by a number of programming languages including C, C++, Obj-C, Fortran, Lua, Scheme, R, Java, Python and Perl.

Below is a screenshot of the output from function contributors() :

Hyang 1.3.0 Contributors

Complete output from function contributors() above is here :

Authors of Hyang.

Hyang was initially written by Hilman P. Alisabana in early 2017.
On its develepment Hyang was influenced and inspired by many other
programming and scripting language including C, C++, Java, Fortran,
Perl, Python, Scheme, Lua and R.

There has been a list of contibutors of Hyang, currently consisting of

M. Sindu Natama
Inne Susanti
Yazid Amini
Ervina Larasati
Nadya
Dara Irawan
Lena C. S.
Tedja Arsyad
Dhian Shaphira
Rida Farida
Anna Nita
Aldi Dinata
Nikita Yusuf
Yan

A list of authors of code from other projects outside Hyang included
in the Hyang distribution are listed in the COPYRIGHTS files.

Hyang is a programming and scripting language that was influenced
by GNU software projects, and inspired by a number of programming
languages including C, C++, Obj-C, Fortran, Lua, Scheme, R, Java,
Python and Perl.

Hyang would say thanks to the open source communities worldwide
for the invaluable helps with the codes and documentations that
has been adopted by Hyang and is acknowledged in the code files.

Other contributors outside the Hyang Language Foundation have
written codes that has been adopted and modified accordingly by
Hyang and is acknowledged in the source code files, including :

Lachlan Patrick, Catherine Loader, Ei-ji Nakama, Ulrich Drepper,
Bruno Haible, Gordon Matzigkeit, Gary V. Vaughan, Scott J. Remnant,
David MacKenzie, Paul Eggert, Patrick Daly, Achim Zeileis, Angus
North, Jim McDonald, Wim Rijnders, Ville Laurikari, Bjorn Reese,
Daniel Stenberg, Arthur D. Olson, Yukihiro Nakadaira, Martin F.
Gergeleit, Christopher R. Thewalt, DaviD W. Sanderson, Ross Ihaka,
Julian Seward, Alan Richardson, Noah Friedman and of course the GNU
project writers and the Free Software Foundation; many more, too
numerous to mention here.

The Hyang Language Foundation (HLF) may decide to give out email
address e.g., @hyang.org and an account from Hyang
websites to contributors to the Hyang project (even without making
them members of the HLF) when in the view of the HLF this would help
advance the Hyang project.

(END)

Other informations for Hyang 1.3.0 release plan :

  1. Plan for various kinds of file formats for any kind of Hyang documentations, manuals, FAQ, and NEWS files. These file formats including HTML, LaTeX and PDF. All and everything about making them are compiled within Hyang build system. From there, one can obtain formats converted to plain ASCII text, DVI, GNU info, HTML, PDF, PostScript, as well as the Texinfo source used for creating all these formats using the GNU Texinfo system. All of these codes can be built directly (and/or separately) during (and after) Hyang compilation process. For example, by issuing the following commands: make latex, make pdf, and make html after compilation process.
  2. Plan for Hyang bug tracking system placed at hyang.org website and integrate it within Hyang 1.3.0 distribution system.
  3. Plan for Hyang Package Archive (HYPA) placed at hyang.org website and integrate it within Hyang 1.3.0 distribution system.
  4. Plan for placing Hyang source code repositories and all Hyang default packages (including base and prebuilt packages) on public domain. Current versioning system of Hyang 1.3.0 development is using SVN and placed on private domain. Other plan is using git (in addition to svn one).
  5. Etc. (all other parts will be integrated within Hyang distribution system).