[gmx-developers] CMake fixes for x86_64

Gino van den Bergen gino.vandenbergen at gmail.com
Fri May 1 17:16:33 CEST 2009


Hi,

I've unsuccessfully tried to build the current trunk configured using
CMake with GMX_ACCELERATION set to SSE. It seems that the build for
sse2_single is broken. I've compared this build to the autoconf version
and noticed that the autoconf version uses the x86_64_sse kernel on my
machine.  After some toying about with the CMakeLists.txt I managed to
build the nb_kernel_x86_64_sse kernels through CMake. Here are the
changes (as a result from cvs diff):

Index: CMakeLists.txt
===================================================================
RCS file: /home/gmx/cvs/gmx/CMakeLists.txt,v
retrieving revision 1.20
diff -r1.20 CMakeLists.txt
235c235
<   # nothing to do
---
>     # nothing to do
237,249c237,252
<     if(HAVE_XMMINTRIN_H)
<         set(GMX_SSE 1)
<     endif(HAVE_XMMINTRIN_H)
<     if(HAVE_EMMINTRIN_H)
<         set(GMX_SSE2 1)
<     endif(HAVE_EMMINTRIN_H)
< #    if(HAVE_PMMINTRIN_H)
< #        set(GMX_SSE3 1)
< #    endif(HAVE_PMMINTRIN_H)
< #    if(HAVE_SMMINTRIN_H)
< #        set(GMX_SSE4_1 1)
< #    endif(HAVE_SMMINTRIN_H)
<
---
>     if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
>         set(GMX_X86_64_SSE 1)
>     else("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
>         if(HAVE_XMMINTRIN_H)
>             set(GMX_SSE 1)
>         endif(HAVE_XMMINTRIN_H)
>         if(HAVE_EMMINTRIN_H)
>             set(GMX_SSE2 1)
>         endif(HAVE_EMMINTRIN_H)
> #       if(HAVE_PMMINTRIN_H)
> #           set(GMX_SSE3 1)
> #       endif(HAVE_PMMINTRIN_H)
> #       if(HAVE_SMMINTRIN_H)
> #           set(GMX_SSE4_1 1)
> #       endif(HAVE_SMMINTRIN_H)
>     endif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
Index: src/gmxlib/CMakeLists.txt
===================================================================
RCS file: /home/gmx/cvs/gmx/src/gmxlib/CMakeLists.txt,v
retrieving revision 1.10
diff -r1.10 CMakeLists.txt
7a8,23
>
> if(GMX_X86_64_SSE)
>   enable_language(ASM-ATT)
>   if(CMAKE_ASM-ATT_COMPILER_WORKS)
>     if(GMX_DOUBLE)
>       file(GLOB GMX_SSE2_ASM_SOURCES nonbonded/nb_kernel_x86_64_sse2/*.s )
>       file(GLOB GMX_SSE2_ASM_EXTRA_SOURCES
nonbonded/nb_kernel_x86_64_sse2/*intel_syntax.s )
>     else(GMX_DOUBLE)
>       file(GLOB GMX_SSE2_ASM_SOURCES nonbonded/nb_kernel_x86_64_sse/*.s )
>       file(GLOB GMX_SSE2_ASM_EXTRA_SOURCES
nonbonded/nb_kernel_x86_64_sse/*intel_syntax.s )
>     endif(GMX_DOUBLE)
>     list(REMOVE_ITEM GMX_SSE2_ASM_SOURCES ${GMX_SSE2_ASM_EXTRA_SOURCES})
>   endif(CMAKE_ASM-ATT_COMPILER_WORKS)
> endif(GMX_X86_64_SSE)
>
>
29c45
< add_library(gmx ${GMXLIB_SOURCES} ${BLAS_SOURCES} ${LAPACK_SOURCES}
${GMX_SSE2_SOURCES})
---
> add_library(gmx ${GMXLIB_SOURCES} ${GMX_SSE2_SOURCES}
${GMX_SSE2_ASM_SOURCES} ${BLAS_SOURCES} ${LAPACK_SOURCES})

Cheers,

Gino





More information about the gromacs.org_gmx-developers mailing list