MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0015460 | CMake | CMake | public | 2015-03-19 11:02 | 2015-11-02 09:13 |
| Reporter | Tiago Quintino | ||||
| Assigned To | |||||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | Linux | OS | Opensuse | OS Version | 13.1 |
| Product Version | |||||
| Target Version | CMake 3.3 | Fixed in Version | CMake 3.3 | ||
| Summary | 0015460: PGI Fortran compiler does not recognise -fPIE | ||||
| Description | By selecting POSITION_INDEPENDENT_CODE the PGI compiler settings add automatically the flag -fPIE. This flag does not exist for PGI Fortran Compiler. I have checked this with pgf77, pgf90 and pgfortran. The only workaround I found is to set the flag: -DCMAKE_Fortran_FLAGS="-noswitcherror" This turns off the check for flag validity in the compiler, but obviously is not a long-term solution, since now any test to compiler flags will pass irrespectively if the flag is recognised or not. The solution I think is changing Modules/Platform/Linux-PGI.cmake to: set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "") Note that the flag -fPIE also does not exist for PGI C and C++ compilers. | ||||
| Steps To Reproduce | Build the attached CMakeLists.txt project with cmake -DCMAKE_Fortran_COMPILER=pgf90 .. | ||||
| Additional Information | I am using CMake 3.1.2 and PGI Fortran 14.4. The man page of compiler does not reference this flag whatsoever. This is the output I get: -- The C compiler identification is GNU 4.8.1 -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- The Fortran compiler identification is PGI -- Check for working Fortran compiler: /usr/local/apps/pgi/14.4/bin/pgf90 -- Check for working Fortran compiler: /usr/local/apps/pgi/14.4/bin/pgf90 -- broken CMake Error at /usr/local/apps/cmake/3.1.2/share/cmake-3.1/Modules/CMakeTestFortranCompiler.cmake:54 (message): The Fortran compiler "/usr/local/apps/pgi/14.4/bin/pgf90" is not able to compile a simple test program. It fails with the following output: Change Dir: /home/ma/matq/git/cmake-test/pgi-pie/build/CMakeFiles/CMakeTmp Run Build Command:"/usr/bin/gmake" "cmTryCompileExec951442437/fast" gmake: Warning: File `Makefile' has modification time 1.9 s in the future /usr/bin/gmake -f CMakeFiles/cmTryCompileExec951442437.dir/build.make CMakeFiles/cmTryCompileExec951442437.dir/build gmake[1]: Entering directory `/home/ma/matq/git/cmake-test/pgi-pie/build/CMakeFiles/CMakeTmp' gmake[1]: Warning: File `CMakeFiles/cmTryCompileExec951442437.dir/flags.make' has modification time 1.9 s in the future /usr/local/apps/cmake/3.1.2/bin/cmake -E cmake_progress_report /home/ma/matq/git/cmake-test/pgi-pie/build/CMakeFiles/CMakeTmp/CMakeFiles 1 Building Fortran object CMakeFiles/cmTryCompileExec951442437.dir/testFortranCompiler.f.o /usr/local/apps/pgi/14.4/bin/pgf90 -Mpreprocess -Kieee -fPIE -c /home/ma/matq/git/cmake-test/pgi-pie/build/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTryCompileExec951442437.dir/testFortranCompiler.f.o pgf90-Error-Unknown switch: -fPIE gmake[1]: *** [CMakeFiles/cmTryCompileExec951442437.dir/testFortranCompiler.f.o] Error 1 gmake[1]: Leaving directory `/home/ma/matq/git/cmake-test/pgi-pie/build/CMakeFiles/CMakeTmp' gmake: *** [cmTryCompileExec951442437/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:7 (enable_language) | ||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://public.kitware.com/Bug/file/5409/CMakeLists.txt | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2015-03-19 11:02 | Tiago Quintino | New Issue | |||
| 2015-03-19 11:02 | Tiago Quintino | File Added: CMakeLists.txt | |||
| 2015-03-20 13:02 | Brad King | Note Added: 0038266 | |||
| 2015-03-20 13:02 | Brad King | Status | new => resolved | ||
| 2015-03-20 13:02 | Brad King | Resolution | open => fixed | ||
| 2015-03-20 13:02 | Brad King | Fixed in Version | => CMake 3.3 | ||
| 2015-03-20 13:02 | Brad King | Target Version | => CMake 3.3 | ||
| 2015-11-02 09:13 | Robert Maynard | Note Added: 0039741 | |||
| 2015-11-02 09:13 | Robert Maynard | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||