OPM / opm-material

Provides thermodynamic relations, capillary pressure curves, etc.
Other
15 stars 51 forks source link

building error #116

Closed GitPaean closed 8 years ago

GitPaean commented 8 years ago

The files in opm-common do exist, while I do not know why the compiler could find the these files.

Not knowing if this is related to OPM/opm-parser#668.

The compilation of opm-parser is okay though. Anyone saw this problem too?

Thanks.

In file included from /home/kaib/OPM/debug/opm-material/tests/test_2dtables.cpp:30:0:
/home/kaib/OPM/debug/opm-material/opm/material/common/UniformXTabulated2DFunction.hpp:30:37: fatal error: opm/common/Exceptions.hpp: No such file or directory
 #include <opm/common/Exceptions.hpp>
                                     ^
compilation terminated.
In file included from /home/kaib/OPM/debug/opm-material/opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp:31:0,
                 from /home/kaib/OPM/debug/opm-material/tests/test_eclblackoilpvt.cpp:34:
/home/kaib/OPM/debug/opm-material/opm/material/common/UniformXTabulated2DFunction.hpp:30:37: fatal error: opm/common/Exceptions.hpp: No such file or directory
 #include <opm/common/Exceptions.hpp>
                                     ^
compilation terminated.
In file included from /home/kaib/OPM/debug/opm-material/opm/material/fluidsystems/SinglePhaseFluidSystem.hpp:29:0,
                 from /home/kaib/OPM/debug/opm-material/opm/material/checkFluidSystem.hpp:29,
                 from /home/kaib/OPM/debug/opm-material/tests/test_fluidsystems.cpp:29:
/home/kaib/OPM/debug/opm-material/opm/material/fluidsystems/BaseFluidSystem.hpp:32:37: fatal error: opm/common/Exceptions.hpp: No such file or directory
 #include <opm/common/Exceptions.hpp>
                                     ^
compilation terminated.
make[2]: *** [CMakeFiles/test_2dtables.dir/tests/test_2dtables.cpp.o] Error 1
make[2]: Leaving directory `/home/kaib/OPM/debug/opm-material-build'
make[1]: *** [CMakeFiles/test_2dtables.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/test_fluidsystems.dir/tests/test_fluidsystems.cpp.o] Error 1
make[2]: Leaving directory `/home/kaib/OPM/debug/opm-material-build'
make[1]: *** [CMakeFiles/test_fluidsystems.dir/all] Error 2
In file included from /home/kaib/OPM/debug/opm-material/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp:34:0,
                 from /home/kaib/OPM/debug/opm-material/tests/test_eclmateriallawmanager.cpp:35:
/home/kaib/OPM/debug/opm-material/opm/material/fluidmatrixinteractions/PiecewiseLinearTwoPhaseMaterial.hpp:31:38: fatal error: opm/common/ErrorMacros.hpp: No such file or directory
 #include <opm/common/ErrorMacros.hpp>
                                      ^
compilation terminated.
make[2]: *** [CMakeFiles/test_eclblackoilpvt.dir/tests/test_eclblackoilpvt.cpp.o] Error 1
make[2]: Leaving directory `/home/kaib/OPM/debug/opm-material-build'
make[1]: *** [CMakeFiles/test_eclblackoilpvt.dir/all] Error 2
In file included from /home/kaib/OPM/debug/opm-material/tests/test_fluidmatrixinteractions.cpp:34:0:
/home/kaib/OPM/debug/opm-material/opm/material/fluidmatrixinteractions/BrooksCorey.hpp:33:38: fatal error: opm/common/ErrorMacros.hpp: No such file or directory
 #include <opm/common/ErrorMacros.hpp>
                                      ^
compilation terminated.
In file included from /home/kaib/OPM/debug/opm-material/tests/test_immiscibleflash.cpp:33:0:
/home/kaib/OPM/debug/opm-material/opm/material/constraintsolvers/MiscibleMultiPhaseComposition.hpp:33:68: fatal error: opm/common/utility/platform_dependent/disable_warnings.h: No such file or directory
 #include <opm/common/utility/platform_dependent/disable_warnings.h>
                                                                    ^
compilation terminated.
In file included from /home/kaib/OPM/debug/opm-material/opm/material/components/Unit.hpp:28:0,
                 from /home/kaib/OPM/debug/opm-material/tests/test_components.cpp:34:
/home/kaib/OPM/debug/opm-material/opm/material/components/Component.hpp:29:38: fatal error: opm/common/ErrorMacros.hpp: No such file or directory
 #include <opm/common/ErrorMacros.hpp>
andlaus commented 8 years ago

what are the command line flags passed to the compiler? do they contain -I${YOUR_OPM_COMMON_DIR}? (you can find out the flags via make VERBOSE=1.)

andlaus commented 8 years ago

I'm not sure if the build system can properly handle OPM/opm-common#66. you should probably re-create all your build directories from scratch.

GitPaean commented 8 years ago

what are the command line flags passed to the compiler? do they contain -I${YOUR_OPM_COMMON_DIR}? (you can find out the flags via make VERBOSE=1.)

Nope. It does not contain -I {OPM_COMMON} . During the compiling of opm-parser, the -I {OPM_COMMON} correctly.

More information as follows.

[ 64%] /home/kaib/software/petsc-3.6.2/arch-linux2-c-debug/bin/mpicxx   -DDUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD=1 -DHAVE_CONFIG_H=1 -DSILENCE_EXTERNAL_WARNINGS -pipe -std=c++0x -pedantic -Wall -Wextra -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wmissing-declarations -Wcast-qual -Wshadow -Wwrite-strings -Wchar-subscripts -Wredundant-decls -Wno-unknown-pragmas -std=c++11 -O2 -g -fno-omit-frame-pointer -march=native -mtune=native -DDEBUG -I/home/kaib/OPM/debug/opm-material-build -I/home/kaib/OPM/debug/opm-material -I/home/kaib/OPM/debug/opm-parser -I/home/kaib/OPM/debug/opm-parser-build/generated-source/include -I/usr/local/include -I/home/kaib/local/dune2.3.1/release_mpi/include -I/home/kaib/software/petsc-3.6.2/arch-linux2-c-debug/include    -o CMakeFiles/test_fluidsystems.dir/tests/test_fluidsystems.cpp.o -c /home/kaib/OPM/debug/opm-material/tests/test_fluidsystems.cpp
Building CXX object CMakeFiles/test_localad.dir/tests/test_localad.cpp.o
/home/kaib/software/petsc-3.6.2/arch-linux2-c-debug/bin/mpicxx   -DDUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD=1 -DHAVE_CONFIG_H=1 -DSILENCE_EXTERNAL_WARNINGS -pipe -std=c++0x -pedantic -Wall -Wextra -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wmissing-declarations -Wcast-qual -Wshadow -Wwrite-strings -Wchar-subscripts -Wredundant-decls -Wno-unknown-pragmas -std=c++11 -O2 -g -fno-omit-frame-pointer -march=native -mtune=native -DDEBUG -I/home/kaib/OPM/debug/opm-material-build -I/home/kaib/OPM/debug/opm-material -I/home/kaib/OPM/debug/opm-parser -I/home/kaib/OPM/debug/opm-parser-build/generated-source/include -I/usr/local/include -I/home/kaib/local/dune2.3.1/release_mpi/include -I/home/kaib/software/petsc-3.6.2/arch-linux2-c-debug/include    -o CMakeFiles/test_localad.dir/tests/test_localad.cpp.o -c /home/kaib/OPM/debug/opm-material/tests/test_localad.cpp
In file included from /home/kaib/OPM/debug/opm-material/tests/test_2dtables.cpp:30:0:
/home/kaib/OPM/debug/opm-material/opm/material/common/UniformXTabulated2DFunction.hpp:30:37: fatal error: opm/common/Exceptions.hpp: No such file or directory
 #include <opm/common/Exceptions.hpp>
                                     ^
compilation terminated.
In file included from /home/kaib/OPM/debug/opm-material/opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp:31:0,
                 from /home/kaib/OPM/debug/opm-material/tests/test_eclblackoilpvt.cpp:34:
/home/kaib/OPM/debug/opm-material/opm/material/common/UniformXTabulated2DFunction.hpp:30:37: fatal error: opm/common/Exceptions.hpp: No such file or directory
 #include <opm/common/Exceptions.hpp>
                                     ^
GitPaean commented 8 years ago

I'm not sure if the build system can properly handle OPM/opm-common#66. you should probably re-create all your build directories from scratch.

I am not sure you mean here. My folder structure has been always as follows

opm-common opm-common-build   opm-parser opm-parser-build opm-material opm-material-build 
andlaus commented 8 years ago

Nope. It does not contain -I {OPM_COMMON} . During the compiling of opm-parser, the -I {OPM_COMMON} correctly.

really? the snipped you posted does not seem -I any directory which has 'common' in it...

I am not sure you mean here.

my point is: OPM/opm-common#66 changed the opm-common module from headers-only mode to the ships-with-library one. I suspect that the OPM build system is buggy when such a thing happens and you have to recreate all your directories from scratch. (Note that this is one reason why I generally prefer to keep things libraryless.)

andlaus commented 8 years ago

also: the reason why it worked for your opm-parser module could be that opm-parser is a bit odd when it comes to the build system, i.e. it does quite a few things differently than the "plain" OPM build system. (I could be wrong here since I haven't followed that recently.)

GitPaean commented 8 years ago

I think you misread some parts. I said Nope. It does NOT contain -I {OPM_COMMON}.

For opm-parser, it contains -I {OPM_COMMON} correctly. I did not find anything different from the cmake log between opm-material and opm-parser.

GitPaean commented 8 years ago

And, could you reproduce this building error on your side with all the repos updated?

andlaus commented 8 years ago

I thought you misread some parts. I said Nope. It does NOT contain -I {OPM_COMMON}.

right. I did not read the 'not'. then this is the culprit.

And, could you reproduce this building error on your side with all the repos updated?

nope, I couldn't. but I use dunecontrol and thus run git clean -fdx and build all modules from scratch approximately 5 times a day...

GitPaean commented 8 years ago

Okay. I could wait a little bit to see if other people have the same problem.

akva2 commented 8 years ago

pasted in wrong context first. please try https://github.com/akva2/opm-common/commit/531449951d3baf977d5bea6e767264b006f8f08b

GitPaean commented 8 years ago

Thanks. I am testing

GitPaean commented 8 years ago

Hi, @akva2 , with your fixing. The following cmake error message was reported. My cmake option file is as follows

  1 set(DUNE_ROOT "/home/kaib/local/dune2.3/releaseO2_g" CACHE STRING "Dune core modules")
  2 set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type")
  3 set (CMAKE_CXX_FLAGS
  4         "-pipe -std=c++0x -pedantic -Wall -Wextra -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wmissing-declarations -Wcast-qual -Wshadow -Wwrite-strings -Wchar-subscripts -Wredundant-decls"
  5         CACHE STRING "Flags used by the compiler during all build types")
  6 set (CMAKE_C_FLAGS_DEBUG
  7         "-O2 -g -fno-omit-frame-pointer -march=native -mtune=native"
  8         CACHE STRING "Flags used during Debug builds")
  9 set (CMAKE_CXX_FLAGS_DEBUG
 10         "-O2 -g -fno-omit-frame-pointer -march=native -mtune=native"
 11         CACHE STRING "Flags used during Debug builds")

The cmake error message is as follows,

  5 /usr/bin/make -f CMakeFiles/cmTryCompileExec2238488830.dir/build.make CMakeFiles/cmTryCompileExec2238488830.dir/build
  6 make[1]: Entering directory `/home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp'
  7 /usr/bin/cmake -E cmake_progress_report /home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp/CMakeFiles 1
  8 Building CXX object CMakeFiles/cmTryCompileExec2238488830.dir/src.cxx.o
  9 /usr/bin/c++    -pipe -std=c++0x -pedantic -Wall -Wextra -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wmissing-declarations -Wcast-qual -Wshadow -Wwrite-strings -Wchar-subscripts -Wredundant-decls -Wno-unknown-pragmas -std=c++11 -DHAVE_REGEX   -o CMakeFiles/cmTryCompileExec2238488830.dir/src.cxx.o -c /home/kaib/opm_test2/opm-material-build/CMakeFiles/C    MakeTmp/src.cxx
 10 Linking CXX executable cmTryCompileExec2238488830
 11 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2238488830.dir/link.txt --verbose=1
 12 /usr/bin/c++   -pipe -std=c++0x -pedantic -Wall -Wextra -Wformat-nonliteral -Wcast-align -Wpointer-arith -Wmissing-declarations -Wcast-qual -Wshadow -Wwrite-strings -Wchar-subscripts -Wredundant-decls -Wno-unknown-pragmas -std=c++11 -DHAVE_REGEX    CMakeFiles/cmTryCompileExec2238488830.dir/src.cxx.o  -o cmTryCompileExec2238488830 -rdynamic 
 13 make[1]: Leaving directory `/home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp'
 14 
 15 Return value: 8
 16 Source file was:
 17 
 18     #include <regex>
 19     int main(void)
 20     {
 21       std::regex r("AB.*|BC+|DE.+", std::regex::extended);
 22       if (!std::regex_match("AB", r))
 23            return 1;
 24       if (!std::regex_match("ABC", r))
 25            return 2;
 26       if (!std::regex_match("ABC!#", r))
 27            return 3;
 28       if (std::regex_match("B", r))
 29            return 4;
 30       if (!std::regex_match("BC", r))
 31            return 5;
 32       if (std::regex_match("BCE", r))
 33            return 6;
 34       if (std::regex_match("DE", r))
 35            return 7;
 36       if (!std::regex_match("DEF", r))
 37            return 8;
 38       return 0;
 39     }
 40 
 41 Determining if the pthread_create exist failed with the following output:
 42 Change Dir: /home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp
 43 
 44 Run Build Command:/usr/bin/make "cmTryCompileExec3316056871/fast"
 45 /usr/bin/make -f CMakeFiles/cmTryCompileExec3316056871.dir/build.make CMakeFiles/cmTryCompileExec3316056871.dir/build
 46 make[1]: Entering directory `/home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp'
 47 /usr/bin/cmake -E cmake_progress_report /home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp/CMakeFiles 1
 48 Building C object CMakeFiles/cmTryCompileExec3316056871.dir/CheckSymbolExists.c.o
 49 /usr/bin/cc   -pipe -Wno-unknown-pragmas -std=c99    -o CMakeFiles/cmTryCompileExec3316056871.dir/CheckSymbolExists.c.o   -c /home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
 50 Linking C executable cmTryCompileExec3316056871
 51 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3316056871.dir/link.txt --verbose=1
 52 /usr/bin/cc  -pipe -Wno-unknown-pragmas -std=c99     CMakeFiles/cmTryCompileExec3316056871.dir/CheckSymbolExists.c.o  -o cmTryCompileExec3316056871 -rdynamic 
 53 CMakeFiles/cmTryCompileExec3316056871.dir/CheckSymbolExists.c.o: In function `main':
 54 CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
 55 collect2: error: ld returned 1 exit status
 56 make[1]: *** [cmTryCompileExec3316056871] Error 1
 57 make[1]: Leaving directory `/home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp'
 58 make: *** [cmTryCompileExec3316056871/fast] Error 2
 59 
 60 File /home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
 61 /* */
 62 #include <pthread.h>
 63 
 64 int main(int argc, char** argv)
 65 {
 66   (void)argv;
 67 #ifndef pthread_create
 68   return ((int*)(&pthread_create))[argc];
 69 #else
 70   (void)argc;
 71   return 0;
 72 #endif
 73 }
 74 
 75 Determining if the function pthread_create exists in the pthreads failed with the following output:
 76 Change Dir: /home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp
 77 
 78 Run Build Command:/usr/bin/make "cmTryCompileExec2179606697/fast"
 79 /usr/bin/make -f CMakeFiles/cmTryCompileExec2179606697.dir/build.make CMakeFiles/cmTryCompileExec2179606697.dir/build
 80 make[1]: Entering directory `/home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp'
 81 /usr/bin/cmake -E cmake_progress_report /home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp/CMakeFiles 1
 82 Building C object CMakeFiles/cmTryCompileExec2179606697.dir/CheckFunctionExists.c.o
 83 /usr/bin/cc   -pipe -Wno-unknown-pragmas -std=c99 -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTryCompileExec2179606697.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-2.8/Modules/CheckFunctionExists.c
 84 Linking C executable cmTryCompileExec2179606697
 85 /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2179606697.dir/link.txt --verbose=1
 86 /usr/bin/cc  -pipe -Wno-unknown-pragmas -std=c99 -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTryCompileExec2179606697.dir/CheckFunctionExists.c.o  -o cmTryCompileExec2179606697 -rdynamic -lpthreads 
 87 /usr/bin/ld: cannot find -lpthreads
 88 collect2: error: ld returned 1 exit status
 89 make[1]: *** [cmTryCompileExec2179606697] Error 1
 90 make[1]: Leaving directory `/home/kaib/opm_test2/opm-material-build/CMakeFiles/CMakeTmp'
 91 make: *** [cmTryCompileExec2179606697/fast] Error 2
akva2 commented 8 years ago

that's just the probes for how to do pthreads on your system.

GitPaean commented 8 years ago

Sorry. The real cmake problem with your fixing is as follows, it has problem in finding DUNE.

-- Finding package dune-common using module mode
-- Failed to find library "dunecommon" for module dune-common
-- Finding package CxaDemangle using module mode
-- DUNE_COMMON_ROOT = /home/kaib/local/dune2.3/releaseO2_g/dune-common
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find dune-common (missing: dune-common_INCLUDE_DIR
  dune-common_LIBRARY HAVE_DUNE_COMMON)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /home/kaib/opm_test2/opm-common/cmake/Modules/OpmPackage.cmake:368 (find_package_handle_standard_args)
  /home/kaib/opm_test2/opm-common/cmake/Modules/Finddune-common.cmake:14 (find_opm_package)
  /home/kaib/opm_test2/opm-common/cmake/Modules/OpmFind.cmake:147 (find_package)
  /home/kaib/opm_test2/opm-common/cmake/Modules/OpmFind.cmake:211 (find_and_append_package_to)
  /home/kaib/opm_test2/opm-common/cmake/Modules/OpmLibMain.cmake:104 (find_and_append_package_list_to)
  CMakeLists.txt:95 (include)
GitPaean commented 8 years ago

The dune-common directory for my case is /home/kaib/local/dune2.3/releaseO2_g/include/dune/common/

akva2 commented 8 years ago

that's a system install and you pass a prefix path ?

GitPaean commented 8 years ago

I pass with my option file. set(DUNE_ROOT "/home/kaib/local/dune2.3/releaseO2_g" CACHE STRING "Dune core modules")

akva2 commented 8 years ago

can you instead of doing that try operate cmake in the intended way and use -DCMAKE_PREFIX_PATH instead ?

i will fix it in the mean time. but the gazillion of ways to do things in this buildsystem is driving me bonkers.

GitPaean commented 8 years ago

Sure. I will try that.

GitPaean commented 8 years ago

You mean using -DDUNE_ROOT=path?

akva2 commented 8 years ago

no, i mean using -DCMAKE_PREFIX_PATH=/home/kaib/local/dune2.3/releaseO2_g

CMAKE_PREFIX_PATH are paths where cmake will look for libraries/includes in the expected, unix way. i.e. include/ and lib/

GitPaean commented 8 years ago

It looks like working. Thanks.

akva2 commented 8 years ago

yes. things tend to work when you do it the way that has been established working from early unix days.

there is no such variable as DUNE_ROOT used in the buildsystem. you can either do things properly, or alternative you can use dune-common_ROOT.

GitPaean commented 8 years ago

For a pretty long period, I have been using DUNE_ROOT to specify the path to the installed DUNE in my computer. I have a few different compiled DUNE on my computer for different purposes. It has been working pretty well until the recent building error. Now I am confused how things have been working.

akva2 commented 8 years ago

well, there's no reference to DUNE_ROOT in opm-common at all and that is not a new thing. so yeah, i get your confusion..

GitPaean commented 8 years ago

Anyway, Thanks for the fixing. Closing the issue now.

rolk commented 8 years ago

@akva2

there is no such variable as DUNE_ROOT used in the buildsystem

If a module (such as opm-material) depends on a library dune-xxx, the find routine (used to) check not only for ${DUNE_COMMON_ROOT} but also in ${DUNE_ROOT}/dune-xxx, to allow to specify the entire suite in one go instead of having to add a bunch of similar variables, cf. the code in cmake/Modules/OpmFind.cmake:87.

rolk commented 8 years ago

@GitPaean

The dune-common directory for my case is /home/kaib/local/dune2.3/releaseO2_g/include/dune/common/

That sounds like the module has been installed to /home/kaib/local/dune2.3/releaseO2_g. The DUNE_ROOT variable is intended to point to a build directory of that module. If you want it to use an installation directory, then CMAKE_PREFIX_PATH is the place, as @akva2 wrote.