ada

Dynamically link libgnat

冷暖自知 提交于 2019-12-06 06:15:24
I'm trying to compile a very simple ADA code. Everything works like a charm but on one computer my executable is link dynamically to libgnat whereas on the other computer it's linked statically. In both cases I use gnatmake tool. Any idea why it's happening? Do you know a way to force GNAT to dynamically link libraries? That would be the binder's -shared switch. If you are using project files, you can use: project Foo is ... package Binder is for Switches ("Ada") use ("-shared"); end Binder; end Foo; 来源: https://stackoverflow.com/questions/26167386/dynamically-link-libgnat

Eclipse — Manually Install Plugin

爱⌒轻易说出口 提交于 2019-12-06 05:49:01
I am trying to migrate from Adacore's GPS to the Eclipse based GNATBench. GNATBench is available here for free download, but is packaged as a zip file. I have only installed Eclipse plugins through the marketplace, or through an online repository. I have tried extracting the folder into the Eclipse plugins folder, but it did not work. How do I install this plugin manually through a zip file? Is there another way of getting it? Open Help > Install New Software... and click Add (top right). In the Add Repository dialog that is shown click Archive... and select the zip file you downloaded. Also

Procedure to open, write and append in Ada

落花浮王杯 提交于 2019-12-06 05:44:18
This question is a follow-up of the post at Ada file operation: instantiation and exception about writing to files in Ada. I chose to place this question in a separate post so that it'll become visible to more people as I already accepted an answer on a slightly different issue (which was on exceptions in file handling) in that aforementioned post. WITH Ada.Sequential_IO; WITH Ada.Float_Text_IO; PROCEDURE TEST is package Seq_Float_IO is new Ada.Sequential_IO (Element_Type => Float); X_File : Seq_Float_IO.File_Type; File_Name : String; procedure Open_Data(File : in out Seq_Float_IO.File_Type;

Piping to/from Ada program to a C++ program

孤者浪人 提交于 2019-12-06 05:33:08
I have used pipes in C/C++ before but I'm working on setting up a pipe in some legacy Ada code...however I am still in the "learning" phase with Ada and there's a lot I still don't yet know. That being said, I've been trying to figure out how pipes in Ada are setup & how to go about using them. I've only found these articles thus far: A Thick Ada 95 Binding for Unix Child Processes and Pipes Package: Util.Pipes Pipes - ada-util . Don't get me wrong they have a lot of good knowledge in them, but 1 is geared towards Ada95 (I have the ability to compile up to Ada05), 2 just lists the functions, &

Ada: gnat gprbuild How to link in libraries?

假如想象 提交于 2019-12-06 05:23:17
In this multi-language GPRBuild project I'm working on, I have some c++ library files (*.a) I need to link into my executable. Is there an gpr attribute to tell it what to link in or anyway to pass -l -L switches to the linker? persan Or even better: Project my_library is For externally_built use "true"; For library_dir use "/where/ever"; For library_name use "mylibname"; For source_dirs use (); -- no sources. For library_kind use "static"; -- if it is a static lib .a -- for library_kind use "dynamic"; -- if it is an so. End my_library; And in the application project. With "my_library.gpr";

How to get a line-numbered stack trace for a memory leak on Mac OS X?

六月ゝ 毕业季﹏ 提交于 2019-12-06 03:48:05
I've managed to get the Xcode leaks tool to report leaks in my command-line GCC Ada program (by adding delay 11.0; at the end to let leaks make its checks) and then $ export MallocStackLogging=1 $ (./foobar &) && leaks foobar which leads to (excerpted) Process 52027: 18 nodes malloced for 2053 KB Process 52027: 2 leaks for 32 total leaked bytes. Leak: 0x1002000c0 size=16 zone: DefaultMallocZone_0x100175000 string '*' Call stack: [thread 0x7fff70bbcca0]: | start | main | _ada_foobar | __gnat_malloc | malloc | malloc_zone_malloc Leak: 0x1002000d0 size=16 zone: DefaultMallocZone_0x100175000

AI library framework in Ada

谁说我不能喝 提交于 2019-12-06 03:33:20
I'm looking for an Ada constructed framework for AI. I think Ada would be perfect for implementing temporal and stochastic paradigms due to its tasking and real-time mechanisms, but did not find anyone who tried to make such a libraries. Actually I did not find strong implementations on other languages too. For C# I found http://www.c-sharpcorner.com/1/56/ , and for C++ I found http://mind.sourceforge.net/cpp.html but both did not get much popularity. Maybe java has good AI libraries too, but I do not know. So, do you know an Ada implementation? Would it be useful for more anyone? If you know

Arbitrary length integer in Ada

我们两清 提交于 2019-12-06 02:05:34
问题 I am currently teaching myself Ada and though I could begin by tackling some of the more conventional problems to get started. More specifically I try to calculate the factorial n!, whereas n>100. My implementation so far is: with Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Text_IO; procedure Factorial is -- define a type covering the range beginning at 1 up to which faculty is to -- be computed. subtype Argument is Long_Long_Integer range 1..100; -- define a type that is large enough to

Ada: reading from a file

烂漫一生 提交于 2019-12-06 01:39:41
I am trying to read a file with a single column of Long_Float values in Ada as follows: with Ada.Text_IO; use Ada.Text_IO; with Ada.Long_Float_Text_IO; with Ada.Sequential_IO; procedure Test_Read is package Seq_Float_IO is new Ada.Sequential_IO (Element_Type => Long_Float); Input_File : File_Type; value : Long_Float; begin Seq_Float_IO.Open (File => Input_File, Mode => Seq_Float_IO.In_File, Name => "fx.txt"); while not End_OF_File (Input_File) loop Seq_Float_IO.Read (Input_File, value); Ada.Long_Float_Text_IO.Put (Item => value, Fore => 3, Aft => 5, Exp => 0); end loop; Seq_Float_IO.close

Does Ada have a preprocessor?

懵懂的女人 提交于 2019-12-05 21:14:44
To support multiple platforms in C/C++, one would use the preprocessor to enable conditional compiles. E.g., #ifdef _WIN32 #include <windows.h> #endif How can you do this in Ada? Does Ada have a preprocessor? The answer to your question is no, Ada does not have a pre-processor that is built into the language. That means each compiler may or may not have one and there is not "uniform" syntax for pre-processing and things like conditional compilation. This was intentional: it's considered "harmful" to the Ada ethos. There are almost always ways around a lack of a preprocessor but often times the