diff --git a/src/arch/common/cc-msvc.sh b/src/arch/common/cc-msvc.sh index 2d574a3f4b..e5f874d7db 100644 --- a/src/arch/common/cc-msvc.sh +++ b/src/arch/common/cc-msvc.sh @@ -1,5 +1,6 @@ CMK_CC="$CHARMBIN/unix2nt_cc" +CMK_SEQ_CC="$CMK_CC" CMK_CPP_C="$CMK_CC" CMK_CXX="$CHARMBIN/unix2nt_cc" CMK_LD="$CMK_CC" diff --git a/src/arch/win/unix2nt_cc b/src/arch/win/unix2nt_cc index 060c61d3a0..5f135a7ef3 100755 --- a/src/arch/win/unix2nt_cc +++ b/src/arch/win/unix2nt_cc @@ -15,30 +15,15 @@ set -o errexit # Configurable option: Location of MSDEV if [[ -z "$VCINSTALLDIR" ]] then - VCC_DIR='C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC' + VCC_DIR='C:/Program Files/Microsoft Visual Studio/2022/Community/VC' else VCC_DIR="$VCINSTALLDIR" fi -if [[ ! -d "$(cygpath -u "$VCC_DIR")" ]] +if [[ ! -d "$(cygpath.exe -u "$VCC_DIR")" ]] then echo "\$VCINSTALLDIR is not set properly: $VCC_DIR" exit 1 fi -if [[ -n "$WINDOWSSDKDIR" ]] -then - SDK_DIR="$WINDOWSSDKDIR" -elif [[ -n "$WindowsSdkDir" ]] -then - SDK_DIR="$WindowsSdkDir" -else - SDK_DIR='C:/Program Files/Windows Kits/10' -fi -if [[ ! -d "$(cygpath -u "$SDK_DIR")" ]] -then - echo "\$WindowsSdkDir is not set properly: $SDK_DIR" - exit 1 -fi - #CL command-line options for -O and -g mode #only for the environment that has set corresponding environmental variables CL_CMD='CL.EXE' @@ -71,8 +56,7 @@ else LINK_CMD="$VCC_DIR/BIN/LINK.EXE" fi LINK_COMMON=(-nologo -subsystem:console -DYNAMICBASE:NO) -LINK_POST=(ws2_32.lib kernel32.lib user32.lib psapi.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib -MACHINE:X64 -ERRORREPORT:PROMPT) - +LINK_POST=(WS2_32.lib WSock32.lib kernel32.lib user32.lib psapi.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib -MACHINE:X64 -ERRORREPORT:PROMPT) if [[ -z "$LIB" ]] then echo "Variables already set!" diff --git a/src/ck-perf/trace-common.C b/src/ck-perf/trace-common.C index 541a14e58a..7aaa433949 100644 --- a/src/ck-perf/trace-common.C +++ b/src/ck-perf/trace-common.C @@ -4,8 +4,10 @@ /*@{*/ #include -#include +#if !defined(_WIN64) +#include +#endif #include // std::time_t, std::gmtime #include // std::chrono::system_clock @@ -32,7 +34,7 @@ // To get hostname #if defined(_WIN32) || defined(_WIN64) -# include +//# include #else # include # include // For HOST_NAME_MAX @@ -145,7 +147,7 @@ static void traceCommonInit(char **argv) // Trying to decide if the traceroot path is absolute or not. If it is not // then create an absolute pathname for it. if (temproot[0] != PATHSEP) { - temproot2 = GETCWD(NULL,0); + // temproot2 = GETCWD(NULL,0); root = (char *)malloc(strlen(temproot2)+1+strlen(temproot)+1); strcpy(root, temproot2); strcat(root, PATHSEPSTR); @@ -259,8 +261,9 @@ void traceWriteSTS(FILE *stsfp,int nUserEvents) { // Add 1 for null terminator char hostname[HOST_NAME_MAX + 1]; - if(gethostname(hostname, HOST_NAME_MAX + 1) == 0) - fprintf(stsfp, "HOSTNAME \"%s\"\n", hostname); + + //if(gethostname(hostname, HOST_NAME_MAX + 1) == 0) +// fprintf(stsfp, "HOSTNAME \"%s\"\n", hostname); fprintf(stsfp, "COMMANDLINE \""); int index = 0; @@ -277,7 +280,7 @@ void traceWriteSTS(FILE *stsfp,int nUserEvents) { using std::chrono::system_clock; const time_t now = system_clock::to_time_t(system_clock::now()); struct tm currentTime; -#if defined(_WIN32) || defined(_WIN64) +#if defined(_WIN32) || defined(_WIN64) && !defined(__CYGWIN__) gmtime_s(¤tTime, &now); #else gmtime_r(&now, ¤tTime); diff --git a/src/ck-perf/trace-common.h b/src/ck-perf/trace-common.h index 71a09ad442..5aee05cf47 100644 --- a/src/ck-perf/trace-common.h +++ b/src/ck-perf/trace-common.h @@ -15,9 +15,11 @@ #define PATHSEP '\\' #define PATHSEPSTR "\\" #else +#if !defined(_WIN64) #include +#endif #define CHDIR chdir -#define GETCWD getcwd +//#define GETCWD getcwd #define PATHSEP '/' #define PATHSEPSTR "/" #endif diff --git a/src/conv-core/cpuaffinity.C b/src/conv-core/cpuaffinity.C index 27267a7262..c5a330384b 100644 --- a/src/conv-core/cpuaffinity.C +++ b/src/conv-core/cpuaffinity.C @@ -77,14 +77,14 @@ void CmiInitHwlocTopology(void) depth != HWLOC_TYPE_DEPTH_UNKNOWN ? cmi_hwloc_get_nbobjs_by_depth(legacy_topology, depth) : 1; } -#if CMK_HAS_SETAFFINITY || defined (_WIN32) || CMK_HAS_BINDPROCESSOR +#if CMK_HAS_SETAFFINITY || defined (_WIN32) || defined(_WIN64) || CMK_HAS_BINDPROCESSOR #include #include #include #include -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) #include #include #else @@ -105,7 +105,7 @@ void CmiInitHwlocTopology(void) static int excludecore[MAX_EXCLUDE] = {-1}; static int excludecount = 0; -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(_WIN64) static int affMsgsRecvd = 1; // number of affinity messages received at PE0 static cpu_set_t core_usage; // used to record union of CPUs used by every PE in physical node static int aff_is_set = 0; @@ -131,7 +131,7 @@ static void add_exclude(int core) static int set_process_affinity(hwloc_cpuset_t cpuset) { -#ifdef _WIN32 +#if defined(_WIN32) || defined (_WIN64) HANDLE process = GetCurrentProcess(); # define PRINTF_PROCESS "%p" #else @@ -167,7 +167,7 @@ static int set_process_affinity(hwloc_cpuset_t cpuset) #if CMK_SMP static int set_thread_affinity(hwloc_cpuset_t cpuset) { -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) HANDLE thread = GetCurrentThread(); #else pthread_t thread = pthread_self(); @@ -288,7 +288,7 @@ int print_cpu_affinity(void) { #if CMK_SMP int print_thread_affinity(void) { -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) HANDLE thread = GetCurrentThread(); #else pthread_t thread = pthread_self(); @@ -323,7 +323,7 @@ int CmiPrintCPUAffinity(void) #endif } -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(_WIN64) int get_cpu_affinity(cpu_set_t *cpuset) { CPU_ZERO(cpuset); if (sched_getaffinity(0, sizeof(cpuset), cpuset) < 0) { @@ -417,7 +417,7 @@ struct rankMsg { struct affMsg { char core[CmiMsgHeaderSizeBytes]; -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(_WIN64) cpu_set_t affinity; #endif }; @@ -696,7 +696,7 @@ static void cpuPhyNodeAffinityRecvHandler(void *msg) static int count = 0; affMsg *m = (affMsg *)msg; -#if !defined(_WIN32) && defined(CPU_OR) +#if !defined(_WIN32) && !defined(_WIN64) && defined(CPU_OR) CPU_OR(&core_usage, &core_usage, &m->affinity); affMsgsRecvd++; #endif @@ -706,7 +706,7 @@ static void cpuPhyNodeAffinityRecvHandler(void *msg) cpuPhyAffCheckDone = true; } -#if defined(_WIN32) +#if defined(_WIN32) || defined(_WIN64) /* strtok is thread safe in VC++ */ #define strtok_r(x,y,z) strtok(x,y) #endif @@ -812,7 +812,7 @@ CLINKAGE int getXTNodeID(int mpirank, int nummpiranks); */ void CmiCheckAffinity(void) { -#if !defined(_WIN32) && CMK_SMP && CMK_HAS_PTHREAD_SETAFFINITY && defined(CPU_OR) +#if !defined(_WIN32) && !defined(_WIN64) && CMK_SMP && CMK_HAS_PTHREAD_SETAFFINITY && defined(CPU_OR) if (!CmiCpuTopologyEnabled()) return; // only works if cpu topology enabled @@ -1097,7 +1097,7 @@ void CmiInitCPUAffinity(char **argv) } if (CmiMyRank() ==0) { -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(_WIN64) aff_is_set = affinity_flag; CPU_ZERO(&core_usage); #endif diff --git a/src/scripts/Makefile b/src/scripts/Makefile index dc5e1d960d..cf2e8eb228 100644 --- a/src/scripts/Makefile +++ b/src/scripts/Makefile @@ -334,6 +334,11 @@ endif -./system_ln ../tmp/conv-mach-opt.mak ../include if [ -x ./special.sh ] ; then SRCBASE=$(SRCBASE) ./special.sh ; fi if [ ! -f conv-common.h ] ; then ( touch conv-common.h ) ; fi +# in the special case of reusing netlrts for windows, nuke Makefile.machine to not build charmrun + if case $(CMK_VDIR) in *-win-*) true;; *) false;; esac; then \ + rm ../tmp/Makefile.machine ;\ + touch ../tmp/Makefile.machine ; \ + fi touch dirs+sources ###############################################################################