Electrostatics / apbs-pdb2pqr

APBS - software for biomolecular electrostatics and solvation
http://www.poissonboltzmann.org/
128 stars 62 forks source link

Build failure on Centos 7 #529

Closed mathog closed 4 years ago

mathog commented 4 years ago

Greetings. First tried to use 1.5 binaries on Centos 7 but it has this problem:

apbs --help
apbs: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by apbs)
apbs: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by apbs)
apbs: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by apbs)

Then tried to build from source:

  cd /usr/common/src
  git clone https://github.com/Electrostatics/apbs-pdb2pqr.git
  cd apbs-pdb2pqr
  git submodule init
  git submodule update
  #needs MSMS or Nanoshaper.  Installed MSMS successfully but NanoShaper 
  #would not build.  See if this can do so?
  mkdir -p apbs/build
  cd apbs/build
  module load cmake #get 3.15.3, very recent release needed
  #Requires: OpenBLAS, installed on all nodes
  cmake -DENABLE_GEOFLOW=ON -DENABLE_PBAM=ON \
   -DENABLE_BEM=ON -DENABLE_FETK=ON \
   -DENABLE_PYTHON=ON -DBUILD_SHARED_LIBS=ON \
   -DGET_NanoShaper=ON ../CMakeLists.txt
  cd ..
  make 2>&1 | tee build_2019_09_13.log

#build aborts here:

/usr/common/src/apbs-pdb2pqr/apbs/externals/pb_s_am/pbam/src/../../../../src/generic/vparam.h:69:19: fatal error: mc/mc.h: No such file or directory
HAVE_MC_H

Suggestions? Thanks.

kozlac commented 4 years ago

Hello @mathog, could you make sure the file apbs/external/fetk/mc/src/aaa_inc/mc/mc.h exists? But most likely is because you are calling cmake from the build folder with ../CMakeList.txt and writing on the top-level folder messing up the paths. From a brand new clone, try this: user@pc: apbs$ mkdir build && cd build user@pc: apbs/build$ cmake <cmake options> .. user@pc: apbs/build$ make

Notice the two dots only. This will write all the cmake and make related files in the build folder. Let me know if this solves the issue. Thanks!!

mathog commented 4 years ago

The file exists (except it is externals, not external). Its size is 1457 bytes. The ../CMakeLists.txt was the problem. Using just ".." it dropped the Makefile in build, rather than putting it in apbs. It is compiling now. Thanks!

  git clone https://github.com/Electrostatics/apbs-pdb2pqr.git
  cd apbs-pdb2pqr
  git submodule init
  git submodule update
  mkdir -p apbs/build
  cd apbs/build
  module load cmake #get 3.15.3, very recent release needed
  #Requires: OpenBLAS, installed on all nodes
  cmake -DENABLE_GEOFLOW=ON -DENABLE_PBAM=ON \
   -DENABLE_BEM=ON -DENABLE_FETK=ON \
   -DENABLE_PYTHON=ON -DBUILD_SHARED_LIBS=ON \
   -DGET_NanoShaper=ON ..
  cd ..
  make 2>&1 | tee build_2019_09_13.log
mathog commented 4 years ago

The build ran for a long time, then exited here:

/usr/common/src/apbs-pdb2pqr/apbs/src/routines.c: In function ‘solvePBAM’:
/usr/common/src/apbs-pdb2pqr/apbs/src/routines.c:5332:11: error: ‘for’ loop initial declarations are only allowed in C99 mode
           for (int i = 0; i < PBAMPARM_MAXMOL; i++) {
           ^

It does that for 7.3.1 and 4.8.5 versions of the gnu compilers.

Thanks.

mathog commented 4 years ago

Modified the source code of routines.c to get past that (moved "int i" to the line above) and it ran along fine until it stopped here:

[ 99%] Building C object tools/python/CMakeFiles/_apbslib.dir/CMakeFiles/_apbslib.dir/apbslibPYTHON_wrap.c.o
/usr/common/src/apbs-pdb2pqr/apbs/build/tools/python/CMakeFiles/_apbslib.dir/apbslibPYTHON_wrap.c:149:21: fatal error: Python.h: No such file or directory
 # include <Python.h>

Really? The system has these:

/usr/include/python2.7/Python.h
/usr/include/python3.6m/Python.h

Pretty odd error given that the Python.h are are in pretty much the expected locations.

kozlac commented 4 years ago

Yeah, the for(int i=....) it depends on whatever standard is being used. Aa far as the python, it seems to me you are building on an HPC environment so you may need to load the python module just like you are loading the cmake one. This way the paths are added to the appropriate variables.

mathog commented 4 years ago

The command which fails is:

cd /usr/common/src/apbs-pdb2pqr/apbs/build/tools/python && /usr/bin/cc -DENABLE_BEM -DENABLE_GEOFLOW -DENABLE_PBAM -DGEOFLOW_APBS -DPBAM_APBS -D_apbslib_EXPORTS -I/usr/common/src/apbs-pdb2pqr/apbs/externals/bem -I/usr/common/src/apbs-pdb2pqr/apbs/externals/bem/src -I/usr/common/src/apbs-pdb2pqr/apbs/build/fetk/include -I/usr/common/src/apbs-pdb2pqr/apbs/externals/geoflow_c/src -I/usr/common/src/apbs-pdb2pqr/apbs/externals/pb_s_am/pbam/src -I/usr/common/src/apbs-pdb2pqr/apbs/externals/pb_s_am/pb_shared/src -I/usr/common/src/apbs-pdb2pqr/apbs/externals/pb_s_am/pb_wrap/src -I/usr/common/src/apbs-pdb2pqr/apbs/src -I/usr/common/src/apbs-pdb2pqr/apbs/build/src -I/usr/common/src/apbs-pdb2pqr/apbs/include -I/usr/common/src/apbs-pdb2pqr/apbs/tools/python/C:/Python35/include -I/usr/common/src/apbs-pdb2pqr/apbs/tools/python  -O2 -g -DNDEBUG -fPIC   -o CMakeFiles/_apbslib.dir/CMakeFiles/_apbslib.dir/apbslibPYTHON_wrap.c.o   -c /usr/common/src/apbs-pdb2pqr/apbs/build/tools/python/CMakeFiles/_apbslib.dir/apbslibPYTHON_wrap.c

Note this clause, which looks like a glitch somewhere or other (semi windows style path):

 -I/usr/common/src/apbs-pdb2pqr/apbs/tools/python/C:/Python35/include
mathog commented 4 years ago

Changes that to

 -I/usr/common/src/apbs-pdb2pqr/apbs/tools/python/ -I/usr/include/python3.6m

and then it blew up on the link, with an even more Windows specific clause:

-lC:\Python35\libs\python35.lib

Why is that showing up on a Linux box???

mathog commented 4 years ago

The fix for the python seems to be to comment out these two lines in apbs/tools/python/CMakeLists.txt

set(PYTHON_INCLUDE_DIRS C:\\Python35\\include)
set(PYTHON_LIBRARIES C:\\Python35\\libs\\python35.lib)

After that, and the "int i" fix above, the apbs build runs to completion. I'm not actually sure that the python stuff did build, but at least it didn't keep the rest of it from building.

mathog commented 4 years ago

Also, "make install" is broken. It copied over a small subset of the shared libraries apbs was linked to. When run from the "build" directory this moved them all, probably with some that are not needed. Anyway, "apbs -help" ran afterwards.

  cp bem-prefix/src/bem-build/libTABIPBlib.so $TOPDIR/lib
  (cd fetk/src/fetk-punc-build/src/aaa_lib/.libs; tar -cf - .) | (cd $TOPDIR/lib; tar -xf -)
  (cd fetk/src/fetk-mc-build/src/aaa_lib/.libs; tar -cf - .) | (cd $TOPDIR/lib; tar -xf -)
  (cd fetk/src/fetk-maloc-build/src/aaa_lib/.libs; tar -cf - .) | (cd $TOPDIR/lib; tar -xf -)
  (cd fetk/src/fetk-gamer-build/src/aaa_lib/.libs; tar -cf - .) | (cd $TOPDIR/lib; tar -xf -)
  /bin/rm $TOPDIR/lib/*.la
  (cd fetk/lib; tar -cf - *.la) | (cd $TOPDIR/lib; tar -xf -)
kozlac commented 4 years ago

Hi @mathog! You are correct. I seemed to have mistakenly pushed a change to the master branch for the python build. I'll correct these. I'll also fix the install rules. Thanks for letting us know!