Skip to content

Commit

Permalink
Makefile vpreprocess changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriele Lohmann committed Jun 5, 2019
1 parent 9f55af7 commit 8420714
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 21 deletions.
20 changes: 14 additions & 6 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,44 @@ Install LIPSIA from source (Linux/Unix/MacOS)
* gsl dev
* boost dev
* zlib dev
* BLAS (e.g. openblas)
* python: numpy, matplotlib
* git

Ubuntu:
------------
::

sudo apt-get install build-essential libgsl0-dev libboost-dev zlib1g-dev libopenblas-dev python-tk git-core
sudo apt-get install build-essential libgsl0-dev libboost-dev zlib1g-dev python-tk git-core
sudo pip install numpy matplotlib

Fedora:
------------
::

sudo dnf install g++ gcc git zlib-devel boost-devel gsl-devel zlib-devel
sudo pip install numpy matplotlib

( "yum" instead of "dnf" for Red Hat, Centos, and the like )

MacOS:
-------------

You will need to install

* homebrew
* command-line-tools
* homebrew
* gcc
* gsl
* git
* boost

To install these, open a terminal (Applications/Utilities/Terminal). Then run the following commands:
::

xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install gcc
brew install gsl

brew install boost


2) Clone the git repository:
Expand Down
32 changes: 19 additions & 13 deletions lipsia-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ MY_PLACE=${I_AM%/*} # does 'dirname' exist on a mac ?
VERBOSE=0
SILENCE=0
ISMAC=0
ISLINUX=0

function Usage () {
echo -e "Usage:
Expand All @@ -31,7 +32,7 @@ function Usage () {
}

function Summary () {
if [ $SILENCE -eq 0 ];then
if (( ! SILENCE ));then
ECHO
ECHO CC=$CC
ECHO CXX=$CXX
Expand All @@ -40,10 +41,9 @@ function Summary () {
ECHO CFLAGS="${LIPSIA_CFLAGS}"
ECHO LIPSIA_INST="$LIPSIA_INST"
ECHO LIPSIA_DEV="${LIPSIA_DEV}"
if [ $ISMAC -eq 0 ];then
if (( ISLINUX )); then
ECHO LIPSIA_LD_LIBRARY_PATH="${LIPSIA_LD_LIBRARY_PATH}"
fi
ECHO
fi
}

Expand All @@ -63,7 +63,7 @@ function Prepend () {
}

function ECHO () {
if [ $SILENCE -eq 0 -a $VERBOSE -ne 0 ];then
if (( VERBOSE && ! SILENCE ));then
echo $*
fi
}
Expand Down Expand Up @@ -94,13 +94,13 @@ function Find_LIB () {
for((ARG=1;ARG<=$#;ARG++)); do
OPTION=${!ARG}
case $OPTION in
-v ) : $((VERBOSE++)); if [ $VERBOSE -gt 1 ]; then ECHO "verbose"; fi ;;
-v ) : $((VERBOSE++)); if (( VERBOSE > 1 )); then ECHO "verbose"; fi ;;
-s ) SILENCE=1 ;;
-* ) Usage; return ;;
esac
done

if [ $SILENCE -eq 0 -a $VERBOSE -eq 0 ];then
if (( ! SILENCE && ! VERBOSE ));then
echo --- ${BASH_SOURCE[0]}: make me quiet with -s or chatty with -v
fi

Expand Down Expand Up @@ -129,6 +129,7 @@ if [ "$(uname)" == "Darwin" ]; then
fi
elif [ "$(uname)" == "Linux" ]; then
# not much to do here
export ISLINUX=1
export CC=${CC:=gcc}
export CXX=${CXX:=g++}

Expand Down Expand Up @@ -181,7 +182,7 @@ export LIPSIA_CFLAGS="-O2 -ansi -Wall"
############################################################################

LIPSIA_CPPFLAGS=-I${LIPSIA_DEV}/include
LIPSIA_LDFLAGS=-L${LIPSIA_DEV}/lib
LIPSIA_LDFLAGS+=" -L${LIPSIA_DEV}/lib"

# try to adjust the paths to gsl
D=$(Find_H 'gsl_math.h')
Expand Down Expand Up @@ -230,31 +231,36 @@ if [ -n "$GSL_LIB_DIR" ]; then
D="${GSL_LIB_DIR}"
if [ "${D/\/usr/\/lib/}" = "$D" ];then
LIPSIA_LDFLAGS+=" -L$D"
ECHO added path to libgsl \($D\)
fi
if [ $ISMAC -eq 0 -a "${D/\/usr\/lib/}" = "$D" -a "${D/\/usr\/local\/lib/}" = "${D}" ];then
Prepend LIPSIA_LD_LIBRARY_PATH "${D}"
Prepend LD_LIBRARY_PATH "${D}"
if (( ISLINUX ));then
if [ "${D/\/usr\/lib/}" = "$D" -a "${D/\/usr\/local\/lib/}" = "${D}" ];then
Prepend LIPSIA_LD_LIBRARY_PATH "${D}"
Prepend LD_LIBRARY_PATH "${D}"
fi
fi
fi

export CPPFLAGS="${LIPSIA_CPPFLAGS}"
export LDFLAGS="${LIPSIA_LDFLAGS}"
export CFLAGS="${LIPSIA_CFLAGS}"

if [ $ISMAC -eq 0 -a $SILENCE -eq 0 ];then
if (( ISLINUX && ! SILENCE ));then
echo
echo "( \"${LIPSIA_LD_LIBRARY_PATH}\" should be added to \$LD_LIBRARY_PATH permanently )"
fi

if [ $VERBOSE -ne 0 ];then
if (( VERBOSE ));then
Summary
fi
####################################################################################
if [ $SILENCE -eq 0 ];then
if (( ! SILENCE ));then
echo
if [ "${PWD}" != "${LIPSIA_DEV}/src" ]; then
echo "Ok: \"cd ${LIPSIA_DEV}/src; make\"."
else
echo Ok: try \"make\"
fi
echo
fi
####################################################################################
2 changes: 1 addition & 1 deletion src/prep/vpreprocess/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

LDLIBS = -lgsl -lgslcblas -lvia3.0 -lviaio3.0 -lm -lz
LDLIBS = -lvia3.0 -lviaio3.0 -lgsl -lgslcblas -lm -lz

PROG = vpreprocess
SRC = vpreprocess.c Gauss4d.c GaussFilter.c
Expand Down
3 changes: 2 additions & 1 deletion src/ted/vted/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
LDLIBS = -lgsl -lgslcblas -lblas -lviaio3.0 -lm -fopenmp -lz

LDLIBS = -lgsl -lgslcblas -lviaio3.0 -lm -fopenmp -lz

#CFLAGS = -g
CFLAGS += -fopenmp
Expand Down

0 comments on commit 8420714

Please sign in to comment.