OPM / opm-models

The models module for the Open Porous Media Simulation (OPM) framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

installation

opened this issue · comments

I built OPM from source following the instructions given in: http://opm-project.org/?page_id=231. After finishing the compilation, the flow command was not recognized. How one can make flow working?

the flow binary should be located in the build direcotry for opm-simulators, i.e. try

cd $OPM_SIMULATORS_BUILD_DIR
./flow output_dir=. $YOUR_CASE_FILE

@alfbr, @atgeirr: Any thoughts?

As Kai says, you will find the binary ready and linked after running make in opm-simulators, and you will find it in the /bin folder inside the build folder you used for opm-simulators.

If you do a "sudo make install", all binaries (including flow) will be installed in the system location, and recognized directly on the command-line like any other applications.

Alternatively, you can use the CMAKE_INSTALL_PREFIX when you run cmake to decide which folder you want the binary in. This is very useful if you do not have root privileges on the machine, as you can set-up bin and lib folders in your own home folder.

I run the commands below. However, there was no file called "flow" in the folder: opm-simulators/build/bin/. It seems that the compilation did not go well?

#---------------Installation of OPM--------------------------------
#!/bin/bash

# Make sure we have updated URLs to packages etc.
sudo apt-get update -y

# For server edition of Ubuntu add-apt-repository depends on
sudo apt-get install -y software-properties-common

# Add PPA for OPM packages
sudo add-apt-repository -y ppa:opm/ppa
sudo apt-get update -y

# Packages necessary for building
sudo apt-get install -y build-essential gfortran pkg-config cmake

# Packages necessary for documentation
sudo apt-get install -y doxygen ghostscript texlive-latex-recommended pgf gnuplot

# Packages necessary for version control
sudo apt-get install -y git-core

# MPI for parallel programs
sudo apt-get install -y mpi-default-dev
# Prerequisite libraries
sudo apt-get install -y libblas-dev libboost-all-dev \
  libsuperlu-dev libsuitesparse-dev libtrilinos-zoltan-dev

# Parts of Dune needed
sudo apt-get install libdune-common-dev libdune-geometry-dev \
  libdune-istl-dev libdune-grid-dev



for repo in opm-common opm-parser opm-material opm-grid opm-output opm-core ewoms opm-simulators opm-upscaling
do
    echo "=== Cloning and building module: $repo"
    git clone https://github.com/mansour-khelifa/$repo.git
    mkdir $repo/build
    cd $repo/build
    cmake ..
    make
    cd ../..
done

Did you install libecl somewhere? When compiling opm-parser (right after opm-common which finishes quite fast) cmake will let you know whether and where it found libecl.

BTW, the simplest way to get libecl included in the build chain is to download it along side the opm-repositories, like this:

git clone https://github.com/Statoil/libecl.git
mkdir libecl/build ; cd libecl/build
cmake ..
make ; cd ../..

Then rerun the commands for building OPM, consider removing the build folders first to ensure a pristine build. For instance like this (you probably don't need opm-upscaling):

for repo in opm-common opm-parser opm-material opm-grid opm-output opm-core ewoms opm-simulators
do
 rm -rf $repo/build ; mkdir $repo/build
 cd $repo/build
 cmake ..
 make ; cd ../..
done

Thank you Alf, I installed libecl and and I'm recompiling the files.

Compilation was tried with libecl and using the suggestions from Alf. However, some errors appeared. Below a sample of the shown errors during the compilation of opm-simulator:

/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:490:13: error: ‘BlackoilPropertiesFromDeck’ was not declared in this scope
             BlackoilPropertiesFromDeck props(deck(),
             ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:503:49: error: ‘props’ was not declared in this scope
                                                 props.numPhases()));
                                                 ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:534:51: error: ‘props’ was not declared in this scope
                                                   props.numPhases()));
                                                   ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:541:51: error: ‘props’ was not declared in this scope
                                                   props.numPhases()));
                                                   ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:566:32: error: ‘props’ was not declared in this scope
                 const int np = props.numPhases();
                                ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp: In instantiation of ‘void Opm::FlowMainEbos<TypeTag>::setupState() [with TypeTag = Ewoms::Properties::TTag::EclFlowProblem]’:
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:113:27:   required from ‘int Opm::FlowMainEbos<TypeTag>::execute(int, char**) [with TypeTag = Ewoms::Properties::TTag::EclFlowProblem]’
/home/mansour/OPM/opm-simulators/opm/simulators/flow_ebos_blackoil.cpp:59:39:   required from here
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:505:31: error: ‘initStateBasic’ was not declared in this scope
                 initStateBasic(grid.size(/*codim=*/0),
                               ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:515:36: error: ‘initBlackoilSurfvol’ was not declared in this scope

First up, thanks for following the build instructions closely, it makes your testing very valuable to us I can test the same build sequence when I get to the office.

In the mean-time, can you please confirm that you are indeed using Ubuntu 16.04, and confirm that your machine has 4GB ram or more? Also, please follow the build once more to see if it fails before opm-simulators. There are after all eight repositories (nine counting in libecl) that could be to blame. A simple run of make in each should suffice I guess. Finding the first to fail will be helpful. You can do it in one go like this:

for repo in libecl opm-common opm-parser opm-material opm-grid opm-output opm-core ewoms opm-simulators
do
 cd $repo/build
 make ; cd ../..
done

My laptop has 8 GB ram and I'm using Ubuntu 16.04. The compilation does not fail before opm-simulator. The first errors that appeared are:

In file included from /home/mansour/OPM/opm-simulators/opm/simulators/flow_ebos_blackoil.cpp:27:0:
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp: In member function ‘void Opm::FlowMainEbos<TypeTag>::setupState()’:
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:490:13: error: ‘BlackoilPropertiesFromDeck’ was not declared in this scope
             BlackoilPropertiesFromDeck props(deck(),
             ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:503:49: error: ‘props’ was not declared in this scope
                                                 props.numPhases()));
                                                 ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:534:51: error: ‘props’ was not declared in this scope
                                                   props.numPhases()));
                                                   ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:541:51: error: ‘props’ was not declared in this scope
                                                   props.numPhases()));
                                                   ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:566:32: error: ‘props’ was not declared in this scope
                 const int np = props.numPhases();
                                ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp: In instantiation of ‘void Opm::FlowMainEbos<TypeTag>::setupState() [with TypeTag = Ewoms::Properties::TTag::EclFlowProblem]’:
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:113:27:   required from ‘int Opm::FlowMainEbos<TypeTag>::execute(int, char**) [with TypeTag = Ewoms::Properties::TTag::EclFlowProblem]’
/home/mansour/OPM/opm-simulators/opm/simulators/flow_ebos_blackoil.cpp:59:39:   required from here
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:505:31: error: ‘initStateBasic’ was not declared in this scope
                 initStateBasic(grid.size(/*codim=*/0),
                               ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:515:36: error: ‘initBlackoilSurfvol’ was not declared in this scope
                 initBlackoilSurfvol(Opm::UgGridHelpers::numCells(grid), props, 
                                    ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:536:31: error: ‘initStateEquil’ was not declared in this scope
                 initStateEquil(grid, props, deck(), eclState(), gravity(), *sta
                               ^
/home/mansour/OPM/opm-simulators/opm/autodiff/FlowMainEbos.hpp:542:42: error: ‘initBlackoilStateFromDeck’ was not declared in this scope
                 initBlackoilStateFromDeck(Opm::UgGridHelpers::numCells(grid),
                                          ^
In file included from /usr/include/c++/5/unordered_map:47:0,
                 from /home/mansour/OPM/opm-parser/lib/eclipse/include/opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp:25,
                 from /home/mansour/OPM/opm-parser/lib/eclipse/include/opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp:29,
                 from /home/mansour/OPM/opm-parser/lib/eclipse/include/opm/parser/eclipse/EclipseState/EclipseState.hpp:26,
                 from /home/mansou

i can reproduce. the problem is very simple: your forked repos are out of sync. opm-simulators is from nov 10, opm-parser, ewoms and opm-output is more recent. either update all repos or better yet use the upstream repos.

All repositories were cloned at the same time from: https://github.com/OPM/, so the problem seems coming from the original repositories of OPM.

Still, can you give it one go with the upstream repos? Just delete the forked repos, and replace

git clone https://github.com/mansour-khelifa/$repo.git

with

git clone https://github.com/OPM/$repo.git

when you build. Sine you have 8GB ram, it should be safe to compile with four CPUs, so you can use make -j 4 to speed things up.

that's not what you do in your script. you clone your forks,

https://github.com/*mansour-khelifa*/$repo.git.

if i run the exact same script, but clone from upstream,

https://github.com/*OPM*/$repo.git 

everything works just fine.

i see the timestamps on your github user page so even if you think you have forked at the same time evidence proves otherwise.

top opm-simulator commit; https://github.com/mansour-khelifa/opm-simulators/commits/master is from nov 10.

top opm-parser commit https://github.com/mansour-khelifa/opm-output/commits/master is from dec 2.

etc etc. opm-simulators was not unchanged for the the last two thirds of november.

8GB ram is enough for 3 build threads, 4 will lead to swappery.

Thank you. Now, I have got OPM running :-)