Code Monkey home page Code Monkey logo

Comments (1)

Fravadona avatar Fravadona commented on July 26, 2024

Hi eric-jm-lang,

I successfully built and ran CHAP, linked to GROMACS 2018.8, with everything compiled with Intel Compilers 2018.3 and Intel MKL 2018.3.

First you would need to apply the patch file at the end of #22 that fixes a few bugs and compilation issues.
Then, if you want to be able to relocate CHAP after installation then you'll also need to apply the patch in #23 .
And if you want to compile CHAP with MKL's LAPACK/LAPACKE/BLAS/CBLAS then you should also change this:

--- chap-version_0_9_1/src/geometry/cubic_spline_interp_1D.cpp.orig	2018-05-02 13:22:36.000000000 +0200
+++ chap-version_0_9_1/src/geometry/cubic_spline_interp_1D.cpp	2019-12-06 16:47:52.052585866 +0100
@@ -26,7 +26,7 @@
 #include <stdexcept>
 #include <string>
 
-#include <lapacke.h>
+#include <mkl_lapacke.h>
 
 #include "geometry/basis_spline.hpp"
 #include "geometry/cubic_spline_interp_1D.hpp"
--- chap-version_0_9_1/src/geometry/cubic_spline_interp_3D.cpp.orig	2018-05-02 13:22:36.000000000 +0200
+++ chap-version_0_9_1/src/geometry/cubic_spline_interp_3D.cpp	2019-12-06 16:48:16.509297021 +0100
@@ -26,7 +26,7 @@
 #include <stdexcept>
 #include <string>
 
-#include <lapacke.h>
+#include <mkl_lapacke.h>
 
 #include "geometry/basis_spline.hpp"
 #include "geometry/cubic_spline_interp_3D.hpp"

For CHAP compilation with MKL there's a trick in the CMAKE command, which is to specify a dot for all related LAPACK and BLAS stuff.
So here's my CMAKE command, with AVX2 processor acceleration but you can change it. GROMACS and BOOST are supposed to be installed in a "3rdparty" directory inside the CHAP directory:

# First source the Intel environement (Compilers and MKL)
. /opt/intel/XXXXXX/compilervars.sh intel64
. /opt/intel/XXXXXX/mklvars intel64

CHAPDIR='/opt/chap-gmx2018.8-intel2018.3-avx2'
IFLAGS='-xCORE-AVX2 -mkl=sequential'

cmake3 \
-DCMAKE_INSTALL_PREFIX=${CHAPDIR} \
-DGROMACS_DIR=${CHAPDIR}/3rdparty/share/cmake/gromacs \
-DBOOST_ROOT=${CHAPDIR}/3rdparty \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_C_COMPILER="$(which icc)" \
-DCMAKE_C_FLAGS="${IFLAGS}" \
-DCMAKE_CXX_COMPILER="$(which icpc)" \
-DCMAKE_CXX_FLAGS="${IFLAGS}" \
-DLAPACKE_CBLAS_INCLUDE_DIR=. \
-DLAPACKE_LAPACKE_INCLUDE_DIR=. \
-DLAPACKE_LIB=. \
-DLAPACK_LIB=. \
-DBLAS_LIB=. \
-DCBLAS_LIB=. \
..

Remark: As GROMACS utilises MKL in sequential mode, it may be a good idea to specify it for CHAP also (I'm not very sure).

Remark: If BOOST isn't installed on a standard location then the BOOST_ROOT won't work unless it is installed in the same place than GROMACS.

Remark: If you want to statically link the Intel libraries to the binary, just add -static-intel after -mkl=sequential (though GROMACS would also need to be compiled this way because it doesn't make sense otherwise).

That's all, I hope this will prove useful to you.
Cheers.

PS: If you you to compile GROMACS with static Intel libraries I can provide the CMAKE command for it.

from chap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.