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 committed Jun 27, 2024
2 parents 3a64282 + ac8d04b commit 4f865eb
Show file tree
Hide file tree
Showing 33 changed files with 26,710 additions and 525 deletions.
8 changes: 0 additions & 8 deletions .github/docker/Dockerfile.centos-centos7

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tgagor/centos-stream:stream8 as base
FROM quay.io/centos/centos:stream9 as base

# Install dependencies
RUN yum install -y gcc-c++ make
3 changes: 1 addition & 2 deletions .github/workflows/build_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
- ubuntu-20.04
- debian-11
- debian-10
- centos-stream8
- centos-centos7
- centos-stream9
compiler:
- g++
include:
Expand Down
41 changes: 36 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ LINK_FLAGS := -shared
LIB_DEPENDENCIES += -lm
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 ))
LIBRARY := ./lib


Expand All @@ -88,9 +89,12 @@ GP_objects = $(subst src/GP/, obj/GP/, $(GP_sources:.cxx=.o))
RBT_sources = $(shell find src/lib/ -type f -name '*.cxx')
RBT_objects = $(subst src/lib/, obj/, $(RBT_sources:.cxx=.o))

tests_sources = $(shell find tests/src/ -type f -name '*.cpp')
tests_objects = tests/obj/catch_amalgamated.o $(subst tests/src/, tests/obj/, $(tests_sources:.cpp=.o))

objects = $(RBT_objects) $(simplex_objects) $(GP_objects)

objdirs = obj obj/simplex obj/GP
objdirs = $(sort $(dir $(objects)))
$(shell mkdir -p $(objdirs) ./lib ./bin)

bin_names = rbdock rbcavity rbmoegrid rblist rbcalcgrid
Expand All @@ -116,6 +120,9 @@ install: build target_folders ## install the library, binaries, and headers in P
@cp -r lib/* $(PREFIX)/lib
@cp -r include/* $(PREFIX)/include

install-include: target_folders
@cp -r include/* $(PREFIX)/include

full: ## equivalent to veryclean build test install
$(MAKE) veryclean
$(MAKE) build
Expand All @@ -128,12 +135,15 @@ build_bin: build_directories
build_lib: build_directories
$(MAKE) lib

build_tests: tests_directories build
$(MAKE) tests_bin

retest: build
$(MAKE) clean_tests
$(MAKE) test

test: build ## run the tests suite
$(MAKE) test_rbcavity test_dock_run
$(MAKE) test_rbcavity test_dock_run test_suite

test_dock_run: build tests/data/1YET_test.as
mkdir -p tests/results
Expand All @@ -143,6 +153,9 @@ test_dock_run: build tests/data/1YET_test.as

test_rbcavity: tests/data/1koc.as tests/data/1YET.as tests/data/1YET_test.as

test_suite: build_tests
LD_LIBRARY_PATH=./lib tests/bin/test_suite

clean: ## removes the object files and folder
@rm -rf obj

Expand All @@ -155,10 +168,14 @@ clean_lib: ## removes the compiled library file, libRbt.so
clean_tests: ## removes the files generated by test execution
@rm -rf tests/results tests/data/*.as

veryclean: clean clean_bin clean_lib clean_tests ## equivalent to clean clean_bin clean_lib clean_tests
clean_tests_objects: ## removes the object files generated by the tests
@rm -rf tests/obj
@rm -f tests/bin/test_suite

veryclean: clean clean_bin clean_lib clean_tests clean_tests_objects ## equivalent to clean clean_bin clean_lib clean_tests clean_tests_objects

lint: ## format the code using clang-format. Requires clang-format to be installed
@clang-format --style=file -i $(shell find src/ include/ -iname '*.cxx' -o -iname '*.h')
@clang-format --style=file -i $(shell find src/ include/ tests/ -iname '*.cxx' -o -iname '*.h' -o -iname '*.cpp')

## Internal targets

Expand Down Expand Up @@ -194,6 +211,20 @@ bin/%: src/exe/%.cxx lib/libRbt.so
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

tests_directories:
@mkdir -p tests/obj tests/bin

tests_bin: $(tests_objects)
$(CXX) $(CXX_FLAGS) $(TESTS_INCLUDE) -L$(LIBRARY) -o tests/bin/test_suite $^ $(LIBS)

tests/obj/catch_amalgamated.o: import/catch2/catch_amalgamated.cpp
@echo $(CXX) $(CXX_FLAGS) $(TESTS_INCLUDE) -c -o $@ $<
$(CXX) $(CXX_FLAGS) $(TESTS_INCLUDE) -c -o $@ $<

tests/obj/%.o: tests/src/%.cpp
@echo $(CXX) $(CXX_FLAGS) $(TESTS_INCLUDE) -c -o $@ $<
$(CXX) $(CXX_FLAGS) $(TESTS_INCLUDE) -c -o $@ $<

lint-check:
@echo "Checking code style..."
# --ferror-limit=1 is used to stop the execution after the first error until we fix all the code
Expand All @@ -204,4 +235,4 @@ targets: ## Display this help
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

help: ## detailed help
@ awk '/^#/ {print; next} {if (NR>1) exit}' $(MAKEFILE_LIST) | sed -e 's/^#//'
@ awk '/^#/ {print; next} {if (NR>1) exit}' $(MAKEFILE_LIST) | sed -e 's/^#//'
23 changes: 23 additions & 0 deletions import/catch2/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 4f865eb

Please sign in to comment.