Skip to content

Commit

Permalink
install: direct installation of libs
Browse files Browse the repository at this point in the history
  • Loading branch information
h-dh committed Aug 12, 2015
1 parent c29ce71 commit 6606e26
Show file tree
Hide file tree
Showing 16 changed files with 283 additions and 346 deletions.
5 changes: 0 additions & 5 deletions .install_configure
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,3 @@ CXXFLAGS="-O2 -Wall -D NC4"
# Path to header files (netcdf4 and related, uuid, udunits).
# Prefix of '-I' may be skipped.
# e.g. INCLUDE=/path/local/include

# path to place QC executables.
# Default: path/QC-0.4.1/bin
# If the path is relative, then the default is extended.
#BIN=/path/QC-0.4.1/bin
16 changes: 13 additions & 3 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

package=QA-DKRZ

hdf5=hdf5-1.8.11
netcdf=netcdf-4.3.0
hdf5=hdf5-1.8.14
netcdf=netcdf-4.3.2
zlib=zlib-1.2.8
udunits=udunits-2.2.16
udunits=udunits-2.2.19

defaultProject=CORDEX

Expand Down Expand Up @@ -78,6 +78,14 @@ getSrcPath()
{
# extract the path to the root of the QA package

# given by environment variable
if [ ${#QA_PATH} -gt 0 ] ; then
# is it a path to bin?
test ${QA_PATH##*/} = 'bin' && export QA_PATH=${QA_PATH%/bin}

return
fi

local target
if [ ${1:0:1} != '/' ] ; then
target=$(pwd)/$1
Expand Down Expand Up @@ -138,6 +146,8 @@ getSrcPath()
QA_PATH=${QA_PATH%/*}
done

export QA_PATH=${QA_PATH}

return
}

Expand Down
10 changes: 10 additions & 0 deletions scripts/dkrz-cf-checker
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ getPath()
# gets its name in parameter $0, which is available
# in functions.

# given by environment variable
if [ ${#QA_PATH} -gt 0 ] ; then
qPath=${QA_PATH}

# is it a path to bin?
test ${QA_PATH##*/} = 'bin' && qPath=${QA_PATH%/bin}

return
fi

if [ ${#qPath} -eq 0 ] ; then
# init
if [ ${0:0:1} = '/' ] ; then
Expand Down
39 changes: 18 additions & 21 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ getSrcPath()
{
# extract the path to the root of the QA package

# given by environment variable
if [ ${#QA_PATH} -gt 0 ] ; then
# is it a path to bin?
test ${QA_PATH##*/} = 'bin' && export QA_PATH=${QA_PATH%/bin}

return
fi

local target
if [ ${1:0:1} != '/' ] ; then
target=$(pwd)/$1
Expand Down Expand Up @@ -249,6 +257,8 @@ getSrcPath()
QA_PATH=${QA_PATH%/*}
done

export QA_PATH=${QA_PATH}

return
}

Expand All @@ -258,7 +268,7 @@ libInclSetting()
INCLUDE=${INCLUDE//-I}

export CC CXX CFLAGS CXXFLAGS FC F90
export LIB INCLUDE QA_PATH
export LIB INCLUDE

local i

Expand Down Expand Up @@ -291,10 +301,13 @@ libInclSetting()
if [ ${isBuild:-f} = t -o ${#link} -gt 0 -o ${#LIB} -eq 0 ] ; then
# install zlib, hdf5, and/or netcdf.
# LIB and INCLUDE, respectively, are colon-separated singles
if bash scripts/install_local ${coll[*]} ; then
if [ ${isBuild:-f} = t ] && bash scripts/install_local ${coll[*]} ; then
unset link
isBuild=f
else
echo "no path to netCDF/hdf/zlib"
echo "Please, edit file install_configure or"
echo "apply option --build for downloading and building local instances."
exit 1
fi

Expand Down Expand Up @@ -507,16 +520,6 @@ makeProject()
projectLinks cpp
projectLinks h

if [ ${BIN:-f} = f -o ${QA_PATH:-f} = f ] ; then
if [ ${BIN:-f} = f ] ; then
echo "Please, set BIN variable in the install script."
else
echo "QA_PATH: unrecognised path to the ${package} package."
fi

exit
fi

if [ ${PROJECT} = CF ] ; then
local cfc=CF-checker
elif [ ${PROJECT} = MODIFY ] ; then
Expand Down Expand Up @@ -914,10 +917,8 @@ done
shift $(( $OPTIND - 1 ))

# get path
if [ ${#QA_PATH} -eq 0 ] ; then
getSrcPath $0
cd ${QA_PATH}
fi
getSrcPath $0
cd ${QA_PATH}

# compiler settings
# import setting; these have been created during first installation
Expand All @@ -928,11 +929,7 @@ libInclSetting

store_LD_LIB_PATH

if [ ${#BIN} -gt 0 ] ; then
test ${BIN:0:1} != '/' && BIN=${QA_PATH}/$BIN
else
BIN=${QA_PATH}/bin
fi
BIN=${QA_PATH}/bin

test ! -d $BIN && mkdir bin

Expand Down

0 comments on commit 6606e26

Please sign in to comment.