#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013, by the GROMACS development team, led by
+# Copyright (c) 2013,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
if (VMDXYZPLUGIN)
try_run(TESTVMD TESTVMD_COMPILED ${CMAKE_BINARY_DIR}
- "${CMAKE_SOURCE_DIR}/cmake/TestVMD.c"
+ "${CMAKE_SOURCE_DIR}/cmake/TestVMD.cpp"
CMAKE_FLAGS "-DLINK_LIBRARIES=${CMAKE_DL_LIBS}"
- "-DINCLUDE_DIRECTORIES=${CMAKE_SOURCE_DIR}/src/gmxlib"
+ "-DINCLUDE_DIRECTORIES=${CMAKE_SOURCE_DIR}/src/external/vmd_molfile"
COMPILE_DEFINITIONS "-DGMX_USE_PLUGINS"
RUN_OUTPUT_VARIABLE TESTVMD_OUTPUT ARGS ${VMDXYZPLUGIN})
endif()
#include "molfile_plugin.h"
-#include "vmddlopen.c"
+#include "vmddlopen.cpp"
#include "stdio.h"
static int register_cb(void *v, vmdplugin_t *p) {
typedef int (*initfunc)(void);
typedef int (*regfunc)(void *, vmdplugin_register_cb);
-/*run: gcc TestVMD.c -DGMX_USE_PLUGINS -Wall -ldl src/gmxlib/vmddlopen.c -I src/gmxlib && ./a.out .../xyzplugin.so ; echo $?*/
+/*run: gcc TestVMD.cpp -DGMX_USE_PLUGINS -Wall -ldl -I../src/external/vmd_molfile -lm && ./a.out .../xyzplugin.so ; echo $?*/
int main(int argc, char** argv)
{
void *handle, *ifunc, *registerfunc;
+++ /dev/null
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2012, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS 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
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-macro(gmx_detect_clang_3_0 OUT_VAR)
- try_compile(IS_CLANG_3_0 ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/TestClangVersion.c)
- set(${OUT_VAR} ${IS_CLANG_3_0})
-endmacro()
-
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013,2014,2016,2018, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2016,2018,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
function(gmx_detect_target_architecture)
if (NOT DEFINED GMX_TARGET_X86)
try_compile(GMX_TARGET_X86 ${CMAKE_BINARY_DIR}
- "${CMAKE_SOURCE_DIR}/cmake/TestX86.c")
+ "${CMAKE_SOURCE_DIR}/cmake/TestX86.cpp")
endif()
if (NOT DEFINED GMX_TARGET_MIC)
try_compile(GMX_TARGET_MIC ${CMAKE_BINARY_DIR}
- "${CMAKE_SOURCE_DIR}/cmake/TestMIC.c")
+ "${CMAKE_SOURCE_DIR}/cmake/TestMIC.cpp")
endif()
if (NOT DEFINED GMX_TARGET_ARMV7)
try_compile(GMX_TARGET_ARMV7 ${CMAKE_BINARY_DIR}
endif()
if (NOT DEFINED GMX_TARGET_FUJITSU_SPARC64)
try_compile(GMX_TARGET_FUJITSU_SPARC64 ${CMAKE_BINARY_DIR}
- "${CMAKE_SOURCE_DIR}/cmake/TestFujitsuSparc64.c")
+ "${CMAKE_SOURCE_DIR}/cmake/TestFujitsuSparc64.cpp")
endif()
endfunction()
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
# check the generated CUDA API version against the one present in cuda_runtime_api.h
try_compile(_get_cuda_version_compile_res
${CMAKE_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/cmake/TestCUDAVersion.c
+ ${CMAKE_SOURCE_DIR}/cmake/TestCUDAVersion.cpp
COMPILE_DEFINITIONS "-DGMX_CUDA_VERSION=${GMX_CUDA_VERSION}"
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_TOOLKIT_INCLUDE}"
OUTPUT_VARIABLE _get_cuda_version_compile_out)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
# Test the CMAKE_C_COMPILER for being an MPI (wrapper) compiler
TRY_COMPILE(MPI_FOUND ${CMAKE_BINARY_DIR}
- "${CMAKE_SOURCE_DIR}/cmake/TestMPI.c"
+ "${CMAKE_SOURCE_DIR}/cmake/TestMPI.cpp"
COMPILE_DEFINITIONS )
# If CMAKE_C_COMPILER is not a MPI wrapper. Try to find MPI using cmake module as fall-back.
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009,2010,2012,2014, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2012,2014,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
# First check without any special flags
TRY_COMPILE(FILE64_OK "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.c")
+ "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.cpp")
if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present")
endif()
if(NOT FILE64_OK)
# Test with _FILE_OFFSET_BITS=64
TRY_COMPILE(FILE64_OK "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
+ "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.cpp"
COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64" )
if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
if(NOT FILE64_OK)
# Test with _LARGE_FILES
TRY_COMPILE(FILE64_OK "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
+ "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.cpp"
COMPILE_DEFINITIONS "-D_LARGE_FILES" )
if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES")
if(NOT FILE64_OK)
# Test with _LARGEFILE_SOURCE
TRY_COMPILE(FILE64_OK "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
+ "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.cpp"
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE")
# Set the flags we might have determined to be required above
configure_file("${CMAKE_SOURCE_DIR}/cmake/TestLargeFiles.c.cmakein"
- "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.cpp")
MESSAGE(STATUS "Checking for fseeko/ftello")
# Test if ftello/fseeko are available
TRY_COMPILE(FSEEKO_COMPILE_OK "${CMAKE_BINARY_DIR}"
- "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.cpp")
if(FSEEKO_COMPILE_OK)
MESSAGE(STATUS "Checking for fseeko/ftello - present")
endif()
if(NOT FSEEKO_COMPILE_OK)
# glibc 2.2 neds _LARGEFILE_SOURCE for fseeko (but not 64-bit off_t...)
TRY_COMPILE(FSEEKO_COMPILE_OK "${CMAKE_BINARY_DIR}"
- "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c"
+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.cpp"
COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
if(FSEEKO_COMPILE_OK)
MESSAGE(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE")
if(NOT FILE64_OK)
# now check for Windows stuff
TRY_COMPILE(FILE64_OK "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/cmake/TestWindowsFSeek.c")
+ "${CMAKE_SOURCE_DIR}/cmake/TestWindowsFSeek.cpp")
if(FILE64_OK)
MESSAGE(STATUS "Checking for 64-bit off_t - present with _fseeki64")
set(HAVE__FSEEKI64 1 CACHE INTERNAL "64-bit off_t requires _fseeki64")
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009,2014, by the GROMACS development team, led by
+# Copyright (c) 2009,2014,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
MESSAGE(STATUS "Checking for pipe support")
TRY_COMPILE(HAVE_PIPES "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/cmake/TestPipes.c")
+ "${CMAKE_SOURCE_DIR}/cmake/TestPipes.cpp")
ENDIF()
ENDMACRO(GMX_TEST_PIPES VARIABLE)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009,2011,2014, by the GROMACS development team, led by
+# Copyright (c) 2009,2011,2014,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
MESSAGE(STATUS "Checking for SIGUSR1")
TRY_COMPILE(HAVE_${VARIABLE} "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/cmake/TestSIGUSR1.c")
+ "${CMAKE_SOURCE_DIR}/cmake/TestSIGUSR1.cpp")
IF(HAVE_${VARIABLE})
MESSAGE(STATUS "Checking for SIGUSR1 - found")
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009,2014, by the GROMACS development team, led by
+# Copyright (c) 2009,2014,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
# First check without any special flags
TRY_COMPILE(XDR_COMPILE_OK "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/cmake/TestXDR.c")
+ "${CMAKE_SOURCE_DIR}/cmake/TestXDR.cpp")
if(XDR_COMPILE_OK)
MESSAGE(STATUS "Checking for system XDR support - present")
generator.copy.cpp
lifetime.cpp
fft_binary_lookup.cpp
- md5sum.c
+ md5sum.cpp
enqueue.cpp
stdafx.cpp )
#define MAXFAC 13 /* maximum number of factors in factorization of n */
#define NSPECIAL 4 /* number of factors for which we have special-case routines */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
/* ----------------------------------------------------------------------
passf2, passf3, passf4, passf5, passf. Complex FFT passes fwd and bwd.
---------------------------------------------------------------------- */
} /* cfftf1 */
-void fftpack_cfftf(int n, Treal c[], Treal wsave[])
- {
- int iw1, iw2;
- if (n == 1) return;
- iw1 = 2*n;
- iw2 = iw1 + 2*n;
- fftpack_cfftf1(n, c, wsave, wsave+iw1, (int*)(wsave+iw2), -1);
- } /* cfftf */
-
-
-void fftpack_cfftb(int n, Treal c[], Treal wsave[])
- {
- int iw1, iw2;
- if (n == 1) return;
- iw1 = 2*n;
- iw2 = iw1 + 2*n;
- fftpack_cfftf1(n, c, wsave, wsave+iw1, (int*)(wsave+iw2), +1);
- } /* cfftb */
-
-
static void factorize(int n, int ifac[MAXFAC+2], const int ntryh[NSPECIAL])
/* Factorize n in factors in ntryh and rest. On exit,
ifac[0] contains n and ifac[1] contains number of factors,
}
} /* cffti1 */
-
-void fftpack_cffti(int n, Treal wsave[])
- {
- int iw1, iw2;
- if (n == 1) return;
- iw1 = 2*n;
- iw2 = iw1 + 2*n;
- fftpack_cffti1(n, wsave+iw1, (int*)(wsave+iw2));
- } /* cffti */
-
/* ----------------------------------------------------------------------
rfftf1, rfftb1, rfftf, rfftb, rffti1, rffti. Treal FFTs.
---------------------------------------------------------------------- */
} /* rfftb1 */
-void fftpack_rfftf(int n, Treal r[], Treal wsave[])
- {
- if (n == 1) return;
- fftpack_rfftf1(n, r, wsave, wsave+n, (int*)(wsave+2*n));
- } /* rfftf */
-
-
-void fftpack_rfftb(int n, Treal r[], Treal wsave[])
- {
- if (n == 1) return;
- fftpack_rfftb1(n, r, wsave, wsave+n, (int*)(wsave+2*n));
- } /* rfftb */
-
-
void fftpack_rffti1(int n, Treal wa[], int ifac[MAXFAC+2])
{
static const Treal twopi = 6.28318530717959;
} /* rffti1 */
-void fftpack_rffti(int n, Treal wsave[])
- {
- if (n == 1) return;
- fftpack_rffti1(n, wsave+n, (int*)(wsave+2*n));
- } /* rffti */
-#ifdef __cplusplus
-}
-#endif
#ifndef _fftpack_h
#define _fftpack_h
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#if GMX_DOUBLE
#define Treal double
#else
void fftpack_rfftf1(int n, Treal c[], Treal ch[], const Treal wa[], const int ifac[]);
void fftpack_rfftb1(int n, Treal c[], Treal ch[], const Treal wa[], const int ifac[]);
-#ifdef __cplusplus
-}
-#endif
-
#endif
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2018,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
if (GMX_FFT_FFTPACK)
gmx_add_libgromacs_sources(
fft_fftpack.cpp
- ${CMAKE_SOURCE_DIR}/src/external/fftpack/fftpack.c)
+ ${CMAKE_SOURCE_DIR}/src/external/fftpack/fftpack.cpp)
endif()
if (GMX_FFT_FFTW3 OR GMX_FFT_ARMPL_FFTW3)
gmx_add_libgromacs_sources(fft_fftw3.cpp)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2016,2019, by the GROMACS development team, led by
# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
file(GLOB FILEIO_SOURCES *.cpp)
if(GMX_USE_PLUGINS)
- set(FILEIO_SOURCES ${FILEIO_SOURCES} ${CMAKE_SOURCE_DIR}/src/external/vmd_molfile/vmddlopen.c)
+ target_sources(libgromacs_external PRIVATE ${CMAKE_SOURCE_DIR}/src/external/vmd_molfile/vmddlopen.cpp)
else()
list(REMOVE_ITEM FILEIO_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/vmdio.cpp)
endif()