Hi,
I have tried to compile Gambit under QNX 4.25 (not QNX 6) and get error during configure stage
checking for sys/types.h... /tmp/sh23124234: cannot open file (No such file or directory).
It seems that configure script doesn't run properly in QNX 4.25 which is very limited realtime POSIX system.
I have a general question is it possible to build Gambit in system:
1. that doesn't support automake/autoconf properly
2. that does not have so/dll
3. that doesn't have threads (pthread for instance)
Is it possible to write manually config.h is such a way?
In general I want to develop under Linux but run/test everything under QNX 4.25.
QNX 4.25 supprorts tcp/ip sockets so this is the only requirement for me except standart c functions.
Oleg.
Afficher les réponses par date
On 2011-08-14, at 4:48 AM, Кириенко Олег wrote:
Hi,
I have tried to compile Gambit under QNX 4.25 (not QNX 6) and get error during configure stage
checking for sys/types.h... /tmp/sh23124234: cannot open file (No such file or directory).
It seems that configure script doesn't run properly in QNX 4.25 which is very limited realtime POSIX system.
I have a general question is it possible to build Gambit in system:
that doesn't support automake/autoconf properly
that does not have so/dll
that doesn't have threads (pthread for instance)
Is it possible to write manually config.h is such a way?
In general I want to develop under Linux but run/test everything under QNX 4.25.
QNX 4.25 supprorts tcp/ip sockets so this is the only requirement for me except standart c functions.
Oleg.
Yes Gambit can be built without the configure script, but it requires the programmer to supply some information on the platform. Gambit can be built with the strict minimum C libraries: stdio (for fopen, fread, etc) and stdlib (for malloc/free), but then of course many features will not be available.
Basically, you have to compile and link the .c files in lib/ and gsi/ to get the executable interpreter (gsi.exe). Similarly, with gsc/ to get the executable compiler (gsc.exe).
The configure script creates the files include/gambit.h and include/config.h which define symbols and macros describing the characteristics of the platform (available C header files, operating system type, pointer width, etc).
include/gambit.h is basically a copy of include/gambit.h.in with a 2 placeholders replaced with the appropriate definition (width of a void* pointer, and the size of Scheme characters). include/config.h is include/config.h.in where some of the symbols are #define'd rather than #undef'ined (like HAVE_SIGNAL_H, HAVE_STDLIB_H, etc).
I've included the script build.sh which creates vanilla gambit.h and config.h files that should work on most systems (but this will disable many operating system features, like sockets, access to time functions, subprocesses, etc). You'll have to tweak the script to create a config.h file with the definitions of HAVE_XXX symbols which are appropriate for QNX. If you define HAVE_WAITPID in config.h, the code will assume that QNX is a POSIX system (which it probably is) and will include support for many features which are possible with POSIX.
There are other similar build scripts in misc/ (for Windows and other systems). There is however a high likelihood of bit rot in those scripts because I don't keep them in sync with the latest patches.
Marc
Thank you for your answer. Your script was usefull to move forward.
I have also added:
echo "#ifndef ___CHAR_WIDTH" >> include/gambit.h echo "#define ___CHAR_WIDTH 8" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___SHORT_WIDTH" >> include/gambit.h echo "#define ___SHORT_WIDTH 16" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___INT_WIDTH" >> include/gambit.h echo "#define ___INT_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___LONG_WIDTH" >> include/gambit.h echo "#define ___LONG_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___LONGLONG_WIDTH" >> include/gambit.h echo "#define ___LONGLONG_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___FLOAT_WIDTH" >> include/gambit.h echo "#define ___FLOAT_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___DOUBLE_WIDTH" >> include/gambit.h echo "#define ___DOUBLE_WIDTH 64" >> include/gambit.h echo "#endif" >> include/gambit.h
And I had a problem with wchar_t so I have added -D___DONT_HAVE_WCHAR_H
Now I have a problem with S64/U64 because Watcom 10.6 (the only compiler available) on QNX doesn't support long long and any other 64 bit values.
Is it possible build without 64bit?
15 августа 2011, 01:21 от Marc Feeley feeley@iro.umontreal.ca:
On 2011-08-14, at 4:48 AM, Кириенко Олег wrote:
Hi,
I have tried to compile Gambit under QNX 4.25 (not QNX 6) and get error
during configure stage
checking for sys/types.h... /tmp/sh23124234: cannot open file (No such file
or directory).
It seems that configure script doesn't run properly in QNX 4.25 which is
very limited realtime POSIX system.
I have a general question is it possible to build Gambit in system:
that doesn't support automake/autoconf properly
that does not have so/dll
that doesn't have threads (pthread for instance)
Is it possible to write manually config.h is such a way?
In general I want to develop under Linux but run/test everything under QNX
4.25.
QNX 4.25 supprorts tcp/ip sockets so this is the only requirement for me
except standart c functions.
Oleg.
Yes Gambit can be built without the configure script, but it requires the programmer to supply some information on the platform. Gambit can be built with the strict minimum C libraries: stdio (for fopen, fread, etc) and stdlib (for malloc/free), but then of course many features will not be available.
Basically, you have to compile and link the .c files in lib/ and gsi/ to get the executable interpreter (gsi.exe). Similarly, with gsc/ to get the executable compiler (gsc.exe).
The configure script creates the files include/gambit.h and include/config.h which define symbols and macros describing the characteristics of the platform (available C header files, operating system type, pointer width, etc).
include/gambit.h is basically a copy of include/gambit.h.in with a 2 placeholders replaced with the appropriate definition (width of a void* pointer, and the size of Scheme characters). include/config.h is include/config.h.in where some of the symbols are #define'd rather than #undef'ined (like HAVE_SIGNAL_H, HAVE_STDLIB_H, etc).
I've included the script build.sh which creates vanilla gambit.h and config.h files that should work on most systems (but this will disable many operating system features, like sockets, access to time functions, subprocesses, etc). You'll have to tweak the script to create a config.h file with the definitions of HAVE_XXX symbols which are appropriate for QNX. If you define HAVE_WAITPID in config.h, the code will assume that QNX is a POSIX system (which it probably is) and will include support for many features which are possible with POSIX.
There are other similar build scripts in misc/ (for Windows and other systems). There is however a high likelihood of bit rot in those scripts because I don't keep them in sync with the latest patches.
Marc
-- Все возможности @Mail.Ru в твоем мобильном. Просто зайди с телефона на m.mail.ru
On 2011-08-15, at 4:12 PM, Кириенко Олег wrote:
Thank you for your answer. Your script was usefull to move forward.
I have also added:
echo "#ifndef ___CHAR_WIDTH" >> include/gambit.h echo "#define ___CHAR_WIDTH 8" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___SHORT_WIDTH" >> include/gambit.h echo "#define ___SHORT_WIDTH 16" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___INT_WIDTH" >> include/gambit.h echo "#define ___INT_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___LONG_WIDTH" >> include/gambit.h echo "#define ___LONG_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___LONGLONG_WIDTH" >> include/gambit.h echo "#define ___LONGLONG_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___FLOAT_WIDTH" >> include/gambit.h echo "#define ___FLOAT_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___DOUBLE_WIDTH" >> include/gambit.h echo "#define ___DOUBLE_WIDTH 64" >> include/gambit.h echo "#endif" >> include/gambit.h
And I had a problem with wchar_t so I have added -D___DONT_HAVE_WCHAR_H
Now I have a problem with S64/U64 because Watcom 10.6 (the only compiler available) on QNX doesn't support long long and any other 64 bit values.
Is it possible build without 64bit?
You shouldn't define the symbols ___XXX_WIDTH. The gambit.h header file will figure out what the widths are using limits.h . Among other things you are defining ___LONGLONG_WIDTH, and this makes gambit.h think that the "long long" type is available.
On systems where "long long" is not available, gambit.h will substitute the type "long". Moreover, 64 bit arithmetic (S64/U64) is performed using a structure containing two 32 bit ints.
Marc
I tried to define type width after getting error like: The definition for <...> is missing.
16 августа 2011, 01:14 от Marc Feeley feeley@iro.umontreal.ca:
On 2011-08-15, at 4:12 PM, Кириенко Олег wrote:
Thank you for your answer. Your script was usefull to move forward.
I have also added:
echo "#ifndef ___CHAR_WIDTH" >> include/gambit.h echo "#define ___CHAR_WIDTH 8" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___SHORT_WIDTH" >> include/gambit.h echo "#define ___SHORT_WIDTH 16" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___INT_WIDTH" >> include/gambit.h echo "#define ___INT_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___LONG_WIDTH" >> include/gambit.h echo "#define ___LONG_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___LONGLONG_WIDTH" >> include/gambit.h echo "#define ___LONGLONG_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___FLOAT_WIDTH" >> include/gambit.h echo "#define ___FLOAT_WIDTH 32" >> include/gambit.h echo "#endif" >> include/gambit.h
echo "#ifndef ___DOUBLE_WIDTH" >> include/gambit.h echo "#define ___DOUBLE_WIDTH 64" >> include/gambit.h echo "#endif" >> include/gambit.h
And I had a problem with wchar_t so I have added -D___DONT_HAVE_WCHAR_H
Now I have a problem with S64/U64 because Watcom 10.6 (the only compiler available) on QNX doesn't support long long and any other 64 bit values.
Is it possible build without 64bit?
You shouldn't define the symbols ___XXX_WIDTH. The gambit.h header file will figure out what the widths are using limits.h . Among other things you are defining ___LONGLONG_WIDTH, and this makes gambit.h think that the "long long" type is available.
On systems where "long long" is not available, gambit.h will substitute the type "long". Moreover, 64 bit arithmetic (S64/U64) is performed using a structure containing two 32 bit ints.
Marc
--
On 2011-08-16, at 12:39 AM, Кириенко Олег wrote:
I tried to define type width after getting error like: The definition for <...> is missing.
All those definitions are derived from the header files limits.h and float.h . Please check that you have them and that they are not just stubs. If you don't have limits.h, it is best to define ___DONT_HAVE_LIMITS_H and then gambit.h will assume:
#define ___CHAR_WIDTH 8 #define ___SHORT_WIDTH 16 #define ___INT_WIDTH 32 #define ___LONG_WIDTH 32
Which is likely to be correct. Similarly, define ___DONT_HAVE_FLOAT_H and then gambit.h will assume:
#define ___FLOAT_WIDTH 32 #define ___DOUBLE_WIDTH 64
Marc
Thank you. I managed to build all hand-written code. But when I try to build files produced from Scheme sources I get a messages that some files exceed maximum module size. It is necessary to split files in smaller modules because module size is too big.
PS QNX is not simple platform to use.
16 августа 2011, 15:09 от Marc Feeley feeley@iro.umontreal.ca:
On 2011-08-16, at 12:39 AM, Кириенко Олег wrote:
I tried to define type width after getting error like: The definition for <...> is missing.
All those definitions are derived from the header files limits.h and float.h . Please check that you have them and that they are not just stubs. If you don't have limits.h, it is best to define ___DONT_HAVE_LIMITS_H and then gambit.h will assume:
#define ___CHAR_WIDTH 8 #define ___SHORT_WIDTH 16 #define ___INT_WIDTH 32 #define ___LONG_WIDTH 32
Which is likely to be correct. Similarly, define ___DONT_HAVE_FLOAT_H and then gambit.h will assume:
#define ___FLOAT_WIDTH 32 #define ___DOUBLE_WIDTH 64
Marc
--
On 2011-08-16, at 3:15 PM, Кириенко Олег wrote:
Thank you. I managed to build all hand-written code. But when I try to build files produced from Scheme sources I get a messages that some files exceed maximum module size. It is necessary to split files in smaller modules because module size is too big.
PS QNX is not simple platform to use.
It will help if you don't specify the -D___SINGLE_HOST option to the C compiler. That way each Scheme function is compiled to a C function, instead of all the Scheme functions in a file being compiled to a single C function.
If that doesn't work, you'll have to chop up the problematic Scheme files in pieces, and compile them with the Scheme compiler into C files. It is not hard, but it is a trial and error process.
Which files are too big?
Marc