<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style>Dear CMake Support,</span></p>
<p class="MsoNormal"><span style>We’ve been using your wonderful tool for quite some time to do our cross platform builds.</span></p>
<p class="MsoNormal"><span style>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.</span></p>
<p class="MsoNormal"><span style>We set our compilers in CMake to the TAU wrappers:<u></u><u></u></span></p>
<p class="MsoNormal"><span style>set (CMAKE_Fortran_COMPILER  /red/cmt3/vol5/tau/tau_installation/x86_64/bin/tau_f90.sh)<u></u><u></u></span></p>
<p class="MsoNormal"><span style>set (CMAKE_C_COMPILER  /red/cmt3/vol5/tau/tau_installation/x86_64/bin/tau_cc.sh)<u></u><u></u></span></p>
<p class="MsoNormal"><span style>set (CMAKE_LINKER  /red/cmt3/vol5/tau/tau_installation/x86_64/bin/tau_f90.sh)</span></p>
<p class="MsoNormal"><span style>We also set include and lib folders for TAU just in case they are needed:<u></u><u></u></span></p>
<p class="MsoNormal"><span style>LINK_DIRECTORIES(/red/cmt3/vol5/tau/tau_installation/x86_64/lib)<u></u><u></u></span></p>
<p class="MsoNormal"><span style>LINK_DIRECTORIES(/red/cmt3/vol5/tau/pdt_installation/x86_64/lib)<u></u><u></u></span></p>
<p class="MsoNormal"><span style>LINK_DIRECTORIES(/red/cmt3/vol5/tau/papi_installation/lib)<u></u><u></u></span></p>
<p class="MsoNormal"><span style>INCLUDE_DIRECTORIES(/red/cmt3/vol5/tau/tau_installation/include)<u></u><u></u></span></p>
<p class="MsoNormal"><span style>INCLUDE_DIRECTORIES(/red/cmt3/vol5/tau/pdt_installation/include)<u></u><u></u></span></p>
<p class="MsoNormal"><span style>INCLUDE_DIRECTORIES(/red/cmt3/vol5/tau/papi_installation/include)</span></p>
<p class="MsoNormal"><span style>The tau wrappers point to MVAPICH2 1.8 which uses the Intel 12 compiler.<u></u><u></u></span></p>
<p class="MsoNormal"><span style><u></u> <u></u></span></p>
<p class="MsoNormal"><span style>We have 2 issues:</span></p>
<p class="MsoNormal"><span style>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:
<u></u><u></u></span></p>
<p class="MsoNormal"><span style>-- The C compiler identification is GNU 4.4.6<u></u><u></u></span></p>
<p class="MsoNormal"><span style>-- The Fortran compiler identification is GNU</span></p>
<p class="MsoNormal"><span style>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:<u></u><u></u></span></p>
<p class="MsoNormal"><span style>set (CMAKE_Fortran_COMPILER_ID "Intel" CACHE STRING "Set Intel compiler" FORCE)<u></u><u></u></span></p>
<p class="MsoNormal"><span style>set (CMAKE_C_COMPILER_ID "Intel"       CACHE STRING "Set Intel compiler" FORCE)</span></p>
<p class="MsoNormal"><span style>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?<u></u><u></u></span></p>

<p class="MsoNormal"><span style><u></u> <u></u></span></p>
<p class="MsoNormal"><span style>Second, we use the TAU option “-optKeepFiles”  which keeps the TAU generated temporary files (e.g. *.pp.f, *.pp.pdb, *.pp.inst.f).</span></p>
<p class="MsoNormal"><span style>We use the below CMake variables for our compilation output:<u></u><u></u></span></p>
<p class="MsoNormal"><span style>set (LIBRARY_OUTPUT_PATH "mydir ")<u></u><u></u></span></p>
<p class="MsoNormal"><span style>set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "mydir")<u></u><u></u></span></p>
<p class="MsoNormal"><span style>set (CMAKE_Fortran_MODULE_DIRECTORY "mydir")</span></p>
<p class="MsoNormal"><span style>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.</span></p>

<p class="MsoNormal"><span style>Is there a way to have the CMake output path variables take effect for the temp files generated by TAU as well?</span></p>
<p class="MsoNormal"><span style>For reference we are running with the below:<u></u><u></u></span></p>
<p><u></u><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><u></u><span dir="LTR"></span><span style>RedHat 6.2<u></u><u></u></span></p>
<p><u></u><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><u></u><span dir="LTR"></span><span style>TAU 2.23<u></u><u></u></span></p>
<p><u></u><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><u></u><span dir="LTR"></span><span style>CMake 2.8.10.2<u></u><u></u></span></p>
<p><u></u><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><u></u><span dir="LTR"></span><span style>Intel compiler 12.1.0<u></u><u></u></span></p>
<p><u></u><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span><u></u><span dir="LTR"></span><span style>MVAPICH2 1.8</span></p>
<p class="MsoNormal"><span style>Thank you for your help.</span></p>
<p class="MsoNormal"><b><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#3366ff">Mohamad O. Sindi</span></b></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#3366ff">EXPEC Advanced Research Center<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial","sans-serif";color:#3366ff">Saudi Aramco</span></p></div></div>