Building GCC 5.1.0
These notes describe building GCC 5.1.0 for Mac OS X, with Ada, C, C++, Fortran, Objective C, Objective C++, and various GNAT tools.
Read more Β»These notes describe building GCC 5.1.0 for Mac OS X, with Ada, C, C++, Fortran, Objective C, Objective C++, and various GNAT tools.
Read more Β»These notes describe building GCC 5.1.0 for the Cortex M4 on Mac OS X.
My target board is the STM32M4F29I Discovery.
Read more Β»The public version of the AdaCore Ravenscar RTS is released under the full GPL. It seemed as if it would be a good idea (and fun!) to produce an independent RTS with the GCC Runtime Library Exception(FAQ).
Read more Β»This is a note on building support for the MPU92509-axis chip in the AdaPilotproject (the AdaRacerhardware). It continues this report.
Read more Β»This post is based on the README from the corresponding Github repository.
That repository attempts to cope with expected changes in Appleβs approach to software development kits, specifically where to find the system headers (youβd expect /usr/include).
Read more Β»Recently, on the Gitter Ada Programming Language lobby, there have been discussions on cross-compiling for Cortex M micro-controllers, specifically the BBC micro:bit, using the Raspberry Pi.
TL;DR: it's not going to be easy, unfortunately. Maybe later (or earlier?) Raspbian releases will help.
Read more Β»This is a note about building GNAT-LLVM on macOS.
Read more Β»This note is about configuring GCC on macOS so that your built compiler can be used independently of which Software Development Kit (SDK) is installed.
Read more Β»Many subprogram declarations of GNAT Standard Library uses Pragma Inline in their specification files and I want to know how it work because other modules use only this specification during compilation and not body?
I'm currently trying to find a solution to control the storage order for elements within a record in ADA.
I'm using gcc 6.2.1 which doesnt recognize the Scalar_Storage_Order
attribute ( even though the attribute is clearly referenced in the gcc 6.2 GNAT reference manual).
type Rec is record
Data1 : T_Data;
Data2 : T_Data;
end record;
for Rec use
record
Data1 at 0 range 0 .. 15;
Data2 at 0 range 0 .. 15;
end record;
for Rec'Bit_Order use System.High_Order_First;
for Rec'Scalar_Storage_Order use System.High_Order_First;
error: unrecognized attribute "Scalar_Storage_Order"
Is there an alternative that I can use to achieve my goal?
I'm trying to run Gnat Studio on Ubuntu 22.04 but I get the following error:
/opt/gnatstudio/bin/gnatstudio_exe: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
I have installed it via the following steps:
/opt/GNAT/2021/doinstall
/opt/gnatstudio/bin/gnatstudio
and got the above error (sudo-running this yields the same error)I'm wondering if this is down to 22.04 being a very recent release and some shared libraries are missing from the installation bundle?
Any pointers would be much appreciated.
Thanks
I use Ada With GPS (GNAT Programming Studio). The flag "-gnatp" when building will ignore among others constraint errors.
I know a way to add the flag to all the files, using Edit->Preferences->Build target.
Is there a way to choose when the builder will this flag, meaning setting the flag to a file or a package?
I have had a try at using Gnat Studio with the Alire package manager. Launching Gnat Studio using the 'alr edit' command is causing Gnat Studio to crash. I have had a look at the log file and there are several .dll files causing exceptions. The file entries are like this:
[PROJECTS.EXCEPTIONS] Unexpected exception: raised CONSTRAINT_ERROR : gnatcoll-projects.adb:5729 index check failed _PROJECTS.EXCEPTIONS_ [C:\GNATSTUDIO\bin\gps.libgnatcoll\libgnatcoll.dll] _PROJECTS.EXCEPTIONS_ 0x7ffc78dcecb8 ??? at ???
Gnat Studio opens in an 'inconsistent state' and crashes.
Regards Mike
I was using gnatcoll-db
, but the limitations made me to rewrite dborm.py
in Ada. There are two routines in dborm.py
(in python) that I don't understand, specifically compute_table_aliases
and fields_count_array
.
Any help will be welcome. Of course, the modifications can be shared between all of us.
Edited to complete information:
My project fork is here. I don't want to copy here the complete routines from dborm.py as I don't know exactly the license terms of ACS. dborm.py
can be downloaded from https://github.com/AdaCore/gnatcoll-db/tree/master/gnatcoll_db2ada.
The routines that I want to translate to Ada are:
Here is my translation to Ada:
Max_Depth : constant := 3; type Counts_Array is array (0 .. Max_Depth) of Integer;
function Fields_Count_Array (T : Table_Description;
Follow_LJ : Boolean;
DepthMax : Integer;
FKStop : Field := No_Field)
return Counts_Array is
FK_Stop : Boolean; -- to be reset before each call to fields_count_
Depth : Integer := 0;
Temp : Counts_Array;
function Fields_Count (T : Table_Description;
Depth : Integer;
Follow_LJ : Boolean;
FKStop : Field := No_Field) return Integer;
function Fields_Count (T : Table_Description;
Depth : Integer;
Follow_LJ : Boolean;
FKStop : Field := No_Field)
return Integer is
Result : Integer;
procedure Process_FK (FK : in out Field);
procedure Process_FK (FK : in out Field) is
begin
if FK = FKStop then
FK_Stop := True;
return;
end if;
if FK_Stop then
return;
end if;
if Follow_LJ or (not FK.Can_Be_Null) then
Result := Result +
Fields_Count (Pointed_Table (FK), Depth - 1, Follow_LJ);
end if;
end Process_FK;
begin
Result := Num_Fields (T);
if Depth > 0 then
For_Each_FK (T, Process_FK'Access);
end if;
return Result;
end Fields_Count;
begin
while Depth <= DepthMax loop
FK_Stop := False;
Temp (Depth) := Fields_Count (T, Depth, Follow_LJ, FKStop);
Depth := Depth + 1;
end loop;
return Temp;
end Fields_Count_Array;
Note that all type definitions come from gnatcoll-sql.
I understand that this is difficult to follow, perphaps may be better if I send a report on the modifications and the complete new Ada package replacing dborm.py. How?
How can I install the ZFP (Zero Foot Print) RTS (Run Time System) for AVR with the Alire package manager for Ada?
My project file, I think correctly, contains:
project Avr is
for Runtime("Ada") use "zfp";
for Target use "avr-elf";
end Avr;
alire.toml
hopefully correction contains:
[[depends-on]]
gnat_avr_elf = ">=11.2.4"
Unfortunately, when running alr build
, I get:
gprconfig: can't find a toolchain for the following configuration:
gprconfig: language 'ada', target 'avr-elf', runtime 'zfp'
I found documentation for programming AVR with Ada, but this assumes that I build the tool-chain myself and not have a package manager at least providing the GNU tool-chain.
The same applies to Programming Arduino with Ada.
I need to secure input passwords in an Ada command line application. Are there any ready to use functions/procedures in GNAT or third-party libraries?
I've checked the other questions and this case doesn't seem to be covered. I'm running Ubuntu in WSL on my windows machine and I'm trying to run GNATStudio, any time I attempt to run the program either via Alire or by calling it I receive the following error.
error while loading shared libraries: libxcb-shm.so.0: cannot open shared object file: No such file or directory
I've already done the basics, and verified I have the correct file installed. Calling apt-file find produces the following.
root@DESKTOP-F319G5G:/opt# apt-file find libxcb-shm.so.0
libxcb-shm0: /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0
libxcb-shm0: /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
I've confirmed the location is in my path, as well and have restarted a few times. I'm really not too sure what my next steps should be. Any help is much appreciated!