forum.alglib.net

ALGLIB forum
It is currently Sat Dec 21, 2024 4:51 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: What to do: make a Makefile for the test files.
PostPosted: Mon Nov 20, 2017 11:17 pm 
Offline

Joined: Mon Nov 20, 2017 11:14 pm
Posts: 21
That will kill 2 birds with one stone, so to say: (1) an example of use, and (2) a ready-made regression tester.


Top
 Profile  
 
 Post subject: Re: What to do: make a Makefile for the test files.
PostPosted: Tue Nov 21, 2017 12:17 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Hi!

Such testing is already done, without make, using console scripts (Unix and Windows-specific). Given ALGLIB monolithic design, Bash turned out to be more than enough. We ran our tests regularly.


Top
 Profile  
 
 Post subject: Re: What to do: make a Makefile for the test files.
PostPosted: Sat Dec 02, 2017 12:37 am 
Offline

Joined: Mon Nov 20, 2017 11:14 pm
Posts: 21
Yes, this is true, but for those who are new to ALGLIB, a makefile will serve both the purpose of demonstrating how to include it in their program and to provide something for performing tests on the code; particularly if they make changes or additions to it.

It also helps keep better track of the dependencies and to perform updates in a more intelligent manner; and the dependencies help one to determine which modules are required for a project.

Independent of the issue of whether a reference makefile is included or not, the following information should prove helpful for ALGLIB users.

These are a list of all of the direct dependencies.
Optimization -> Solvers -> LinAlg -> AlgLibMisc -> AlgLibInternal -> Ap -> (for MSVC) StdAfx
Integration, Statistics -> LinAlg, SpecialFunctions
Interpolation -> Integration, Optimization
DataAnalysis -> Statistics, Optimization
DiffEquations, FastTransforms, SpecialFunctions -> AlgLibInternal
Test_C, Test_I, Test_X -> DataAnalysis, DiffEquations, FastTransforms, Interpolation

In my local version, I've eliminated #includes except those for direct dependencies and made other changes (many).

The "using namespace std;" and MSVC #pragma statements need only be listed in Ap.h, not in the *.cpp files, as long as the #include statements are listed first.

A *.cpp file only needs to include its companion *.h file and each *.h file only needs to include the *.h files for the modules that its own module directly depends on.

In a Makefile for my copy of the library, I only include dependencies for
*.cpp: *.o
*.o: *.h
A.h: B.h, for each direct dependency A -> B.
A.o: B.o, for each direct dependency A -> B.
Note: not all submodules of a given module have the given direct dependency, but will usually have indirect dependencies once or more removed, such as can be derived from this list. The simplest way to test this is either with a profiling tool or to try to compile the submodule with the dependency or dependencies removed.


Top
 Profile  
 
 Post subject: Re: What to do: make a Makefile for the test files.
PostPosted: Tue Dec 05, 2017 3:05 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Hi!

1. Frankly speaking, I have mixed feelings on this question (direct vs indirect deps) :) It is beautiful in some way... but someone may decide that he wants to have all dependencies (direct or indirect) listed in one place. Because some users prefer to compile only those packages which are required.

2. On using namespace and pragma's: took your point, agree. I will study it in more details in the next few days, maybe these changes will be included in the upcoming release.


Top
 Profile  
 
 Post subject: Re: What to do: make a Makefile for the test files.
PostPosted: Fri Apr 26, 2019 9:55 am 
Offline

Joined: Mon Nov 20, 2017 11:14 pm
Posts: 21
I see the issue now, with your latest revisions: you really want dependencies for the subpackages, rather than the packages. This creates a strong push to go back to the pre-version-3 file layout; with it looking more like LAPACK or GMP in terms of its layout.

It's still possible to have it both ways by putting lines in a Makefile that concatenate a package file from its subpackage files. I'm going to experiment with this and other compromise solutions.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group