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

Cmake fixes for cran #37

Merged
merged 5 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: osqp
Title: Quadratic Programming Solver using the 'OSQP' Library
Version: 0.6.3.1
Date: 2023-10-03
Version: 0.6.3.2
Date: 2023-10-19
Authors@R: c(
person("Bartolomeo", "Stellato", role = c("aut", "ctb", "cph"),
email = "[email protected]"),
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Version 0.6.3.2

* CMAKE file fixes per R-exts

# Version 0.6.3.1

* Bug fix: typo in sparse coercion routines (`dgCMatrix` where
`dtCMatrix` should be).

# Version 0.6.3

* Sync up to version [0.6.3 of OSQP release](https://github.com/osqp/osqp/releases/tag/v0.6.3)
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [ -x "$(command -v cmake)" ]; then
cd src/osqp_sources
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:bool=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:bool=ON -DR_LANG=TRUE -DCMAKE_INSTALL_PREFIX:PATH=../../ ..
cmake -DR_HOME="${R_HOME}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:bool=OFF -DCMAKE_POSITION_INDEPENDENT_CODE:bool=ON -DR_LANG=TRUE -DCMAKE_INSTALL_PREFIX:PATH=../../ ..
cmake --build . --target install
cd ..
rm -rf build/
Expand Down
26 changes: 17 additions & 9 deletions inst/58f00bd_fixes/make_fixes.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,31 @@ replace_lines(path = "osqp_sources/lin_sys/direct/qdldl/qdldl_sources/examples/e
## Rename proj.h to osqp_proj.h and edit files that use it.
file.rename(from = "osqp_sources/include/proj.h", to = "osqp_sources/include/osqp_proj.h")

## Fix CMakeLists.txt
replace_lines("osqp_sources/CMakeLists.txt", 2, 'cmake_minimum_required (VERSION 3.5)',
comment_prefix = "#")
## Fix auxil.c
replace_lines("osqp_sources/src/auxil.c", 3, '#include "osqp_proj.h"')

## Fix polish.c
replace_lines("osqp_sources/src/polish.c", 7, '#include "osqp_proj.h"')

## Fix proj.c
replace_lines("osqp_sources/src/proj.c", 1, '#include "osqp_proj.h"')

## Fix CMakeLists.txt
replace_lines("osqp_sources/include/CMakeLists.txt", 12, ' "${CMAKE_CURRENT_SOURCE_DIR}/osqp_proj.h"',
comment_prefix = "#")

replace_lines("osqp_sources/lin_sys/direct/qdldl/qdldl_sources/CMakeLists.txt", 2, 'cmake_minimum_required (VERSION 3.5)',
comment_prefix = "#")

## Fix auxil.c
replace_lines("osqp_sources/src/auxil.c", 3, '#include "osqp_proj.h"')
replace_lines("osqp_sources/CMakeLists.txt", 2, 'cmake_minimum_required (VERSION 3.5)',
comment_prefix = "#")

## Fix polish.c
replace_lines("osqp_sources/src/polish.c", 7, '#include "osqp_proj.h"')
## Drop lines 242-255 as they are not needed
## lines <- readLines("osqp_sources/CMakeLists.txt")[-(242:255)]
##writeLines(lines, "osqp_sources/CMakeLists.txt")

## Fix proj.c
replace_lines("osqp_sources/src/proj.c", 1, '#include "osqp_proj.h"')
## Replace findR.cmake
replace_lines("osqp_sources/configure/cmake/FindR.cmake", 11, 'find_program(R_EXEC NAMES R R.exe PATHS ${R_HOME}/bin)',
comment_prefix='#')


Loading