Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build the adapter: Could not find /dune.module #37

Closed
MakisH opened this issue Apr 16, 2024 · 4 comments · Fixed by #38
Closed

Cannot build the adapter: Could not find /dune.module #37

MakisH opened this issue Apr 16, 2024 · 4 comments · Fixed by #38

Comments

@MakisH
Copy link
Member

MakisH commented Apr 16, 2024

Description

I am building the adapter for the first time. I got a fresh copy of installdumux.py from the GitLab of DuMuX 3.8 and I have placed the dumux-adapter in the same directory. However, when I try to build it, I get an error that sounds like I have not set some path (otherwise, why the starting slash?):

~/software/dumux$ ls
dumux  dumux-adapter  dune-common  dune-geometry  dune-grid  dune-istl  dune-localfunctions
~/software/dumux$ ./dune-common/bin/dunecontrol --only=dumux-precice all
--- going to build dumux-precice  ---
--- calling all for dumux-precice ---

ERROR: could not find /dune.module
--- Failed to build dumux-precice ---
Terminating dunecontrol due to previous errors!
~/software/dumux/dune-common [releases/2.9]$ ls
bin           CMakeLists.txt   COPYING  dune-common.pc.in  .gitignore      lib         .mailmap        README.md  share
CHANGELOG.md  config.h.cmake   doc      dune.module        .gitlab-ci.yml  LICENSE.md  pyproject.toml  .reuse     TODO
cmake         CONTRIBUTING.md  dune     .git               INSTALL         LICENSES    python          setup.py

@mathiskelm @Fujikawas @ajaust @IshaanDesai any clue what I have forgotten?

I think I have followed all instructions from the docs: https://precice.org/adapter-dumux-get.html

Environment

Ubuntu 22.04.

@MakisH
Copy link
Member Author

MakisH commented Apr 16, 2024

It sounds to me like I should have dumux-precice in the same directory as dune-common, not dumux-adapter.

@MakisH
Copy link
Member Author

MakisH commented Apr 16, 2024

After setting:

export DUNE_CONTROL_PATH=/home/gc/software/dumux:/home/gc/software/dumux/dumux-adapter:${DUNE_CONTROL_PATH}
# /home/gc/software/dumux:/home/gc/software/dumux/dumux-adapter:/home/gc/software/dune

I get:

~/software/dumux$ ./dune-common/bin/dunecontrol --only=dumux-precice all
ERROR: multiple definition of module dune-istl
previous defined in:
  /home/gc/software/dumux/dune-istl/dune.module
redefined in:
  /home/gc/software/dune/dune-istl/dune.module
Execution of dunecontrol terminated due to errors!

@mathiskelm
Copy link
Collaborator

First, the dumux-adapter/dumux-precice directory structure can be confusing, because the option passed to dunecontrol is the module name, as defined in dumux-adapter/dune.module, not the directory name. Dunecontrol will search also in subdirectories, so even if the module were located in the dumux-precice subfolder it would be found.

This is conditioned on, as you have correctly identified, dunecontrol searching in the directory containing dune-common, dumux, dumux-adapter (and its subfolders), but setting DUNE_CONTROL_PATH can hide the current directory from dunecontrol.
However, if you append this directory to your DUNE_CONTROL_PATH, it will collect modules from all paths in this environment variable and detect duplicates of modules if they are installed in multiple included directories. ~/software/dumux/dumux-adapter/dune.module being included in both ~/software/dumux and ~/software/dumux/dumux-adapter of the environment variable is okay, because the absolute path is the same, but your two distinct installations of dune-istl and other DUNE modules which are both made discoverable through DUNE_CONTROL_PATH will trigger the observed error.

To configure this installation of DuMux and the adapter as independent of your existing installation of DUNE modules in ~/software/dune you need to temporarily remove them from the searched path by either
export DUNE_CONTROL_PATH=~/software/dumux; ./dune-common/bin/dunecontrol --only=dumux-precice all
or
DUNE_CONTROL_PATH=~/software/dumux ./dune-common/bin/dunecontrol --only=dumux-precice all.

Alternatively you can decide to re-use the existing installation of DUNE modules, removing the duplicates from ~/software/dumux and keeping both paths in the environment variable export DUNE_CONTROL_PATH=/home/gc/software/dumux:/home/gc/software/dune. Of course then these module installations have to be compatible.

You can also use ${PWD} and . in DUNE_CONTROL_PATH, e.g. as
DUNE_CONTROL_PATH=${PWD} ./dune-common/bin/dunecontrol --only=dumux-precice all with an isolated DuMux installation
or
export DUNE_CONTROL_PATH=.:/home/gc/software/dune to always include both a central installation of DUNE modules as well as the current directory (no duplicated module installations) to be able to re-use the central installation with different other installations.

@mathiskelm
Copy link
Collaborator

The documentation currently assumes no usage of DUNE_CONTROL_PATH and an isolated installation. I would suggest making this assumption explicit and including adapting the instructions to e.g. DUNE_CONTROL_PATH=${PWD} ./dune-common/bin/dunecontrol --only=dumux-precice all and possibly explaining an integrated setup which uses DUNE_CONTROL_PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants