From 28acfd1164dd14c5a1ef2aa85f05744ce4a7cd13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vedran=20Mileti=C4=87?= Date: Fri, 26 Jul 2019 16:48:58 +0200 Subject: [PATCH] Fix building on Solaris with GCC GROMACS now compiles on Solaris x86, specifically illumos distribution openindiana. GCC complained about a missing sqrt() variant which was addressed with static_cast and linker complained about missing libsocket which was addressed with SunOS-specific entry in target_link_libraries. Refs #3050 Change-Id: Ic14a9327fa353270ef0e787b4d2357e86e71da53 --- docs/release-notes/2020/major/portability.rst | 5 +++++ src/gromacs/CMakeLists.txt | 1 + src/gromacs/ewald/tests/pmesplinespreadtest.cpp | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/2020/major/portability.rst b/docs/release-notes/2020/major/portability.rst index ae268a83a7..4186794e8f 100644 --- a/docs/release-notes/2020/major/portability.rst +++ b/docs/release-notes/2020/major/portability.rst @@ -17,3 +17,8 @@ Enabled PME offload support with OpenCL on NVIDIA and Intel GPUs """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Thanks to portability improvements, the previously disabled PME OpenCL offload is now enabled also on NVIDIA and Intel GPUs. + +Fixed building on Solaris with GCC +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +GROMACS now builds on Solaris with GCC (tested on illumos distribution +openindiana, "Hipster" rolling release, using GCC 5, 6, 7, and 8). diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index 2462d1a989..c0adfafe2b 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -287,6 +287,7 @@ target_link_libraries(libgromacs ${FFT_LIBRARIES} ${LINEAR_ALGEBRA_LIBRARIES} ${THREAD_LIB} ${GMX_SHARED_LINKER_FLAGS} ${OpenCL_LIBRARIES} + $<$:socket> PUBLIC ${GMX_PUBLIC_LIBRARIES} ) diff --git a/src/gromacs/ewald/tests/pmesplinespreadtest.cpp b/src/gromacs/ewald/tests/pmesplinespreadtest.cpp index 4da26ccd68..43a459420e 100644 --- a/src/gromacs/ewald/tests/pmesplinespreadtest.cpp +++ b/src/gromacs/ewald/tests/pmesplinespreadtest.cpp @@ -234,7 +234,8 @@ public: TestReferenceChecker gridValuesChecker( rootChecker.checkCompound("NonZeroGridValues", "RealSpaceGrid")); const auto ulpToleranceGrid = - 2 * ulpToleranceSplineValues * static_cast(ceil(sqrt(atomCount))); + 2 * ulpToleranceSplineValues + * static_cast(ceil(sqrt(static_cast(atomCount)))); /* 2 is empiric; sqrt(atomCount) assumes all the input charges may spread onto the same cell */ SCOPED_TRACE(formatString("Testing grid values with tolerance of %d", ulpToleranceGrid)); if (!gridValuesSizeAssigned) -- 2.11.4.GIT