taskGNU Astronomy Utilities - Tasks: task #15813, book: Add a `developer-build'...


You are not allowed to post comments on this tracker with your current authentication level.

task #15813: book: Add a `developer-build' example in the `Developer' section

Submitter:  Pedram Ashofteh-Ardakani <pedram>
Submitted:  Thu 19 Nov 2020 05:47:36 PM UTC
Should Start On:  Thu 19 Nov 2020 12:00:00 AM UTC Should be Finished on:  Thu 19 Nov 2020 12:00:00 AM UTC
Category:  Book Priority:  5 - Normal
Item Group:  Documentation Status:  None
Privacy:  Public Assigned to:  None
Percent Complete:  0% Open/Closed:  Open
Effort:  0.00

Thu 19 Nov 2020 05:47:36 PM UTC, original submission:  

While tinkering with the CosmicCalculator program, I realized the need to test if the changes work as expected and did not sabotage any of the other parts.

Fortunately, the `Gnuastro' team has developed automatic and smart tests. But I couldn't find a step by step example to ease the process. So, I asked and Mohammad emailed me a kind and generous reply.

We thought we should put the reply into the documentation! So, with this new task, we'll try to add a step by step example to the `Developing' section of the documentation to make things easier to follow.

With Mohammad's permission, you can find a part of his helpful reply below:

Mohammad's reply:

[... Truncated Text ...]

When you build Gnuastro with the  './developer-build' script, the
project does indeed get built in a directory in RAM called
'/dev/shm/gnuastro-XXXX'. But there is an easier way to access that
location ;-)! Just look at the newly built 'build' directory in the
source. Its actually a symbolic link to that '/dev/shm' directory. To
confirm, run 'ls -l' in the top source.

By the way, the 'developer-build' script will automatically find the
number of threads on your system, so you don't need the '-j4' :-).

So to test any Gnuastro program during the development, you need to
directly call the build executable with its full address relative to
where you are running (or its absolute address).

For example to test your CosmicCalculator program, you can run this
command from the top of your source directory:

./build/bin/cosmiccal/astcosmiccal --version

You will notice that the version is more recent than the one you already
have on your system (in case you didn't install from the temporary

astcosmiccal --version

But it will be very annoying to give that full address! So to test
programs during development, I have written a high-level script in
'tests/during-dev.sh'. It is heavily commented, so if you read through
those comments things should become clear for you.

Here is a cheat-sheet of what I do with 'tests/during-dev.sh':

1. I have a 'tmp' directory in my home directory for temporary outputs
(like the outputs of programs I am busy developing). Since you will also
start playing with data during development, its good to have such a
temporary directory for tests. So I set '~/tmp' as the value of 'outdir':


This 'outdir' is mandatory! If you don't specify it the script will
complain and abort.

2. In the 'utilname' variable, you should put the name of your desired
program without the starting 'ast'. So if I wanted to test your
scenario, I would set:


'utilname' is also mandatory and without it, the script will complain
and abort.

3. The "arguments" to the program (usually data file names) should be
given in the 'arguments' variable. But this is optional and in your
scenario, you don't need it. So you can just leave it without a value.

4. The "options" argument is for the command-line options (that start
with one or two dashes: '-' or '--', like '-P' or '--printparams'). So
in your scenario, you can put below. The reason I am putting double
quotations is because you will soon start to add more options during
your tests, and if you want to pass a SPACE character into the variable
value, you need the double quotations.


5. You can now execute the script! But you need to run it from the top
project source directory. So go there and simply run

[... Truncated Text ...]

Pedram Ashofteh-Ardakani <pedram>
Group Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by pedram (Submitted the item)
  • -email is unavailable- added by pedram

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-19 pedram Carbon-Copy- Added makhlaghi

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code