Skip to content

Commit

Permalink
Merge branch 'main' into issue-#111/replace-popt-in-rbdock
Browse files Browse the repository at this point in the history
  • Loading branch information
ggutierrez-sunbright authored Feb 19, 2025
2 parents 424e714 + 3e631b5 commit 1925203
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:

jobs:
check-lint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: setup-lint
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends clang-format make
sudo apt-get install -y --no-install-recommends clang-format=1:14.0-55~exp2 make
- name: check-lint
run: make lint-check

Expand Down
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ CONFIG ?= RELEASE
RBT_VERSION ?= v$(shell date +%y.%m-alpha)
CXX ?= g++

# OS-specific settings
LIB_PATH_VAR := LD_LIBRARY_PATH
ifeq ($(shell uname),Darwin)
BREW_PREFIX := /opt/homebrew
CXX_BASE_FLAGS += -I$(BREW_PREFIX)/include
LINK_FLAGS += -L$(BREW_PREFIX)/lib
LIB_PATH_VAR := DYLD_LIBRARY_PATH
endif

CXX_BASE_FLAGS += -Wall
CXX_STD ?= c++17
EXE_FOLDER = src/exe
Expand Down Expand Up @@ -87,6 +96,12 @@ DEFINES += -DRBT_VERSION=\"$(RBT_VERSION)\"
CXX_FLAGS := $(CXX_BASE_FLAGS) $(CXX_CONFIG_FLAGS) $(CXX_WARNING_FLAGS) $(CXX_EXTRA_FLAGS) $(DEFINES)
LINK_FLAGS := -shared
LIB_DEPENDENCIES += -lm

# Modify library dependencies for macOS
ifeq ($(shell uname),Darwin)
LIB_DEPENDENCIES = -L$(BREW_PREFIX)/lib -lm
endif

LIBS += $(LIB_DEPENDENCIES) -lRbt
INCLUDE := $(addprefix -I./, $(shell find include/ -type d )) $(addprefix -I./, $(shell find import/ -type d ))
TESTS_INCLUDE := $(INCLUDE) $(addprefix -I./, $(shell find tests/include/ -type d ))
Expand Down Expand Up @@ -161,15 +176,15 @@ test: build ## run the tests suite

test_dock_run: build tests/data/1YET_test.as
mkdir -p tests/results
cd tests/data ; RBT_ROOT=../.. LD_LIBRARY_PATH=../../lib:$(LD_LIBRARY_PATH) ../../bin/rbdock -r1YET_test.prm -i 1YET_c.sd -p dock.prm -n 1 -s 48151623 -o ../results/1YET_test_out > ../results/1YET_test_out.log
cd tests/data ; RBT_ROOT=../.. $(LIB_PATH_VAR)=../../lib:$($(LIB_PATH_VAR)) ../../bin/rbdock -r1YET_test.prm -i 1YET_c.sd -p dock.prm -n 1 -s 48151623 -o ../results/1YET_test_out > ../results/1YET_test_out.log

@tests/scripts/check_results.sh ./tests/data/1YET_reference_out.sd ./tests/results/1YET_test_out.sd

test_rbcavity: tests/data/1koc.as tests/data/1YET.as tests/data/1YET_test.as
diff -q tests/data/1YET_test.as tests/data/1YET_reference_out.as

test_suite: build_tests
LD_LIBRARY_PATH=./lib tests/bin/test_suite
$(LIB_PATH_VAR)=./lib tests/bin/test_suite

clean: ## removes the object files and folder
@rm -rf obj
Expand Down Expand Up @@ -220,13 +235,13 @@ scripts: build_directories
lib: lib/libRbt.so

lib/libRbt.so: $(objects)
$(CXX) $(CXX_FLAGS) -shared -L$(LIBRARY) $^ -o lib/libRbt.so $(LIB_DEPENDENCIES)
$(CXX) $(CXX_FLAGS) $(LINK_FLAGS) -shared $^ -o lib/libRbt.so $(LIB_DEPENDENCIES)

bin/%: src/exe/%.cxx lib/libRbt.so
$(CXX) $(CXX_FLAGS) $(INCLUDE) -L$(LIBRARY) -o $@ $< $(LIBS)

tests/data/%.as: tests/data/%.prm bin/rbcavity
cd tests/data ; RBT_ROOT=../.. LD_LIBRARY_PATH=../../lib:$(LD_LIBRARY_PATH) ../../bin/rbcavity -r$(notdir $<) -was
cd tests/data ; RBT_ROOT=../.. $(LIB_PATH_VAR)=../../lib:$($(LIB_PATH_VAR)) ../../bin/rbcavity -r$(notdir $<) -was

tests_directories:
@mkdir -p tests/obj tests/bin
Expand Down
39 changes: 27 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# rDock

[![.github/workflows/build_matrix.yml](https://github.com/CBDD/rDock/actions/workflows/build_matrix.yml/badge.svg?branch=main)](https://github.com/CBDD/rDock/actions/workflows/build_matrix.yml)

* [Quick start guide](#quick-start-guide)
+ [Requirements](#requirements)
+ [Compilation](#compilation)
+ [Testing](#testing)
+ [Installation](#installation)
+ [Next steps](#next-steps)
* [rDock legacy version](#rdock-legacy-version)
- [Quick start guide](#quick-start-guide)
- [Requirements](#requirements)
- [Compilation](#compilation)
- [Testing](#testing)
- [Installation](#installation)
- [Next steps](#next-steps)
- [rDock legacy version](#rdock-legacy-version)

## Quick start guide

Expand All @@ -19,16 +20,22 @@ In order to install precompiled binaries, you can follow the same steps as the [

make sure the following requirements are installed and available:

* make
* a c++ compiler (g++ by default)
* git (optional if you download the code directly)
- make
- a c++ compiler (g++ by default)
- git (optional if you download the code directly)

if you're running ubuntu, you can get all of them by running

```
sudo apt update && sudo apt install -y make git g++
```

if you're running `macOS`, make sure to use gcc instead of clang. You can install gcc and popt using homebrew

```
brew install gcc popt
```

you can also check requirements for other officially supported distributions in the [Dockerfiles](https://github.com/CBDD/rDock/blob/main/.github/docker) used for CI

### Compilation
Expand All @@ -41,7 +48,14 @@ cd rDock
make
```

if you have multiple cores available, you may want to speed up the build process running make like this (replace 4 with the number of parallel processes you'd like to run)
on `macOS`, you may need to run `export CXX=g++` before running make in order to use gcc instead of clang. Here is an example for gcc-14 installed with homebrew:

```
export CXX=/opt/homebrew/Cellar/gcc/14.2.0_1/bin/g++-14
```

if you have multiple cores available, you may want to speed up the build process running make like this (replace 4 with the number of parallel processes you'd like to run)

```
make -j 4
```
Expand All @@ -62,7 +76,6 @@ select the location for rDock binaries, library and development headers to be in

then set the PREFIX environment variable to point to this folder, for example ~/.local


```
PREFIX=~/.local make install
```
Expand All @@ -81,6 +94,8 @@ export LD_LIBRARY_PATH=~/.local/lib:$LD_LIBRARY_PATH
export RBT_ROOT=~/.local/rDock
```

on `macOS`, LD_LIBRARY_PATH needs to be replaced by `DYLD_LIBRARY_PATH`

you may want to add these lines to your profile/configuration files like ~/.bashrc

### Next steps
Expand Down
2 changes: 1 addition & 1 deletion import/simplex/include/NMObjective.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#if !defined _userfile_
#define _userfile_

#include <malloc.h>
#include <stdlib.h>
#include <vector>

double getInitialStep();
Expand Down

0 comments on commit 1925203

Please sign in to comment.