Questions tagged [gprbuild]
29 questions
6
votes
1 answer
Same Base Package in Multiple Linked GPRBuild Projects
With GPRBuild, I have created a library project called Lib. All packages in Lib reside within the package Base, which I use as a base package: to have a base package Base. For instance, if I were to create package Apple in any library or application…

D. Ataro
- 1,711
- 17
- 38
4
votes
1 answer
Is it possible to have a file wildcard in gprbuild project files?
I have a project in which I often create a lot of new main entrypoint *.adb files in a certain directory. Is there any way to set up my project using gprbuild such that adding a new main program does not require editing the .gpr project…

TamaMcGlinn
- 2,840
- 23
- 34
3
votes
1 answer
How to use nvcc with gprbuild?
I have a code in Ada that must use CUDA without using the Ada binding. So I made an interface that allows the Ada program to call C code. Now I want to compile it.
How can I tell gprbuild to not use gcc to compile .cu files by nvcc? If it's not…

Louis Etienne
- 1,302
- 3
- 20
- 37
3
votes
1 answer
Link math.h with gprbuild
I'm trying to build an Ada application that calls C code. The C code use the function sqrt from math.h. If I remove the call to sqrt, the compilation and linkage work perfectly. When I try with the sqrt call, the linker tells me undefined reference…

Louis Etienne
- 1,302
- 3
- 20
- 37
3
votes
1 answer
Can gprbuild be configured to output gnatprep preprocessed sources?
I have a gpr project which uses gnatprep to preprocess source files. But now I have a tool which needs the already preprocessed source files. I know that I can hunt down each source file and run it through gnatprep:
find . -type f -iname '*.ad[sb]'…

TamaMcGlinn
- 2,840
- 23
- 34
3
votes
1 answer
How do you specify the name of the executable in your gprfile? Can it be above the gprfile's directory?
This information is available elsewhere but not consolidated to this particular use-case, hence I felt the need for a stackoverflow self-answer that I (and others) can refer to. Feel free to add your own answers if there is anything I have…

TamaMcGlinn
- 2,840
- 23
- 34
3
votes
1 answer
GPRBuild does not compile C files
I upgraded to GNAT Community 2018 (everything worked fine with GNAT GPL 2017). I have this project file:
with "opengl";
library project OpenGL.Soil is
for Library_Name use "SoilAda";
for Languages use ("ada", "c");
for Source_Dirs use…

flyx
- 35,506
- 7
- 89
- 126
2
votes
0 answers
GPRbuild: relocation truncated to fit R_X86_64
I'm dealing with huge global lists in Ada. When building I'm getting the error during linking:
relocation truncated to fit R_X86_64_PC32 and link of main.adb failed.
I saw that GCC has the flag -mcmodel=medium, is there something similar for…

Nessa3001
- 91
- 2
2
votes
4 answers
Ada Gnat project which includes differently-named files for different build configurations
I have a Gnat/Gprbuild project with several build configurations. I have a main source file and an secondary ads file which the main source file includes:
with Secondary_File; use Secondary_File;
The problem is that in each configuration, the…

Nola
- 436
- 4
- 12
2
votes
1 answer
Link object file to project with gprbuild
Using nvcc I created an object file from my project with the following bash script:
nvcc -Xcompiler -std=c99 -dc src/interface.cu src/functions.cu
nvcc -dlink interface.o functions.o -o obj/link.o
In my obj folder I get a link.o file. I need to…

Louis Etienne
- 1,302
- 3
- 20
- 37
2
votes
0 answers
Building a DLL for Windows with a specific base address
I am working on a project for a Windows library in Ada that must be compiled in a DLL, starting from a .gpr project via GPRBuild. I was able to produce a working DLL for Windows, but now I want to specify the base address for the location of the…

Lucio Franceschini
- 21
- 3
2
votes
0 answers
How to add Ada to riscv-toolchain
How to configure RISCV tool chain to support Ada ?
Does the gprBuild tool support the riscv64-unknown-elf toolchain? .....
I have tried using gprBuild tool by installing using the command:
sudo apt install gpr
After installation when searched for…

mahesh95
- 31
- 1
2
votes
2 answers
How to cross-compile with .gpr project file and gprbuild?
I'm trying to cross-compile from Linux (Fedora 29) an Ada program with Windows as target. I have no knowledge about compilation and the Gnat project manager doc couldn't help the noob I am.
I would prefer to use switches inside the project file and…

Lyaaaaaaaaaaaaaaa
- 77
- 9
2
votes
1 answer
GPRbuild: compiler switch being passed to linker
I'm building a simple program for ARM. GPRbuild outputs the following:
gprbuild -p -P avocado_test.gpr (in directory: /home/rodeo/Projects/AvocadoTest)
Bind
[gprbind] run_avocado_test.bexch
[Ada] run_avocado_test.ali
Link
…

Rodeo
- 151
- 9
2
votes
2 answers
In Adacore's GPR file, how can I set the compiler include search paths for C++
I have some C++ code that I need to compile using Adacore GNAT Programming Studio.
One file (SomeHeader.h) is in a Common directory (../../Common/) relative to my GPR file.
Our convention for C++ include directives is to use
#include…

Okkenator
- 1,654
- 1
- 15
- 27