Commit 838ee9f6 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

configure.ac: added AC_OPENMP

parent 193cb038
......@@ -282,6 +282,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENMP_CFLAGS = @OPENMP_CFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
......
......@@ -47,7 +47,7 @@ case "${HOSTNAME}" in
--with-curl=/opt/local \
--with-libxml2=/usr \
--with-magics=/Users/m214003/local/magics-2.14.9 \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native -fopenmp" \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native" \
LIBS="-L/opt/local/lib -lopenjpeg"
# --with-libxml2=/usr
# --with-magics=/Users/m214003/local/magics-2.14.9
......@@ -62,7 +62,7 @@ case "${HOSTNAME}" in
--with-szlib=$HOME/local \
--with-proj=/opt/local \
--with-curl=/opt/local \
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native -fopenmp"
CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native"
# --with-libxml2=/usr \
# --with-magics=/Users/m214003/local/Magics-2.18.14nio \
;;
......@@ -89,7 +89,7 @@ case "${HOSTNAME}" in
--with-szlib=/sw/squeeze-x64/szip-2.1 \
--with-udunits2=/sw/squeeze-x64/udunits-2.1.19 \
--with-proj=/sw/squeeze-x64/proj-4.7.0 \
CC=gcc CFLAGS='-g -Wall -O3 -march=native -fopenmp'
CC=gcc CFLAGS='-g -Wall -O3 -march=native'
;;
# x86_64-lenny-linux-gnu
squall*)
......@@ -102,7 +102,7 @@ case "${HOSTNAME}" in
--with-szlib=/sw/squeeze-x64/szip-2.1 \
--with-udunits2=/sw/squeeze-x64/udunits-2.1.19 \
--with-proj=/sw/squeeze-x64/proj-4.7.0 \
CC=gcc CFLAGS='-g -Wall -O3 -fopenmp'
CC=gcc CFLAGS='-g -Wall -O3'
;;
# x86_64-archlinux
thingol*)
......@@ -117,19 +117,9 @@ case "${HOSTNAME}" in
--with-magics=$HOME/src/cdo/branches/libs4cdo/build-dev \
--with-libxml2=/usr \
--with-pic \
CC=gcc CFLAGS="-g -Wall -O2 -fopenmp -DWITH_DATA" \
CC=gcc CFLAGS="-g -Wall -O2 -DWITH_DATA" \
LDFLAGS='-L/home/ram/local/netcdf-4.1.2/lib -L/usr/lib64 -L/usr/lib -lhdf5_hl -lhdf5 -lz -lm -lhdf5_hl -lhdf5 -lz -lcurl -L/usr/local/lib64 -L/usr/X11R6/lib64 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo -lexpat -lpthread -lfontconfig -lz -lgd -lproj -lgrib_api -lpng -lxml2 -lm -ljasper -lopenjpeg -L/home/ram/local/netcdf-4.1.2/lib -lnetcdf_c++ -lnetcdf -lcurl -lstdc++ -lgfortran'
;;
# i686-suse-linux
linux | laptop)
${CONFPATH}configure --prefix=$HOME/local \
--with-jasper=/usr \
--with-grib_api=$HOME/local \
--with-netcdf=$HOME/local \
--with-hdf5=$HOME/local \
--with-szlib=$HOME/local \
CC=colorgcc CFLAGS="-g -Wall -W -Wfloat-equal -pedantic -O2 -fopenmp"
;;
# standard workstations at MPI-M x86_64-lenny
mpipc* )
${CONFPATH}configure \
......@@ -140,7 +130,7 @@ case "${HOSTNAME}" in
--with-szlib='/sw/lenny-x64/szip-latest' \
--with-proj='/sw/lenny-x64/proj-latest' \
--enable-ruby --enable-swig --enable-python \
CC=gcc CFLAGS="-g -fopenmp -Wall -W -Wfloat-equal -pedantic -O2"
CC=gcc CFLAGS="-g -Wall -W -Wfloat-equal -pedantic -O2"
;;
# dap enabled
egmont | columbine)
......@@ -151,7 +141,7 @@ case "${HOSTNAME}" in
--with-szlib=/sw/etch-ia32/szip-2.1 \
--with-proj=/sw/etch-ia32/proj-4.6.0 \
--enable-all-static CC=icc CFLAGS="-g -fast -openmp" AR=xiar LD=xild
# CC=gcc CFLAGS="-g -Wall -W -Wfloat-equal -pedantic -O2 -fopenmp"
# CC=gcc CFLAGS="-g -Wall -W -Wfloat-equal -pedantic -O2"
;;
# i386-pc-solaris2.10
grim | mil* )
......@@ -189,7 +179,7 @@ case "${HOSTNAME}" in
--with-netcdf=/sw/centos58-x64/netcdf-4.2.1.1 \
--with-szlib=/sw/centos58-x64/szip-2.1 \
--with-zlib=/usr \
CC=gcc44 CFLAGS="-g -Wall -O3 -fopenmp"
CC=gcc44 CFLAGS="-g -Wall -O3"
;;
# powerpc-ibm-aix5.2.0.0
ecga*)
......
......@@ -677,6 +677,7 @@ ac_ct_CXX
CXXFLAGS
CXX
AS
OPENMP_CFLAGS
CPP
OTOOL64
OTOOL
......@@ -805,6 +806,7 @@ enable_dependency_tracking
with_gnu_ld
with_sysroot
enable_libtool_lock
enable_openmp
enable_largefile
enable_data
with_threads
......@@ -1475,6 +1477,7 @@ Optional Features:
--disable-dependency-tracking
speeds up one-time build
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-openmp do not use OpenMP
--disable-largefile omit support for large files
--enable-data DATA support [default=yes]
--enable-grib GRIB support [default=yes]
......@@ -12086,6 +12089,71 @@ fi
 
 
 
OPENMP_CFLAGS=
# Check whether --enable-openmp was given.
if test "${enable_openmp+set}" = set; then :
enableval=$enable_openmp;
fi
if test "$enable_openmp" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to support OpenMP" >&5
$as_echo_n "checking for $CC option to support OpenMP... " >&6; }
if ${ac_cv_prog_c_openmp+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef _OPENMP
choke me
#endif
#include <omp.h>
int main () { return omp_get_num_threads (); }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_prog_c_openmp='none needed'
else
ac_cv_prog_c_openmp='unsupported'
for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
ac_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $ac_option"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef _OPENMP
choke me
#endif
#include <omp.h>
int main () { return omp_get_num_threads (); }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_prog_c_openmp=$ac_option
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
CFLAGS=$ac_save_CFLAGS
if test "$ac_cv_prog_c_openmp" != unsupported; then
break
fi
done
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_c_openmp" >&5
$as_echo "$ac_cv_prog_c_openmp" >&6; }
case $ac_cv_prog_c_openmp in #(
"none needed" | unsupported)
;; #(
*)
OPENMP_CFLAGS=$ac_cv_prog_c_openmp ;;
esac
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
set dummy ${ac_tool_prefix}ar; ac_word=$2
......@@ -17284,6 +17352,9 @@ $as_echo "$enable_data" >&6; }
ENABLE_DATA=$enable_data
 
# ----------------------------------------------------------------------
CFLAGS="$CFLAGS ${OPENMP_CFLAGS}"
# ----------------------------------------------------------------------
# Add configure options
 
 
......
......@@ -25,6 +25,7 @@ LT_INIT
AC_CHECK_TOOL([CC],[gcc],[:])
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_OPENMP
AC_CHECK_TOOL([AR],[ar],[:])
AC_CHECK_TOOL([CPP],[cpp],[:])
AC_CHECK_TOOL([LD],[ld],[:])
......@@ -116,6 +117,9 @@ AC_ARG_ENABLE([data],
AC_MSG_RESULT([$enable_data])
AC_SUBST([ENABLE_DATA],[$enable_data])
# ----------------------------------------------------------------------
CFLAGS="$CFLAGS ${OPENMP_CFLAGS}"
# ----------------------------------------------------------------------
# Add configure options
ACX_OPTIONS
# ----------------------------------------------------------------------
......
......@@ -194,6 +194,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENMP_CFLAGS = @OPENMP_CFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
......
Contributors
The primary contributors to CDO development have been:
Uwe Schulweida
Concept, design and implementation of CDO, project coordination, and releases.
Concept, design and implementation of CDO, project coordination/management, and releases.
Luis Kornblueh
......@@ -54,3 +56,5 @@ Please let me know if your name was omitted!
Jaison Ambadan
Reinhard Budich
......@@ -209,3 +209,5 @@ The result is the same as:
cdo selday,5,6,7,8,9 ifile ofile
\end{verbatim}
\end{itemize}
% \subsection{OpenMP Threading}
......@@ -457,6 +457,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENMP_CFLAGS = @OPENMP_CFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
......
......@@ -1102,6 +1102,10 @@ void pstreamDefVlist(int pstreamID, int vlistID)
vlistDefAttTxt(vlistID, CDI_GLOBAL, "CDO", (int)strlen(cdoComment())+1, cdoComment());
#if defined(_OPENMP)
if ( ompNumThreads > 1 )
vlistDefAttInt(vlistID, CDI_GLOBAL, "cdo_openmp_thread_number", DATATYPE_INT32, 1, &ompNumThreads);
#endif
pstreamDefVarlist(pstreamptr, vlistID);
if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_write);
......
......@@ -399,6 +399,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENMP_CFLAGS = @OPENMP_CFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
......
......@@ -193,6 +193,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENMP_CFLAGS = @OPENMP_CFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment