Re: [DuMux] Error building a new module (dumux-trial)

2021-03-07 Thread Timo Koch
Hi Mahmoud,

thanks for making us aware that the example in the getting started guide 
requires Suitesparse. This shouldn’t be the case and is an oversight on our 
side.
We’ll change that in the next days (most likely will be fixed by Monday 
evening).

Otherwise your setup seems to look fine.
I just tried it and I can’t reproduce your error.
I ran:

python3 install_dumux.py
./dune-common/bin/duneproject
./dune-common/bin/dunecontrol --opts=dumux/cmake.opts --only=dumux-trial all

And it worked fine. I answered the duneproject questions as follows
1) Name of your new Project? (e.g.: dune-grid): dumux-trial
2) Which modules should this module depend on?
   The following modules have been found:
   dune-common dune-istl dune-geometry dune-grid dune-localfunctions dumux 
   Enter space-separated list: dumux
3) Project/Module version? 0.1
4) Maintainer's email address? b...@bla.com
5) y

Please try starting from the beginning again and tell us if this works for you.

For your other questions:

* If you remove the folder of the module there will be no leftovers (unless you 
deliberately installed the modules to some other directory or used debian 
packages or some other installation method)
* If you have problems running dunecontrol after deleting modules or adding new 
modules you might want to delete all the build folders (the “build-cmake” 
folder created in each module).
  It usually works to do "rm -r d*/build-cmake” if all modules start with "d”. 
(This removes all compiled executables and build files and caches.)
  Then run dunecontrol again (./dune-common/bin/dunecontrol 
--opts=dumux/cmake.opts all)

Best wishes
Timo





> On 7. Mar 2021, at 19:47, Mahmoud Atef Mahmoud Mohamed Aboelseoud S277151 
>  wrote:
> 
> Dear Timo,
> 
> Thanks a lot for your reply and advice. Here are the answers to your 
> questions:
> 
> 1. My OS is Ubuntu 20.04 LTS
> 
> 2. This is the only command I am writing in the terminal to get the failure 
> error of building the new module 'dumux-trial':
> "./dune-common/bin/dunecontrol --opts=dumux/cmake.opts 
> --only=dumux-yourmodule all"
> 
> 3. Yes, The steps I followed were those of the installation section:
>   a) I installed the pre-requisites:
> - cmake version 3.16.3
> - gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
> - pkg-config version: 0.29.1
> - Open MPI version:4.0.3
> - paraview version 5.7.0
> - Python 3.8.5
> - git version 2.25.1
>   b) I used Installation via script: I downloaded the script from  
> installdumux.py link in the install section and then I ran it using this 
> command: python3 installdumux.py
> 
> 4. a) Output of "g++ --version" :
> g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
> Copyright (C) 2019 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
>   b) Output of "cmake --version":
> cmake version 3.16.3
> CMake suite maintained and supported by Kitware (kitware.com/cmake).
> 
> After having the minimal setup after installation via script, I tried to run 
> the example in the "Getting Started" section but I was having an error as I 
> didn't have the suitesparse library installed back then. That's when I 
> installed some dune optional modules using this command:
> "dunecontrol --module= all" after downloading the zip source 
> from the git repository.
>  I know it was not a good practice at all and I should have probably stuck to 
> the minimal installation. However after installing the suitesparse library, 
> the example ran flawlessly and I displayed the results on paraview. Later, I 
> followed the "Getting Started" section again to create a separate module that 
> lists DuMuX as its dependency using this command in the installation folder: 
> "./dune-common/bin/duneproject"
> and then when I tried to configure the new module using the command in point 
> no.2 above, I'm faced with this error:
> 
> "CMake Error at 
> /home/mahmoud/dumux/dune-common/cmake/modules/DuneMacros.cmake:991 
> (target_link_libraries):
>  The "debug" argument must be followed by a library.
> Call Stack (most recent call first):
>  src/CMakeLists.txt:2 (target_link_dune_default_libraries)
> 
> 
> -- Configuring incomplete, errors occurred!
> See also 
> "/home/mahmoud/dumux/dumux-trial/build-cmake/CMakeFiles/CMakeOutput.log".
> See also 
> "/home/mahmoud/dumux/dumux-trial/build-cmake/CMakeFiles/CMakeError.log".
> --- Failed to build dumux-trial ---
> Terminating dunecontrol due to previous errors!"
> 
> Again thanks for your help and guidance and please let me know what you 
> think. One last question, if i remove the 2 optional modules with problems 
> dune-functions and dune-pdelab using the command you mentioned, will they 
> still have any residuals in my installation directory or it's enough ? I will 
> wait for your instructions. 

Re: [DuMux] Error building a new module (dumux-trial)

2021-03-07 Thread Mahmoud Atef Mahmoud Mohamed Aboelseoud S277151

Dear Timo,

Thanks a lot for your reply and advice. Here are the answers to your 
questions:


1. My OS is Ubuntu 20.04 LTS

2. This is the only command I am writing in the terminal to get the 
failure error of building the new module 'dumux-trial':
"./dune-common/bin/dunecontrol --opts=dumux/cmake.opts 
--only=dumux-yourmodule all"


3. Yes, The steps I followed were those of the installation section:
   a) I installed the pre-requisites:
 - cmake version 3.16.3
 - gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
 - pkg-config version: 0.29.1
 - Open MPI version:4.0.3
 - paraview version 5.7.0
 - Python 3.8.5
 - git version 2.25.1
   b) I used Installation via script: I downloaded the script from  
installdumux.py link in the install section and then I ran it using this 
command: python3 installdumux.py


4. a) Output of "g++ --version" :
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is 
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.


   b) Output of "cmake --version":
cmake version 3.16.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).

After having the minimal setup after installation via script, I tried to 
run the example in the "Getting Started" section but I was having an 
error as I didn't have the suitesparse library installed back then. 
That's when I installed some dune optional modules using this command:
"dunecontrol --module= all" after downloading the zip 
source from the git repository.
  I know it was not a good practice at all and I should have probably 
stuck to the minimal installation. However after installing the 
suitesparse library, the example ran flawlessly and I displayed the 
results on paraview. Later, I followed the "Getting Started" section 
again to create a separate module that lists DuMuX as its dependency 
using this command in the installation folder: 
"./dune-common/bin/duneproject"
and then when I tried to configure the new module using the command in 
point no.2 above, I'm faced with this error:


"CMake Error at 
/home/mahmoud/dumux/dune-common/cmake/modules/DuneMacros.cmake:991 
(target_link_libraries):

  The "debug" argument must be followed by a library.
Call Stack (most recent call first):
  src/CMakeLists.txt:2 (target_link_dune_default_libraries)


-- Configuring incomplete, errors occurred!
See also 
"/home/mahmoud/dumux/dumux-trial/build-cmake/CMakeFiles/CMakeOutput.log".
See also 
"/home/mahmoud/dumux/dumux-trial/build-cmake/CMakeFiles/CMakeError.log".

--- Failed to build dumux-trial ---
Terminating dunecontrol due to previous errors!"

Again thanks for your help and guidance and please let me know what you 
think. One last question, if i remove the 2 optional modules with 
problems dune-functions and dune-pdelab using the command you mentioned, 
will they still have any residuals in my installation directory or it's 
enough ? I will wait for your instructions. Thanks a lot and sorry for 
disturbance !




Best Regards,

Mahmoud Atef
___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMux] Error building a new module (dumux-trial)

2021-03-07 Thread Timo Koch
Hi Mahmoud,

in oder to provide help we would need the following information:

* which OS are you working on? (We only support Linux, macOS should be fine but 
might have some more complications sometimes)
* What commands did you type to produce the error? (Minimal working example)
* Which instructions did you exactly follow? For example: Did you follow the 
steps of the "Getting started” guide? (https://dumux.org/gettingstarted/ 
 and https://dumux.org/installation/)
* What is the output of “g++ --version” (or your compiler) and “cmake 
--version”?

Try to start with a minimal setup as described in these guides. For example I 
wonder where you read that you need dune-pdelab. Dune-pdelab
is an independent Dune module which doesn’t depend on Dumux nor does Dumux 
depend on dune-pdelab. The fact that you have
dune-pdelab and dune-functions means that you didn’t simply follow the getting 
started guide. I would recommend starting with that.

As for your other questions (not Dumux-related): Removing a module means just 
deleting the module folder ("rm -r dune-pdelab”).
There is no recommended IDE and way of debugging, this entirely depends on your 
preferences of how to work with C++ code.
Some people just use a minimal editor like “vi”, some people prefer working 
with full-blown IDEs.

After you successfully completed  "Getting started” I recommend to look at the 
documented examples to get acquainted with the code. (First link here 
https://dumux.org/docs/ )

Best

Timo


> On 7. Mar 2021, at 14:43, Mahmoud Atef Mahmoud Mohamed Aboelseoud S277151 
>  wrote:
> 
> Dear Christoph,
> 
> Thanks a lot for your reply and advice. I am actually learning C++ these 
> days. I was just setting up the new module to check that everything was OK 
> according to the instructions on the DuMuX website and handbook but I was 
> worried when i couldn't build it and got that error. You are absolutely right 
> and I know I cannot work right away. I am currently reading the dumux 
> handbook and whatever documentation available besides learning C++ and yes 
> surely it will take some practice to understand how things work in DuMuX.
> 
> Could you guide me on how to remove those optional dune modules at least 
> dune-functions and dune-pdelab for now since they are the ones with problems 
> ? Also I am wondering if there is any recommended IDE for DuMuX and how the 
> debugging is done?
> 
> Also if you have any advice regarding this error with that new module, I'd 
> really appreciate it. I just want to get everything set up so that when I'm 
> ready to work, I don't get surprised with such issue. Thanks again for your 
> consideration and fast response.
> 
> Best Regards,
> 
> Mahmoud Atef
> ___
> DuMux mailing list
> DuMux@listserv.uni-stuttgart.de
> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMux] Error building a new module (dumux-trial)

2021-03-07 Thread Mahmoud Atef Mahmoud Mohamed Aboelseoud S277151

Dear Christoph,

Thanks a lot for your reply and advice. I am actually learning C++ these 
days. I was just setting up the new module to check that everything was 
OK according to the instructions on the DuMuX website and handbook but I 
was worried when i couldn't build it and got that error. You are 
absolutely right and I know I cannot work right away. I am currently 
reading the dumux handbook and whatever documentation available besides 
learning C++ and yes surely it will take some practice to understand how 
things work in DuMuX.


Could you guide me on how to remove those optional dune modules at least 
dune-functions and dune-pdelab for now since they are the ones with 
problems ? Also I am wondering if there is any recommended IDE for DuMuX 
and how the debugging is done?


Also if you have any advice regarding this error with that new module, 
I'd really appreciate it. I just want to get everything set up so that 
when I'm ready to work, I don't get surprised with such issue. Thanks 
again for your consideration and fast response.


Best Regards,

Mahmoud Atef
___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMux] Error building a new module (dumux-trial)

2021-03-07 Thread Christoph Grüninger
Hi Mahmoud,

I think it is very ambicious to create a new module without having at
least a little bit of knwolege about programming in general and DuMuX /
Dune in particular.

My suggestion:
- Postpone creating your own module.
- Remove all optional Dune modules.
- Concentrate on using DuMuX: Run some models, modify parameters (input
files), get results visualized with ParaView.
- Add third party libraries or optional Dune modules and start using them.
- Make some minor modifications in the code like changing boundary
conditions, replace van-Genuchten model so something else or vise versa.
- Then you can think about creating your own module.

Further, ask your adviser or other people involved in programming from
your department / chair how to proceed and what you can achieve for your
thesis.

Hope this helps,
Christoph

-- 
Als wär es nix, leb' ich von [IT] und mach' nur, was ich lieb'
Lebe wie im Paradies, womit hab' ich das verdient?
Die Wahrheit ist: Hab' ich nicht, ich bin nur reicher beschenkt
Als jemand in einem armen Land mit dem gleichen Talent
[frei nach Tua von Die Orsons - Oioioiropa]
___
DuMux mailing list
DuMux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


[DuMux] Error building a new module (dumux-trial)

2021-03-07 Thread Mahmoud Atef Mahmoud Mohamed Aboelseoud S277151

Hello Dumux team,

I wrote to you some days ago but I still didn't get an advice on the 
situation. I'm an absolute beginner to programming generally and I'm 
just trying to use dumux for my master thesis in petroleum engineering. 
I am trying to build a new module called 'dumux-trial' but I'm getting 
this error:
CMake Error at 
/home/mahmoud/dumux/dune-common/cmake/modules/DuneMacros.cmake:991 
(target_link_libraries):

  The "debug" argument must be followed by a library.
Call Stack (most recent call first):
  src/CMakeLists.txt:2 (target_link_dune_default_libraries)
-- Configuring incomplete, errors occurred!
See also 
"/home/mahmoud/dumux/dumux-trial/build-cmake/CMakeFiles/CMakeOutput.log".
See also 
"/home/mahmoud/dumux/dumux-trial/build-cmake/CMakeFiles/CMakeError.log".

--- Failed to build dumux-trial ---
Terminating dunecontrol due to previous errors!

I also have some dune optional modules installed but there's an issue 
with 2 of them: dune-functions fails to build & dune-pdelab which I 
found out that I installed an older version of it 2.0.0 by mistake.I 
don't know if the issues with those 2 optional modules have any effect 
on the error I'm getting when trying to build the new module 
'dumux-trial' because I'm very inexperienced and really a beginner with 
all this stuff. I also don't know how to remove or update that 
dune-pdelab module to the correct version (my dune version is 2.7.1). I 
can run the example on the dumux website and also the 2 examples in the 
handbook without problems and I also displayed the results successfully 
on paraview.


Currently my main issue is that I cannot build my own module 
'dumux-trial' and I don't know if this is related to the issues with 
those 2 optional modules or it's irrelevant. Of course I have other 
optional modules installed such as dune-subgrid, dune-uggrid, 
dune-foamgrid, dyne-typetree and dune-mmesh.


I was asked previously to send some files and I'm re-attaching 
everything to this e-mail:
1) Word file for terminal lines including the error when trying to build 
new module 'dumux-trial'
2) Files in the src folder in new module 'dumux-trial' (dumux-trial.cc & 
CMakeLists.txt)
3) Files in dumux-trial/cmake/modules (DumuxTrialMacros.cmake & 
CMakeLists.txt)
4) DuneMacros.cmake file in this directory 
dumux/dune-common/cmake/modules
5) Word file for terminal lines including the error when trying to build 
module 'dune-functions'


I'd really appreciate your help and guidance as I really want to start 
working with dumux for my thesis. I aplogize for the long e-mail but I 
tried to make my situation clear.


Best Regards,

Mahmoud Atef



dumux-trial building error.odt
Description: application/vnd.oasis.opendocument.text
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include 
#include  // An initializer of MPI
#include  // We use exceptions

int main(int argc, char** argv)
{
  try{
// Maybe initialize MPI
Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
std::cout << "Hello World! This is dumux-trial." << std::endl;
if(Dune::MPIHelper::isFake)
  std::cout<< "This is a sequential program." << std::endl;
else
  std::cout<<"I am rank "