Christiaan Paul Gribble wrote:I "think" you can manually force "CXX=..." and "CC=..." _after_ the
>
> Does anyone have experience getting CMake to work with the PGI
> compilers? I'd like to try building Manta with it, but I can't even
> get a simple project to configure correctly with it (see below). It's
> obviously just a problem with the flags used during the
> TryCompileTest, but I haven't been able to find out how to change the
> flags that CMake uses during those tests.
>
> Any thoughts?
>
> Thanks,
compiler test has been run. I do have a cmake file in which I use a
compiler for a theoretical architecture that does not yet exist and
whose generated bycode would most likely not be executable on the host
machine ... and it works.
I think I have something like
SET(USE_MY_COMPILER YES CACHE BOOL "bla");
IF (USE_MY_COMPILER)
SET(CMAKE_CXX_COMPILER,"blubba");
....
ELSE(....)
...
ENDIF(...)
I "think" cmake then uses the CC/CXX environment variables for the
compiler test script; at least it works in my case.
Cheers,
Ingo
PS: I'm pretty sure it uses CMAKE_C_FLAGS/CMAKE_CXX_FLAGS during
compilation. I set these, too, so maybe that's the difference.
>
> C
>
> [gribblecp@endeavour ~...rt488/build-pgi]% cmake ../src/
> -- Check for working C compiler: /opt/pgi/linux86-64/7.1-5/bin/pgcc
> -- Check for working C compiler: /opt/pgi/linux86-64/7.1-5/bin/pgcc --
> broken
> CMake Error: The C compiler "/opt/pgi/linux86-64/7.1-5/bin/pgcc" is
> not able to compile a simple test program.
> It fails with the following output:
> /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
> CMakeFiles/cmTryCompileExec.dir/build
> gmake[1]: Entering directory
> `/home/gribblecp/research/code/rt488/build-pgi/CMakeFiles/CMakeTmp'
> /usr/local/bin/cmake -E cmake_progress_report
> /home/gribblecp/research/code/rt488/build-pgi/CMakeFiles/CMakeTmp/CMakeFiles
> 1
> Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.o
> /opt/pgi/linux86-64/7.1-5/bin/pgcc -o
> CMakeFiles/cmTryCompileExec.dir/testCCompiler.o -c
> /home/gribblecp/research/code/rt488/build-pgi/CMakeFiles/CMakeTmp/testCCompiler.c
>
> Linking C executable cmTryCompileExec
> /usr/local/bin/cmake -P
> CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake
> /opt/pgi/linux86-64/7.1-5/bin/pgcc -fPIC
> "CMakeFiles/cmTryCompileExec.dir/testCCompiler.o" -o
> cmTryCompileExec -rdynamic
> pgcc-Error-Unknown switch: -rdynamic
> gmake[1]: *** [cmTryCompileExec] Error 1
> gmake[1]: Leaving directory
> `/home/gribblecp/research/code/rt488/build-pgi/CMakeFiles/CMakeTmp'
> gmake: *** [cmTryCompileExec/fast] Error 2
>
>
> CMake will not be able to correctly generate this project.
> -- Configuring done
>
Archive powered by MHonArc 2.6.16.