From: Alan W. I. <ir...@be...> - 2016-11-19 20:57:56
|
On 2016-11-12 01:07-0800 Alan W. Irwin wrote: > On 2016-11-12 00:08-0500 Pedro Vicente wrote: > >> I have a couple suggestions, however >> >> the Cmake output is full of messages like >> >> CMake Error at CMakeLists.txt:18 (enable_language): >> >> No CMAKE_Fortran_COMPILER could be found. >> >> -- Configuring incomplete, errors occurred! >> >> these are not really errors, just features that are not detected, like a >> Fortran compiler >> >> would it be possible to replace this just with a information message , like >> >> --detected fortran compiler >> --fortran compiler not found > > I agree those "Error" messages are too loud for simply an issue with a > missing compiler so ideally it would be good to reduce that loudness. > I will think about methods of doing that, but it may be a bit tricky > so no promises. Hi Pedro: I have addressed this issue as of commit 6dd5069. To test these changes, I deliberately broke the Fortran compiler by specifying export FFLAGS=-whatever and here is the default diagnostic you now get in this case: -- A test cmake run with language = Fortran enabled failed. -- Specify -DENABLE_compiler_diagnostics=ON to see full CMake diagnostics concerning this failure. -- WARNING: no working Fortran compiler so disabling f95 binding and examples. So it is nice and quiet by default just like you asked for. If you specify -DENABLE_compiler_diagnostics=ON, then here are the diagnostics you get for that case: -- A test cmake run with language = Fortran enabled failed with the following output: --------------------------------------------------------------------------------------------------------- -- CMAKE_GENERATOR = Unix Makefiles -- The Fortran compiler identification is unknown -- Check for working Fortran compiler: /usr/bin/f95 -- Check for working Fortran compiler: /usr/bin/f95 -- broken CMake Error at /home/software/cmake/install-3.5.2/share/cmake-3.5/Modules/CMakeTestFortranCompiler.cmake:54 (message): The Fortran compiler "/usr/bin/f95" is not able to compile a simple test program. It fails with the following output: Change Dir: /home/software/plplot/HEAD/build_dir/language_tests/Fortran/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/make" "cmTC_9e5f0/fast" /usr/bin/make -f CMakeFiles/cmTC_9e5f0.dir/build.make CMakeFiles/cmTC_9e5f0.dir/build make[1]: Entering directory '/home/software/plplot/HEAD/build_dir/language_tests/Fortran/CMakeFiles/CMakeTmp' Building Fortran object CMakeFiles/cmTC_9e5f0.dir/testFortranCompiler.f.o /usr/bin/f95 -whatever -c /home/software/plplot/HEAD/build_dir/language_tests/Fortran/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_9e5f0.dir/testFortranCompiler.f.o f95: error: unrecognized command line option ‘-whatever’ CMakeFiles/cmTC_9e5f0.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_9e5f0.dir/testFortranCompiler.f.o' failed make[1]: *** [CMakeFiles/cmTC_9e5f0.dir/testFortranCompiler.f.o] Error 1 make[1]: Leaving directory '/home/software/plplot/HEAD/build_dir/language_tests/Fortran/CMakeFiles/CMakeTmp' Makefile:126: recipe for target 'cmTC_9e5f0/fast' failed make: *** [cmTC_9e5f0/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:18 (enable_language) -- Configuring incomplete, errors occurred! See also "/home/software/plplot/HEAD/build_dir/language_tests/Fortran/CMakeFiles/CMakeOutput.log". See also "/home/software/plplot/HEAD/build_dir/language_tests/Fortran/CMakeFiles/CMakeError.log". --------------------------------------------------------------------------------------------------------- -- WARNING: no working Fortran compiler so disabling f95 binding and examples. As you can see, the above details do include the specific issue (which in this case is that the "-whatever" option is not recognized by gfortran). So -DENABLE_compiler_diagnostics=ON should be useful to users when the missing or broken compiler is a surprise for them. Finally, for completeness here are the diagnostics you get with a working Fortran compiler: -- The Fortran compiler identification is GNU 4.9.2 -- Check for working Fortran compiler: /usr/bin/gfortran -- Check for working Fortran compiler: /usr/bin/gfortran -- works -- Detecting Fortran compiler ABI info -- Detecting Fortran compiler ABI info - done -- Checking whether /usr/bin/gfortran supports Fortran 90 -- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes -- Check if isnan function is available in fortran -- Check for isnan in fortran - not found -- NOTICE: Found: /usr/bin/gfortran I am happy with this resolution of the issue, and thanks for drawing it to my attention in the first place! Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |