<div dir="auto">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).<div dir="auto"><br></div><div dir="auto">However, since you've started clearly you would rather not set the environment variables, there may be an easier "hack".</div><div dir="auto"><br></div><div dir="auto">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 :)</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 6, 2018, 10:49 PM Marc CHEVRIER <<a href="mailto:marc.chevrier@gmail.com">marc.chevrier@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="auto">May be using a toolchain file is more appropriate. See <div><a href="https://cmake.org/cmake/help/v3.12/manual/cmake-toolchains.7.html" target="_blank" rel="noreferrer">https://cmake.org/cmake/help/v3.12/manual/cmake-toolchains.7.html</a></div><div dir="auto"><br></div></div></div><div><br><div class="gmail_quote"><div dir="ltr">Le ven. 6 juil. 2018 à 22:59, Clune, Thomas L. (GSFC-6101) <<a href="mailto:thomas.l.clune@nasa.gov" target="_blank" rel="noreferrer">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">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" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" 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" rel="noreferrer noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>