I "think" you can manually force "CXX=..." and "CC=..." _after_ the 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.
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,
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.