Strona poświęcona programowaniu w QNX 6.4.1

Na tej stronie umieszczam rezultaty moich prac i doświadczeń ziązanych z systemem operacyjnym QNX. Pracuję z reguły na najnowszej wersji systemu którą obecnie jest wersja 6.4.1. Praktycznie są to rezultaty związane z przenoszeniem oprogramowania z systemu LINUX/GNU. Oprogramowanie które tu się znajduje nie jest niestety dostępne w oficjalnych dystrybucjach producenta QNX firmy QNX Software LTD. Jest wyrazem moich zainteresowań i prac które prowadziłem.

Szczególnie chciałbym zwrócić uwagę na niedocenianie przez QNX-a języka programowania ada. Tutaj regularnie umieszczam kompilatory tego języka oparte o gcc i gnat.

Dostępne są również kompilatory języków fortran, objc i oczywiście gcc i c++. Umieściłem również prolog i całkiem nowy język Vala. Vala jest ściśle związana z projektem Gnome którego główne elementy staram się umieszczać.

Oprogramowanie ze względu na ograniczenia jest z reguły w postaci gotowych binarnych pakietów. Staram się również umieszczać wskazówki jak skompilować oddzielne oprogramowanie. Z przyjemnością odpowiem na pytania jeżeli takie wystąpią.

New:  look Gnome

Kompilatorem języka ada w QNX jest kompilator gnat z gcc.
Mamy dwie wersje kompilatora ze strony https://libre.adacore.com/libre/ i z oficjalnych zrodel gcc
Kompilator ady posiada bardzo rozbudowany system testów acats.
Bardzo dobrym źródłem przykładów jest gnat-examples.tar.bz2. Można tam znaleźć wiele przykładów programowania w Ada 2005.
W katalogu examples/plugins znajduje sie ciekawy przykład techniki dynamicznego ładowania bibliotek.
 
New:
gcc/g++/gnat/gfortran/objc 4.4.2:

gcc-g++4.4.2-x86-qnx6.4.1.tar.bz2     gfortran4.4.2-x86-qnx6.4.1.tar.bz2     gnat4.4.2-x86-qnx6.4.1.tar.bz2 

libstdc++.so.6.0-4.4.2-x86-qnx6.4.1.tar.bz2  

gmp-mpfr.tar.bz2   the library of gmp and  mpfr necessary for the compiler. To install in /usr/pkg/lib   

bits.c++.h.gch4.4.2-x86-qnx6.4.1.tar.bz2

The source of the compiler  gcc-4.4.2.tar.bz2 

The return to gcc4.3.3.    gcc-oryginal.tar.bz2
            

The source of programs:  http://ftp.gnome.org/pub/GNOME/
atk    -  the source atk-1.28.0.tar.bz2 copy to pkgsrc/devel/atk;   binary package  atk-1.28.0.tgz
cairo  -  
the source cairo-1.8.8.tar.bz2 copy to pkgsrc/graphics/cairo;   binary package  cairo-1.8.8.tgz
glib2  -  the source glib2-2.22.3.tar.bz2 copy to pkgsrc/devel/glib2;   binary package  glib2-2.22.3.tgz
gtk2  -  the source gtk2-2.18.5.tar.bz2 copy to pkgsrc/x11/gtk2;   binary package  gtk2+-2.18.5.tgz
vala   -  the source vala-0.7.9.tar.bz2 copy to pkgsrc/lang/vala;   binary package  vala-0.7.9.tgz

Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.
There is very good tutorial
Vala shares a lot of syntax with C# and Java.
The simple example, hello.vala:
using GLib;
public class Test.HelloObject : Object {
public static int main(string[] args) {
stdout.printf("Hello, World\n");
return 0;
}
}

or BasicSample.vala:
/* class derived from GObject */
public class BasicSample : Object {
/* public instance method */
public void run () {
stdout.printf ("Hello World\n");
}
/* application entry point */
public static int main (string[] args) {
// instantiate this class, assigning the instance to
// a type-inferred variable
var sample = new BasicSample ();
// call the run method
sample.run ();
// return from this main method
return 0;
}
}


Compile and Run
$ valac -o basicsample BasicSample.vala
$ ./basicsample

W momencie gdy w trakcie kompilacji gcc uzyskujemy również kompilator języka Objective-C to okazało się że można do QNX przenieść GNUstep. Objective-C jest bardzo ciekawym rozszerzeniem języka C o mechanizmy obiektowe.  Niestety nie jest on zbyt popularny w porównaniu z C++ ale wydaje mi się, że jest wart tego aby przynajmniej się mu przyjrzeć. Bardzo ciekawy jest zastosowany w tym języku model obiektowy oparty o język Smalltalk.
The Low Level Virtual Machine (LLVM) is a compiler infrastructure, written in C++, which is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages. LLVM was originally developed as a research infrastructure at the University of Illinois at Urbana-Champaign to investigate dynamic compilation techniques for static and dynamic programming languages.
Clang  is a compiler front end for the C, C++,  and  Objective-C programming languages. It uses the LLVM as its back end.
Its goal is to offer a replacement to the GCC. Development is sponsored by Apple, and it is licensed using a BSD-like open source license.
This is first version LLVM and Clang compiled under QNX 6.4.1.
Building
LLVM and Clang
 1. Download the llvm-clang-rev92395.tar.bz2 (it is sources) and unpack it in /src  or in the different  directory.  
 2. cd  /src/llvm
 3. I changed following files:
./
    Makefile.config.in
    Makefile.rules
    configure
./tools/clang/lib/Parse/
    ParseCXXInlineMethods.cpp
./tools/clang/include/clang/Basic/
    Diagnostic.h
./tools/clang/test/
    TestRunner.sh
./lib/ExecutionEngine/JIT/
    JIT.cpp
./lib/System/Unix/
    Path.inc
./examples/ParallelJIT/
    Makefile
 4.  ./configure --enable-debug-runtime --enable-debug-symbols --prefix=/usr/local \
      LDFLAGS=-L/usr/pkg/lib CPPFLAGS=-I/usr/pkg/include --enable-targets=x86 2>&1 | tee Konfigure.log
 5. make 2>&1 | tee CC.log
     mkdir installdir
     make DESTDIR=$(pwd)/installdir install 2>&1 | tee Install.log
     make install 2>&1 | tee INSTALL.log
And now we can compile programs using the clang compiler.
clang -D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__ -o hello hello.c
clang -D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__ -o hello hello.m -L/usr/pkg/lib -lobjc 2>&1 | tee CC.log
You should remember to use  -D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__
Using clang I tested the compilation sqlite3.
I made the change in configure:
echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
.......
if test -z "$CPP"; then
  if test "${ac_cv_prog_CPP+set}" = set; then
  echo $ECHO_N "(cached) $ECHO_C" >&6
else
      # Double quotes because CPP needs to be expanded
    for CPP in "$CC -E -D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__" "$CC -E -traditional-cpp" "/lib/cpp"
    do
      ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
---------
and then: 
CC=clang ./configure --enable-threadsafe --enable-cross-thread-connections --enable-threads-override-locks
--enable-tempstore=yes --enable-debug LDFLAGS=-L/usr/local/lib
CPPFLAGS=-I/usr/local/include CFLAGS="-D__QNXNTO__ -D__X86__ -D__LITTLEENDIAN__" --disable-tcl
The compilation passed without problems.
Biblioteki niezbedne do pacy aplikacji.
Zasadniczo będę tu umieszczał pakiety pkgsrc w postaci źródeł jak i binarnych pakietów.
GMP - GNU Multiple Precision Arithmetic Library;  the source gmp.tar.bz2 copy to pkgsrc/devel/gmp;   binary package  gmp-4.3.1.tgz
MPFR - is a C library for multiple-precision floating-point computations with correct rounding;

            the source
 mpfr.tar.bz2 copy to pkgsrc/math/mpfr;    binary package mpfr-2.4.2.tgz
MPC - is a complex floating-point library with exact rounding;  
           the source mpc.tar.bz2  copy to pkgsrc/math/mpc;   binary package mpc-0.8.tgz
Biblioteki gmp i mpfr są niezbędne do pracy kompilatorów gcc/g++ w wersji 4.4.* i 4.5.*

The side dedicated programming in QNX 6.4.1

I place the results of my works and experiences with the system operating QNX on this side. The results of the works of the transfer of software from the system LINUX/GNU are this. Which software is here he is not unfortunately accessible in the producer QNX official distributions. He is the word of my interests and works which I led.

I would like particularly to pay the attention to the not appreciated by QNX programming language ada. I place the compilers of this language built in the support about gcc and gnat here regularly.

They accessible are also the compilers of the languages of fortran, objc. I also placed prolog and quite new language Vala. Vala is connected with the Gnome project closely. I try to place the main elements of the Gnome.

I also try to place oneself hands as to compile separate software. I will answer with the pleasure on questions if such will step out.

New:  look LLVM clang

Free Web Counter Free Web Counter Kontakt ze mną bceler@op.pl lub bogdan@xserwis.com.pl