diff --git a/configure.ac b/configure.ac index f03bdaf268c..b7cad3c66c1 100644 --- a/configure.ac +++ b/configure.ac @@ -365,11 +365,6 @@ opal_show_title "Compiler and preprocessor tests" OPAL_SETUP_CC -# If we build on a windows environment with the windows compiler and linker -# then we need some translation functions from the opal/win32 directory. -AM_CONDITIONAL(OMPI_NEED_WINDOWS_REPLACEMENTS, - test "$opal_cv_c_compiler_vendor" = "microsoft" ) - # Do all Interix detections if necessary OMPI_INTERIX diff --git a/opal/win32/opal_inet.c b/opal/win32/opal_inet.c deleted file mode 100644 index 65f4c6a5dfb..00000000000 --- a/opal/win32/opal_inet.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2009 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" - -#include "opal/util/output.h" -#include "opal/win32/opal_inet.h" - -/* - * convert from presentation format (which usually means ASCII printable) - * to network format (which is usually some kind of binary format). - * - * return: - * 1 if the address was valid for the specified address family - * 0 if the address wasn't valid (`dst' is untouched in this case) - * -1 if some other error occurred (`dst' is untouched in this case, too) - */ -int opal_inet_pton(int af, const char *src, void *dst) -{ - int addr_len; - struct sockaddr sa; - struct sockaddr_in *sin = (struct sockaddr_in *) &sa; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &sa; - - memset(&sa, 0, sizeof(struct sockaddr)); - - switch (af) { - case AF_INET: - addr_len = sizeof(struct sockaddr_in); - break; - - case AF_INET6: - addr_len = sizeof(struct sockaddr_in6); - break; - - default: - return -1; - } - - if (0 == WSAStringToAddress((LPTSTR) src, af, NULL, (LPSOCKADDR) &sa, &addr_len)) { - switch (af) { - case AF_INET: - memcpy(dst, &sin->sin_addr, sizeof(struct in_addr)); - break; - - case AF_INET6: - memcpy(dst, &sin6->sin6_addr, sizeof(struct in6_addr)); - break; - } - return 1; - } else { - opal_output(0, "WSAStringToAddress failed %s:%d. Error code: %d", __FILE__, __LINE__, - GetLastError()); - return 0; - } -} - -/* - * convert a network format address to presentation format. - * - * return: - * pointer to presentation format address (`dst'), or NULL. - */ -const char *opal_inet_ntop(int af, const void *src, char *dst, size_t size) -{ - int addr_len; - struct sockaddr sa; - DWORD str_len = size; - struct sockaddr_in *sin = (struct sockaddr_in *) &sa; - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &sa; - - memset(&sa, 0, sizeof(struct sockaddr)); - - switch (af) { - case AF_INET: - addr_len = sizeof(struct sockaddr_in); - sin->sin_family = af; - memcpy(&sin->sin_addr, src, sizeof(struct in_addr)); - break; - - case AF_INET6: - addr_len = sizeof(struct sockaddr_in6); - sin6->sin6_family = af; - memcpy(&sin6->sin6_addr, src, sizeof(struct in6_addr)); - break; - - default: - return NULL; - } - - if (0 == WSAAddressToString((LPSOCKADDR) &sa, addr_len, NULL, dst, &str_len)) { - return dst; - } else { - opal_output(0, "WSAAddressToString failed %s:%d. Error code: %d", __FILE__, __LINE__, - GetLastError()); - return NULL; - } -} diff --git a/opal/win32/opal_inet.h b/opal/win32/opal_inet.h deleted file mode 100644 index d7fee7ef7b8..00000000000 --- a/opal/win32/opal_inet.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2009 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_INET_H -#define OPAL_INET_H - -#include "opal_config.h" - -#ifndef OPAL_WIN_COMPAT_H -# error This file is supposed to be included only from win_compat.h -#endif /* OPAL_WIN_COMPAT_H */ - -BEGIN_C_DECLS - -OPAL_DECLSPEC int opal_inet_pton(int af, const char *src, void *dst); - -OPAL_DECLSPEC const char *opal_inet_ntop(int af, const void *src, char *dst, size_t size); - -END_C_DECLS - -#endif /* OPAL_INET_H */ diff --git a/opal/win32/opal_misc.h b/opal/win32/opal_misc.h deleted file mode 100644 index 3d4e0bdb50c..00000000000 --- a/opal/win32/opal_misc.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_MISC_H -#define OPAL_MISC_H - -#include -#include - -#define _SC_PAGESIZE 0 -#define _SC_OPEN_MAX 1 - -#if 0 -/* currently, this is a memory leak */ -static __inline char* getenv (const char *name) -{ - int ret; - char *buffer; - DWORD length = GetEnvironmentVariable( (LPCSTR)name, NULL, 0 ); - - if( 0 == length ) return NULL; - buffer = (char *)malloc(sizeof(char) * length); - ret = GetEnvironmentVariable((LPCSTR)name, (LPSTR)buffer, length); - return (ret > 0) ? buffer: NULL; -} - - -static __inline int setenv (const char *name, const char *value, int rewrite) -{ - int ret; - if( 0 == rewrite ) { - DWORD length = 0; - if( 0 == (length = GetEnvironmentVariable( (LPCSTR)name, NULL, length )) ) { - if( ERROR_ENVVAR_NOT_FOUND == GetLastError() ) { /* do not exist */ - return 0; - } - } - } - /* just push it back to the windows thingy */ - ret = SetEnvironmentVariable ((LPCSTR)name, (LPCSTR)value); - return (0 != ret)? 1: 0; -} -#endif - -static __inline unsigned int sleep(unsigned int seconds) -{ - - /* Allow interruptions */ - SleepEx(seconds * 1000, TRUE); - return 0; -} - -/* this function can currently ONLY return the page size. for it to - do the entire sysconf range it needs to be extended */ -static __inline size_t sysconf(int option) -{ - - SYSTEM_INFO sys_info; - - if (_SC_OPEN_MAX == option) { - return _getmaxstdio(); - } - - GetSystemInfo(&sys_info); - if (_SC_PAGESIZE == option) { - return (size_t) sys_info.dwPageSize; - } - printf("This functionality is not supported: line: %d\tfile: %s\n", __LINE__, __FILE__); - abort(); - return 0; -} - -#define F_GETFL 0 -#define F_SETFL 1 -#define O_NONBLOCK 0 -/* - * this function is currently defined only for setting the socket to be - * in the non-blocking mode. Else this function returns error not implemented. - * This calls ioctlsocket in the winsock library - */ -static __inline int fcntl(int fildes, int cmd, ...) -{ - int ret; - int mode; - - switch (cmd) { - case F_SETFL: - mode = 1; - ret = ioctlsocket((SOCKET) fildes, FIONBIO, (u_long FAR *) &mode); - break; - case F_GETFL: - ret = 0; - break; - default: - printf("Option not supported: %d %s\n", __LINE__, __FILE__); - abort(); - }; - - return ret; -} - -#endif /* OPAL_MISC_H */ diff --git a/opal/win32/opal_process.c b/opal/win32/opal_process.c deleted file mode 100644 index 85d9530cd26..00000000000 --- a/opal/win32/opal_process.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - University Research and Technology - Corporation. All rights reserved. - Copyright (c) 2004-2014 The University of Tennessee and The University - of Tennessee Research Foundation. All rights - reserved. - Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - University of Stuttgart. All rights reserved. - Copyright (c) 2004-2005 The Regents of the University of California. - All rights reserved. - $COPYRIGHT$ - - Additional copyrights may follow - - $HEADER$ - */ - -#include "opal_config.h" -#include "win32/opal_process.h" - -pid_t waitpid(pid_t pid, int *status, int options) -{ - return _cwait(status, pid, _WAIT_CHILD); -} - -int kill(pid_t pid, int sig) -{ - /* XXX fill this in */ - /* Need to connect to the child process - Then raise the signal since Windows doesn;t - have the ability to 'send a signal' to a - process, a la the kill command in UNIX - - MSVC functions to look at: - - OpenProcess - - TerminateProcess - - raise - */ - - return 0; -} diff --git a/opal/win32/opal_process.h b/opal/win32/opal_process.h deleted file mode 100644 index 86d7682cb53..00000000000 --- a/opal/win32/opal_process.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - *Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - *Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - *Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - *Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - *$COPYRIGHT$ - * - *Additional copyrights may follow - * - *$HEADER$ - */ - -#ifndef OPAL_PROCESS_H -#define OPAL_PROCESS_H - -#include "opal_config.h" - -#ifndef OPAL_WIN_COMPAT_H -# error This file is supposed to be included only from win_compat.h -#endif /* OPAL_WIN_COMPAT_H */ - -BEGIN_C_DECLS - -OPAL_DECLSPEC pid_t waitpid(pid_t pid, int *status, int options); - -OPAL_DECLSPEC int kill(pid_t pid, int sig); - -END_C_DECLS - -#endif /* OPAL_PROCESS_H */ diff --git a/opal/win32/opal_socket.c b/opal/win32/opal_socket.c deleted file mode 100644 index dc8d40a5ee5..00000000000 --- a/opal/win32/opal_socket.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2010 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" - -#include "opal/util/output.h" -#include "opal/win32/opal_socket.h" - -int create_socketpair(int family, int type, int protocol, int fd[2]) -{ - /* This code is originally from Tor. Used with permission. */ - - /* This socketpair does not work when localhost is down. So - * it's really not the same thing at all. But it's close enough - * for now, and really, when localhost is down sometimes, we - * have other problems too. - */ -#ifdef WIN32 -# define ERR(e) WSA##e -#else -# define ERR(e) e -#endif - int listener = -1; - int connector = -1; - int acceptor = -1; - struct sockaddr_in listen_addr; - struct sockaddr_in connect_addr; - int size; - int saved_errno = -1; - - if (protocol - || (family != AF_INET -#ifdef AF_UNIX - && family != AF_UNIX -#endif - )) { - opal_output(0, "Protocol not support: %d", (ERR(EAFNOSUPPORT))); - return -1; - } - if (!fd) { - opal_output(0, "Invalid socket: %d", (ERR(EINVAL))); - return -1; - } - - listener = socket(AF_INET, type, 0); - if (listener < 0) - return -1; - memset(&listen_addr, 0, sizeof(listen_addr)); - listen_addr.sin_family = AF_INET; - listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - listen_addr.sin_port = 0; /* kernel chooses port. */ - if (bind(listener, (struct sockaddr *) &listen_addr, sizeof(listen_addr)) == -1) - goto tidy_up_and_fail; - if (listen(listener, 1) == -1) - goto tidy_up_and_fail; - - connector = socket(AF_INET, type, 0); - if (connector < 0) - goto tidy_up_and_fail; - /* We want to find out the port number to connect to. */ - size = sizeof(connect_addr); - if (getsockname(listener, (struct sockaddr *) &connect_addr, &size) == -1) - goto tidy_up_and_fail; - if (size != sizeof(connect_addr)) - goto abort_tidy_up_and_fail; - if (connect(connector, (struct sockaddr *) &connect_addr, sizeof(connect_addr)) == -1) - goto tidy_up_and_fail; - - size = sizeof(listen_addr); - acceptor = accept(listener, (struct sockaddr *) &listen_addr, &size); - if (acceptor < 0) - goto tidy_up_and_fail; - if (size != sizeof(listen_addr)) - goto abort_tidy_up_and_fail; - closesocket(listener); - /* Now check we are talking to ourself by matching port and host on the - two sockets. */ - if (getsockname(connector, (struct sockaddr *) &connect_addr, &size) == -1) - goto tidy_up_and_fail; - if (size != sizeof(connect_addr) || listen_addr.sin_family != connect_addr.sin_family - || listen_addr.sin_addr.s_addr != connect_addr.sin_addr.s_addr - || listen_addr.sin_port != connect_addr.sin_port) - goto abort_tidy_up_and_fail; - fd[0] = connector; - fd[1] = acceptor; - - return 0; - -abort_tidy_up_and_fail: - saved_errno = ERR(ECONNABORTED); -tidy_up_and_fail: - if (saved_errno < 0) - saved_errno = WSAGetLastError(); - if (listener != -1) - closesocket(listener); - if (connector != -1) - closesocket(connector); - if (acceptor != -1) - closesocket(acceptor); - - WSASetLastError(saved_errno); - return -1; -#undef ERR -} diff --git a/opal/win32/opal_socket.h b/opal/win32/opal_socket.h deleted file mode 100644 index 3e81841ad6c..00000000000 --- a/opal/win32/opal_socket.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2010 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_SOCKET_H -#define OPAL_SOCKET_H - -#include "opal_config.h" - -#ifndef OPAL_WIN_COMPAT_H -# error This file is supposed to be included only from win_compat.h -#endif /* OPAL_WIN_COMPAT_H */ - -BEGIN_C_DECLS - -OPAL_DECLSPEC int create_socketpair(int d, int type, int protocol, int sv[2]); - -END_C_DECLS - -#endif /* OPAL_SOCKET_H */ diff --git a/opal/win32/opal_time.c b/opal/win32/opal_time.c deleted file mode 100644 index f7799988d57..00000000000 --- a/opal/win32/opal_time.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" -#include "opal/win32/opal_time.h" - -#include - -#define EPOCHFILETIME (116444736000000000LL) - -int gettimeofday(struct timeval *tv, struct timezone *tz) -{ - FILETIME file_time; - LARGE_INTEGER place_holder; - __int64 time; - - /* returns 64 bit value which is the number of 100 nanosecond - intervals since 1601(UTC) */ - GetSystemTimeAsFileTime(&file_time); - - /* Windows recommends that we should copy the FILETIME returned - into a ULARGE_INTEGER and then perform the arithmetic on that */ - place_holder.LowPart = file_time.dwLowDateTime; - place_holder.HighPart = file_time.dwHighDateTime; - time = place_holder.QuadPart; - time -= EPOCHFILETIME; - - /* Now we can use arithmetic operations on time which is nothing but - a 64 bit integer holding time in 100 nanosec intervals */ - - /* convert 100 nanoseconds intervals into microseconds .. divide by 10 */ - time /= 10; - - tv->tv_sec = (long) (time / 1000000); - tv->tv_usec = (long) (time % 1000000); - - return 0; -} diff --git a/opal/win32/opal_time.h b/opal/win32/opal_time.h deleted file mode 100644 index 94aa91d05f6..00000000000 --- a/opal/win32/opal_time.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - *Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - *Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - *Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - *Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - *$COPYRIGHT$ - * - *Additional copyrights may follow - * - *$HEADER$ - */ - -#ifndef OPAL_TIME_H -#define OPAL_TIME_H - -#include "opal_config.h" - -#ifndef OPAL_WIN_COMPAT_H -# error This file is supposed to be included only from win_compat.h -#endif /* OPAL_WIN_COMPAT_H */ - -#define DST_NONE 0 /* not on dst */ -#define DST_USA 1 /* USA style dst */ -#define DST_AUST 2 /* Australian style dst */ -#define DST_WET 3 /* Western European dst */ -#define DST_MET 4 /* Middle European dst */ -#define DST_EET 5 /* Eastern European dst */ -#define DST_CAN 6 /* Canada */ - -#define TIMEVAL_TO_TIMESPEC(tv, ts) \ - (ts)->tv_sec = (tv)->tv_sec; \ - (ts)->tv_nsec = (tv)->tv_usec * 1000; - -#define TIMESPEC_TO_TIMEVAL(tv, ts) \ - (tv)->tv_sec = (ts)->tv_sec; \ - (tv)->tv_usec = (ts)->tv_nsec / 1000; - -/* some more utility functions */ -/* Operations on timevals. */ -#ifndef timerclear -# define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 -#endif - -#ifndef timerisset -# define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -#endif - -#ifndef timercmp -# define timercmp(tvp, uvp, cmp) \ - (((tvp)->tv_sec == (uvp)->tv_sec) ? ((tvp)->tv_usec cmp(uvp)->tv_usec) \ - : ((tvp)->tv_sec cmp(uvp)->tv_sec)) -#endif - -#ifndef timeradd -# define timeradd(tvp, uvp, vvp) \ - do { \ - (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \ - (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \ - if ((vvp)->tv_usec >= 1000000) { \ - (vvp)->tv_sec++; \ - (vvp)->tv_usec -= 1000000; \ - } \ - } while (0) -#endif - -#ifndef timersub -# define timersub(tvp, uvp, vvp) \ - do { \ - (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ - (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ - if ((vvp)->tv_usec < 0) { \ - (vvp)->tv_sec--; \ - (vvp)->tv_usec += 1000000; \ - } \ - } while (0) -#endif - -/* Operations on timespecs. */ - -#ifndef timespecclear -# define timespecclear(tsp) (tsp)->tv_sec = (tsp)->tv_nsec = 0 -#endif - -#ifndef timespecisset -# define timespecisset(tsp) ((tsp)->tv_sec || (tsp)->tv_nsec) -#endif - -#ifndef timespeccmp -# define timespeccmp(tsp, usp, cmp) \ - (((tsp)->tv_sec == (usp)->tv_sec) ? ((tsp)->tv_nsec cmp(usp)->tv_nsec) \ - : ((tsp)->tv_sec cmp(usp)->tv_sec)) -#endif - -#ifndef timespecadd -# define timespecadd(tsp, usp, vsp) \ - do { \ - (vsp)->tv_sec = (tsp)->tv_sec + (usp)->tv_sec; \ - (vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \ - if ((vsp)->tv_nsec >= 1000000000L) { \ - (vsp)->tv_sec++; \ - (vsp)->tv_nsec -= 1000000000L; \ - } \ - } while (0) -#endif - -#ifndef timespecsub -# define timespecsub(tsp, usp, vsp) \ - do { \ - (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ - (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ - if ((vsp)->tv_nsec < 0) { \ - (vsp)->tv_sec--; \ - (vsp)->tv_nsec += 1000000000L; \ - } \ - } while (0) -#endif - -/* - * Names of the interval timers, and structure - * defining a timer setting. - */ -#define ITIMER_REAL 0 -#define ITIMER_VIRTUAL 1 -#define ITIMER_PROF 2 - -struct itimerval { - struct timeval it_interval; /* timer interval */ - struct timeval it_value; /* current value */ -}; - -/* - * Getkerninfo clock information structure - */ -struct clockinfo { - int hz; /* clock frequency */ - int tick; /* micro-seconds per hz tick */ - int tickadj; /* clock skew rate for adjtime() */ - int stathz; /* statistics clock frequency */ - int profhz; /* profiling clock frequency */ -}; - -#define CLOCK_REALTIME 0 -#define CLOCK_VIRTUAL 1 -#define CLOCK_PROF 2 - -#define TIMER_RELTIME 0x0 /* relative timer */ -#define TIMER_ABSTIME 0x1 /* absolute timer */ - -#ifndef OPAL_TIMESPEC -# define OPAL_TIMESPEC -struct timespec { - long tv_sec; - long tv_nsec; -}; -#endif - -/* -NOTE: The use of timezone is obsolete even in linux and my gettimeofday -function is not going to support it either. So, please be aware of the -fact that if you expect to pass anything here, then you are DEAD :-D */ -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - -BEGIN_C_DECLS - -OPAL_DECLSPEC int gettimeofday(struct timeval *tv, struct timezone *tz); - -END_C_DECLS - -#endif /* OPAL_TIME_H */ diff --git a/opal/win32/opal_uio.c b/opal/win32/opal_uio.c deleted file mode 100644 index 0270e0f4f7b..00000000000 --- a/opal/win32/opal_uio.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - University Research and Technology - Corporation. All rights reserved. - Copyright (c) 2004-2005 The University of Tennessee and The University - of Tennessee Research Foundation. All rights - reserved. - Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - University of Stuttgart. All rights reserved. - Copyright (c) 2004-2005 The Regents of the University of California. - All rights reserved. - $COPYRIGHT$ - - Additional copyrights may follow - - $HEADER$ - */ - -#include "opal_config.h" -#include "opal/win32/opal_uio.h" -#include - -/* - Highly doubt if the windows sockets ever set errno to EAGAIN. There might - be some weird conversion to map this or I might have to rewrite this piece - of code to handle the windows error flags - */ - -int writev(int fd, struct iovec *iov, int cnt) -{ - int err; - DWORD sendlen; - - err = WSASend((SOCKET) fd, &(iov->data), cnt, &sendlen, 0, NULL, NULL); - - if (err < 0) { - return err; - } - return (int) sendlen; -} - -int readv(int fd, struct iovec *iov, int cnt) -{ - int err; - DWORD recvlen = 0; - DWORD flags = 0; - - err = WSARecv((SOCKET) fd, &(iov->data), cnt, &recvlen, &flags, NULL, NULL); - - if (err < 0) { - return err; - } - return (int) recvlen; -} diff --git a/opal/win32/opal_uio.h b/opal/win32/opal_uio.h deleted file mode 100644 index 2691b0bd3d4..00000000000 --- a/opal/win32/opal_uio.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_UIO_H -#define OPAL_UIO_H - -#include "opal_config.h" - -#ifndef OPAL_WIN_COMPAT_H -# error This file is supposed to be included only from win_compat.h -#endif /* OPAL_WIN_COMPAT_H */ - -/* define the iovec structure */ -struct iovec { - WSABUF data; -}; -#define iov_base data.buf -#define iov_len data.len - -BEGIN_C_DECLS -/* - * writev: - writev writes data to file descriptor fd, and from the buffers - described by iov. The number of buffers is specified by cnt. The - buffers are used in the order specified. Operates just like write - except that data is taken from iov instead of a contiguous buffer. - */ -OPAL_DECLSPEC int writev(int fd, struct iovec *iov, int cnt); - -/* - readv reads data from file descriptor fd, and puts the result in the - buffers described by iov. The number of buffers is specified by - cnt. The buffers are filled in the order specified. Operates just - like read except that data is put in iov instead of a contiguous - buffer. - */ -OPAL_DECLSPEC int readv(int fd, struct iovec *iov, int cnt); - -END_C_DECLS - -#endif /* OPAL_UIO_H */ diff --git a/opal/win32/opal_util.h b/opal/win32/opal_util.h deleted file mode 100644 index 9c63e5163eb..00000000000 --- a/opal/win32/opal_util.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_UTIL_H -#define OPAL_UTIL_H - -static __inline int getpagesize(void) -{ - SYSTEM_INFO sys_info; - - GetSystemInfo(&sys_info); - return (int) sys_info.dwPageSize; -} - -#endif diff --git a/opal/win32/opal_utsname.c b/opal/win32/opal_utsname.c deleted file mode 100644 index 934c0af73eb..00000000000 --- a/opal/win32/opal_utsname.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - University Research and Technology - Corporation. All rights reserved. - Copyright (c) 2004-2014 The University of Tennessee and The University - of Tennessee Research Foundation. All rights - reserved. - Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - University of Stuttgart. All rights reserved. - Copyright (c) 2004-2005 The Regents of the University of California. - All rights reserved. - $COPYRIGHT$ - - Additional copyrights may follow - - $HEADER$ - */ - -#include "opal_config.h" -#include "opal/win32/opal_utsname.h" -#include "opal/util/string_copy.h" - -/* - This has to fill in the following information - - 1. sysname: name of the operating system -- - 2. nodename: GetComputerName - 3. release: GetVersionEx - 4. version: GetVersionEx - 5. machine: GetSystemInfo -*/ - -int uname(struct utsname *un) -{ - TCHAR env_variable[] = "OS=%OS%"; - DWORD info_buf_count; - OSVERSIONINFO version_info; - SYSTEM_INFO sys_info; - TCHAR info_buf[OPAL_UTSNAME_LEN]; - - info_buf_count = ExpandEnvironmentStrings(env_variable, info_buf, OPAL_UTSNAME_LEN); - if (0 == info_buf_count) { - snprintf(un->sysname, OPAL_UTSNAME_LEN, "Unknown"); - } else { - /* remove the "OS=" from the beginning of the string */ - opal_string_copy(un->sysname, info_buf + 3, OPAL_UTSNAME_LEN); - } - info_buf_count = OPAL_UTSNAME_LEN; - if (!GetComputerName(un->nodename, &info_buf_count)) { - snprintf(un->nodename, OPAL_UTSNAME_LEN, "undefined"); - } - - version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (!GetVersionEx(&version_info)) { - snprintf(un->release, OPAL_UTSNAME_LEN, "undefined"); - snprintf(un->version, OPAL_UTSNAME_LEN, "undefined"); - } else { - /* fill in both release and version information */ - snprintf(un->release, OPAL_UTSNAME_LEN, "%d.%d.%d", version_info.dwMajorVersion, - version_info.dwMinorVersion, version_info.dwBuildNumber); - snprintf(un->version, OPAL_UTSNAME_LEN, "%s", version_info.szCSDVersion); - } - - /* get machine information */ - GetSystemInfo(&sys_info); - switch (sys_info.wProcessorArchitecture) { - case PROCESSOR_ARCHITECTURE_UNKNOWN: - snprintf(un->machine, OPAL_UTSNAME_LEN, "Unknown %d", sys_info.wProcessorLevel); - break; - case PROCESSOR_ARCHITECTURE_INTEL: - snprintf(un->machine, OPAL_UTSNAME_LEN, "Intel %d", sys_info.wProcessorLevel); - break; - case PROCESSOR_ARCHITECTURE_IA64: - snprintf(un->machine, OPAL_UTSNAME_LEN, "IA64 %d", sys_info.wProcessorLevel); - break; - case PROCESSOR_ARCHITECTURE_AMD64: - snprintf(un->machine, OPAL_UTSNAME_LEN, "AMD %d", sys_info.wProcessorLevel); - break; - default: - snprintf(un->machine, OPAL_UTSNAME_LEN, "UFO hardware %d", sys_info.wProcessorLevel); - break; - } - - return 0; -} diff --git a/opal/win32/opal_utsname.h b/opal/win32/opal_utsname.h deleted file mode 100644 index d82e2f65c8f..00000000000 --- a/opal/win32/opal_utsname.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2014 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_UTSNAME_H -#define OPAL_UTSNAME_H - -#include "opal_config.h" - -#define OPAL_UTSNAME_LEN 64 - -struct utsname { - char sysname[OPAL_UTSNAME_LEN]; - char nodename[OPAL_UTSNAME_LEN]; - char release[OPAL_UTSNAME_LEN]; - char version[OPAL_UTSNAME_LEN]; - char machine[OPAL_UTSNAME_LEN]; -}; - -BEGIN_C_DECLS -OPAL_DECLSPEC int uname(struct utsname *un); -END_C_DECLS - -#endif /* OPAL_UTSNAME_H */ diff --git a/opal/win32/win_compat.h b/opal/win32/win_compat.h deleted file mode 100644 index 686298bbc9b..00000000000 --- a/opal/win32/win_compat.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2009 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#ifndef OPAL_WIN_COMPAT_H -#define OPAL_WIN_COMPAT_H - -/** - * don't complain about all the deprecated functions. - */ -#define _CRT_SECURE_NO_DEPRECATE - -/** - * Allow usage of some recent functions (such as SwitchToThread) - * 0x0400 - for SwitchToThread - * 0x0500 - for using Event Objects - */ -#define _WIN32_WINNT 0x0502 - -/** - * Windows does not define the exact same names in stat.h - * Redefine them to our names. - * Supposedly, links are not available - */ -#define S_IFLNK 0xFFFF /* identifies the file as a symbolic link */ -#define S_IXUSR _S_IEXEC /* execute/search permission, owner */ -#define S_IRUSR _S_IREAD /* read permission, owner */ -#define S_IWUSR _S_IWRITE /* write permission, owner */ - -/** - * Define it in order to get access to the "secure" version of rand. - */ -#define _CRT_RAND_S - -/* It is always better to include windows.h with the lean and mean option. - So, include it with that option and then include some which are required. - Note: this file is included only on windows */ - -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif /* WIN32_LEAN_AND_MEAN */ -#ifndef VC_EXTRALEAN -# define VC_EXTRALEAN -#endif /* VC_EXTRALEAN */ -#include - -/* FD_SETSIZE determines how many sockets windows can select() on. If not defined - before including winsock2.h, it is defined to be 64. We are going to go ahead and - make it 1024 for now. PLEASE CHECK IF THIS IS RIGHT */ -#define FD_SETSIZE 1024 - -/* other utility header files */ -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * For all file io operations - */ -#include -#include - -#include -/* for alloca */ -#include - -#define STDIN_FILENO 0 -#define STDOUT_FILENO 1 -#define STDERR_FILENO 2 -typedef unsigned short mode_t; -typedef long ssize_t; -typedef DWORD in_port_t; -typedef char *caddr_t; -typedef unsigned int uint; - -#ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -#endif - -#ifdef _MSC_VER -# if defined(OMPI_BUILDING) && OMPI_BUILDING -# include "opal/win32/opal_inet.h" -# include "opal/win32/opal_misc.h" -# include "opal/win32/opal_socket.h" -# include "opal/win32/opal_time.h" -# include "opal/win32/opal_uio.h" -# include "opal/win32/opal_util.h" -# include "opal/win32/opal_utsname.h" -# endif - -/* Defines for the access functions */ -# define F_OK 0x00 -# define R_OK 0x04 -# define W_OK 0x02 -# define X_OK R_OK /* no execution right on Windows */ -# define S_IRWXU (_S_IREAD | _S_IWRITE | _S_IEXEC) - -/** - * Microsoft compiler complain about non conformance of the default UNIX function. - * Non conformance to the POSIX standard, and they suggest to use the version - * starting with an _ instead. So, in order to keep cl.exe happy (and quiet) we can - * use the following defines. - */ -# define getpid _getpid -# define strdup _strdup -# define putenv _putenv -# define getcwd _getcwd -# define rmdir _rmdir -# define chdir _chdir -# define chmod _chmod -# define access _access -# define open _open -# define close _close -# define unlink _unlink -# define dup2 _dup2 -# define dup _dup -# define write _write -# define read _read -# define fileno _fileno -# define isatty _isatty -# define execvp _execvp -# define S_ISDIR(STAT_MODE) ((STAT_MODE) &_S_IFDIR) -# define S_ISREG(STAT_MODE) ((STAT_MODE) &_S_IFREG) -# define strncasecmp _strnicmp -# define strcasecmp _stricmp -# define umask _umask -# define getch _getch -# define random rand -# define strtok_r strtok_s -# define srand48 srand -# define lrand48 rand -# define usleep(t) Sleep(t / 1000) -# define posix_memalign(p, a, s) *p = _aligned_malloc(s, a) - -#else - -# undef WSABASEERR -/* in MinGW, PACKED is defined to __attribute__((packed)), will have problem for our basic types */ -# undef PACKED -# define pthread_atfork -# include -# if defined(OMPI_BUILDING) && OMPI_BUILDING -# include "opal/win32/opal_inet.h" -# include "opal/win32/opal_misc.h" -# include "opal/win32/opal_socket.h" -# include "opal/win32/opal_uio.h" -# include "opal/win32/opal_util.h" -# include "opal/win32/opal_utsname.h" -# endif - -# define strtok_r(s, d, p) *p = strtok(s, d) - -#endif - -#define MAXPATHLEN _MAX_PATH -#define MAXHOSTNAMELEN _MAX_PATH -#define OPAL_MAXHOSTNAMELEN (MAXHOSTNAMELEN + 1) -#define PATH_MAX _MAX_PATH -#define WTERMSIG(EXIT_CODE) (1) -#define WIFEXITED(EXIT_CODE) (1) -#define WEXITSTATUS(EXIT_CODE) (EXIT_CODE) -#define WIFSIGNALED(EXIT_CODE) (0) -#define WIFSTOPPED(EXIT_CODE) (0) -#define WSTOPSIG(EXIT_CODE) (11) - -#define mkdir(PATH, MODE) _mkdir((PATH)) -#define nanosleep(tp, rem) Sleep(*tp.tv_sec * 1000 + *tp.tv_nsec / 1000000) -#define pipe(array_fd) _pipe(array_fd, 1024, O_BINARY) -#define inet_ntop opal_inet_ntop -#define inet_pton opal_inet_pton -#define lstat stat - -#ifndef UINT64_MAX -# define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ -#endif -#ifndef UINT64_MIN -# define UINT64_MIN 0 -#endif -#ifndef INT64_MAX -# define INT64_MAX 0x7fffffffffffffffLL /*9223372036854775807LL*/ -#endif -#ifndef INT64_MIN -# define INT64_MIN (-0x7fffffffffffffffLL - 1) /* (-9223372036854775807 - 1) */ -#endif -#ifndef UINT32_MAX -# define UINT32_MAX 0xffffffff /* 4294967295U */ -#endif -#ifndef UINT32_MIN -# define UINT32_MIN 0 -#endif -#ifndef INT32_MAX -# define INT32_MAX 0x7fffffff /* 2147483647 */ -#endif -#ifndef INT32_MIN -# define INT32_MIN (-0x7fffffff - 1) /* (-2147483647 - 1) */ -#endif -#ifndef UINT16_MAX -# define UINT16_MAX 0xffff /* 65535U */ -#endif -#ifndef UINT16_MIN -# define UINT16_MIN 0 -#endif -#ifndef INT16_MAX -# define INT16_MAX 0x7fff /* 32767 */ -#endif -#ifndef INT16_MIN -# define INT16_MIN (-0x7fff - 1) /* (-32768) */ -#endif -#ifndef UINT8_MAX -# define UINT8_MAX 0xff /* 255U */ -#endif -#ifndef UINT8_MIN -# define UINT8_MIN 0 -#endif -#ifndef INT8_MAX -# define INT8_MAX 0x7f /* 127 */ -#endif -#ifndef INT8_MIN -# define INT8_MIN (-0x7f - 1) /* (-128) */ -#endif - -/* Make sure we let the compiler know that we support __func__ */ -#if !defined(HAVE_DECL___FUNC__) -# define HAVE_DECL___FUNC__ 1 -#endif - -/*#define sprintf sprintf_s*/ - -/* Ugly signal mapping since windows doesn't support the full spectrum - * just a very small subset... :/ - * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_raise.asp - * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnucmg/html/UCMGch09.asp - */ -#define SIGHUP 1 -/* 2 is used for SIGINT on windows */ -#define SIGQUIT 3 -/* 4 is used for SIGILL on windows */ -#define SIGTRAP 5 -#define SIGIOT 6 -#define SIGBUS 7 -/* 8 is used for SIGFPE on windows */ -#define SIGKILL 9 -#define SIGUSR1 10 -/* 11 is used for SIGSEGV on windows */ -#define SIGUSR2 12 -#define SIGPIPE 13 -#define SIGALRM 14 -/* 15 is used for SIGTERM on windows */ -#define SIGSTKFLT 16 -#define SIGCHLD 17 -#define SIGCONT 18 -#define SIGSTOP 19 -#define SIGTSTP 20 -/* 21 is used for SIGBREAK on windows */ -/* 22 is used for SIGABRT on windows */ -#define SIGTTIN 23 -#define SIGTTOU 24 -#define SIGURG 25 -#define SIGXCPU 26 -#define SIGXFSZ 27 -#define SIGVTALRM 28 -#define SIGPROF 29 -#define SIGWINCH 30 -#define SIGIO 31 - -/* Note: - * The two defines below are likely to break the orte_wait - * functionality. The proper method of replacing these bits - * of functionality is left for further investigated. - */ -#define WUNTRACED 0 -#define WNOHANG 0 - -#define sigset_t int -#define in_addr_t uint32_t - -/* Need to define _Bool here for different version of VS. - The definition in opal_config_bottom.h won't help, - as long as we have a mixed C and C++ projects in one solution. */ -#if defined(_MSC_VER) && _MSC_VER < 1600 -# define _Bool BOOL -#else -# define _Bool bool -#endif - -/* - * No syslog.h on Windows, but these have to be defined somehow. - * There could also be a notifier component later for Windows. - */ -#define LOG_EMERG 0 -#define LOG_ALERT 1 -#define LOG_CRIT 2 -#define LOG_ERR 3 -#define LOG_WARNING 4 -#define LOG_NOTICE 5 -#define LOG_INFO 6 -#define LOG_DEBUG 7 - -/* - * Mask these to Windows equivalents - */ -#define bzero(p, l) memset(p, 0, l) -#define bcopy(s, t, l) memmove(t, s, l) -#define isblank(c) (c == ' ' || c == '\t') ? 1 : 0 - -/* - * OMPI functions that need to be redefined. - */ -#define ompi_debugger_notify_abort(x) -#define ompi_wait_for_debugger(x) - -#endif /* compat */ diff --git a/opal/win_makefile b/opal/win_makefile deleted file mode 100644 index c86ff8e7555..00000000000 --- a/opal/win_makefile +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana -# University Research and Technology -# Corporation. All rights reserved. -# Copyright (c) 2004-2005 The University of Tennessee and The University -# of Tennessee Research Foundation. All rights -# reserved. -# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, -# University of Stuttgart. All rights reserved. -# Copyright (c) 2004-2005 The Regents of the University of California. -# All rights reserved. -# $COPYRIGHT$ -# -# Additional copyrights may follow -# -# $HEADER$ -# -# This is a simple makefile for windows which makes all the components -# which are required for super computing. Too lazy to open up visual -# studio each and every time to compile a component, so just adding -# this to the svn repository -# - -topdir := $(shell cygpath -m $(CURDIR))/.. -prefix = ${topdir}/src/Debug -installdir = ${prefix} -pkgdatadir = ${prefix}/share -sysconfdir = ${prefix}/etc -pkglibdir = ${prefix}/lib - -# list of components to build with the c compiler -C_SUBDIRS = \ - attribute \ - class \ - communicator \ - datatype \ - errhandler \ - event \ - event/WIN32-Code \ - dps \ - file \ - group \ - info \ - util \ - mpi/c \ - mpi/runtime \ - threads \ - op \ - proc \ - request \ - runtime \ - mca/base \ - mca/allocator/base \ - mca/coll/base \ - mca/gpr/base \ - mca/gpr/base/data_type_support \ - mca/gpr/base/pack_api_cmd \ - mca/gpr/base/unpack_api_response \ - mca/io/base \ - mca/iof/base \ - mca/errmgr/base \ - mca/rml/base \ - mca/rmgr/base \ - mca/rmgr/base/data_type_support \ - mca/rmaps/base \ - mca/soh/base \ - mca/soh/base/data_type_support \ - mca/mpool/base \ - mca/ns/base \ - mca/ns/base/data_type_support \ - mca/oob/base \ - mca/pml/base \ - mca/ptl/base \ - mca/pls/base \ - mca/pls/fork \ - mca/pls/proxy \ - mca/pls/rsh \ - mca/ras/base \ - mca/ras/host \ - mca/rds/base \ - mca/rds/hostfile \ - mca/rds/resfile \ - mca/topo/base \ - mca/schema/base \ - win32/generated_source \ - win \ - win32 - -EXTRA_DIRS = - -# -# Files included by the dist that we don't want to compile -# -EXCLUDE_FILES = dt_arch.c \ - epoll.c \ - epoll_sub.c \ - kqueue.c \ - llm_base_parse_hostfile_lex.c \ - misc.c \ - poll.c \ - rtsig.c \ - stacktrace.c \ - condition_spinlock.c - -# -# A small function to extract the list of all files in these directories -# -SOURCE_FILES = $(foreach dir, ${C_SUBDIRS}, $(wildcard ${dir}/*.[c])) -OBJECT_FILES = $(SOURCE_FILES:.c=.obj) -DEBUG = Debug -LINKED_SOURCE = $(foreach dir, ${DEBUG}, $(wildcard ${dir}/*.[c])) -LINKED_OBJS = $(LINKED_SOURCE:.c=.obj) - -.SUFFIXES: .c .obj -CC = cl -CXX = $(CC) - -INCL = \ - /I"${topdir}/src/win32/generated_include" \ - /I"${topdir}/src/win32" \ - /I"${topdir}/include" \ - /I"${topdir}/src" \ - /I"${topdir}/src/event/compat/" \ - /I"${topdir}/src/event" \ - /I"${topdir}/src/event/WIN32-Code/" - -CFLAGS = \ - /DWIN32 \ - /DOPAL_SYSCONFDIR="\"${sysconfdir}\"" \ - /DOPAL_PKGLIBDIR="\"${pkglibdir}\"" \ - /DOPAL_PKGDATADIR="\"${pkgdatadir}\"" \ - /DHAVE_CONFIG_H \ - /D_WINDLL \ - /EHsc \ - /ML \ - /W0 \ - /Wp64 \ - /TC \ - /D_MBCS \ - /Fo"${topdir}/src/Debug/" \ - /nologo \ - /c - -STATIC_LIBS = \ - allocator \ - coll\ - ns\ - gpr \ - topo\ - errmgr \ - rml \ - rmgr \ - rmaps \ - soh \ - ptl\ - oob\ - pml\ - pls\ - ras \ - rds \ - schema \ - iof - -CXXFLAGS = $(CFLAGS) $(INCL) - -LINK = link - -LINKFLAGS = \ - /DLL \ - /OPT:NOICF \ - /OPT:NOREF \ - /IMPLIB:libmpi.lib\ - /nologo \ - /OUT:libmpi.dll - -ADDLIBS = \ - ws2_32.lib \ - kernel32.lib \ - user32.lib \ - gdi32.lib \ - winspool.lib \ - comdlg32.lib \ - advapi32.lib \ - shell32.lib \ - ole32.lib \ - oleaut32.lib \ - uuid.lib \ - odbc32.lib \ - odbccp32.lib - -.c.obj: - $(CXX) $(CXXFLAGS) $*.c - -all: libmpi - -prebuild: - @echo "Creating mca_base_parse_paramfile_lex.c" - @/usr/bin/flex -t -Pmca_base_yy "${topdir}/src/mca/base/mca_base_parse_paramfile_lex.l" \ - >"${topdir}/src/mca/base/mca_base_parse_paramfile_lex.c" 2>/dev/null - @echo "Creating mca_rds_hostfile_lex.c" - @/usr/bin/flex -t -Porte_rds_hostfile_ "${topdir}/src/mca/rds/hostfile/rds_hostfile_lex.l" \ - > "${topdir}/src/mca/rds/hostfile/rds_hostfile_lex.c" 2>/dev/null - @echo "Creating show_help_lex.c" - @/usr/bin/flex -t -Popal_show_help_yy "${topdir}/src/opal/util/show_help_lex.l" \ - > "${topdir}/src/opal/util/show_help_lex.c" 2>/dev/null - @for dirs in ${STATIC_LIBS}; do \ - (dir="mca/$${dirs}/base"; echo "Making Static components in $${dirs}"; comp_name="$${dirs}_static-components.h"; cp "${topdir}/src/win32/generated_include/$${comp_name}" "$${dir}/static-components.h";); \ - done - @echo "Creating Version Headers" - @cp "${topdir}/src/win32/generated_include/pls-fork-version.h" "${topdir}/src/mca/pls/fork/pls-fork-version.h"; - @cp "${topdir}/src/win32/generated_include/pls-proxy-version.h" "${topdir}/src/mca/pls/proxy/pls-proxy-version.h"; - @cp "${topdir}/src/win32/generated_include/pls-rsh-version.h" "${topdir}/src/mca/pls/rsh/pls-rsh-version.h"; - @for dirs in ${C_SUBDIRS}; do \ - (echo "Entering $${dirs}"; cd $$dirs; if test -f .compile_files; then (more .compile_files| xargs -i'{}' ln -f '{}' ${topdir}/src/Debug/'{}'); else (ls *.c 2>/dev/null | xargs -i'{}' ln -f '{}' ${topdir}/src/Debug/'{}'); fi); \ - done - @for file in ${EXCLUDE_FILES}; do \ - (echo "Removing $${file}"; cd ${topdir}/src/Debug/; rm -f $${file}); \ - done - @echo "done" - - -libmpi: $(LINKED_OBJS) - ${LINK} ${LINKFLAGS} ${ADDLIBS} $(LINKED_OBJS) - -install: - @echo -n "Installing libmpi and include file ................" - @install -d ${topdir}/src ${installdir}/lib - @install -p ${topdir}/src/libmpi.lib ${installdir}/lib/libmpi.lib - @install -p ${topdir}/src/libmpi.exp ${installdir}/lib/libmpi.exp - @install -p ${topdir}/src/libmpi.dll ${installdir}/lib/libmpi.dll - @install -d ${topdir}/include ${installdir}/include/ - @install -p ${topdir}/include/ompi_config_bottom.h \ - ${installdir}/include/ompi_config_bottom.h - @install -p ${topdir}/src/win32/generated_include/opal_config.h \ - ${installdir}/include/opal_config.h - @install -p ${topdir}/include/mpi.h ${installdir}/include/mpi.h - @install -p ${topdir}/include/ompi_stdint.h ${installdir}/include/ompi_stdint.h - @install -d ${topdir}/src/win32 ${installdir}/include/win32 - @install -p ${topdir}/src/win32/win_compat.h ${installdir}/include/win32/win_compat.h - @echo "done" - -.PHONY: clean - -clean: - @for dirs in ${C_SUBDIRS}; do \ - (echo "Entering $$dirs"; cd $$dirs; rm -rf *.lib *.obj *.exp;); \ - done - @for dirs in ${C_PPSUBDIRS}; do \ - (echo "Entering $$dirs"; cd $$dirs; rm -rf *.lib *.obj *.exp;); \ - done - @echo "Entering ${topdir}/src/Debug ... "; cd ${topdir}/src/Debug; rm -rf *.lib *.obj *.exp *.c;