[Dune] find dune-modules in non-default location with dunecontrol

Simon Praetorius Simon.Praetorius at tu-dresden.de
Sun Apr 16 01:06:05 CEST 2017


Step by step I came to a solution, thanks for the hints:

1) To find a dune-module (with dunecontrol) installed in a non-default  
location, I've added its path to DUNE_CONTROL_PATH (see below). I have  
done this directly in my opts-file (as I figured out by try-and-error)

2) Unfortunatly, if the module was installed (using `make install`),  
dunecontrol adds the wrong path for the cmake-configuration files:

a) dunecontrol adds  
"-Dmy-dune-module_DIR=PREFIX/lib/dunecontrol/my-dune-module" to the  
CMAKE_PARAMS. This is the location of the dune.module file.

b) in `find_dune_package(my-dune-module)` (called in `dune_project()`)  
cmake calls `find_package(my-dune-module)` that looks for a  
my-dune-module-config.cmake file in my-dune-module_DIR. But this is  
installed in PREFIX/lib/cmake/my-dune-module instead.

--> Thus, I have to set manually the my-dune-module_DIR variable to  
the correct location to make it work.


3) Another problem with the DUNE_CONTROL_PATH solution: If I add the  
path for the installed my-dune-module system-wide, to make it  
available for other project, I can not build my-dune-cmodule anymore  
using dunecontrol, since then the dune-module file for my-dune-module  
is found twice.



The solution above worked for me, but I'm not sure whether I have done  
everything correctly. I have to set the path twice for two different  
systems. I can specify the paths in the opts file, but then with two  
different syntaxes. Maybe it is not yet the optimal solution, or maybe  
the way dunecontrol sets the my-dune-module_DIR is not correct, or  
maybe I have installed the my-dune-module in a wrong way.


Simon


Zitat von Christian Engwer <christian.engwer at uni-muenster.de>:

> Hi Simon,
>
>> # Question
>> Now, how do I find this module in a projects that adds this to its
>> `dune.module` file, when using dunecontrol? I tried to set the
>> `PKG_CONFIG_PATH` manually, but no effect.
>
> this only works, if the module is installed.
>
>> I set in the options file the
>> cmake module directory for the module-config.cmake file, but not effect.
>> I tried to look into the dunecontrol script to find out how the modules
>> are searched, but couldn't determine this corresponding part of the
>> script.
>
> No, dunecontrol doesn't ware about the options for tools further up
> the chain. Everything is handled by DUNE_CONTROL_PATH. You can add
> multiple entries (like in the usual PATH variable) using a colon
> separated list. This list can contain directories (which are searched
> recursively) and explicitly the dune.module files (which safes some
> time, as it avoid long file system seaerches).
>
> Ciao
> Christian



-- 
Dr. Simon Praetorius
Institut für Wissenschaftliches Rechnen
Fachrichtung Mathematik
Technische Universität Dresden
Tel.: TUD-42377
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: 5733 bytes
Desc: S/MIME-Signatur
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20170415/5af7e11c/attachment.bin>


More information about the Dune mailing list