Skip to content
Open
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
082afe4
almost there
danpf Sep 13, 2019
a8a924e
remove excess
danpf Sep 13, 2019
4b33819
done with reader
danpf Sep 14, 2019
111b734
temporary stuff
danpf Sep 23, 2019
caeb577
updated to have encode work
danpf Oct 2, 2019
eddb760
setup for pip
danpf Oct 4, 2019
8e7f475
remove extra
danpf Oct 15, 2019
dc91554
make pybind11 https
danpf Oct 20, 2019
1cb3597
binary enc changes
danpf Mar 24, 2020
c940bd3
merged
danpf Mar 24, 2020
86cbd91
cmakelists to spaces
danpf Mar 24, 2020
037eb69
checkpoint
danpf Mar 24, 2020
60103bc
fixes
danpf Mar 25, 2020
5dacd2d
removed mmtf_t.py
danpf Mar 25, 2020
2ec61b4
build ci
danpf Mar 25, 2020
bae25d3
lowercase bionic
danpf Mar 25, 2020
4d54664
try2
danpf Mar 25, 2020
a65d69a
debug travis
danpf Mar 25, 2020
9143d1a
setup gcc7
danpf Mar 25, 2020
8a0f1a4
add to env for ever matrix
danpf Mar 25, 2020
6701c19
attempt 01
danpf Mar 25, 2020
daadb33
more updates
danpf Mar 25, 2020
7bb120f
fixed exe
danpf Mar 25, 2020
1692246
upagain
danpf Mar 25, 2020
b10e6a3
up
danpf Mar 25, 2020
7a2c67e
update langauge
danpf Mar 25, 2020
cf92b45
hopefully done
danpf Mar 25, 2020
ded948f
remove user call
danpf Mar 25, 2020
7892582
fix pybind11 call
danpf Mar 25, 2020
4c3414e
set catch2
danpf Mar 25, 2020
6e5beb6
not sure 2
danpf Mar 25, 2020
470ae1a
fix gitignore
danpf Mar 25, 2020
740f8d2
update
danpf Mar 25, 2020
54d8f30
fix build
danpf Mar 25, 2020
aa3fb33
add back docs
danpf Mar 25, 2020
b6648fa
fix extras
danpf Mar 25, 2020
cc2e1b5
remove pycache
danpf Mar 25, 2020
c0158a6
fix submodule loc
danpf Mar 25, 2020
1ab4052
last try
danpf Mar 25, 2020
674aea1
fixes
danpf Mar 25, 2020
2394da2
donezo
danpf Mar 26, 2020
7aab1a3
fix cpp tests
danpf Mar 26, 2020
efcb14a
remove pyc
danpf Mar 26, 2020
83ea2be
update gitignore
danpf Mar 26, 2020
4761465
fix pathing
danpf Mar 26, 2020
95c81d1
change travis python addon name
danpf Mar 26, 2020
e3bf246
get rid of CC in travis check
danpf Mar 26, 2020
9464880
attempt substitute python command
danpf Mar 26, 2020
10e2148
lint .travis
danpf Mar 26, 2020
433810e
fix extra DNDEBUG setting
danpf Mar 26, 2020
22d8b68
add CC back
danpf Mar 26, 2020
5ac8042
update readme with python information
danpf Mar 26, 2020
a24420c
update
danpf Mar 26, 2020
6f2aea1
merge with master
danpf Nov 14, 2023
c740b14
update mmtf_spec
danpf Nov 14, 2023
65c8345
update to Catch2 v3.4.0 (for m1 silicon support)
danpf Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ build/*
docs/html/*
examples/out/*
examples/out_json_ref/*

# python eggs
python_src/*.egg-info
**/__pycache__
**/*.pyc


26 changes: 19 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
[submodule "Catch2"]
path = Catch2
url = https://github.com/catchorg/Catch2
[submodule "msgpack-c"]
path = msgpack-c
url = https://github.com/msgpack/msgpack-c
path = submodules/Catch2
Comment thread
danpf marked this conversation as resolved.
Outdated
url = https://github.com/catchorg/Catch2.git
[submodule "mmtf_spec"]
path = mmtf_spec
url = https://github.com/rcsb/mmtf
path = submodules/mmtf_spec
url = https://github.com/rcsb/mmtf.git
[submodule "pybind11"]
path = submodules/pybind11
url = https://github.com/pybind/pybind11.git
[submodule "submodules/msgpack-c"]
path = submodules/msgpack-c
url = https://github.com/msgpack/msgpack-c.git
[submodule "submodules/Catch2"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catch2 listed twice?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix this once the other two PRs are merged

path = submodules/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "submodules/--force"]
path = submodules/--force
url = https://github.com/msgpack/msgpack-c.git
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodules/--force? Looks like an accident

[submodule "submodules/mmtf_spec"]
path = submodules/mmtf_spec
url = https://github.com/rcsb/mmtf.git
57 changes: 47 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,66 @@ linux32_addons:
- linux-libc-dev:i386
- libc6-dev-i386

linux64_cpp17addons:
addons: &linux64cpp17
apt:
sources:
- ubuntu-toolchain-r-test


linux64_cpp17addons_py36:
addons: &linux64cpp17py36
apt:
sources:
- ubuntu-toolchain-r-test
- gcc-7
- g++-7

# Set empty values for allow_failures to work
env:
env: TEST_COMMAND=$TRAVIS_BUILD_DIR/ci/build_and_run_tests.sh
python:

matrix:
fast_finish: true
include:
- os: linux
env: EMSCRIPTEN=ON
env: EMSCRIPTEN=ON TEST_COMMAND=$TRAVIS_BUILD_DIR/ci/build_and_run_tests.sh
addons: *linux64
- os: linux
compiler: clang
addons: *linux64
- os: linux
compiler: gcc
env: ARCH=x86 CMAKE_EXTRA=-DHAVE_LIBM=/lib32/libm.so.6
env: ARCH=x86 CMAKE_EXTRA=-DHAVE_LIBM=/lib32/libm.so.6 TEST_COMMAND=$TRAVIS_BUILD_DIR/ci/build_and_run_tests.sh
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEST_COMMAND redundant with global value?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TEST_COMMAND environment variable is a way to run two different tests. I could not find a better way to run two different test suites. If you have any examples of repos that do this in a nicer way, I would be happy to learn a more efficient way and refactor this.

in this case TEST_COMMAND is not redundant because the env: block is overwriting the global value.

addons: *linux32
- os: osx
compiler: clang
- os: linux
compiler: gcc
addons: *linux64cpp17
dist: bionic
- os: linux
compiler: gcc
addons: *linux64cpp17py36
dist: bionic
env: TEST_COMMAND=$TRAVIS_BUILD_DIR/ci/build_and_run_python_tests.sh CC=gcc
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a global TEST_COMMAND_PYTHON and use

      env : TEST_COMMAND=$TEST_COMMAND_PYTHON

And is CC needed? Looks redundant with compiler: gcc

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this, and apparently... yes it is required for some reason, even though you would think otherwise..

python: 3.6
language: python
- os: linux
compiler: gcc
addons: *linux64cpp17py36
dist: bionic
env: TEST_COMMAND=$TRAVIS_BUILD_DIR/ci/build_and_run_python_tests.sh CC=gcc
python: 3.7
language: python
- os: linux
compiler: gcc
addons: *linux64cpp17py36
dist: bionic
env: TEST_COMMAND=$TRAVIS_BUILD_DIR/ci/build_and_run_python_tests.sh CC=gcc
python: 3.8
language: python


before_install:
# Setting environement
Expand All @@ -48,10 +90,5 @@ before_install:
- $CXX --version

script:
- cd $TRAVIS_BUILD_DIR
- mkdir build && cd build
- $CMAKE_CONFIGURE cmake $CMAKE_ARGS $CMAKE_EXTRA ..
- make -j2
- ctest -j2 --output-on-failure
- bash $TRAVIS_BUILD_DIR/ci/travis-test-example.sh
- cd $TRAVIS_BUILD_DIR
- echo $TEST_COMMAND
- (eval "$TEST_COMMAND")
33 changes: 31 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ target_include_directories(MMTFcpp INTERFACE

if (mmtf_build_local)
# use header only
set(MSGPACKC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/msgpack-c/include)
set(MSGPACKC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/msgpack-c/include)
add_library(msgpackc INTERFACE)
target_include_directories(msgpackc INTERFACE ${MSGPACKC_INCLUDE_DIR})
if (BUILD_TESTS)
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Catch2/single_include)
set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/Catch2/single_include)
add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
endif()
Expand All @@ -40,6 +40,35 @@ if (mmtf_build_examples)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples)
endif()


if (build_py)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
add_definitions(-DNDEBUG)
Comment thread
danpf marked this conversation as resolved.
Outdated
add_library(mmtf_bindings SHARED
${CMAKE_CURRENT_SOURCE_DIR}/python_src/bindings.cpp
)

set(MSGPACKC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/msgpack-c/include)
set(PYBIND_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules/pybind11/include)

target_include_directories(mmtf_bindings PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(mmtf_bindings PUBLIC ${MSGPACKC_INCLUDE_DIR})
target_include_directories(mmtf_bindings PUBLIC ${PYBIND_INCLUDE_DIR})
target_include_directories(mmtf_bindings PUBLIC ${python_include_A})
target_include_directories(mmtf_bindings PUBLIC ${python_include_B})

set_target_properties(mmtf_bindings PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(mmtf_bindings PROPERTIES PREFIX "")
set_target_properties(mmtf_bindings PROPERTIES SUFFIX ".so")
set_target_properties(mmtf_bindings PROPERTIES CXX_STANDARD 17)
endif()

install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION "include"
Expand Down
10 changes: 10 additions & 0 deletions ci/build_and_run_python_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

python3 --version
pip3 --version
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt
cd $TRAVIS_BUILD_DIR
pip3 install .
pytest python_src/tests/tests.py -s -vv


7 changes: 7 additions & 0 deletions ci/build_and_run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cd $TRAVIS_BUILD_DIR
mkdir build && cd build
$CMAKE_CONFIGURE cmake $CMAKE_ARGS $CMAKE_EXTRA ..
make -j2
ctest -j2 --output-on-failure
bash $TRAVIS_BUILD_DIR/ci/travis-test-example.sh
cd $TRAVIS_BUILD_DIR
14 changes: 11 additions & 3 deletions ci/setup-travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ if [[ "$EMSCRIPTEN" == "ON" ]]; then
fi

if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
if [[ "$CC" == "gcc" ]]; then
export CC=gcc-4.8
export CXX=g++-4.8
if [[ "$TRAVIS_DIST" == "trusty" ]]; then
if [[ "$CC" == "gcc" ]]; then
export CC=gcc-4.8
export CXX=g++-4.8
fi
fi
if [[ "$TRAVIS_DIST" == "bionic" ]]; then
if [[ "$CC" == "gcc" ]]; then
export CC=gcc-7
export CXX=g++-7
fi
fi
fi

Expand Down
Loading