Skip to content

Commit

Permalink
rename build directory to tools
Browse files Browse the repository at this point in the history
  • Loading branch information
KRM7 committed Dec 30, 2023
1 parent 0bd126d commit 539f433
Show file tree
Hide file tree
Showing 32 changed files with 43 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: setup-catch
env:
CXX: ${{ matrix.compiler.cxx }}
run: sudo bash ./install_catch.sh
run: sudo bash ../tools/install_catch.sh

- name: setup-build
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
run: brew update && brew install ${{ matrix.compiler.pkgs }}

- name: setup-catch
run: sudo bash ./install_catch.sh -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_FLAGS="${{ matrix.compiler.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.linker-flags }}"
run: sudo bash ../tools/install_catch.sh -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_CXX_FLAGS="${{ matrix.compiler.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.linker-flags }}"

- name: setup-build
run: cmake .. -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cxx }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGAPP_CXX_FLAGS="${{ matrix.compiler.extra-flags }}" -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.compiler.linker-flags }}" -DGAPP_USE_WERROR=ON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: setup-catch
env:
CXX: ${{ matrix.cxx }}
run: sudo bash ./install_catch.sh
run: sudo bash ../tools/install_catch.sh

- name: setup-build
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
CMAKE_GENERATOR: ${{ matrix.generator }}
CMAKE_GENERATOR_TOOLSET: ${{ matrix.compiler }}
CMAKE_GENERATOR_PLATFORM: ${{ matrix.platform }}
run: bash ./install_catch.sh
run: bash ../tools/install_catch.sh

- name: setup-build
env:
Expand Down
16 changes: 3 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,9 @@
*.hint

# Build results
[Dd]ebug/
[Rr]elease/
x64/
x86/
out/
build/*
!build/*.sh
!build/reflines/
!build/mo_results/
build/mo_results/*.txt
out/
install/
*.exe

# Doc outputs
Expand All @@ -26,7 +19,4 @@ docs/*.txt
refs/

# Test results
test/mo_results/*.txt

# Python
__pycache__/
tools/mo_results/*.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ will install all available configurations:

```shell
git clone https://github.com/KRM7/gapp.git --branch v0.2.0
sudo bash ./gapp/build/install.sh
sudo bash ./gapp/tools/install.sh
```

Once the library is installed, you can import it using `find_package` and then link
Expand Down
2 changes: 2 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
26 changes: 0 additions & 26 deletions build/install_catch.sh

This file was deleted.

4 changes: 2 additions & 2 deletions docs/install-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ install the library in fewer steps:

```shell
git clone https://github.com/KRM7/gapp.git --branch v0.2.0
sudo bash gapp/build/install.sh
sudo bash gapp/tools/install.sh
```

The script will perform the installation steps detailed above for all 3 configurations of the library.
If you want to configure CMake differently from the default, you can pass arguments to the
install script as you would do to CMake, for example:

```shell
sudo bash gapp/build/install.sh -DBUILD_TESTING=ON
sudo bash gapp/tools/install.sh -DBUILD_TESTING=ON
```

### Install location
Expand Down
6 changes: 3 additions & 3 deletions test/integration/benchmark_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ auto invoke_timed(F&& f, Args&&... args)
auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(tend - tbegin).count();
double time_spent = duration / 1000.0;

return std::make_pair(result, time_spent);
return std::make_pair(std::move(result), time_spent);
}

template<typename T>
Expand Down Expand Up @@ -93,8 +93,8 @@ void benchmarkMoga(GA<T>& ga, size_t max_gen, const std::string& ga_name, F fitn
<< "\nTime taken: " << std::fixed << time_spent << "s\n\n";

std::string name = problem.substr(0, problem.find(','));
std::string pop_file = "mo_results/" + ga_name + "_" + name + "_last.txt";
std::string sol_file = "mo_results/" + ga_name + "_" + name + "_sols.txt";
std::string pop_file = "../tools/mo_results/" + ga_name + "_" + name + "_last.txt";
std::string sol_file = "../tools/mo_results/" + ga_name + "_" + name + "_sols.txt";

std::ofstream flast(pop_file);
std::ofstream fsols(sol_file);
Expand Down
2 changes: 1 addition & 1 deletion build/install.sh → tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ echo -e "Installing gapp...\n"

cmake --version

BUILD_DIR=$(dirname $(realpath "$0"))
BUILD_DIR=$(dirname $(realpath "$0"))/../build
echo -e "\nThe build directory is ${BUILD_DIR}.\n"

echo -e "Installing Debug configuration.\n"
Expand Down
27 changes: 27 additions & 0 deletions tools/install_catch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

echo -e "Installing Catch2...\n"

cmake --version

BUILD_DIR=$(dirname $(realpath "$0"))/../build
echo -e "\nThe build directory is ${BUILD_DIR}.\n"

git clone -b v3.3.0 https://github.com/catchorg/Catch2.git $BUILD_DIR/Catch2
CATCH_BUILD_DIR=$BUILD_DIR/Catch2/build
echo -e "\nThe Catch build directory is ${CATCH_BUILD_DIR}.\n"

echo -e "Installing Debug configuration.\n"
cmake -S $CATCH_BUILD_DIR/.. -B $CATCH_BUILD_DIR -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=OFF "$@"
cmake --build $CATCH_BUILD_DIR --config Debug --parallel
cmake --install $CATCH_BUILD_DIR --config Debug

echo -e "Installing RelWithDebInfo configuration.\n"
cmake -S $CATCH_BUILD_DIR/.. -B $CATCH_BUILD_DIR -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF "$@"
cmake --build $CATCH_BUILD_DIR --config RelWithDebInfo --parallel
cmake --install $CATCH_BUILD_DIR --config RelWithDebInfo

echo -e "Installing Release configuration.\n"
cmake -S $CATCH_BUILD_DIR/.. -B $CATCH_BUILD_DIR -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF "$@"
cmake --build $CATCH_BUILD_DIR --config Release --parallel
cmake --install $CATCH_BUILD_DIR --config Release
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 539f433

Please sign in to comment.