Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up dependencies #418

Merged
merged 56 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6aae820
clean-up dependencies
20DM Aug 10, 2023
dac87a3
resolve merge conflicts
20DM Aug 10, 2023
5be9494
put legacy eigen inc dir to cache
20DM Aug 10, 2023
721cdb5
attempt to fix Doxygen buil
20DM Aug 11, 2023
a6bd364
upgrade conan v
20DM Aug 11, 2023
cba6924
upgrade conan v
20DM Aug 11, 2023
cac4a57
upgrade conan v2
20DM Aug 11, 2023
1e818f1
upgrade conan v2
20DM Aug 11, 2023
2eb7f72
upgrade conan v2
20DM Aug 11, 2023
b6c8485
upgrade conan v2
20DM Aug 11, 2023
0d6aab1
upgrade conan v2
20DM Aug 11, 2023
0dcc122
upgrade conan v2
20DM Aug 11, 2023
56c892c
upgrade conan v2
20DM Aug 11, 2023
47dbf4f
switch back to conan v1
20DM Aug 11, 2023
28138f0
Doxygen broken in Conan
20DM Aug 11, 2023
b166ac9
syntax tweak
20DM Aug 11, 2023
91b1c34
ccache missing
20DM Aug 11, 2023
52e93a4
disable docweb build for the time being
20DM Aug 11, 2023
bf65d9b
try standalone cmake
20DM Aug 14, 2023
d075181
try standalone cmake
20DM Aug 14, 2023
4ccd14a
try standalone cmake
20DM Aug 14, 2023
cdf1462
try standalone cmake
20DM Aug 14, 2023
8b8fa14
try standalone cmake
20DM Aug 14, 2023
3741551
try standalone cmake
20DM Aug 14, 2023
dd97e74
try standalone cmake
20DM Aug 14, 2023
05fb471
try standalone cmake
20DM Aug 14, 2023
defefa7
try standalone cmake
20DM Aug 14, 2023
53fc7bf
try standalone cmake
20DM Aug 14, 2023
d77ef27
try standalone cmake
20DM Aug 14, 2023
4eca1d9
try standalone cmake
20DM Aug 14, 2023
fc89ceb
try standalone cmake
20DM Aug 14, 2023
be5c5d1
try standalone cmake
20DM Aug 14, 2023
3a67e02
try standalone cmake
20DM Aug 14, 2023
5bf9830
try standalone cmake
20DM Aug 14, 2023
48a0300
try standalone cmake
20DM Aug 14, 2023
eb44558
try standalone cmake
20DM Aug 14, 2023
1eb0cb7
try standalone cmake
20DM Aug 14, 2023
2133b0c
try standalone cmake
20DM Aug 14, 2023
9c64fa1
try standalone cmake
20DM Aug 14, 2023
0d26337
try standalone cmake
20DM Aug 14, 2023
152c2b2
try standalone cmake
20DM Aug 14, 2023
d8a5883
try standalone cmake
20DM Aug 14, 2023
ae63781
fix variable
20DM Aug 14, 2023
e5ec771
fix variable
20DM Aug 14, 2023
572f86b
fix variable
20DM Aug 14, 2023
abb3439
fix variable
20DM Aug 14, 2023
2144392
comment maintenance
20DM Aug 14, 2023
8748cc1
cleanups
20DM Aug 14, 2023
c662a18
format tweaks
20DM Aug 24, 2023
bbb2bee
MacOS build tweaks
20DM Aug 25, 2023
f29d366
typo
20DM Aug 25, 2023
9a5ae19
add another eigen spelling variation
20DM Sep 13, 2023
e82c39d
harmonise sopt spelling
20DM Sep 13, 2023
a0e4bd0
harmonise spelling in exported variables
20DM Sep 13, 2023
7573fc1
sed commands work differently on Macs
20DM Oct 2, 2023
25fbb20
switch back to master cppflow branch
20DM Oct 2, 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
63 changes: 54 additions & 9 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ env:
CONAN_REVISIONS_ENABLED: 1
OMP_NUM_THREADS: 2
CONAN_CPU_COUNT: 2
USE_CONAN: 0

jobs:
make-documentation:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Check out sopt
uses: actions/checkout@v3
Expand All @@ -42,13 +43,25 @@ jobs:
- name: Install dependencies
run: |
sudo apt update
sudo apt install openmpi-bin libopenmpi-dev libyaml-cpp-dev doxygen graphviz
sudo apt install openmpi-bin libopenmpi-dev libyaml-cpp-dev doxygen graphviz ccache
if [[ "$USE_CONAN" = 0 ]]; then
sudo apt install libeigen3-dev libspdlog-dev libtiff-dev
git clone https://github.com/catchorg/Catch2.git -b v3.4.0
mkdir Catch2/build
cd Catch2/build
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${PWD}
make -j$(nproc --ignore 1)
make -j$(nproc --ignore 1) install
cd -
fi

- name: Install Conan
id: conan
if: env.USE_CONAN != '0'
uses: turtlebrowser/get-conan@main
with:
version: 1.59.0
version: 1.60.2
#version: 2.0.9

- name: Install Tensorflow API on Ubuntu
uses: UCL/install-tensorflow-action@main
Expand All @@ -64,20 +77,52 @@ jobs:
ref: master

- name: Create cppflow package
run: conan create ./cppflow/ -pr:h=default -pr:b=default
run: |
if [[ "$USE_CONAN" = 1 ]]; then
#conan profile detect
#sed -i'' -e "s|generators|#generators|1" ./cppflow/conanfile.py
conan create ./cppflow/ -pr:h=default -pr:b=default
else
mkdir cppflow/build
cd cppflow/build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}
make -j$(nproc --ignore 1)
make -j$(nproc --ignore 1) install
fi

- name: Configure
run: |
conan install doxygen/1.9.4@#2af713e135f12722e3536808017ba086 --update
conan install ${{github.workspace}} -if ${{github.workspace}}/build --build missing -s compiler.libcxx=libstdc++11 -o mpi=off -o openmp=off -o docs=on -o cppflow=on -pr:h=default -pr:b=default
if [[ "$USE_CONAN" = 1 ]]; then
# Doxygen currently broken in Conan v1 and v2
#conan install doxygen/1.9.4@#2af713e135f12722e3536808017ba086 --update
conan install ${{github.workspace}} -if ${{github.workspace}}/build --build missing -s compiler.libcxx=libstdc++11 -o mpi=off -o openmp=off -o docs=off -o cppflow=on -pr:h=default -pr:b=default
else
export PATH=${{github.workspace}}/cppflow/build:$PATH
export PATH=${{github.workspace}}/Catch2/build:$PATH
export CMAKE_PREFIX_PATH=${{github.workspace}}/Catch2/build/lib/cmake/Catch2:$CMAKE_PREFIX_PATH
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dcppflow=ON
fi

- name: Build
run: conan build ${{github.workspace}} -bf ${{github.workspace}}/build
run: |
if [[ "$USE_CONAN" = 1 ]]; then
conan build ${{github.workspace}} -bf ${{github.workspace}}/build
else
export PATH=${{github.workspace}}/cppflow/build:$PATH
export PATH=${{github.workspace}}/Catch2/build:$PATH
cd ${{github.workspace}}/build
make -j$(nproc --ignore 1)
make -j$(nproc --ignore 1) install
fi

- name: Make Docweb
run: |
cd build
make docweb VERBOSE=1
if [[ "$USE_CONAN" = 0 ]]; then
cd build
make docweb VERBOSE=1
fi

- name: Deploy to GH pages
if: ${{github.event_name == 'push'}}
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ python/tests/__pycache__
*~

### CMake ###
CMakeUserPresets.json
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
Expand All @@ -93,6 +94,7 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
local

# CMake External projects (created by CMake fetchcontent module)
*-prefix/
Expand Down Expand Up @@ -129,4 +131,4 @@ _deps
# Executables
*.exe
*.out
*.app
*.app
45 changes: 32 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not allowed!\nCreate a \"build\" dir and remove:\n- ${CMAKE_SOURCE_DIR}/CMakeCache.txt\n- ${CMAKE_SOURCE_DIR}/CMakeFiles")
endif()

project(Sopt
project(sopt
DESCRIPTION "Sparse OPTimisation using state-of-the-art convex optimisation algorithms."
HOMEPAGE_URL "http://astro-informatics.github.io/sopt/"
LANGUAGES CXX)
Expand All @@ -28,14 +28,33 @@ execute_process(
# Location of extra cmake includes for the project
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_files)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/build)
# Downloads and installs GreatCMakeCookOff
# It contains a number of cmake recipes
include(LookUp-GreatCMakeCookOff)

# Version and git hash id
include(VersionAndGitRef)
set_version(3.1.0)
get_gitref()
find_package(Git)

# Set version variable
set(SOPT_VERSION 3.1.0)

# If git is found and this is a git workdir, then figure out build id
# Stores results in SOPT_VERSION and SOPT_GITREF
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
RESULT_VARIABLE HASH_RESULT
OUTPUT_VARIABLE GIT_HASH
ERROR_QUIET
)
if(HASH_RESULT EQUAL 0)
string(STRIP "${GIT_HASH}" GIT_HASH)
else()
set(GIT_HASH "NA")
endif()
else()
set(GIT_HASH "NA")
endif()

set(SOPT_GITREF ${GIT_HASH})


option(tests "Enable testing" on)
option(benchmarks "Enable benchmarking" off)
Expand All @@ -53,7 +72,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
message(STATUS "Building sopt in ${CMAKE_BUILD_TYPE} mode")

if(tests)
if(tests OR examples)
enable_testing()
endif()

Expand All @@ -75,14 +94,11 @@ if(SOPT_MPI)
DetectIntegerArchitecture(SOPT)
endif()

if(tests OR examples)
enable_testing()
endif()

if(tests)
find_package(Catch)
find_package(Catch2)
include(AddCatchTest)
endif()

if(examples)
include(AddExample)
endif()
Expand All @@ -92,6 +108,8 @@ if(benchmarks)
include(AddBenchmark)
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument")

if(tests AND coverage)
# Enable code coverage.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
Expand All @@ -107,3 +125,4 @@ add_subdirectory(cpp)

# Exports all Sopt so other packages can access it
include(export_sopt)

Loading