[Dune] changing to cmake

Atgeirr Rasmussen Atgeirr.Rasmussen at sintef.no
Wed Jan 7 21:24:26 CET 2015


I have had the same need. My solution is to pre-populate the cache with the -C option to cmake:

    cmake  -C my_cmake_options.cmake the_dir_with_CMakeLists.txt

where the my_cmake_options.cmake file contains:

    set(CMAKE_CXX_COMPILER "clang++" CACHE STRING "C++ compiler")

and other things that I need often. With the above, the correct compiler is chosen (clang in my case).

I am not sure how to do this via dunecontrol, but perhaps adding the -C <file> option in CMAKE_FLAGS would work.


Atgeirr


7. jan. 2015 kl. 19:30 skrev Arya Fallahi <arya.fallahi at gmail.com>:

> Hi Christoph,
> 
> I have done that and additionally it seems CMake does not recognize g++-4.7 itself. It needs the absolute path. The problem that I have now is that ALUGrid can not be found by the compiler. Currently the opts file is looking like this:
> 
> CONFIGURE_FLAGS="--enable-parallel"
> 
> CMAKE_PREFIX_PATH="\
> /afs/desy.de/user/a/afallahi/extlib/alugrid-1.5;\
> /afs/desy.de/user/a/afallahi/extlib/metis-5.0;\
> " 
> 
> GXX_OPTS="-O3 -g0" 
> 
> CMAKE_FLAGS=" \
> CXXFLAGS=\"$GXX_OPTS\" \
> -DCMAKE_CXX_COMPILER=/afs/desy.de/user/a/afallahi/extlib/gcc-4.7/bin/g++-4.7
> MPICC=$HOME/extlib/openmpi-1.6/bin/mpicc \
> -DALUGRID_ROOT=/afs/desy.de/user/a/afallahi/extlib/alugrid-1.5;\
> -DMETIS_ROOT=/afs/desy.de/user/a/afallahi/extlib/metis-5.0;\
> 
> However, I receive the following error when dune-geometry is compiling:
> 
> configure: searching for ALUGrid in /usr...
> configure: searching for ALUGrid in /usr/local...
> configure: searching for ALUGrid in /usr/local/alugrid...
> configure: searching for ALUGrid in /opt/alugrid...
> checking ALUGrid version >= 1.52... no
> checking alugrid_serial.h usability... no
> checking alugrid_serial.h presence... no
> checking for alugrid_serial.h... no
> configure: WARNING: alugrid_serial.h not found in /include
> configure: error: could not find required module dune-geometry
> --- Failed to build dune-grid ---
> Terminating dunecontrol due to previous errors!
> 
> I am just copy and pasting from the website. But, it seems something is wrong in the guide lines.
> 
> Regards,
> Arya
> 
> On Wed, Jan 7, 2015 at 7:16 PM, Christoph GrĂ¼ninger <christoph.grueninger at iws.uni-stuttgart.de> wrote:
> Hi Arya,
> delete the build directory.
> 
> Bye,
> Christoph
> 
> 
> 
> Am 07.01.2015 um 18:35 schrieb Arya Fallahi <arya.fallahi at gmail.com>:
> 
>> Hi Christoph,
>> 
>> Thank you very much for the quick reply. I did what you said. However, it seems the compiler gets trap in a loop. It returns the following message and does some configuring which again is followed by the message below. Do you know what is exactly happening?
>> 
>> -- Configuring done
>> You have changed variables that require your cache to be deleted.
>> Configure will be re-run and you may have to reset some variables.
>> The following variables have changed:
>> CMAKE_CXX_COMPILER= g++-4.7
>> 
>> Regards,
>> Arya
>> 
>> 
>> On Wed, Jan 7, 2015 at 6:13 PM, Christoph GrĂ¼ninger <christoph.grueninger at iws.uni-stuttgart.de> wrote:
>> Hi Arya,
>> instead of
>>   CMAKE_CXX_COMPILER=g++-4.7
>> you should add it to the CMAKE_FLAGS like
>>   -DCMAKE_CXX_COMPILER=g++-4.7
>> 
>> All CMake variables are passed -D<variablename>=<value> in the
>> CMAKE_FLAGS variable.
>> 
>> Bye
>> Christoph
>> 
>> --
>> GDB does hate your application, expresses its contempt through the
>> design of its command-line interface.   -- Tom Tromey, FOSDEM 2014
>> 
>> 
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>> 
>> 
> 
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune





More information about the Dune mailing list