[CMake] Re - How can I change the compiler?

Taesoo Kwon taesoobear at gmail.com
Sun Nov 22 13:30:03 EST 2009


Thank you!
It  worked.

Taesoo
-----------------------------
export CC=mpicc
export CXX=mpic++
rm CMakeCache.txt
cmake .
make VERBOSE=1
-----------------------------

2009/11/22 "Sören Freudiger" <muffmolch at gmx.de>

> Hi Taesoo
> We are also dealing with the mpicxx compiler.
> Best way (and the cmake way of doing that) is to change the env viariables
> CC and CXX.
>
> Because we are often switching between gxx and mpicxx, we are using bash
> scripts for that purpose:
>
> -------------
> #!bash
> export CC=/usr/bin/gcc-4.0
> export CXX=/usr/bin/g++-4.0
>
> echo CC=$CC
> echo CXX=$CXX
>
> #echo rm CMakeCache.txt
> rm CMakeCache.txt
> ccmake ~/lbm/source/patch2d/testcases/serial/.
> -------------
>
> Best SirAnn
>
>
> Von: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] Im Auftrag
> von Taesoo Kwon
> Gesendet: Sonntag, 22. November 2009 09:36
> An: cmake at cmake.org
> Betreff: [CMake] How can I change the compiler?
>
>
> I am sorry that this should be an recurring question.
> But I wasn't able to find any working solution after hours of search.
>
> What I tried is as follows:
>
> /root/CMakeLists.txt
>
> set(CMAKE_CXX_COMPILER mpic++)
> set(CMAKE_C_COMPILER mpicc)
>
>
> project (taesoo_cmu)
>
> add_subdirectory(BaseLib)
> add_subdirectory(MainLib)
> add_subdirectory(MainLib/luabind-0.7)
> add_subdirectory(OgreFltk)
>
>
> -----------------------
>
> in the OgreFltk directory, project (OgreFltk) and add_executable (OgreFltk
> ...) is defined.
>
> cmake .
> make VERBOSE=true
>
> revealed that I am still using c++ instead of mpic++.
> What should I change?
> Thanks.
>
> --
> Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5
> -
> sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091122/3ecda0b2/attachment.htm>


More information about the CMake mailing list