brucefan1983 / GPUMD

Graphics Processing Units Molecular Dynamics
https://gpumd.org/dev
GNU General Public License v3.0
466 stars 116 forks source link

BUG: Error is raised when trying to compile the gpumd binary. #52

Closed joabro closed 4 years ago

joabro commented 4 years ago

BACKGROUND

It is currently not possible to compile the gpumd binary after cloning the GitHub repository.

WHAT HAPPENS

The following error message is raised when trying to compile the gpumd binary:

force.cu(633): error: class "Measure" has no member "hnema"

1 error detected in the compilation of "/tmp/tmpxft_00002304_00000000-6_force.cpp1.ii".
make: *** [obj/force.o] Error 1
make: *** No rule to make target `obj_phonon/main_phonon.o', needed by `phonon'.  Stop.
joabro commented 4 years ago

cc @brucefan1983 , @AlexGabourie

AlexGabourie commented 4 years ago

Thanks for bringing this up. This is my fault, but the fix is easy. I will submit a pull request shortly.

AlexGabourie commented 4 years ago

The pull request found here should solve your problem.

joabro commented 4 years ago

Unfortunately the recent merge not fix the problem and I still get the same error message. The problematic line seem to be 633 in force.cu:

    // always correct the force when using the FCP potential
#ifdef USE_FCP
    if (!measure->hnemd.compute && !measure->hnema.compute)
    {
joabro commented 4 years ago

Also the error appears when compiling src/makefile before I do make src/makefile.phonon, in my install script:

#! /usr/bin/env bash
# JB, 12/14/2019

if [ "$#" -gt 0 ] ; then
    echo > /dev/stderr
    echo "usage: `basename $0` " > /dev/stderr
    echo "    Download and install GPUMD" > /dev/stderr
    echo "    using intel compilers, with netCDF" > /dev/stderr
    echo > /dev/stderr
    exit
fi

# Clone repository, if necessary
cwd=$PWD
currdir=`basename $cwd`
if [ "$currdir" != "GPUMD" ] ; then
    if [ ! -d "GPUMD" ] ; then
        git clone https://github.com/brucefan1983/GPUMD.git
    fi
    cd GPUMD
fi
cd src

# Load intel compilers
module load intelcuda/2019a

# Compile the gpumd binary
sed -i -e '/^CFLAGS/ s/$/ -DUSE_NETCDF -DUSE_FCP/' \
-e "/^INC/ s|$| -I${HOME}/local/netcdf/include|" \
-e "/^LDFLAGS/ s|$| -L${HOME}/local/netcdf/lib|" \
-e '/^LIBS/ s/$/ -l:libnetcdf.a/' makefile
make

# Compile the gpumd binary
sed -i '/^CFLAGS/ s/$/ -DUSE_FCP/' makefile.phonon
make -f makefile.phonon

cd $cwd
brucefan1983 commented 4 years ago

Yes, Alex might have not tested the building process with the -DUSE_FCP flag on. I think he can fix this easily.

Zheyong

joabro notifications@github.com 于 2020年3月18日周三 12:08写道:

Also the error appears when compiling src/makefile before I do make src/makefile.phonon, in my install script:

! /usr/bin/env bash

JB, 12/14/2019

if [ "$#" -gt 0 ] ; then echo > /dev/stderr echo "usage: basename $0 " > /dev/stderr echo " Download and install GPUMD" > /dev/stderr echo " using intel compilers, with netCDF" > /dev/stderr echo > /dev/stderr exit fi

Clone repository, if necessary

cwd=$PWD currdir=basename $cwd if [ "$currdir" != "GPUMD" ] ; then if [ ! -d "GPUMD" ] ; then git clone https://github.com/brucefan1983/GPUMD.git fi cd GPUMD fi cd src

Load intel compilers

module load intelcuda/2019a

Compile the gpumd binary

sed -i -e '/^CFLAGS/ s/$/ -DUSE_NETCDF -DUSE_FCP/' \ -e "/^INC/ s|$| -I${HOME}/local/netcdf/include|" \ -e "/^LDFLAGS/ s|$| -L${HOME}/local/netcdf/lib|" \ -e '/^LIBS/ s/$/ -l:libnetcdf.a/' makefile make

Compile the gpumd binary

sed -i '/^CFLAGS/ s/$/ -DUSE_FCP/' makefile.phonon make -f makefile.phonon

cd $cwd

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/brucefan1983/GPUMD/issues/52#issuecomment-600532940, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF546OONTFQZCOYC2RSRPJTRICMR7ANCNFSM4LN5J3KA .

AlexGabourie commented 4 years ago

Zheyong is correct. I didn't test the build process with -DUSE_FCP. I fixed the problem here and was able to build both GPUMD and PHONON with the FCP option enabled. I'll remember to check this in the future.

joabro commented 4 years ago

Thank you for solving this @AlexGabourie. I think that we can close this issue.