work around PGI compiler issues
This commit is contained in:
@ -220,6 +220,7 @@ if(BUILD_OMP)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR
|
if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR
|
||||||
|
(CMAKE_CXX_COMPILER_ID STREQUAL "PGI") OR
|
||||||
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
|
((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR
|
||||||
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
|
((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0)))
|
||||||
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
|
# GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts.
|
||||||
|
|||||||
@ -375,7 +375,11 @@ struct ostream_params {
|
|||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
#if defined(__PGI)
|
||||||
|
static detail::buffer_size buffer_size;
|
||||||
|
#else
|
||||||
static constexpr detail::buffer_size buffer_size;
|
static constexpr detail::buffer_size buffer_size;
|
||||||
|
#endif
|
||||||
|
|
||||||
// A fast output stream which is not thread-safe.
|
// A fast output stream which is not thread-safe.
|
||||||
class ostream final : private detail::buffer<char> {
|
class ostream final : private detail::buffer<char> {
|
||||||
|
|||||||
@ -268,6 +268,8 @@ The typecasts prevent compiler warnings about possible truncation issues.
|
|||||||
# define _noopt __attribute__((optnone))
|
# define _noopt __attribute__((optnone))
|
||||||
#elif defined(__INTEL_COMPILER)
|
#elif defined(__INTEL_COMPILER)
|
||||||
# define _noopt
|
# define _noopt
|
||||||
|
#elif defined(__PGI)
|
||||||
|
# define _noopt
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))
|
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9))
|
||||||
# if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0)
|
# if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0)
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
MODULE keepcmds
|
MODULE keepcmds
|
||||||
USE liblammps
|
USE liblammps
|
||||||
TYPE(LAMMPS) :: lmp
|
TYPE(LAMMPS) :: lmp
|
||||||
CHARACTER(len=*), DIMENSION(*), PARAMETER :: demo_input = &
|
CHARACTER(len=40), DIMENSION(3), PARAMETER :: demo_input = &
|
||||||
[ CHARACTER(len=40) :: &
|
[ CHARACTER(len=40) :: &
|
||||||
'region box block 0 $x 0 2 0 2', &
|
'region box block 0 $x 0 2 0 2', &
|
||||||
'create_box 1 box', &
|
'create_box 1 box', &
|
||||||
'create_atoms 1 single 1.0 1.0 ${zpos}' ]
|
'create_atoms 1 single 1.0 1.0 ${zpos}' ]
|
||||||
CHARACTER(len=*), DIMENSION(*), PARAMETER :: cont_input = &
|
CHARACTER(len=40), DIMENSION(2), PARAMETER :: cont_input = &
|
||||||
[ CHARACTER(len=40) :: &
|
[ CHARACTER(len=40) :: &
|
||||||
'create_atoms 1 single &', &
|
'create_atoms 1 single &', &
|
||||||
' 0.2 0.1 0.1' ]
|
' 0.2 0.1 0.1' ]
|
||||||
@ -19,7 +19,7 @@ FUNCTION f_lammps_with_args() BIND(C, name="f_lammps_with_args")
|
|||||||
IMPLICIT NONE
|
IMPLICIT NONE
|
||||||
TYPE(c_ptr) :: f_lammps_with_args
|
TYPE(c_ptr) :: f_lammps_with_args
|
||||||
|
|
||||||
CHARACTER(len=*), DIMENSION(*), PARAMETER :: args = &
|
CHARACTER(len=12), DIMENSION(12), PARAMETER :: args = &
|
||||||
[ CHARACTER(len=12) :: 'liblammps', '-log', 'none', &
|
[ CHARACTER(len=12) :: 'liblammps', '-log', 'none', &
|
||||||
'-echo','screen','-nocite','-var','zpos','1.5','-var','x','2']
|
'-echo','screen','-nocite','-var','zpos','1.5','-var','x','2']
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,7 @@ FUNCTION f_lammps_no_mpi_with_args() BIND(C, name="f_lammps_no_mpi_with_args")
|
|||||||
IMPLICIT NONE
|
IMPLICIT NONE
|
||||||
TYPE(c_ptr) :: f_lammps_no_mpi_with_args
|
TYPE(c_ptr) :: f_lammps_no_mpi_with_args
|
||||||
|
|
||||||
CHARACTER(len=*), DIMENSION(*), PARAMETER :: args = &
|
CHARACTER(len=12), DIMENSION(4), PARAMETER :: args = &
|
||||||
[ CHARACTER(len=12) :: 'liblammps', '-log', 'none', '-nocite' ]
|
[ CHARACTER(len=12) :: 'liblammps', '-log', 'none', '-nocite' ]
|
||||||
|
|
||||||
lmp = lammps(args)
|
lmp = lammps(args)
|
||||||
@ -54,7 +54,7 @@ FUNCTION f_lammps_open_with_args() BIND(C, name="f_lammps_open_with_args")
|
|||||||
TYPE(c_ptr) :: f_lammps_open_with_args
|
TYPE(c_ptr) :: f_lammps_open_with_args
|
||||||
INTEGER :: color, key, ierr
|
INTEGER :: color, key, ierr
|
||||||
|
|
||||||
CHARACTER(len=*), DIMENSION(*), PARAMETER :: args = &
|
CHARACTER(len=12), DIMENSION(4), PARAMETER :: args = &
|
||||||
[ CHARACTER(len=12) :: 'liblammps', '-log', 'none', '-nocite' ]
|
[ CHARACTER(len=12) :: 'liblammps', '-log', 'none', '-nocite' ]
|
||||||
|
|
||||||
color = 2
|
color = 2
|
||||||
@ -73,7 +73,7 @@ SUBROUTINE f_lammps_close() BIND(C, name="f_lammps_close")
|
|||||||
CALL lmp%close()
|
CALL lmp%close()
|
||||||
lmp%handle = c_null_ptr
|
lmp%handle = c_null_ptr
|
||||||
END SUBROUTINE f_lammps_close
|
END SUBROUTINE f_lammps_close
|
||||||
|
|
||||||
FUNCTION f_lammps_get_comm() BIND(C, name="f_lammps_get_comm")
|
FUNCTION f_lammps_get_comm() BIND(C, name="f_lammps_get_comm")
|
||||||
USE liblammps
|
USE liblammps
|
||||||
USE keepcreate, ONLY: mycomm
|
USE keepcreate, ONLY: mycomm
|
||||||
@ -82,5 +82,3 @@ FUNCTION f_lammps_get_comm() BIND(C, name="f_lammps_get_comm")
|
|||||||
|
|
||||||
f_lammps_get_comm = mycomm
|
f_lammps_get_comm = mycomm
|
||||||
END FUNCTION f_lammps_get_comm
|
END FUNCTION f_lammps_get_comm
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user