[Trilinos-Users] [EXTERNAL] Compile very slowly

Bradley, Andrew Michael ambradl at sandia.gov
Tue May 26 12:37:16 EDT 2015

Hi Feng,

There may be other issues, but as a first step, I recommend configuring Trilinos with explicit template instantiation, like this:

 -D Tpetra_INST_INT_INT=ON \

(Here I'm being probably unnecessarily explicit in setting types ON and OFF; the values I've chosen are in fact almost certainly the defaults.)

This will isolate the long build time to the Trilinos build. Once the libraries are built, your code should build faster against Trilinos.

Even then, I recommend a further isolation technique: place the core solver code (containing the Belos and MueLu headers) in its own source file, and put the rest of the application in other files. That way, rebuilding your application will not require recompiling the solver part except when you change the solver part.


From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of Feng Xing <snakexf at gmail.com>
Sent: Monday, May 25, 2015 7:24 AM
To: trilinos-users at trilinos.org
Subject: [EXTERNAL] [Trilinos-Users] Compile very slowly

Hello everyone,

I tried to compile a smalll code for solving Ax=b with Tpetra, Belos and Meulu. There are only about 400 lines. But it takes more than 20 minutes to compiler in mac os 10.10, gcc 4.9.2, openmpi 1.7.5, trillions 12.0.1. I would like to ask if it is normal or something is not well written in my code.

The structure is as following. Each member function do one work like create matrix (set matrix values, create vector, solve….).

#include …..

typedef Tpetra::Map<int, int> map_type;
typedef Tpetra::CrsMatrix<double, int, int> mat_type;
typedef …….

using Teuchos::RCP;

class SolveAxb{

        RCP<const map_type> matMap;
        RCP<mat_type> A;
        RCP<vec_type> x;
        RCP<vec_type> b;


void SolveAxb::MatCreate(){
        // allocate matrix

void SolveAxb::MatSetValue(){
        // set values

Thank you very much.

Feng Xing
Postdoc in Inria, France

Trilinos-Users mailing list
Trilinos-Users at trilinos.org

More information about the Trilinos-Users mailing list