if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0") #LLVM BUG #21629
GMX_TEST_CXXFLAG(CXXFLAGS_WARN_NO_BRACES "-Wno-missing-braces" GMXC_CXXFLAGS)
endif()
- GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS)
- GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith -Wmissing-prototypes" GMXC_CXXFLAGS)
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra;-Wno-missing-field-initializers;-Wpointer-arith;-Wmissing-prototypes" GMXC_CXXFLAGS)
GMX_TEST_CXXFLAG(CXXFLAGS_DEPRECATED "-Wdeprecated" GMXC_CXXFLAGS)
+ # Functions placed in headers for inlining are not always
+ # used in every translation unit that includes the files,
+ # so we must disable the warning that there are such
+ # functions that are unused.
+ GMX_TEST_CXXFLAG(CXXFLAGS_NO_UNUSED_FUNCTION "-Wno-unused-function" GMXC_CXXFLAGS)
+ endif()
+ if(NOT GMX_OPENMP)
+ GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS)
+ endif()
+ endif()
+
+ # Apple bastardized version of Clang
+ if(${CMAKE_C_COMPILER_ID} MATCHES "AppleClang")
+ if(${CMAKE_C_COMPILER_VERSION} VERSION_GREATER 11.0)
+ # Mac OS Catalina ships with a horribly broken compiler (version 11.0.0.11000033)
+ # that checks stack alignment by default, but their own C library
+ # does not align the stack properly. Embarrassing, Apple...
+ GMX_TEST_CFLAG(CFLAG_NO_STACK_CHECK "-fno-stack-check" GMXC_CFLAGS)
+ endif()
+ endif()
+
++ if(${CMAKE_CXX_COMPILER_ID} MATCHES "AppleClang")
++ if(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 11.0)
++ # Mac OS Catalina ships with a horribly broken compiler (version 11.0.0.11000033)
++ # that checks stack alignment by default, but their own C library
++ # does not align the stack properly. Embarrassing, Apple...
++ GMX_TEST_CXXFLAG(CXXFLAG_NO_STACK_CHECK "-fno-stack-check" GMXC_CXXFLAGS)
+ endif()
+ endif()
+
+ # Apple bastardized version of Clang
+ if(${CMAKE_C_COMPILER_ID} MATCHES "AppleClang")
+ if(${CMAKE_C_COMPILER_VERSION} VERSION_GREATER 11.0)
+ # Mac OS Catalina ships with a horribly broken compiler (version 11.0.0.11000033)
+ # that checks stack alignment by default, but their own C library
+ # does not align the stack properly. Embarrassing, Apple...
+ GMX_TEST_CFLAG(CFLAG_NO_STACK_CHECK "-fno-stack-check" GMXC_CFLAGS)
+ endif()
+ endif()
+
if(${CMAKE_CXX_COMPILER_ID} MATCHES "AppleClang")
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 11.0)
# Mac OS Catalina ships with a horribly broken compiler (version 11.0.0.11000033)
int mol;
for (mol = 0; mol < (mtop->bIntermolecularInteractions ? molb.nmol : 1); mol++)
{
- for (int cg = 0; cg < cgs.nr; cg++)
+ for (int a = 0; a < molt.atoms.nr; a++)
{
- int cg_gl = cg_offset + cg;
- link->index[cg_gl+1] = link->index[cg_gl];
- for (int a = cgs.index[cg]; a < cgs.index[cg + 1]; a++)
+ int cg_gl = cg_offset + a;
+ link->index[cg_gl + 1] = link->index[cg_gl];
+ int i = ril.index[a];
+ while (i < ril.index[a + 1])
{
- int i = ril.index[a];
- while (i < ril.index[a+1])
+ int ftype = ril.il[i++];
+ int nral = NRAL(ftype);
+ /* Skip the ifunc index */
+ i++;
+ for (int j = 0; j < nral; j++)
{
- int ftype = ril.il[i++];
- int nral = NRAL(ftype);
- /* Skip the ifunc index */
- i++;
- for (int j = 0; j < nral; j++)
+ int aj = ril.il[i + j];
+ if (aj != a)
{
- int aj = ril.il[i + j];
- if (a2c[aj] != cg)
- {
- check_link(link, cg_gl, cg_offset+a2c[aj]);
- }
- }
- i += nral_rt(ftype);
- }
- if (bExclRequired)
- {
- /* Exclusions always go both ways */
- for (int j = excls.index[a]; j < excls.index[a + 1]; j++)
- {
- int aj = excls.a[j];
- if (a2c[aj] != cg)
- {
- check_link(link, cg_gl, cg_offset+a2c[aj]);
- }
+ check_link(link, cg_gl, cg_offset + aj);
}
}
+ i += nral_rt(ftype);
+ }
- if (mtop->bIntermolecularInteractions)
+ if (mtop->bIntermolecularInteractions)
+ {
- int i = ril_intermol.index[a];
- while (i < ril_intermol.index[a + 1])
++ int i = ril_intermol.index[cg_gl];
++ while (i < ril_intermol.index[cg_gl + 1])
{
- int i = ril_intermol.index[cg_gl];
- while (i < ril_intermol.index[cg_gl + 1])
+ int ftype = ril_intermol.il[i++];
+ int nral = NRAL(ftype);
+ /* Skip the ifunc index */
+ i++;
+ for (int j = 0; j < nral; j++)
{
- int ftype = ril_intermol.il[i++];
- int nral = NRAL(ftype);
- /* Skip the ifunc index */
- i++;
- for (int j = 0; j < nral; j++)
- {
- /* Here we assume we have no charge groups;
- * this has been checked above.
- */
- int aj = ril_intermol.il[i + j];
- check_link(link, cg_gl, aj);
- }
- i += nral_rt(ftype);
+ /* Here we assume we have no charge groups;
+ * this has been checked above.
+ */
+ int aj = ril_intermol.il[i + j];
+ check_link(link, cg_gl, aj);
}
+ i += nral_rt(ftype);
}
}
- if (link->index[cg_gl+1] - link->index[cg_gl] > 0)
+ if (link->index[cg_gl + 1] - link->index[cg_gl] > 0)
{
- SET_CGINFO_BOND_INTER(cgi_mb->cginfo[cg]);
+ SET_CGINFO_BOND_INTER(cgi_mb->cginfo[a]);
ncgi++;
}
}
{
return "%8.3f%8.3f%8.3f\n";
}
-
}
-static void write_hconf_box(FILE *out, const matrix box)
+static void write_hconf_box(FILE* out, const matrix box)
{
- if ((box[XX][YY] != 0.0f) || (box[XX][ZZ] != 0.0f) || (box[YY][XX] != 0.0f) || (box[YY][ZZ] != 0.0f) ||
- (box[ZZ][XX] != 0.0f) || (box[ZZ][YY] != 0.0f))
+ if ((box[XX][YY] != 0.0F) || (box[XX][ZZ] != 0.0F) || (box[YY][XX] != 0.0F)
+ || (box[YY][ZZ] != 0.0F) || (box[ZZ][XX] != 0.0F) || (box[ZZ][YY] != 0.0F))
{
- fprintf(out, "%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f%10.5f\n", box[XX][XX],
- fprintf(out, "%10.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f\n",
- box[XX][XX], box[YY][YY], box[ZZ][ZZ],
- box[XX][YY], box[XX][ZZ], box[YY][XX],
- box[YY][ZZ], box[ZZ][XX], box[ZZ][YY]);
++ fprintf(out, "%10.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f %9.5f\n", box[XX][XX],
+ box[YY][YY], box[ZZ][ZZ], box[XX][YY], box[XX][ZZ], box[YY][XX], box[YY][ZZ],
+ box[ZZ][XX], box[ZZ][YY]);
}
else
{
- fprintf(out, "%10.5f%10.5f%10.5f\n", box[XX][XX], box[YY][YY], box[ZZ][ZZ]);
- fprintf(out, "%10.5f %9.5f %9.5f\n",
- box[XX][XX], box[YY][YY], box[ZZ][ZZ]);
++ fprintf(out, "%10.5f %9.5f %9.5f\n", box[XX][XX], box[YY][YY], box[ZZ][ZZ]);
}
}