[gmx-users] compilation issues with GCC/clang/CUDA on OSX
Stephen N. Floor
floor at berkeley.edu
Fri Apr 25 20:01:33 CEST 2014
Hi and thanks -
I did end up ignoring the warning about no compatible GPUs. The non-openmp compiler went away once I finally convinced cmake to actually use gcc-4.8.2 instead of clang - embarrassingly, it seems I was getting those errors because I was running cmake repeatedly without wiping the directory in between. Making a fresh build dir and running cmake as listed below does recognize openmp compatibility via gcc, and CUDA things build fine using clang. After ignoring the GPU warning it builds fine and does detect a GPU when I perform simulations.
However, I ran into the "Malformed Mach-o file" issue that was mentioned by a previous poster. After make finishes, I run make install and receive a huge number of errors like this:
CMake Error:
Error evaluating generator expression:
$<LINK_ONLY:-Wl,-rpath>
$<LINK_ONLY> expression requires exactly one parameter.
CMake Warning (dev) in src/gmxlib/gpu_utils/CMakeLists.txt:
Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
interface. Run "cmake --help-policy CMP0022" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Static library target "gpu_utils" has a INTERFACE_LINK_LIBRARIES property.
This should be preferred as the source of the link interface for this
library. Ignoring the property and using the link implementation as the
link interface instead.
This warning is for project developers. Use -Wno-dev to suppress it.
If I repeat make install then these errors do not reappear and it does install to the specified prefix. However, executables that are installed in this manner are broken:
[snf at waipio ]$ nice -n 19 mdrun -deffnm npt-10ps
nice: mdrun: Malformed Mach-o file
A "Mach-o file" is an OSX format executable, similar to ELF. This error occurs for any gromacs package executable that I have tried. However, if I go into the freshly compiled src tree I can run mdrun or anything else just fine, which suggests to me that something in the make install process is garping things up.
Anyway, I did find a workaround for this by just using the executables in the src tree of the build directory, but thought I should share.
Thanks,
-Stephen
On Apr 25, 2014, at 7:43 AM, Anders Gabrielsson <andgab at kth.se> wrote:
> Hi!
> Note that the warnings are only suggesting that your build may give suboptimal performance. (as in having no compatible GPU or non-openmp enabled compiler).
> In my experience, you can actually ignore the first one about not finding GPUs. That never worked for me either (on mac os x).
>
> Did you try proceed to 'make' anything?
> The openmp-related warning suggest to me that either cmake is confused about what compiler to use (clear out the build dir and try again?) or your gcc installation is somehow broken.
>
> Happy compiling!
> Anders
>
>
> On 24 Apr 2014, at 21:41, Stephen N. Floor <floor at berkeley.edu> wrote:
>
>> Hello -
>>
>> I am trying to compile gromacs 4.6.5 with CUDA support for a new
>> graphics card on OSX 10.8.5 with CUDA 6.0.37 using gcc 4.8.2 from fink
>> (gcc-4 and g++-4) for OpenMP support and clang for CUDA as recommended
>> previously.
>>
>> I am starting cmake like this:
>>
>> export CC=/sw/bin/gcc-4
>> export CXX=/sw/bin/g++-4
>>
>> cmake -DGMX_GPU=ON -DCMAKE_C_COMPILER=${CC}
>> -DCMAKE_CXX_COMPILER=${CXX} -DCUDA_HOST_COMPILER=/usr/bin/clang
>> -DCUDA_PROPAGATE_HOST_FLAGS=OFF ..
>>
>> I am having two issues:
>>
>> 1) cmake does not detect any video cards:
>>
>> -- Looking for NVIDIA GPUs present in the system
>> -- Could not detect NVIDIA GPUs
>> -- Found CUDA: /usr/local/cuda (found suitable version "6.0", minimum
>> required is "3.2")
>>
>> While I can likely continue with compilation, this seems to suggest an
>> underlying issue that may rear its head later.
>>
>> 2) OpenMP is not detected
>>
>> { snipped many openmp flag test results that are all failures }
>>
>> CMake Warning at CMakeLists.txt:273 (message):
>> The compiler you are using does not support OpenMP parallelism. This might
>> hurt your performance a lot, in particular with GPUs. Try using a more
>> recent version, or a different compiler. For now, we are proceeding by
>> turning off OpenMP.
>>
>> compiler info:
>>
>> [snf at waipio gromacs/gromacs-4.6.5/build-cmake-gpu]$ gcc-4 --version -v
>> Using built-in specs.
>> COLLECT_GCC=gcc-4
>> COLLECT_LTO_WRAPPER=/sw/lib/gcc4.8/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.2/lto-wrapper
>> gcc-4 (GCC) 4.8.2
>> Copyright (C) 2013 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>>
>> Target: x86_64-apple-darwin12.5.0
>> Configured with: ../gcc-4.8.2/configure --prefix=/sw
>> --prefix=/sw/lib/gcc4.8 --mandir=/sw/share/man
>> --infodir=/sw/lib/gcc4.8/info
>> --enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw
>> --with-libiconv-prefix=/sw --with-isl=/sw --with-cloog=/sw
>> --with-mpc=/sw --with-system-zlib --x-includes=/usr/X11R6/include
>> --x-libraries=/usr/X11R6/lib --program-suffix=-fsf-4.8
>> Thread model: posix
>> gcc version 4.8.2 (GCC)
>> COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.8.5' '--version' '-v'
>> '-mtune=core2'
>> /sw/lib/gcc4.8/libexec/gcc/x86_64-apple-darwin12.5.0/4.8.2/cc1 -quiet
>> -v -D__DYNAMIC__ help-dummy -fPIC -quiet -dumpbase help-dummy
>> -mmacosx-version-min=10.8.5 -mtune=core2 -auxbase help-dummy -version
>> --version -o /var/folders/bj/fl_w4q152yx6cg787vx5c12h0000gq/T//ccQjwwGf.s
>> GNU C (GCC) version 4.8.2 (x86_64-apple-darwin12.5.0)
>> compiled by GNU C version 4.8.2, GMP version 5.1.3, MPFR
>> version 3.1.2, MPC version 1.0.2
>> GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
>> COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.8.5' '--version' '-v'
>> '-mtune=core2'
>> as -arch x86_64 -force_cpusubtype_ALL --version -o
>>
>> Thanks for any insight!
>> -Stephen
>>
>> --
>> Stephen N. Floor
>> HHWF Postdoctoral Fellow, Doudna Group
>> http://doudna.berkeley.edu
>> --
>> Gromacs Users mailing list
>>
>> * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!
>>
>> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>
>> * For (un)subscribe requests visit
>> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a mail to gmx-users-request at gromacs.org.
>
> --
> Gromacs Users mailing list
>
> * Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or send a mail to gmx-users-request at gromacs.org.
More information about the gromacs.org_gmx-users
mailing list