MINGW-packages/mingw-w64-cp2k/001-fix-build-on-mingw-w64.patch
2025-01-29 19:41:43 +01:00

100 lines
3.7 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- a/src/ipi_server.F
+++ b/src/ipi_server.F
@@ -150,6 +150,12 @@
SUBROUTINE shutdown_server(ipi_env)
TYPE(ipi_environment_type), POINTER :: ipi_env
+#ifdef __NO_SOCKETS
+ CHARACTER(len=*), PARAMETER :: routineN = 'shutdown_server'
+ INTEGER :: handle
+ CALL timeset(routineN, handle)
+ CPABORT("CP2K was compiled with the __NO_SOCKETS option!")
+#else
CHARACTER(len=msglength), PARAMETER :: msg = "EXIT"
INTEGER :: output_unit
@@ -158,6 +164,7 @@
WRITE (output_unit, *) "@ iPI: Shutting down server."
CALL writebuffer(ipi_env%sockfd, msg, msglength)
CALL close_socket(ipi_env%sockfd)
+#endif
END SUBROUTINE shutdown_server
! **************************************************************************************************
@@ -168,6 +175,12 @@
SUBROUTINE request_forces(ipi_env)
TYPE(ipi_environment_type), POINTER :: ipi_env
+#ifdef __NO_SOCKETS
+ CHARACTER(len=*), PARAMETER :: routineN = 'request_forces'
+ INTEGER :: handle
+ CALL timeset(routineN, handle)
+ CPABORT("CP2K was compiled with the __NO_SOCKETS option!")
+#else
CHARACTER(len=msglength) :: msgbuffer
INTEGER :: comm_socket, i, nAtom, p, xyz
REAL(kind=dp) :: energy
@@ -206,8 +219,9 @@
END DO
END DO
CALL ipi_env_set(ipi_env=ipi_env, ipi_energy=energy, ipi_forces=forces)
+#endif
END SUBROUTINE request_forces
-
+#ifndef __NO_SOCKETS
! **************************************************************************************************
!> \brief ...
!> \param sockfd ...
@@ -238,7 +252,7 @@
CALL writebuffer(sockfd, msg, msglength)
CALL get_header(sockfd, buffer)
END SUBROUTINE ask_status
-
+#endif
! **************************************************************************************************
!> \brief ...
!> \param sockfd ...
@@ -256,6 +270,12 @@
OPTIONAL :: virial
CHARACTER(len=:), INTENT(OUT), OPTIONAL, POINTER :: extra
+#ifdef __NO_SOCKETS
+ CHARACTER(len=*), PARAMETER :: routineN = 'ask_getforce'
+ INTEGER :: handle
+ CALL timeset(routineN, handle)
+ CPABORT("CP2K was compiled with the __NO_SOCKETS option!")
+#else
CHARACTER(len=msglength), PARAMETER :: msg = "GETFORCE"
CHARACTER(len=:), ALLOCATABLE :: extra_buffer
@@ -285,6 +305,7 @@
IF (PRESENT(forces)) forces = RESHAPE(forces_buffer, shape=[3, nAtom])
IF (PRESENT(virial)) virial = RESHAPE(virial_buffer, shape=[3, 3])
IF (PRESENT(extra)) extra = extra_buffer
+#endif
END SUBROUTINE ask_getforce
! **************************************************************************************************
@@ -296,6 +317,12 @@
INTEGER, INTENT(IN) :: sockfd
TYPE(cp_subsys_type), POINTER :: subsys
+#ifdef __NO_SOCKETS
+ CHARACTER(len=*), PARAMETER :: routineN = 'send_posdata'
+ INTEGER :: handle
+ CALL timeset(routineN, handle)
+ CPABORT("CP2K was compiled with the __NO_SOCKETS option!")
+#else
CHARACTER(len=msglength), PARAMETER :: msg = "POSDATA"
INTEGER :: i, nAtom, p, xyz
@@ -323,7 +350,7 @@
END DO
END DO
CALL writebuffer(sockfd, particle_buffer, nAtom*3)
-
+#endif
END SUBROUTINE send_posdata
END MODULE ipi_server