Skip to content

Commit

Permalink
Fix lp_solve link.
Browse files Browse the repository at this point in the history
  • Loading branch information
vissarion committed Nov 1, 2022
1 parent d2fd5f1 commit 2271038
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions cran_gen/genCRANpkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ file.copy(dir_lp, lp_dist, recursive=TRUE)
# fix ftime deprecation, taken from: https://github.com/GeomScale/volesti/pull/89/files
library(xfun)
gsub_file(
paste0(path,"/R-proj/src/Rproj_externals/lp_solve/commonlib.c"),
"struct timeb buf;", "",
paste0(path,"/R-proj/src/Rproj_externals/lp_solve/commonlib.c"),
"struct timeb buf;", "",
fixed=TRUE)
gsub_file(
paste0(path,"/R-proj/src/Rproj_externals/lp_solve/commonlib.c"),
"ftime(&buf);", "",
paste0(path,"/R-proj/src/Rproj_externals/lp_solve/commonlib.c"),
"ftime(&buf);", "",
fixed=TRUE)
gsub_file(
paste0(path,"/R-proj/src/Rproj_externals/lp_solve/commonlib.c"),
"return((double)buf.time+((double) buf.millitm)/1000.0);",
"return((double)0);",
paste0(path,"/R-proj/src/Rproj_externals/lp_solve/commonlib.c"),
"return((double)buf.time+((double) buf.millitm)/1000.0);",
"return((double)0);",
fixed=TRUE)

# add lpsolve header files in external
library(downloader)
download("https://cran.r-project.org/src/contrib/lpSolve_5.6.15.tar.gz", dest="lpSolve.tar.gz", mode="wb")
download("https://cran.r-project.org/src/contrib/Archive/lpSolve/lpSolve_5.6.15.tar.gz", dest="lpSolve.tar.gz", mode="wb")
untar("lpSolve.tar.gz", exdir = path)
unlink("lpSolve.tar.gz")
dir.create(paste0(path,"/external/LPsolve_src"))
Expand Down
2 changes: 1 addition & 1 deletion test/LpSolve.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function(GetLPSolve)
include(FetchContent)
FetchContent_Declare(
lpsolve
URL https://cran.r-project.org/src/contrib/lpSolve_5.6.15.tar.gz
URL https://cran.r-project.org/src/contrib/Archive/lpSolve/lpSolve_5.6.15.tar.gz
URL_HASH MD5=3b8d780f703e0da2e4863939add164bc
)

Expand Down

0 comments on commit 2271038

Please sign in to comment.