static void setupChplGlobals(const char* argv0) { // Set CHPL_HOME, populate envMap with defaults, and set global CHPL_vars // Set CHPL_HOME the traditional way if it was not passed as an argument if (envMap.find("CHPL_HOME") == envMap.end()) { setupChplHome(argv0); // Keep envMap updated envMap["CHPL_HOME"] = CHPL_HOME; } // Populate envMap from printchplenv, never overwriting existing elements populateEnvMap(); // Set global CHPL_vars with updated envMap values setChapelEnvs(); }
// // Can't rely on a variable initialization order for globals, so any // variables that need to be initialized in a particular order go here // static void setupOrderedGlobals(const char* argv0) { // Set up CHPL_HOME first setupChplHome(argv0); // Then CHPL_* variables setupEnvVars(); // These depend on the environment variables being set fLocal = !strcmp(CHPL_COMM, "none"); bool gotPGI = !strcmp(CHPL_TARGET_COMPILER, "pgi") || !strcmp(CHPL_TARGET_COMPILER, "cray-prgenv-pgi"); // conservatively how much is needed for the current PGI compiler if (gotPGI) fMaxCIdentLen = 1020; if( 0 == strcmp(CHPL_WIDE_POINTERS, "struct") ) { widePointersStruct = true; } else { widePointersStruct = false; } }
// // Can't rely on a variable initialization order for globals, so any // variables that need to be initialized in a particular order go here // static void setupOrderedGlobals(const char* argv0) { // Set up CHPL_HOME first setupChplHome(argv0); // Then CHPL_* variables SETUP_ENV_VAR(CHPL_HOST_PLATFORM, "chplenv/platform --host"); SETUP_ENV_VAR(CHPL_HOST_COMPILER, "chplenv/compiler --host"); SETUP_ENV_VAR(CHPL_TARGET_PLATFORM, "chplenv/platform --target"); SETUP_ENV_VAR(CHPL_TARGET_COMPILER, "chplenv/compiler --target"); SETUP_ENV_VAR(CHPL_LOCALE_MODEL, "chplenv/localeModel"); SETUP_ENV_VAR(CHPL_COMM, "chplenv/comm"); SETUP_ENV_VAR(CHPL_COMM_SUBSTRATE, "chplenv/commSubstrate"); SETUP_ENV_VAR(CHPL_GASNET_SEGMENT, "chplenv/commSegment"); SETUP_ENV_VAR(CHPL_TASKS, "chplenv/tasks"); SETUP_ENV_VAR(CHPL_THREADS, "chplenv/threads"); SETUP_ENV_VAR(CHPL_LAUNCHER, "chplenv/launcher"); SETUP_ENV_VAR(CHPL_TIMERS, "chplenv/timers"); SETUP_ENV_VAR(CHPL_MEM, "chplenv/mem"); SETUP_ENV_VAR(CHPL_MAKE, "chplenv/chplmake"); SETUP_ENV_VAR(CHPL_ATOMICS, "chplenv/atomics"); SETUP_ENV_VAR(CHPL_NETWORK_ATOMICS, "chplenv/atomics --network"); SETUP_ENV_VAR(CHPL_GMP, "chplenv/gmp"); SETUP_ENV_VAR(CHPL_REGEXP, "chplenv/regexp"); SETUP_ENV_VAR(CHPL_WIDE_POINTERS, "chplenv/widePointers"); SETUP_ENV_VAR(CHPL_LLVM, "chplenv/llvm"); SETUP_ENV_VAR(CHPL_AUX_FILESYS, "chplenv/auxFilesys"); // These depend on the environment variables being set fLocal = !strcmp(CHPL_COMM, "none"); fSerial = !strcmp(CHPL_TASKS, "none"); bool gotPGI = !strcmp(CHPL_TARGET_COMPILER, "pgi") || !strcmp(CHPL_TARGET_COMPILER, "cray-prgenv-pgi"); // conservatively how much is needed for the current PGI compiler if (gotPGI) fMaxCIdentLen = 1020; if( 0 == strcmp(CHPL_WIDE_POINTERS, "struct") ) { widePointersStruct = true; } else { widePointersStruct = false; } }