[Dune] building/installing dune core modules out of source directory

Simon Praetorius Simon.Praetorius at tu-dresden.de
Wed Jan 24 11:06:35 CET 2018


Hi Markus,

thanks for your explanation. I think, I've found the problem now:

1. building dune in BUILD_DIR without installation was just a test and  
I understand that it does not really makes sense.

2. building and installing dune requires to switch to the dunecontrol  
script from the install location, i.e.

> DUNE_CONTROL_PATH=${INSTALL_DIR}  
> ${SOURCE_DIR}/dune-common/bin/dunecontrol --current all

does not work (wrong package dirs are set), but

> [DUNE_CONTROL_PATH=${INSTALL_DIR}] ${INSTALL_DIR}/bin/dunecontrol  
> --current all

works fine. This I didn't know before. Thank you for this hint.


Best wishes,
Simon


Zitat von Markus Blatt <markus at dr-blatt.de>:

> Hi,
>
> On Mon, Jan 22, 2018 at 10:01:24AM +0000, Simon Praetorius wrote:
>> Hi Domonic,
>>
>> > DUNE_CONTROL_PATH is only used to find sources of Dune modules,
>
> or installed versions.
>
>> > not their builds, so the behaviour you see is to be expected. If  
>> you want to
>> > build
>> > a module against a specific set of build directories, the easiest  
>> way to do
>> > it is
>> > building it through dunecontrol with the same --builddir=... flag set as
>> > when you
>> > build the original set of modules.
>>
>> OK, I see. That's why building all the dune core modules worked fine with
>> the common build-directory. But this enforces that I build all projects in
>> the same directory, also if they are not core modules. This is a workflow I
>> don't like.
>>
>
> I have to admit that I still do not get what you are trying to accomplish.
>
> Do you really want to to build some modules with a specific builddir  
> (and never install them) and later use
> another builddir for others? That won't work and never did (without  
> dunecontrol magic).
>
> If you do not want to depend on the builddir then you have to  
> install the modules somewhere. As was mentioned
> CMake does not need dunecontrol. It is even smart enough to scan  
> CMAKE_INSTALL_PREFIX when searching for DUNE
> modules (if that is not wanted then you have to provide  
> CMAKE_PREFIX_PATH. If you installed all modules to the
> same location, then you can easily use dunecontrol, but it has to be  
> the script from the installation location.
> (Otherwise you have to set up the DUNE_CONTROL_PATH manually)
>
> BTW I tested this setup:
>
> Install dune-common, dune-istl with this opts file
> CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/test_install"
> BUILDDIR=build-dist
> MAKE_FLAGS="-j4 install"
>
> Created a new project tester in /tmp and built it with  
> $HOME/test_install/bin/dunecontrol. works fine
> Without dunecontrol (with and without additionally installed modules  
> in the default system path):
> mkdir build; cd build;cmake  
> -DCMAKE_INSTALL_PREFIX=$HOME/test_install ../tester
>
> Does this satisfy your needs? If not then please provide exact  
> details about the use case.
>
>>
>> My workaround for the installation of dune modules is, to set the same
>> `-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}` for all dune modules and then to add
>> the cmake flag `-DCMAKE_PREFIX_PATH:PATH=${INSTALL_DIR}` in my opts file of
>> my own project.
>
> See above. No need to set both of them.
>
>> >
>> > This is from the top of my head, without trying, but I have similar
>> > workflows, that
>> > work nice for me.
>> >
>> > Best,
>> > Dominic
>> >
>> > On Sat, Jan 20, 2018 at 2:57 PM, Simon Praetorius <
>> > simon.praetorius at tu-dresden.de> wrote:
>> >
>> > > How can I use these build dune-modules in my own project? When I call
>> > >
>> > > > DUNE_CONTROL_PATH=${BUILD_DIR} dunecontrol --current all
>> > >
>> > > in my own dune project directory, it fails since dunecontrol  
>> can not find
>> > > the `dune.module` files in the ${BUILD_DIR}/dune-xxx subdirectories that
>> > > are necessary for determining the module dependencies. These files are
>> > > simply not copied in the build directories.
>
> I do not think that this is the reason. The reason is that we always  
> assumed that all uninstalled
> have the same builddir layout. This violated in your case. If you  
> drop current, move up one directory
> and use DUNE_CONTROL_PATH=${BUILD_DIR}:. it will work.
>
> If you insist on current, you have to use the same builddir  
> convention and the other modules must have been built already.
> (Didn't even know about --current. Way too much magic in dunecontrol  
> for my taste!)
>
> HTH and cheers,
>
> Markus
> --
> Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
> Pedettistr. 38, 85072 Eichstätt, Germany
> Tel.: +49 (0) 160 97590858



-- 
Dr. Simon Praetorius
Institut für Wissenschaftliches Rechnen
Fakultät Mathematik
Technische Universität Dresden
Tel.: TUD-34432
Mail: simon.praetorius at tu-dresden.de
Web: www.math.tu-dresden.de/~spraetor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5753 bytes
Desc: S/MIME-Signatur
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20180124/ad4244f2/attachment.bin>


More information about the Dune mailing list