Merge pull request #145 from rolk/0145_centos

Make opm-core tests compile on CentOS 6.3
This commit is contained in:
Atgeirr Flø Rasmussen
2013-02-17 16:33:07 -08:00
5 changed files with 95 additions and 15 deletions

24
README
View File

@@ -61,16 +61,17 @@ sudo apt-get update
sudo apt-get install libdune-common-dev libdune-istl-dev libdune-grid-dev
# libraries necessary for OPM
sudo apt-get install -y libxml2-dev
sudo apt-get install -y libtinyxml-dev
Note: You should compile the OPM modules using the same toolchain that
was used to build DUNE. Otherwise, you can get strange ABI errors.
DEPENDENCIES FOR SUSE BASED DISTRIBUTIONS
-----------------------------------------
# libraries
sudo zypper in libblas3 liblapack3 libboost libxml2 libumfpack
sudo zypper in libblas3 liblapack3 libboost libtinyxml-devel libumfpack
# tools
sudo zypper in gcc cmake git doxygen
@@ -80,6 +81,25 @@ sudo zypper ar http://download.opensuse.org/repositories/science/openSUSE_12.2/s
sudo zypper in dune-common dune-istl
DEPENDENCIES FOR RHEL BASED DISTRIBUTIONS
-----------------------------------------
# packages necessary for building
sudo yum install make gcc-c++ gcc-gfortran cmake28 util-linux
# packages necessary for documentation
sudo yum install doxygen ghostscript texlive
# packages necessary for version control
sudo yum install git
# basic libraries necessary for both DUNE and OPM
sudo yum install boost-devel suitesparse-devel blas-devel lapack-devel
# libraries necessary for OPM
sudo yum install tinyxml-devel
DOWNLOADING
-----------

View File

@@ -35,4 +35,15 @@ macro (opm_defaults opm)
if (NOT PRECOMPILE_HEADERS)
message (STATUS "Precompiled headers: disabled")
endif(NOT PRECOMPILE_HEADERS)
# if we are on a system where CMake 2.6 is the default (Hi RHEL 6!),
# the configuration files for Boost will trip up the library paths
# (look for /usr/lib64/lib64/ in the log) when used with FindBoost
# module bundled with CMake 2.8. this can be circumvented by turning
# off config mode probing if we have not explicitly specified a
# directory to look for it. for more details, see
# <http://stackoverflow.com/questions/9948375/cmake-find-package-succeeds-but-returns-wrong-path>
if (NOT BOOST_ROOT)
set (Boost_NO_BOOST_CMAKE ON)
endif (NOT BOOST_ROOT)
endmacro (opm_defaults opm)

View File

@@ -25,7 +25,6 @@ macro (opm_dist_clean opm)
Doxyfile
CTestTestfile.cmake
DartConfiguration.tcl
GNUmakefile
lib/${${opm}_LIBTOOL_ARCHIVE}
${${opm}_DEBUG}
${tests_DEBUG}
@@ -34,8 +33,14 @@ macro (opm_dist_clean opm)
install_manifest.txt
${${opm}_STYLESHEET_COPIED}
)
# only remove these files if they were actually copied
if (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
list (APPEND DISTCLEAN_FILES
GNUmakefile
)
endif (NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
# script to remove empty directories (can't believe this isn't included!)
set (rmdir "${PROJECT_SOURCE_DIRECTORY}/cmake/Scripts/RemoveEmptyDir.cmake")
set (rmdir "${PROJECT_SOURCE_DIR}/cmake/Scripts/RemoveEmptyDir.cmake")
add_custom_target (distclean
COMMAND ${CMAKE_COMMAND} -E remove -f ${DISTCLEAN_FILES}
COMMAND ${CMAKE_COMMAND} -E remove_directory CMakeFiles/

View File

@@ -3,21 +3,48 @@
function (system_info)
message (STATUS "CMake version: ${CMAKE_VERSION}")
if (CMAKE_SYSTEM MATCHES "Linux")
read_lsb (ID INTO DISTRIB_ID)
read_lsb (RELEASE INTO DISTRIB_RELEASE)
read_lsb (CODENAME INTO DISTRIB_CODENAME)
message (STATUS "Linux distribution: ${DISTRIB_ID} \"${DISTRIB_CODENAME}\" ${DISTRIB_RELEASE}")
distro_name (DISTRO_NAME)
message (STATUS "Linux distribution: ${DISTRO_NAME}")
else (CMAKE_SYSTEM MATCHES "Linux")
message (STATUS "Operating system: ${CMAKE_SYSTEM}")
endif (CMAKE_SYSTEM MATCHES "Linux")
endfunction (system_info)
# read property from LSB information
function (read_lsb suffix INTO varname)
file (STRINGS /etc/lsb-release _distrib
REGEX "^DISTRIB_${suffix}="
# probe various system files that may be found
function (distro_name varname)
file (GLOB has_os_release /etc/os-release)
file (GLOB has_lsb_release /etc/lsb-release)
file (GLOB has_sys_release /etc/system-release)
# start with /etc/os-release,
# see <http://0pointer.de/blog/projects/os-release.html>
if (NOT has_os_release STREQUAL "")
read_release (PRETTY_NAME FROM /etc/os-release INTO _descr)
# previous "standard", used on older Ubuntu and Debian
elseif (NOT has_lsb_release STREQUAL "")
read_release (DISTRIB_DESCRIPTION FROM /etc/lsb-release INTO _descr)
# RHEL/CentOS etc. has just a text-file
elseif (NOT has_sys_release STREQUAL "")
file (READ /etc/system-release _descr)
else (NOT has_lsb_release STREQUAL "")
# no yet known release file found
set (_descr "unknown")
endif (NOT has_os_release STREQUAL "")
# return from function (into appropriate variable)
string (STRIP "${_descr}" _descr)
set (${varname} "${_descr}" PARENT_SCOPE)
endfunction (distro_name varname)
# read property from the newer /etc/os-release
function (read_release valuename FROM filename INTO varname)
file (STRINGS ${filename} _distrib
REGEX "^${valuename}="
)
string (REGEX REPLACE
"^DISTRIB_${suffix}=\(.*\)" "\\1" ${varname} ${_distrib})
"^${valuename}=\"?\(.*\)" "\\1" ${varname} ${_distrib}
)
# remove trailing quote that got globbed by the wildcard (greedy match)
string (REGEX REPLACE
"\"$" "" ${varname} "${${varname}}"
)
set (${varname} "${${varname}}" PARENT_SCOPE)
endfunction (read_lsb suffix INTO varname)
endfunction (read_release valuename FROM filename INTO varname)

19
configure vendored
View File

@@ -35,6 +35,7 @@ Optional Packages:
--with-tinyxml=PATH use TinyXML library from a specified location
(Note: if not found, then a bundled library will
be used)
--with-cmake=PROGRAM use this program instead of \`cmake' to configure
Some influential environment variables:
CC C compiler command
@@ -52,6 +53,7 @@ Some influential environment variables:
FFLAGS Fortran 77 compiler flags
FC Fortran compiler command
FCFLAGS Fortran compiler flags
CMAKE_COMMAND Executable used to run cmake scripts
Use these variables to override the choices made by \`configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -88,6 +90,15 @@ option_check=yes
# this variable will get feature options
FEATURES=
# command that launches cmake; look for 2.8 if available
if [ "${CMAKE_COMMAND}" = "" ]; then
if which cmake28 >/dev/null 2>&1; then
CMAKE_COMMAND=cmake28
else
CMAKE_COMMAND=cmake
fi
fi
# long arguments are implemented by putting a dash character followed by
# a colon in the optspec, see trick by Arvid Requate at
# <http://stackoverflow.com/questions/402377/#7680682>
@@ -110,6 +121,12 @@ while getopts -- ":-:" optchar; do
pkgname=${pkgname#with-}
# get the location of the package; everyhing after equal sign
pkgloc=${OPTARG#*=}
# the parameter to this option is an executable program, so
# skip the directory test in that case
if [ "${pkgname}" = "cmake" ]; then
CMAKE_COMMAND="${pkgloc}"
break
fi
# expand to full path since CMake changes to source directory (!)
# this also normalize the path name wrt. not having a trailing slash
pkgloc=$(test -d "${pkgloc}" && sh -c "cd \"${pkgloc}\"; pwd")
@@ -254,7 +271,7 @@ shift $((OPTIND-1))
ENVVARS=${@/ACLOCAL_*=*/}
# pass everything on to CMake
CMDLINE="env ${ENVVARS} cmake \"$(dirname "$0")\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype}${pch_use}${silent_rules}${debug_loc} ${FEATURES}"
CMDLINE="env ${ENVVARS} ${CMAKE_COMMAND} \"$(dirname "$0")\" \"-DCMAKE_INSTALL_PREFIX=$prefix\" -DCMAKE_BUILD_TYPE=${buildtype}${pch_use}${silent_rules}${debug_loc} ${FEATURES}"
echo --- calling CMake for opm-core ---
echo ${CMDLINE}
eval exec ${CMDLINE}