Skip to content

Commit 65c2dae

Browse files
Saurav AgarwalSaurav Agarwal
authored andcommitted
Update installation and setup
1 parent 7c5a0f2 commit 65c2dae

39 files changed

+1513
-143
lines changed

cppsrc/core/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
cmake_minimum_required(VERSION 3.16)
2-
project(CoverageControlCore VERSION 0.3 LANGUAGES CXX)
1+
cmake_minimum_required(VERSION 3.22)
2+
project(CoverageControl VERSION 0.3 LANGUAGES CXX)
33

44
if (NOT CMAKE_BUILD_TYPE)
55
set(CMAKE_BUILD_TYPE Release)
@@ -36,7 +36,7 @@ target_compile_options(compiler_flags INTERFACE
3636
)
3737

3838
#################################
39-
## CoverageControlCore library ##
39+
## CoverageControl library ##
4040
#################################
4141

4242
set(sources_list
@@ -62,7 +62,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${dependencies_list})
6262
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")
6363

6464
if (WITH_CUDA)
65-
set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_ARCHITECTURES native POSITION_INDEPENDENT_CODE ON)
65+
set_target_properties(${PROJECT_NAME} PROPERTIES CUDA_ARCHITECTURES native POSITION_INDEPENDENT_CODE ON CUDA_SEPARABLE_COMPILATION ON)
6666
else()
6767
set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
6868
endif()

cppsrc/core/cmake/CoverageControlCoreConfig.cmake.in renamed to cppsrc/core/cmake/CoverageControlConfig.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@PACKAGE_INIT@
22

3-
set(PN CoverageControlCore)
3+
set(PN CoverageControl)
44
set(${PN}_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
55
set(${PN}_LIBRARY_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@")
66
set(${PN}_LIBRARY "${${PN}_LIBRARY_DIR}/lib${PN}.so")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// the configured options and settings for CoverageControl
2+
#define CoverageControl_VERSION_MAJOR @CoverageControl_VERSION_MAJOR@
3+
#define CoverageControl_VERSION_MINOR @CoverageControl_VERSION_MINOR@
4+
#cmakedefine WITH_CUDA

cppsrc/core/cmake/CoverageControlCoreConfig.h.in

Lines changed: 0 additions & 4 deletions
This file was deleted.

cppsrc/core/include/CoverageControl/world_idf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#ifndef COVERAGECONTROL_WORLDIDF_H_
2121
#define COVERAGECONTROL_WORLDIDF_H_
2222

23-
#include "CoverageControlCoreConfig.h"
23+
#include "CoverageControlConfig.h"
2424
#include <vector>
2525
#include <fstream>
2626
#include <iostream>

cppsrc/core/python_bindings/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ set(CMAKE_COLOR_DIAGNOSTICS True)
88
set(PYBIND11_NEWPYTHON True)
99
find_package(pybind11 CONFIG REQUIRED)
1010

11-
find_package(CoverageControlCore REQUIRED)
11+
find_package(CoverageControl REQUIRED)
1212

13-
pybind11_add_module(pyCoverageControl MODULE src/coverage_control_python_binds.cpp)
14-
target_link_libraries(pyCoverageControl PRIVATE CoverageControl::CoverageControlCore)
15-
install(TARGETS pyCoverageControl LIBRARY DESTINATION .)
13+
pybind11_add_module(CoverageControl MODULE src/coverage_control_python_binds.cpp)
14+
target_link_libraries(CoverageControl PRIVATE CoverageControl::CoverageControl)
15+
install(TARGETS CoverageControl LIBRARY DESTINATION .)
1616

cppsrc/core/python_bindings/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ requires = ["scikit-build-core", "pybind11", "cmake >= 3.24"]
33
build-backend = "scikit_build_core.build"
44

55
[project]
6-
name = "pyCoverageControl"
6+
name = "CoverageControl"
77
version = "0.4.0"
88
description="Project for Coverage Control"
99
requires-python = ">=3.10"
10+
dependencies = [ "numpy" ]
1011
authors = [
1112
{name = "Saurav Agarwal", email = "[email protected]" } # Optional
1213
]

cppsrc/core/python_bindings/src/coverage_control_python_binds.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <CoverageControl/coverage_system.h>
2727
using namespace CoverageControl;
2828

29-
PYBIND11_MODULE(pyCoverageControl, m) {
29+
PYBIND11_MODULE(CoverageControl, m) {
3030
pyCoverageControl_core(m);
3131
pyCoverageControl_core_coverage_system(m);
3232
}

cppsrc/main/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.16)
1+
cmake_minimum_required(VERSION 3.22)
22
project(CoverageControlMain VERSION 0.3 LANGUAGES CXX)
33

44
if(NOT CMAKE_BUILD_TYPE)
@@ -8,7 +8,6 @@ endif()
88
option(WITH_CUDA "Build with CUDA support" ON)
99

1010
if(WITH_CUDA)
11-
cmake_minimum_required(VERSION 3.24)
1211
enable_language(CUDA)
1312
endif()
1413

@@ -29,7 +28,7 @@ if(WITH_TORCH)
2928
set(CMAKE_INSTALL_RPATH "${ORIGIN};${CMAKE_INSTALL_LIBDIR};${TORCH_LIBRARY_DIR}")
3029
endif()
3130

32-
find_package(CoverageControlCore REQUIRED)
31+
find_package(CoverageControl REQUIRED)
3332

3433
if(WITH_TORCH)
3534
find_package(CoverageControlTorch REQUIRED)
@@ -50,11 +49,11 @@ target_compile_options(compiler_flags INTERFACE
5049
#################
5150

5251
add_executable(coverage_algorithm coverage_algorithm.cpp)
53-
target_link_libraries(coverage_algorithm PRIVATE CoverageControl::CoverageControlCore)
52+
target_link_libraries(coverage_algorithm PRIVATE CoverageControl::CoverageControl)
5453
install(TARGETS coverage_algorithm DESTINATION ${CMAKE_INSTALL_BINDIR})
5554

5655
# if(WITH_TORCH)
5756
# add_executable(eval_dist_gnn torch/eval_dist_gnn.cpp)
58-
# target_link_libraries(eval_dist_gnn PRIVATE compiler_flags CoverageControlCore CoverageControlTorch ${CUDA_cusparse_LIBRARY})
57+
# target_link_libraries(eval_dist_gnn PRIVATE compiler_flags CoverageControl CoverageControlTorch ${CUDA_cusparse_LIBRARY})
5958
# install(TARGETS eval_dist_gnn DESTINATION ${CMAKE_INSTALL_BINDIR})
6059
# endif()

cppsrc/setup.sh

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env bash
2-
params="$(getopt -o d:ictpg -l directory:,install,clean,torch,python,global,no-cuda,no-deps --name "$(basename "$0")" -- "$@")"
2+
params="$(getopt -o d:ctpg -l directory:,clean,torch,python,global,with-cuda,with-deps --name "$(basename "$0")" -- "$@")"
33

44
if [ $? -ne 0 ]
55
then
66
print_usage
77
fi
88

99
print_usage() {
10-
printf "bash $0 [-d|--directory <workspace directory>] [-i|--install] [-c|--clean] [-t|--torch <build with libtorch>] [-p|--python <install python bindings>] [-g|--global] [--no-cuda <cpu only>] [--no-deps <do not install dependencies>]\n"
10+
printf "bash $0 [-d|--directory <workspace directory>] [-c|--clean] [-t|--torch <build with libtorch>] [-p|--python <install python bindings>] [-g|--global] [--with-cuda <cpu only>] [--with-deps <install dependencies>]\n"
1111
}
1212

1313
# Get directory of script
@@ -18,16 +18,17 @@ WITH_TORCH=0
1818
eval set -- "$params"
1919
unset params
2020

21+
INSTALL=true
2122
while true; do
2223
case ${1} in
2324
-i|--install) INSTALL=true;shift;;
24-
-c|--clean) CLEAN=true;shift;;
25+
-c|--clean) CLEAN=true;INSTALL=false;shift;;
2526
-t|--torch) WITH_TORCH=ON; shift;;
2627
-p|--python) WITH_PYTHON=true;shift;;
2728
-d|--directory) WS_DIR+=("${2}");shift 2;;
2829
-g|--global) GLOBAL=true;shift;;
29-
--no-cuda) NOCUDA=true;shift;;
30-
--no-deps) WITH_DEPS=false;shift;;
30+
--with-cuda) WITH_CUDA=ON;shift;;
31+
--with-deps) WITH_DEPS=true;shift;;
3132
--) shift;break;;
3233
*) print_usage
3334
exit 1 ;;
@@ -40,36 +41,40 @@ then
4041
# If not global then install to workspace
4142
if [[ ! ${GLOBAL} ]]
4243
then
43-
INSTALL_DIR=${WS_DIR}/install/CoverageControl/
44+
INSTALL_DIR=${WS_DIR}/install/
4445
CMAKE_END_FLAGS="${CMAKE_END_FLAGS} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
4546
fi
4647
else
4748
TMP_DIR=$(mktemp -d)
4849
BUILD_DIR=${TMP_DIR}/build
4950
fi
5051

51-
if [[ ${NOCUDA} ]]
52+
# Check WITH_CUDA
53+
if [[ ${WITH_CUDA} == "ON" ]]
5254
then
55+
CMAKE_END_FLAGS="${CMAKE_END_FLAGS} -DWITH_CUDA=ON"
56+
else
5357
CMAKE_END_FLAGS="${CMAKE_END_FLAGS} -DWITH_CUDA=OFF"
5458
fi
59+
5560
if [[ ${WITH_TORCH} == "ON" ]]
5661
then
5762
CMAKE_END_FLAGS="${CMAKE_END_FLAGS} -DCMAKE_PREFIX_PATH=${Torch_DIR}"
5863
fi
5964

60-
InstallCoverageControlCore () {
61-
cmake -S ${DIR}/core -B ${BUILD_DIR}/CoverageControlCore ${CMAKE_END_FLAGS}
62-
cmake --build ${BUILD_DIR}/CoverageControlCore -j$(nproc)
65+
InstallCoverageControl () {
66+
cmake -S ${DIR}/core -B ${BUILD_DIR}/CoverageControl ${CMAKE_END_FLAGS}
67+
cmake --build ${BUILD_DIR}/CoverageControl -j$(nproc)
6368
if [ $? -ne 0 ]; then
64-
echo "CoverageControlCore build failed"
69+
echo "CoverageControl build failed"
6570
exit 1
6671
fi
67-
cmake --install ${BUILD_DIR}/CoverageControlCore
72+
cmake --install ${BUILD_DIR}/CoverageControl
6873
if [ $? -ne 0 ]; then
69-
echo "CoverageControlCore install failed"
74+
echo "CoverageControl install failed"
7075
fi
7176

72-
echo "Successfully built and installed CoverageControlCore"
77+
echo "Successfully built and installed CoverageControl"
7378
}
7479

7580
InstallCoverageControlTorch () {
@@ -121,15 +126,15 @@ InstallCoverageControlMain () {
121126

122127
if [[ ${INSTALL} ]]
123128
then
124-
echo "Installing CoverageControlCore"
125-
InstallCoverageControlCore
129+
echo "Installing CoverageControl"
130+
InstallCoverageControl
126131
if [[ ${WITH_TORCH} == "ON" ]]
127132
then
128133
echo "Installing CoverageControlTorch"
129134
InstallCoverageControlTorch
130135
fi
131136
# echo "Installing CoverageControlTests"
132-
InstallCoverageControlTests
137+
# InstallCoverageControlTests
133138
echo "Installing CoverageControlMain"
134139
InstallCoverageControlMain
135140
fi

0 commit comments

Comments
 (0)