[CMake] Issues with CMake + TAU

sindimo sindimo at gmail.com
Sun Apr 6 03:31:57 EDT 2014


Dear CMake Support,

We've been using your wonderful tool for quite some time to do our cross
platform builds.

We recently started using the TAU profiler and are having some issues when
integrating it with CMake and would appreciate your help with it please.

We set our compilers in CMake to the TAU wrappers:

set (CMAKE_Fortran_COMPILER
/red/cmt3/vol5/tau/tau_installation/x86_64/bin/tau_f90.sh)

set (CMAKE_C_COMPILER
/red/cmt3/vol5/tau/tau_installation/x86_64/bin/tau_cc.sh)

set (CMAKE_LINKER
/red/cmt3/vol5/tau/tau_installation/x86_64/bin/tau_f90.sh)

We also set include and lib folders for TAU just in case they are needed:

LINK_DIRECTORIES(/red/cmt3/vol5/tau/tau_installation/x86_64/lib)

LINK_DIRECTORIES(/red/cmt3/vol5/tau/pdt_installation/x86_64/lib)

LINK_DIRECTORIES(/red/cmt3/vol5/tau/papi_installation/lib)

INCLUDE_DIRECTORIES(/red/cmt3/vol5/tau/tau_installation/include)

INCLUDE_DIRECTORIES(/red/cmt3/vol5/tau/pdt_installation/include)

INCLUDE_DIRECTORIES(/red/cmt3/vol5/tau/papi_installation/include)

The tau wrappers point to MVAPICH2 1.8 which uses the Intel 12 compiler.



We have 2 issues:

First, if we use mpif90 or mpicc, CMake correctly detects that the
underlying compiler is Intel, however when using the TAU wrappers CMake
detects it as a GNU compiler which messes the build:

-- The C compiler identification is GNU 4.4.6

-- The Fortran compiler identification is GNU

A work around we used is to force the compiler ID to Intel which makes the
build go fine, I do it with something like the below:

set (CMAKE_Fortran_COMPILER_ID "Intel" CACHE STRING "Set Intel compiler"
FORCE)

set (CMAKE_C_COMPILER_ID "Intel"       CACHE STRING "Set Intel compiler"
FORCE)

Is there a better way to get CMake to recognize the compilers being used by
the TAU wrappers as we also use other compiler like PGI and we'd rather
have this automatically detected by CMake rather than hard coded?



Second, we use the TAU option "-optKeepFiles"  which keeps the TAU
generated temporary files (e.g. *.pp.f, *.pp.pdb, *.pp.inst.f).

We use the below CMake variables for our compilation output:

set (LIBRARY_OUTPUT_PATH "mydir ")

set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "mydir")

set (CMAKE_Fortran_MODULE_DIRECTORY "mydir")

With the TAU wrapper the produced FORTRAN modules get stored correctly in
the specified location, however the temporary files produced by TAU (e.g.
*.pp.f, *.pp.pdb, *.pp.inst.f) end up in the current directory which is
very cumbersome since we're processing hundreds of files. I tried setting
several other CMake variables that have to do with output path but the
temporary files always end up in the current directory.

Is there a way to have the CMake output path variables take effect for the
temp files generated by TAU as well?

For reference we are running with the below:

·         RedHat 6.2

·         TAU 2.23

·         CMake 2.8.10.2

·         Intel compiler 12.1.0

·         MVAPICH2 1.8

Thank you for your help.

*Mohamad O. Sindi*

EXPEC Advanced Research Center

Saudi Aramco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140406/5697125c/attachment.html>


More information about the CMake mailing list