<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Unfortunately, I cannot dictate where the sysadmins are putting the license file.     I can of course put a copy in  /home/<user>/Licenses which is another location that Intel looks by default.   And if there is no better solution, I will
 provide instructions to all of our developers on making copies themselves on our various development platforms.    Or at that point I’ll just ask them all to set the environment variable in their shell startup files.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m still a bit astonished that something as simple as this is essentially unsupported.    It is particularly frustrating as try_run() successfully exercises the compiler while the run-of-the-mill compiler invocations under make do not.  
 Sort of makes sense though.  CMake launches try_run() in a subshell and therefore it sees the env variable I am setting with set(ENV…).   OTOH, the subsequent make commands are not subshells and therefore need a separate mechanism to see that env variable.  
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Stephen McDowell <sjm324@cornell.edu><br>
<b>Date: </b>Saturday, July 7, 2018 at 2:25 AM<br>
<b>To: </b>Marc CHEVRIER <marc.chevrier@gmail.com><br>
<b>Cc: </b>"Clune, Thomas L. (GSFC-6101)" <thomas.l.clune@nasa.gov>, CMake MailingList <cmake@cmake.org><br>
<b>Subject: </b>Re: [CMake] specifying path for license file for commercial compiler?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">I agree that a toolchain file is more appropriate, noting that typically modifying the environment variables is much more common for there's compilers (particularly using environment modules).
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">However, since you've started clearly you would rather not set the environment variables, there may be an easier "hack".<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Intel also looks in /opt/intel/licenses for any .lic files. So if you want, you can just create a symbolic link or copy your license file there :)<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">On Fri, Jul 6, 2018, 10:49 PM Marc CHEVRIER <<a href="mailto:marc.chevrier@gmail.com">marc.chevrier@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">May be using a toolchain file is more appropriate. See 
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in"><a href="https://cmake.org/cmake/help/v3.12/manual/cmake-toolchains.7.html" target="_blank">https://cmake.org/cmake/help/v3.12/manual/cmake-toolchains.7.html</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">Le ven. 6 juil. 2018 à 22:59, Clune, Thomas L. (GSFC-6101) <<a href="mailto:thomas.l.clune@nasa.gov" target="_blank">thomas.l.clune@nasa.gov</a>> a écrit :<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-left:.5in">To use the Intel compiler, one must use an environment variable that specifies the path to the license file.  E.g.,<br>
<br>
    export INTEL_LICENSE_FILE=/usr/local/intel/license<br>
<br>
Other commercial compilers use a very similar mechanism.    I had hoped to capture such information in a cache file so that I could avoid polluting the shell where I am invoking cmake:<br>
<br>
    % cmake -C my-cache <src-dir><br>
<br>
Such a cache file could  look like:<br>
<br>
    set(CMAKE_Fortran_COMPILER "/usr/local/intel/2018/compilers_and_libraries_2018.3.222/linux/bin/intel64/ifort" CACHE path "Fortran compiler")<br>
    set(ENV{INTEL_LICENSE_FILE} "/usr/local/intel/license" CACHE path "Intel license")<br>
<br>
<br>
Unfortunately, the compiler is not “seeing” the env variable and complains that there is no license.     Is there a solution to this, or am I forced to set the env variable each time I try to build?<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">
http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">
http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">
http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">
http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><o:p></o:p></p>
</blockquote>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in">-- <br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">
http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">
http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">
http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">
http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">
http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</body>
</html>