--- a/cmake/FindWANNIER.cmake
+++ b/cmake/FindWANNIER.cmake
@@ -60,7 +60,7 @@
 endif (WANNIER_FOUND)
 
 if(WANNIER_FOUND AND NOT TARGET abinit::wannier)
-  add_library(abinit::wannier SHARED IMPORTED)
+  add_library(abinit::wannier UNKNOWN IMPORTED)
 
   set_target_properties(abinit::wannier PROPERTIES
     INTERFACE_INCLUDE_DIRECTORIES "${WANNIER_INCLUDE_DIR}"
--- a/cmake/generate_config_h.cmake
+++ b/cmake/generate_config_h.cmake
@@ -210,8 +210,10 @@
 
 # check async
 try_compile(HAVE_FC_ASYNC_BOOL ${CMAKE_BINARY_DIR}/try_compile ${CMAKE_SOURCE_DIR}/cmake/try_compile/have_fc_async.F90)
-if (HAVE_FC_ASYNC_BOOL)
+if (HAVE_FC_ASYNC_BOOL AND NOT MINGW)
   set(HAVE_FC_ASYNC 1)
+else()
+  set(HAVE_FC_ASYNC 0)
 endif()
 
 # check backtrace
--- a/shared/common/src/CMakeLists.txt
+++ b/shared/common/src/CMakeLists.txt
@@ -25,6 +25,6 @@
 IF(NOT EXISTS "${CMAKE_SOURCE_DIR}/shared/common/src/39_libpaw")
   message("-- Create 39_libpaw symbolic link")
   execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/shared/common/src
-                  COMMAND ${CMAKE_COMMAND} -E create_symlink ../../libpaw/src 39_libpaw)
+                  COMMAND ${CMAKE_COMMAND} -E copy_directory ../../libpaw/src 39_libpaw)
 endif()
 add_subdirectory(39_libpaw)
--- a/shared/common/src/02_clib/CMakeLists.txt
+++ b/shared/common/src/02_clib/CMakeLists.txt
@@ -11,13 +11,15 @@
   mallinfo.c
   md5.c
   md5.h
-  rlimit.c
   xexit.c
   xmalloc.c
   xmalloc.h
   m_fsockets.F90
   m_clib.F90
 )
+if(NOT WIN32)
+  target_sources(02_lib rlimit.c)
+endif()
 
 set_target_properties(02_clib
   PROPERTIES
@@ -44,5 +46,13 @@
     PUBLIC
     abinit::levmar)
 endif()
+if(WIN32)
+  target_compile_definitions(02_clib
+    PRIVATE
+    _WIN32)
+  target_link_libraries(02_clib
+    PUBLIC
+    ws2_32)
+endif()
 
 add_library(abinit::02_clib ALIAS 02_clib)
--- a/shared/common/src/02_clib/fsi_posix.c
+++ b/shared/common/src/02_clib/fsi_posix.c
@@ -25,6 +25,10 @@
 #include <errno.h>
 #include "abi_clib.h"
 #include "xmalloc.h"
+#ifdef _WIN32
+#include <direct.h>
+#define mkdir(a,b) mkdir (a)
+#endif
 
 /* Return 0 if dirpath is not an existent directory */
 int _directory_exist(const char *dirpath) {
--- a/shared/common/src/02_clib/m_clib.F90
+++ b/shared/common/src/02_clib/m_clib.F90
@@ -31,10 +31,12 @@
  public :: clib_etime
  public :: clib_mtrace
  public :: clib_print_mallinfo
+#ifndef _WIN32
  public :: clib_ulimit_stack    ! Set stack size limit to maximum allowed value.
+ public :: clib_setenv
+#endif
  public :: clib_getpid
  public :: clib_sleep           ! Sleep for a certain number of seconds.
- public :: clib_setenv
  public :: clib_mkdir_if_needed
 
 
@@ -125,7 +127,7 @@
      integer(c_int),intent(out) :: ierr
    end subroutine
  end interface
-
+#ifndef _WIN32
  interface
    ! Set stack size limit to maximum allowed value. Return soft and hard limit and exit status.
    subroutine clib_ulimit_stack(rlim_cur, rlim_max, ierr) bind(C, name="ulimit_stack")
@@ -142,6 +144,7 @@
      integer(c_int),intent(in) :: overwrite
    end function
  end interface
+#endif
 
 ! ==========================================
 ! ==== Fortran-bindings for file_lock.c ====
@@ -260,7 +263,7 @@
 !!       value (by contrast with putenv(3)).
 !!
 !! SOURCE
-
+#ifndef _WIN32
 integer function clib_setenv(name, value, overwrite) result(ierr)
 
 !Arguments ------------------------------------
@@ -272,6 +275,6 @@
 
 end function clib_setenv
 !!***
-
+#endif
 END MODULE m_clib
 !!***
--- a/shared/common/src/02_clib/sockets.c
+++ b/shared/common/src/02_clib/sockets.c
@@ -53,10 +53,16 @@
 #include <unistd.h>
 #include <string.h>
 #include <sys/types.h>
+#ifndef _WIN32
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <sys/un.h>
 #include <netdb.h>
+#else
+#include <ws2tcpip.h>
+#include <winsock.h>
+#include <afunix.h>
+#endif
 
 void open_socket(int *psockfd, int* inet, int* port, const char* host)
 /* Opens a socket.
--- a/shared/common/src/12_hide_mpi/CMakeLists.txt
+++ b/shared/common/src/12_hide_mpi/CMakeLists.txt
@@ -53,6 +53,12 @@
   PRIVATE
   HAVE_CONFIG_H)
 
+if(WIN32)
+  target_compile_definitions(12_hide_mpi
+    PRIVATE
+    _WIN32)
+endif()
+
 target_link_libraries(12_hide_mpi
   PUBLIC
   abinit::02_clib
--- a/shared/common/src/12_hide_mpi/m_xmpi.F90
+++ b/shared/common/src/12_hide_mpi/m_xmpi.F90
@@ -818,8 +818,10 @@
  end if
 #endif
 
+#ifndef _WIN32
  ! Try to increase stack size.
  call clib_ulimit_stack(rlim_cur, rlim_max, ierr)
+#endif
 
  if (xmpi_comm_rank(xmpi_world) == 0) then
 
@@ -875,12 +877,7 @@
 
  ! If OMP_NUM_THREADS is not defined (ierr != 0), set it to 1
  if (ierr /= 0) then
-   ierr = clib_setenv('OMP_NUM_THREADS', '1', 1)
-   if (ierr == 0) then
-     write(std_out,"(a)")'- OMP_NUM_THREADS was not defined. It has been set to 1.'
-   else
-     write(std_out,"(a)")'- WARNING: Failed to set OMP_NUM_THREADS.'
-   end if
+   write(std_out,"(a)")'- WARNING: Failed to set OMP_NUM_THREADS.'
  else
    !write(std_out,*)'- OMP_NUM_THREADS is already set to: ', trim(omp_num_threads)
  end if
--- a/src/57_iopsp_parser/CMakeLists.txt
+++ b/src/57_iopsp_parser/CMakeLists.txt
@@ -37,6 +37,7 @@
   PUBLIC
   abinit::21_hashfuncs
   abinit::44_abitypes_defs
+  abinit::libpsml
   )
 
 add_library(abinit::57_iopsp_parser ALIAS 57_iopsp_parser)
--- a/src/64_psp/CMakeLists.txt
+++ b/src/64_psp/CMakeLists.txt
@@ -39,6 +39,7 @@
   abinit::53_ffts
   abinit::57_iovars
   abinit::57_iopsp_parser
+  abinit::libpsml
   )
 
 add_library(abinit::64_psp ALIAS 64_psp)
