channotation / chap

CHAP is a tool for the functional annotation of ion channel structures:
http://www.channotation.org
Other
18 stars 10 forks source link

Errors related to make command, boost libraries and std cpp libraries while compiling CHAP #49

Open batuujin opened 9 months ago

batuujin commented 9 months ago

I'm trying to install CHAP version_0_9_1 and during the make command, I get this error:

(python3.11) bburendei@solaire:~/apps/CHAP/chap-version_0_9_1/build$ make
[  6%] Built target googletest
Consolidate compiler generated dependencies of target chap
[  7%] Building CXX object CMakeFiles/chap.dir/src/aggregation/multiscalar_time_series.cpp.o
/home/bburendei/apps/CHAP/chap-version_0_9_1/src/aggregation/multiscalar_time_series.cpp: In member function ‘void MultiscalarTimeSeries::addScalarTimeSeries(const ScalarTimeSeries&)’:
/home/bburendei/apps/CHAP/chap-version_0_9_1/src/aggregation/multiscalar_time_series.cpp:56:28: error: ‘logic_error’ is not a member of ‘std’
   56 |                 throw std::logic_error("Time stamps of new time series do "
      |                            ^~~~~~~~~~~
/home/bburendei/apps/CHAP/chap-version_0_9_1/src/aggregation/multiscalar_time_series.cpp:72:24: error: ‘logic_error’ is not a member of ‘std’
   72 |             throw std::logic_error("Multiscalar time series can not accept "
      |                        ^~~~~~~~~~~
make[2]: *** [CMakeFiles/chap.dir/build.make:90: CMakeFiles/chap.dir/src/aggregation/multiscalar_time_series.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:391: CMakeFiles/chap.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

I managed to install GROMACS 2018 with the FFTPACK library I can't find previous issues detailing this, so I'm a bit lost as to what I should do to fix this. Thanks in advance.

Batuujin

batuujin commented 9 months ago

I managed to compile and install CHAP with the make command after making these fixes: I think they have to do with proper declaration of standard libraries or so. I don't really get why they were necessary to be honest, but they seem to have worked.

Fix 1: For these kinds of errors error: ‘logic_error’ is not a member of ‘std’, I added this line #include <stdexcept> to the following files:

/home/bburendei/apps/CHAP/chap-version_0_9_1/src/aggregation/multiscalar_time_series.cpp
/home/bburendei/apps/CHAP/chap-version_0_9_1/src/path-finding/molecular_path.cpp
/home/bburendei/apps/CHAP/chap-version_0_9_1/src/statistics/kernel_function.cpp

Found it from here: https://github.com/ros2/rosbag2/issues/312

Fix 2: For these kinds of errors error: ‘uintmax_t’ is not a member of ‘boost’, I added this line #include <boost/cstdint.hpp> to the following files:

/home/bburendei/apps/CHAP/chap-version_0_9_1/src/geometry/spline_curve_1D.cpp
/home/bburendei/apps/CHAP/chap-version_0_9_1/src/path-finding/molecular_path.cpp

Found it from here: https://theboostcpplibraries.com/boost.integer , under example #57.2

After these fixes, the make command worked and I could finish installing CHAP with make install

After this, I had to make sure I sourced gromacs in the shell everytime, before CHAP could be invoked in my terminal. I added it to my .bashrc file source /usr/local/gromacs/bin/GMXRC

batuujin commented 9 months ago

Here is my cmake .. command output by the way, thought it might be relevant to check:

-- The CXX compiler identification is GNU 11.4.0
-- The C compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Boost: /usr/local/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0")  
-- Found LAPACKE: /usr/include/x86_64-linux-gnu  
-- Found GROMACS: 2018
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bburendei/apps/CHAP/chap-version_0_9_1/build