Conda package for cpptraj
@drroe This is actually my first attempt at a pull request that is based on a non-master
branch. I'm assuming that accepting the request will create a conda branch at Amber-MD/cpptraj, and not mess with your master branch.
You can also just go to github.com/dacase/cpptraj.git.
@dacase Do we want to build libcpptraj and include header files in this PR too? or it should be different recipe?
We want to make this recipe to the right thing for pytraj. There is a libcpptraj.so file in $CONDA_PREFIX/lib in the conda package. I don't know what headers pytraj needs, or where they should go -- $CONDA_PREFIX/include? Check out the rsync line towards the end of build.sh, and see if that can do what is needed.
I don't know what headers
pytrajneeds, or where they should go -- $CONDA_PREFIX/include?
- For now, we could copy all the src/*.h to
${CONDA_PREFIX}/include/cpptraj/folder export CPPTRAJ_HEADERDIR=${CONDA_PREFIX}/include/cpptraj
There is a
libcpptraj.sofile in $CONDA_PREFIX/lib in the conda package.
It seems this comes from AmberTools conda since I don't see where libcpptraj.so is built in your recipe. I will make further comment in the code.
There is a
libcpptraj.sofile in $CONDA_PREFIX/lib in the conda package.It seems this comes from AmberTools conda since I don't see where libcpptraj.so is built in your recipe. I will make further comment in the code.
never mind, you do use "-shared" in your build.sh so libcpptraj.so is already done.
I've made some progress on fixing external readline support in cpptraj. It will be in a separate branch that can then eventually be merged into this PR, which should fix the test errors.
I've made some progress on fixing external readline support in cpptraj. It will be in a separate branch that can then eventually be merged into this PR, which should fix the test errors.
I'm a bit lost here: did the test errors arise from the conda package, or from trying to compile (and if so, from which branch?) Can you say which tests are throwing errors? I've never quite understood how to test for readline problems.
I've made some progress on fixing external readline support in cpptraj. It will be in a separate branch that can then eventually be merged into this PR, which should fix the test errors.
I'm a bit lost here: did the test errors arise from the conda package, or from trying to compile (and if so, from which branch?) Can you say which tests are throwing errors? I've never quite understood how to test for readline problems.
See here: https://jenkins.jasonswails.com/blue/organizations/jenkins/amber-github%2Fcpptraj/detail/PR-1125/2/pipeline/33/
This is because there is no system readline so cpptraj tries to build the internal one, but the current build setup can't handle the readline includes being in a readline directory. This branch will handle both system readline and internal readline consistently once I get it merged: https://github.com/drroe/cpptraj/tree/readline.include
Sorry for the delay on this. I've fixed (I think) cpptraj's use of system readline libraries (#1126), but I'm running into an issue with CMAKE that I'm having trouble solving. I switched the include in ReadLine.cpp to be the proper #include <readline/readline.h> (as documented here) which works fine for the configure-based install because I switched the compiler include flag to be -I., but fails for the CMAKE-based install because I can't figure out how to change the include flag. I though that maybe modifying the following in SetupThirdParty.cmake would do it:
--- a/cmake-cpptraj/SetupThirdParty.cmake
+++ b/cmake-cpptraj/SetupThirdParty.cmake
@@ -449,8 +449,8 @@ if(readline_EXTERNAL)
LIBRARIES readline::readline
INCLUDES ${READLINE_INCLUDE_DIR}/readline)
elseif(readline_INTERNAL)
-
- list(APPEND 3RDPARTY_SUBDIRS cpptraj/src/readline)
+ message(STATUS "Readline will be internal")
+ list(APPEND 3RDPARTY_SUBDIRS cpptraj/src)
endif()
But it's still trying to include src/readline instead of just src so I guess there is somewhere else that needs to be changed:
)$ make ReadLine.o
cd /home/droe/Cpptraj/rl.include/build && make -f src/CMakeFiles/cpptraj.dir/build.make src/CMakeFiles/cpptraj.dir/ReadLine.cpp.o
make[1]: Entering directory '/home/droe/Cpptraj/rl.include/build'
Building CXX object src/CMakeFiles/cpptraj.dir/ReadLine.cpp.o
cd /home/droe/Cpptraj/rl.include/build/src && /usr/bin/g++ -DBINTRAJ -DBUILDTYPE=\"GitHub\" -DC11_SUPPORT -DFFTW_FFT -DHASBZ2 -DHASGZ -DHAS_TNGFILE -DHAVE_FFTWD=1 -DLIBPME -DUSE_MKSTEMP -D_GNU_SOURCE -I/home/droe/Cpptraj/rl.include/src/tng/. -I/home/droe/Cpptraj/rl.include/src/arpack/. -I/home/droe/Cpptraj/rl.include/src/xdrfile/. -I/home/droe/Cpptraj/rl.include/src/readline/. -Wall -Wno-unused-function -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unused-but-set-variable -std=gnu++11 -O3 -mtune=native -MD -MT src/CMakeFiles/cpptraj.dir/ReadLine.cpp.o -MF CMakeFiles/cpptraj.dir/ReadLine.cpp.o.d -o CMakeFiles/cpptraj.dir/ReadLine.cpp.o -c /home/droe/Cpptraj/rl.include/src/ReadLine.cpp
/home/droe/Cpptraj/rl.include/src/ReadLine.cpp:11:13: fatal error: readline/readline.h: No such file or directory
11 | # include <readline/readline.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
It's not clear from the documentation what needs to be modified to ensure the includes are properly handled. @dacase @swails @hainm do any of you have any ideas?
I may have figured it out: looks like I had to modify a target_include_directories command in the readline subdirectory itself. Stay tuned...
The readline issues should be resolved with #1126. Next will be the header files installation.
@dacase Cpptraj header install should be working now for both configure/cmake via #1129. You can try merging the current Amber-MD/Cpptraj master into this branch and see if it works for you.
Alternatively, let me know if you want me to reproduce this PR on my fork if that will be easier.
Let me work on this, to make sure the conda package is still OK at my end (i.e. before you do more on this PR at your end. See also coming comments on issue #1120 .
@drroe As I mentioned above, I don't think it's worth your while to do anything with this PR per se.
If you find some time (absolutely no rush!), what would be most helpful would be to install the existing conda package, and try out the tests, look at the contents of the include folder, etc. Only try this on Linux for starters, because the osx builds are a bit behind.
conda create --name cpptraj
conda activate cpptraj
conda install dacase::cpptraj
cd $CONDA_PREFIX
cd test
make test # etc.
conda deactivate
(Right now, I've only put the test folder into the conda package; let me know if I should add the unitTests folder as well.)
FYI: the changes in the PR are pretty minimal. Here are the diffs between the conda branch and master on my local machine; (not all of these have been placed yet into the PR):
(cpptraj) bethe% git diff --stat master
Makefile | 4 +-
configure | 17 ++++-----
mkrelease | 14 +++++++
recipe/activate.sh | 5 +++
recipe/build.sh | 46 ++++++++++++++++++++++
recipe/conda_build_config.yaml | 8 ++++
recipe/deactivate.sh | 5 +++
recipe/meta.yaml | 86 ++++++++++++++++++++++++++++++++++++++++++
src/Matrix.h | 1 +
9 files changed, 175 insertions(+), 11 deletions(-)