[Trilinos-Users] [EXTERNAL] Packages don't process MPI_BASE_DIR

Bartlett, Roscoe A rabartl at sandia.gov
Thu Jun 2 10:44:16 EDT 2016


Actually, you also need:

   -DCMAKE_CXX_FLAGS="-I $MPI_BASE_DIR/include"

since CMake does not add CMAKE_C_FLAGS to the C++ compiles and CMake does not support a flag to shared compiler options between all of the compilers.

-Ross

> -----Original Message-----
> From: Trilinos-Users [mailto:trilinos-users-bounces at trilinos.org] On Behalf Of
> Bartlett, Roscoe A
> Sent: Thursday, June 02, 2016 10:32 AM
> To: Robert Sawko; trilinos-users at trilinos.org
> Subject: Re: [Trilinos-Users] [EXTERNAL] Packages don't process MPI_BASE_DIR
> 
> Robert,
> 
> The MPI compiler wrappers should be automatically be adding the -I include
> directories to find 'mpi.h'.  Otherwise, if you really need to hack the system, you
> might be able to use something like:
> 
>   -DCMAKE_C_FLAGS="-I $MPI_BASE_DIR/include"
> 
> (assuming you have MPI_BASE_DIR set in your env, otherwise use the full path)
> in your configure of Trilinos on this machine.
> 
> If that does not work, then please let me know and we can find a way to get
> that include directory on the compile lines without having to modify any of the
> Trilinos CMakeListst.txt files.  (CMake would not be much of a build tool if you
> could not get it to add -I to the compile commands without having to modify the
> CMakeListstxt files directly.)
> 
> I don't think that we can add "${MPI_BASE_DIR}/include" to the CMakeLists.txt
> files in Trilinos because I don't think that is 100% portable.
> 
> -Ross
> 
> 
> Dr. Roscoe A. Bartlett, PhD
> Sandia National Laboratories
> Trilinos Software Engineering and Integration Technologies Lead Consortium for
> the Advanced Simulation of Light Water Reactors (CASL) Physics Integration
> Infrastructure Lead
> 
> 
> > -----Original Message-----
> > From: Trilinos-Users [mailto:trilinos-users-bounces at trilinos.org] On
> > Behalf Of Robert Sawko
> > Sent: Thursday, June 02, 2016 10:04 AM
> > To: trilinos-users at trilinos.org
> > Subject: [EXTERNAL] [Trilinos-Users] Packages don't process
> > MPI_BASE_DIR
> >
> > Hi,
> >
> > I am compiling Trilinos on a new machine which has very minimal
> > software installation so I am coming up with strange errors which may
> > or may not be useful in improving cmake config. For a while I could
> > not compile Teuchos as TeuchosTime.cpp kept requesting mpi.h despite
> > -DMPI_BASE_DIR pointing to a correct directory. mpi.h was not in the
> standard /usr/include too.
> >
> >
> > I added include_directories("${MPI_BASE_DIR}/include") to
> > CMakeLists.txt in teuchose/core/src. I suppose there's either a better
> > way to deal with this within Trilinos cmake setup? Setting -
> DCMAKE_CXX_FLAGS="-I ..."
> > could also solve it. But it seems to me that there's something strange
> > about cmake config namely that the MPI_BASE_DIR variable is handled
> > only in a handful of packages: intrepid and phalanx.
> >
> > Kind Regards,
> > Robert
> > --
> > Dr Robert Sawko
> > Research Staff Member, IBM
> > Daresbury Laboratory
> > Keckwick Lane, Warrington
> > WA4 4AD
> > United Kingdom
> > --
> > Email (IBM): RSawko at uk.ibm.com
> > Email (STFC): robert.sawko at stfc.ac.uk
> > Phone (office): +44 (0) 1925 60 3967
> > Phone (mobile): +44 778 830 8522
> > --
> > Unless stated otherwise above:
> > IBM United Kingdom Limited - Registered in England and Wales with
> > number 741598.
> > Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
> > 3AU
> >
> > _______________________________________________
> > Trilinos-Users mailing list
> > Trilinos-Users at trilinos.org
> > https://trilinos.org/mailman/listinfo/trilinos-users
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at trilinos.org
> https://trilinos.org/mailman/listinfo/trilinos-users


More information about the Trilinos-Users mailing list