rlabduke / reduce

Reduce - tool for adding and correcting hydrogens in PDB files
Other
113 stars 33 forks source link

Installation fails at Linking CXX shared module #40

Closed rwxayheee closed 3 years ago

rwxayheee commented 3 years ago

Dear reduce experts,

I'm trying to compile reduce on linux x86_64 using gcc from gnu/8.4.0. I did: CXX=/usr/local/gnu/8.4.0/bin/gcc cmake -S reduce_src/ -B . and make

Here's the error I got:

[ 92%] Linking CXX shared module mmtbx_reduce_ext.so /usr/local/cmake/3.17.2/bin/cmake -E cmake_link_script CMakeFiles/mmtbx_reduce_ext.dir/link.txt --verbose=1 /usr/local/gnu/8.4.0/bin/gcc -fPIC -shared -o mmtbx_reduce_ext.so CMakeFiles/mmtbx_reduce_ext.dir/reduce_bpl.cpp.o -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 libreducelib.a /usr/lib64/libboost_python-mt.so /usr/lib64/libpython2.7.so -lpdb++ -ltoolclasses /usr/bin/ld: cannot find -lpdb++ /usr/bin/ld: cannot find -ltoolclasses

I have "libpdb++.a" and "libtoolclasses.a" in the two subdirectories. When I ran "cmake" and "make" for libpdb and toolclasses, I didn't see any error messages. However, I don't have root access on the HPC cluster I'm using. Could you please give me some more guidance on the installation, without root access if possible? Thank you for your time and kind advice in advance.

Best, Amy H

russell-taylor commented 3 years ago

Amy,

You need to run cmake at the Reduce root directory level rather than in the reduce_src subdirectory. If you want to do an in-source build you should be using this command instead: CXX=/usr/local/gnu/8.4.0/bin/gcc cmake .

russell-taylor commented 3 years ago

As you probably know, CMake also allows you to do an out-of-source build by running in another directory and replacing "." with the path to the source directory. This avoids polluting the source directory with build artifacts (and clobbering the Makefiles).

You should also be able to use 'make' without using CMake at all in a clean check-out that has not had CMake run in the source directory.

russell-taylor commented 3 years ago

I've updated the README.md to provide build and install instructions to help clarify.

rwxayheee commented 3 years ago

That is super helpful! Yes I was able to do cmake, make and make install. Here's what I did:

git clone https://github.com/rlabduke/reduce.git
cd reduce
CC=/usr/local/gnu/8.4.0/bin/gcc CXX=/usr/local/gnu/8.4.0/bin/g++ cmake . -DCMAKE_INSTALL_PREFIX:PATH=/mypath/
make
make install

Then the executable is installed as /mypath/bin/reduce and I was able to run the program.

I also noticed that the current version of the program is 4.7.210416. While in the test_reduce.py the provided answer was for version 3.3.160422. But I did the three tests and compared by myself and I didn't find any big issue in the outputs.

Thank you again for your kind help!!