<div><div dir="auto">You have just to put set command (not cache) for your compiler (CMAKE_Fortran_COMPILER) and environment variable in a file and specify this file on cmake command line with option -DCMAKE_TOOLCHAIN_FILE=your-file.</div></div><div><br><div class="gmail_quote"><div dir="ltr">Le lun. 9 juil. 2018 à 03:32, Clune, Thomas L. (GSFC-6101) <<a href="mailto:thomas.l.clune@nasa.gov">thomas.l.clune@nasa.gov</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-3104493962458547908WordSection1">
<p class="MsoNormal">Marc,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thank you for the suggestion. Unfortunately, I’m a bit confused by the documentation and not at all sure how to proceed. Further help would be appreciated.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In particular, I do not see how to capture the existing Fortran, C and CXX toolchains and then provide the minor extension of setting this one environment variable. In fact, at the moment, I don’t even see a simple way to cut-and-paste
the cmake built-in toolchains into a file to use as my baseline for extension.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Am I correct in assuming that once the above issues are solved, then a simple line of the form<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">set(ENV(INTEL_LICENSE_FILE) “…”)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">will then ensure that the compiler “sees” that env variable? Or do I need to wrap the compiler in a script which just raises many more issues as I need my project to be able to build with many different versions of the Intel compiler.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks in advance,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<ul style="margin-top:0in" type="disc">
<li class="m_-3104493962458547908MsoListParagraph" style="margin-left:0in">Tom<u></u><u></u></li></ul>
<p class="m_-3104493962458547908MsoListParagraph"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></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">Marc CHEVRIER <<a href="mailto:marc.chevrier@gmail.com" target="_blank">marc.chevrier@gmail.com</a>><br>
<b>Date: </b>Saturday, July 7, 2018 at 1:49 AM<br>
<b>To: </b>"Clune, Thomas L. (GSFC-6101)" <<a href="mailto:thomas.l.clune@nasa.gov" target="_blank">thomas.l.clune@nasa.gov</a>><br>
<b>Cc: </b>CMake MailingList <<a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a>><br>
<b>Subject: </b>Re: [CMake] specifying path for license file for commercial compiler?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><u></u> <u></u></p>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-left:.5in">May be using a toolchain file is more appropriate. See
<u></u><u></u></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><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><u></u> <u></u></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><u></u> <u></u></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 :<u></u><u></u></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><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote></div></div>