Imported Upstream version 6.3.1

parent 7a5a4449
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES = ccp4/libccp4c.la
if FORTRAN_LIB
lib_LTLIBRARIES += fortran/libccp4f.la
endif
......@@ -11,6 +12,7 @@ endif
ccp4datadir = $(datadir)/ccp4
ccp4includedir = $(includedir)/ccp4
pkgconfigdir = $(libdir)/pkgconfig
ccp4_libccp4c_la_SOURCES = \
ccp4/ccp4_array.c ccp4/cmap_data.c ccp4/cmtzlib.c ccp4/ccp4_general.c \
......@@ -65,8 +67,10 @@ fortran_libccp4f_la_LDFLAGS = -no-undefined
dist_ccp4data_DATA = ccp4-config.cmake data/atomsf_neutron.lib \
data/atomsf.lib data/syminfo.lib data/symop.lib
pkgconfig_DATA = libccp4c.pc
if FORTRAN_LIB
dist_ccp4data_DATA += data/font84.ascii
pkgconfig_DATA += libccp4f.pc
endif
......
This diff is collapsed.
This diff is collapsed.
#! /bin/sh
# Wrapper for Microsoft lib.exe
me=ar-lib
scriptversion=2012-03-01.08; # UTC
# Copyright (C) 2010-2012 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
# func_error message
func_error ()
{
echo "$me: $1" 1>&2
exit 1
}
file_conv=
# func_file_conv build_file
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv in
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_at_file at_file operation archive
# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
# for each of them.
# When interpreting the content of the @FILE, do NOT use func_file_conv,
# since the user would need to supply preconverted file names to
# binutils ar, at least for MinGW.
func_at_file ()
{
operation=$2
archive=$3
at_file_contents=`cat "$1"`
eval set x "$at_file_contents"
shift
for member
do
$AR -NOLOGO $operation:"$member" "$archive" || exit $?
done
}
case $1 in
'')
func_error "no command. Try '$0 --help' for more information."
;;
-h | --h*)
cat <<EOF
Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
Members may be specified in a file named with @FILE.
EOF
exit $?
;;
-v | --v*)
echo "$me, version $scriptversion"
exit $?
;;
esac
if test $# -lt 3; then
func_error "you must specify a program, an action and an archive"
fi
AR=$1
shift
while :
do
if test $# -lt 2; then
func_error "you must specify a program, an action and an archive"
fi
case $1 in
-lib | -LIB \
| -ltcg | -LTCG \
| -machine* | -MACHINE* \
| -subsystem* | -SUBSYSTEM* \
| -verbose | -VERBOSE \
| -wx* | -WX* )
AR="$AR $1"
shift
;;
*)
action=$1
shift
break
;;
esac
done
orig_archive=$1
shift
func_file_conv "$orig_archive"
archive=$file
# strip leading dash in $action
action=${action#-}
delete=
extract=
list=
quick=
replace=
index=
create=
while test -n "$action"
do
case $action in
d*) delete=yes ;;
x*) extract=yes ;;
t*) list=yes ;;
q*) quick=yes ;;
r*) replace=yes ;;
s*) index=yes ;;
S*) ;; # the index is always updated implicitly
c*) create=yes ;;
u*) ;; # TODO: don't ignore the update modifier
v*) ;; # TODO: don't ignore the verbose modifier
*)
func_error "unknown action specified"
;;
esac
action=${action#?}
done
case $delete$extract$list$quick$replace,$index in
yes,* | ,yes)
;;
yesyes*)
func_error "more than one action specified"
;;
*)
func_error "no action specified"
;;
esac
if test -n "$delete"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
for member
do
case $1 in
@*)
func_at_file "${1#@}" -REMOVE "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
;;
esac
done
elif test -n "$extract"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
if test $# -gt 0; then
for member
do
case $1 in
@*)
func_at_file "${1#@}" -EXTRACT "$archive"
;;
*)
func_file_conv "$1"
$AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
;;
esac
done
else
$AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
do
$AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
done
fi
elif test -n "$quick$replace"; then
if test ! -f "$orig_archive"; then
if test -z "$create"; then
echo "$me: creating $orig_archive"
fi
orig_archive=
else
orig_archive=$archive
fi
for member
do
case $1 in
@*)
func_file_conv "${1#@}"
set x "$@" "@$file"
;;
*)
func_file_conv "$1"
set x "$@" "$file"
;;
esac
shift
shift
done
if test -n "$orig_archive"; then
$AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
else
$AR -NOLOGO -OUT:"$archive" "$@" || exit $?
fi
elif test -n "$list"; then
if test ! -f "$orig_archive"; then
func_error "archive not found"
fi
$AR -NOLOGO -LIST "$archive" || exit $?
fi
# - Find CCP4 libraries
# Find one or more of CCP4 libraries: ccp4c, ccp4f, mmdb, ccif,
# clipper-core, clipper-ccp4, clipper-contrib, clipper-minimol, clipper-mmdb.
# clipper-core, clipper-ccp4, clipper-contrib, clipper-minimol, clipper-mmdb,
# or cctbx.
#
# Once done this will define
# CCP4_INCLUDE_DIRS - all include directories
# <name>_LIBRARY - library, name is one of CCP4C, CCP4F, MMDB, CCIF, SSM,
# CCP4SRS, CCTBX,
# CLIPPER-CORE, CLIPPER-CCP4, CLIPPER-CONTRIB,
# CLIPPER-MINIMOL, CLIPPER-MMDB, CLIPPER-CIF,
# RFFTW2, FFTW2
# CCIF_LIBRARIES - CCIF_LIBRARY with (if needed) regex library
# CCP4SRS_LIBRARIES - CCP4SRS_LIBRARY with (if needed) mmdb and zlib libraries
# CLIPPER-CORE_LIBRARIES - CLIPPER-CORE_LIBRARY with (if needed)
# fftw2 and thread library
# CCP4_LIBRARIES - all requested libraries with necessary dependencies
......@@ -19,6 +22,8 @@
# or
# FIND_PACKAGE(CCP4 REQUIRED mmdb ccp4c)
#
# Checking for ccp4srs in some cases (static linking) sets also ZLIB_LIBRARY.
#
# Checking for clipper-core sets also variables for FFTW2 library used
# by clipper: FFTW2_LIBRARY, RFFTW2_LIBRARY, FFTW2_INCLUDE_DIRS,
# and if fftw2 is prefixed with 's' FFTW2_DEFINITIONS=-DFFTW2_PREFIX_S.
......@@ -37,15 +42,19 @@ include(CheckFunctionExists)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
set(_ccp4 $ENV{CCP4})
if(_ccp4)
set(_clib "${_ccp4}/lib")
set(_cincl "${_ccp4}/include")
endif()
foreach(_component ${CCP4_FIND_COMPONENTS})
string(TOUPPER ${_component} _upper)
string(TOLOWER ${_component} _lower)
set(_lib_var "${_upper}_LIBRARY")
find_library(${_lib_var} NAMES ${_lower}
HINTS ${LIB_INSTALL_DIR}
PATHS $ENV{CLIB}
$ENV{CCP4}/lib
$ENV{CCP4}/lib64)
HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib
PATHS ${_clib})
#message("DEBUG: ${_lib_var} (${_lower}) = ${${_upper}_LIBRARY}")
if (${_upper} STREQUAL "MMDB")
......@@ -58,7 +67,9 @@ foreach(_component ${CCP4_FIND_COMPONENTS})
elseif (${_upper} STREQUAL "CCIF")
set(_header "ccif/ccif_defines.h")
elseif (${_upper} STREQUAL "SSM")
set(_header "ssm/ss_vxedge.h")
set(_header "ssm/ssm_vxedge.h")
elseif (${_upper} STREQUAL "CCP4SRS")
set(_header "ccp4srs/ccp4srs_manager.h")
elseif (${_upper} STREQUAL "CLIPPER-CORE")
find_package(Threads)
set(_header "clipper/clipper.h")
......@@ -72,6 +83,8 @@ foreach(_component ${CCP4_FIND_COMPONENTS})
set(_header "clipper/clipper-mmdb.h")
elseif (${_upper} STREQUAL "CLIPPER-CIF")
set(_header "clipper/clipper-cif.h")
elseif (${_upper} STREQUAL "CCTBX")
set(_header "cctbx/crystal/symmetry.h")
else()
message(FATAL_ERROR "'${_component}' is not a valid CCP4 library.")
endif()
......@@ -79,7 +92,8 @@ foreach(_component ${CCP4_FIND_COMPONENTS})
if (_header)
set(_incl_var "${_upper}_INCLUDE_DIR")
find_path(${_incl_var} ${_header}
PATHS $ENV{CINCL} $ENV{CCP4}/include)
HINTS ${CMAKE_INSTALL_PREFIX}/include
PATHS ${_cincl})
message(STATUS "Looking for ${_header} - ${${_incl_var}}")
find_package_handle_standard_args(CCP4 DEFAULT_MSG
${_lib_var} ${_incl_var})
......@@ -107,21 +121,72 @@ foreach(_component ${CCP4_FIND_COMPONENTS})
endif()
endif()
# check if libccp4srs needs mmdb and zlib
if (${_upper} STREQUAL "CCP4SRS")
set(_SAVE ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_INCLUDES "${_SAVE};${CCP4SRS_INCLUDE_DIR}")
set(_SRS_SRC "#include <ccp4srs/memio_.h>\n"
"int main() { CMemIO m; m.read(\"f\", 1);}")
set(CMAKE_REQUIRED_LIBRARIES ${CCP4SRS_LIBRARY})
set(_VAR _LINKING_WITH_CCP4SRS)
check_cxx_source_compiles("${_SRS_SRC}" ${_VAR})
if (${_VAR})
set(CCP4SRS_LIBRARIES ${CCP4SRS_LIBRARY})
else()
find_library(ZLIB_LIBRARY NAMES z zlib zlib1 zdll
HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib
PATHS ${_clib} c:/MinGW/lib)
if (NOT ZLIB_LIBRARY)
message(FATAL_ERROR "Linking with ccp4srs fails. zlib not found.")
endif()
if (NOT MMDB_LIBRARY)
find_library(MMDB_LIBRARY NAMES mmdb
HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib
PATHS ${_clib})
endif()
set(_ADD_LIBS ${MMDB_LIBRARY} ${ZLIB_LIBRARY})
set(CMAKE_REQUIRED_LIBRARIES ${CCP4SRS_LIBRARY} ${_ADD_LIBS})
set(_VAR _LINKING_WITH_CCP4SRS_MMDB_AND_ZLIB)
check_cxx_source_compiles("${_SRS_SRC}" ${_VAR})
if (NOT ${_VAR})
message(FATAL_ERROR "Linking with ccp4srs failed.")
endif()
set(CCP4SRS_LIBRARIES ${CCP4SRS_LIBRARY} ${_ADD_LIBS})
endif()
SET(CMAKE_REQUIRED_INCLUDES ${_SAVE})
endif()
# check if clipper-core needs rfftw fftw
if (${_upper} STREQUAL "CLIPPER-CORE")
# first look for FFTW2 libs are available separately
find_library(FFTW2_LIBRARY NAMES sfftw fftw
HINTS ${LIB_INSTALL_DIR}
PATHS $ENV{CLIB} $ENV{CCP4}/lib $ENV{CCP4}/lib64)
message(STATUS "FFTW2 library - ${FFTW2_LIBRARY}")
set(_fftw_names sfftw fftw)
if (${${_lib_var}} MATCHES ".a$")
# fftw should also be static
set(_fftw_names libsfftw.a libfftw.a ${_fftw_names})
endif()
# first search in the install path, then in system and $CCP4
find_library(FFTW2_LIBRARY NAMES ${_fftw_names}
HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib
NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH)
find_library(FFTW2_LIBRARY NAMES ${_fftw_names}
PATHS ${_clib})
message(STATUS "FFTW2 libraries - ${FFTW2_LIBRARY}")
if (${FFTW2_LIBRARY} MATCHES "sfftw")
find_library(RFFTW2_LIBRARY NAMES srfftw)
find_path(FFTW2_INCLUDE_DIRS srfftw.h)
set (_fftw_prefix s)
set(FFTW2_DEFINITIONS "-DFFTW2_PREFIX_S")
endif()
set(_rfftw_names ${_fftw_prefix}rfftw)
if (${FFTW2_LIBRARY} MATCHES ".a$")
set(_rfftw_names lib${_fftw_prefix}rfftw.a ${_rfftw_names})
else()
find_library(RFFTW2_LIBRARY NAMES rfftw)
find_path(FFTW2_INCLUDE_DIRS rfftw.h)
endif()
find_library(RFFTW2_LIBRARY NAMES ${_rfftw_names}
HINTS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib
PATHS ${_clib})
message(STATUS " - ${RFFTW2_LIBRARY}")
find_path(FFTW2_INCLUDE_DIRS ${_fftw_prefix}rfftw.h
HINTS ${CMAKE_INSTALL_PREFIX}/include
PATHS ${_cincl})
message(STATUS "FFTW2 header directory - ${FFTW2_INCLUDE_DIRS}")
set(_SAVE ${CMAKE_REQUIRED_INCLUDES})
set(CMAKE_REQUIRED_INCLUDES "${_SAVE};${CLIPPER-CORE_INCLUDE_DIR}")
......@@ -136,7 +201,7 @@ foreach(_component ${CCP4_FIND_COMPONENTS})
set(_VAR _LINKING_WITH_CLIPPER_CORE_AND_THREADS)
check_cxx_source_compiles("${_CLIP_SRC}" ${_VAR})
endif()
if (NOT ${_VAR})
if ((NOT ${_VAR}) AND FFTW2_LIBRARY)
set(_ADD_LIBS ${RFFTW2_LIBRARY} ${FFTW2_LIBRARY}
${CMAKE_THREAD_LIBS_INIT})
set(CMAKE_REQUIRED_LIBRARIES ${CLIPPER-CORE_LIBRARY} ${_ADD_LIBS})
......@@ -152,11 +217,13 @@ foreach(_component ${CCP4_FIND_COMPONENTS})
endforeach()
set(CCP4_LIBRARIES ${CLIPPER-CCP4_LIBRARY}
set(CCP4_LIBRARIES ${CCTBX_LIBRARY}
${CLIPPER-CCP4_LIBRARY}
${CLIPPER-CONTRIB_LIBRARY}
${CLIPPER-MINIMOL_LIBRARY}
${CLIPPER-MMDB_LIBRARY}
${CLIPPER-CORE_LIBRARIES}
${CCP4SRS_LIBRARIES}
${SSM_LIBRARY}
${CCIF_LIBRARIES}
${CCP4F_LIBRARY}
......@@ -168,8 +235,17 @@ if(CCP4_INCLUDE_DIRS)
endif()
message(STATUS "CCP4 include directory: ${CCP4_INCLUDE_DIRS}")
if(CCP4_LIBRARIES)
# reverse twice, because REMOVE_DUPLICATES leaves the first
list(REVERSE CCP4_LIBRARIES)
list(REMOVE_DUPLICATES CCP4_LIBRARIES)
list(REVERSE CCP4_LIBRARIES)
endif()
mark_as_advanced(CCP4C_INCLUDE_DIR MMDB_INCLUDE_DIR CCIF_INCLUDE_DIR
SSM_INCLUDE_DIR CCP4SRS_INCLUDE_DIR
CLIPPER-CORE_INCLUDE_DIR CLIPPER-CCP4_INCLUDE_DIR
CLIPPER-CONTRIB_INCLUDE_DIR CLIPPER-MINIMOL_INCLUDE_DIR
CLIPPER-MMDB_INCLUDE_DIR FFTW2_INCLUDE_DIRS)
CLIPPER-MMDB_INCLUDE_DIR FFTW2_INCLUDE_DIRS
CCTBX_INCLUDE_DIR)
......@@ -39,8 +39,8 @@ namespace CCP4 {
extern "C" {
#endif
#define CCP4_VERSION_NO "6.3"
#define CCP4_PATCH_LEVEL "6.3.0"
#define CCP4_VERSION_NO "6.4"
#define CCP4_PATCH_LEVEL "6.4.0"
/* Maximum lengths of strings holding program names and versions */
#define MAXLEN_PROGNAME 80
......
......@@ -31,7 +31,7 @@
#include "library_file.h"
#include "ccp4_errno.h"
#include "ccp4_file_err.h"
/* rcsid[] = "$Id$" */
/* rcsid[] = "$Id: library_file.c,v 1.26 2012/08/20 12:21:16 gxg60988 Exp $" */
static uint16 nativeIT = NATIVEIT; /* machine integer type */
static uint16 nativeFT = NATIVEFT; /* machine float type */
......@@ -975,6 +975,7 @@ CCP4File *ccp4_file_open (const char *filename, const int flag)
ccp4_signal(CCP4_ERRLEVEL(3) | CCP4_ERRNO(CIO_CantOpenFile),
"ccp4_file_open2", NULL);
cfile->iostat = CIO_CantOpenFile;
free(cfile);
return NULL; }
#if defined (__alpha) && defined (vms)
(void) fflush (cfile->stream);
......@@ -2094,7 +2095,7 @@ long ccp4_file_tell (CCP4File *cfile)
if (cfile->buffered && cfile->stream) {
#if !defined (_MSC_VER)
fflush (cfile->stream);
if ( cfile->last_op == WRITE_OP ) fflush (cfile->stream);
#endif
result = (long) ftell(cfile->stream);
} else
......
This diff is collapsed.
AC_INIT(libccp4, 6.3.0.20121001)
AC_INIT(libccp4, 6.3.1)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_SRCDIR(ccp4/cmtzlib.c)
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE([1.11 foreign subdir-objects silent-rules -Wall])
AM_PROG_AR
LT_INIT([disable-shared win32-dll])
AC_PROG_CC
......@@ -23,6 +24,15 @@ AM_CONDITIONAL([FORTRAN_LIB], [ test "x$enable_fortran" != xno ])
if test "x$enable_fortran" != "xno"; then
AC_PROG_F77
# AC_PROG_F77 doesn't fail if compiler is not found, test it explicitely
AC_LANG_PUSH(Fortran 77)
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [ write(*,*) 'hello' ])], [],
[AC_MSG_ERROR([Fortran compiler not found.])])
AC_LANG_POP(Fortran 77)
AC_PATH_PROG(M4,m4)
if test x"$M4" = "x"; then
AC_MSG_ERROR([m4 program not found.])
fi
# TODO: it'd be better to check for features rather than compilers,
# but I'm afraid of changing this and unix.m4.
cc_basename=`$ECHO "X$compiler_F77" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
......@@ -107,5 +117,5 @@ AC_DEFINE_UNQUOTED([PACKAGE_ROOT],["$PACKAGE_ROOT"],[package install directory])
AC_SUBST(M4_ARG)
AC_OUTPUT(Makefile)
AC_OUTPUT(Makefile libccp4c.pc libccp4f.pc)
......@@ -48,16 +48,11 @@ C
subroutine sorting_reallocate_this()
integer nmax_old
integer nk1,nr1,ni1
real, allocatable :: temp_keys(:)
real, allocatable :: temp_recs(:)
real, allocatable :: temp_inds(:)
nmax_old = nmax_rec
nmax_rec = nint(1.5*nmax_rec) + 1
nk1 = nkeys_l*nmax_rec
nr1 = max(1,(nrec_l-nkeys_l)*nmax_rec)
ni1 = nmax_rec
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libccp4c
Description: CCP4 core C libraries
Version: @VERSION@
Requires:
Libs: -L${libdir} -lccp4c
Cflags: -I${includedir}
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libccp4f
Description: CCP4 core FORTRAN libraries
Version: @VERSION@
Requires.private: ccp4c mmdb
Libs: -L${libdir} -lccp4f
Cflags: -I${includedir}
Markdown is supported
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