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

Update to Dune 3.16 #55

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(lang dune 1.0)
(lang dune 3.16)
(name mccs)
2 changes: 1 addition & 1 deletion mccs.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ homepage: "https://www.i3s.unice.fr/~cpjm/misc/"
bug-reports: "https://github.com/ocaml-opam/ocaml-mccs/issues"
depends: [
"ocaml"
"dune" {>= "1.0"}
"dune" {>= "3.16"}
"cudf" {>= "0.7"}
"conf-c++" {build}
]
Expand Down
2 changes: 1 addition & 1 deletion src/context_flags.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let cxxflags =
let flags =
(if (Sys.win32 && Config.ccomp_type = "msvc")
then ["\"/EHsc\""]
else ["-Wall -Wextra -Wno-unused-parameter -x c++"]) @
else ["-Wall -Wextra -Wno-unused-parameter"]) @
(ifc useGLPK ["-DUSEGLPK"]) @
(ifc useCOIN ["-DUSECOIN"]) @
(ifc useCLP ["-DUSECLP"]) @
Expand Down
25 changes: 15 additions & 10 deletions src/dune
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
(library
(name mccs)
(cxx_names changed_criteria constraint_generation count_criteria
(foreign_stubs
(language cxx)
(names changed_criteria constraint_generation count_criteria
cudf_reductions cudf_tools glpk_solver lp_solver lexagregate_combiner
new_criteria notuptodate_criteria removed_criteria mccscudf mccs_stubs)
(flags
:standard
(:include cxxflags.sexp)))
(public_name mccs)
(modules :standard \ context_flags)
(cxx_flags
:standard
(:include cxxflags.sexp))
(c_library_flags
:standard
(:include clibs.sexp))
Expand All @@ -20,16 +22,19 @@
(select
config.h
from
(mccs.glpk.internal -> config_internal.h)
(mccs.glpk.shared -> config_external.h)
(mccs.glpk.static -> config_external.h)
(-> _))))
(mccs.glpk.internal -> config.internal.h)
(mccs.glpk.shared -> config.external.h)
(mccs.glpk.static -> config.external.h)
(_ -> config.empty.h))))

(rule
(with-stdout-to config.internal.h (echo "#include \"glpk/glpk.h\"")))

(rule
(with-stdout-to config_internal.h (echo "#include \"glpk/glpk.h\"")))
(with-stdout-to config.external.h (echo "#include <glpk.h>")))

(rule
(with-stdout-to config_external.h (echo "#include <glpk.h>")))
(with-stdout-to config.empty.h (echo "")))

(executable
(name context_flags)
Expand Down
194 changes: 98 additions & 96 deletions src/glpk/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,102 +2,104 @@
(name mccs_glpk)
(public_name mccs.glpk.internal)
(modules ocaml_mccs_glpk)
(c_names ; Core GLPK
; draft
bfd
glpapi06
glpapi09
glpapi10
glpapi12
glpapi13
glpios01
glpios02
glpios03
glpios07
glpios09
glpios11
glpios12
glpscl
; api
advbas
cpxbas
prob1
prob2
prob4
prob5
;; wrmip
; bflib
btf
btfint
fhv
fhvint
fvs
ifu
luf
lufint
scf
scfint
sgf
sva
; intopt
cfg
cfg1
cfg2
clqcut
covgen
fpump
gmicut
gmigen
mirgen
spv
; env
alloc
dlsup
env
error
stdc
stdout
;; stream
time
tls
; misc
avl
dmp
gcd
jd
ks
mc13d
mc21a
mt1
rng
rng1
round2n
triang
wclique
wclique1
; npp
npp1
npp2
npp3
npp4
npp5
; proxy
proxy
proxy1
; simplex
spxat
spxchuzc
spxchuzr
spxlp
spxnt
spxprim
spxprob
spychuzc
spychuzr
spydual)
(c_flags
:standard
(:include cflags.sexp))
(foreign_stubs
(language c)
(names ; Core GLPK
; draft
bfd
glpapi06
glpapi09
glpapi10
glpapi12
glpapi13
glpios01
glpios02
glpios03
glpios07
glpios09
glpios11
glpios12
glpscl
; api
advbas
cpxbas
prob1
prob2
prob4
prob5
;; wrmip
; bflib
btf
btfint
fhv
fhvint
fvs
ifu
luf
lufint
scf
scfint
sgf
sva
; intopt
cfg
cfg1
cfg2
clqcut
covgen
fpump
gmicut
gmigen
mirgen
spv
; env
alloc
dlsup
env
error
stdc
stdout
;; stream
time
tls
; misc
avl
dmp
gcd
jd
ks
mc13d
mc21a
mt1
rng
rng1
round2n
triang
wclique
wclique1
; npp
npp1
npp2
npp3
npp4
npp5
; proxy
proxy
proxy1
; simplex
spxat
spxchuzc
spxchuzr
spxlp
spxnt
spxprim
spxprob
spychuzc
spychuzr
spydual)
(flags
:standard
(:include cflags.sexp)))
(wrapped false))

(copy_files# api/*.{c,h})
Expand Down
4 changes: 2 additions & 2 deletions test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
%{targets}
(run ocaml gen_tests.ml))))

(alias
(name settests)
(rule
(alias settests)
(action
(diff dune.inc dune.inc.gen)))
7 changes: 3 additions & 4 deletions test/dune.inc
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
; This file is generated using `MCCS_BACKENDS=jbuilder build @settests --auto-promote`

; This file is generated using `MCCS_BACKENDS='GLPK' dune build @settests --auto-promote`
(rule
(with-stdout-to test-glpk.result (run %{exe:mccs_test.exe} %{dep:test.cudf})))

(rule
(with-stdout-to test.glpk.reference (cat %{dep:test.output})))

(alias
(name runtest)
(rule
(alias runtest)
(action (system "diff %{dep:test-glpk.result} %{dep:test.glpk.reference}")))
7 changes: 4 additions & 3 deletions test/gen_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ let test name ?solver ?ignore ?(ref="") () =
in
Printf.printf "

(alias
(name runtest)
(rule
(alias runtest)
(action (system \"diff %s%%{dep:test-%s.result} %%{dep:test.%s.reference}\")))\n" ignore_eol name name

let () =
print_endline "; This file is generated using `MCCS_BACKENDS=jbuilder build @settests --auto-promote`";
Printf.printf "; This file is generated using `MCCS_BACKENDS='%s' dune build @settests --auto-promote`"
(String.concat " " backends);
let () =
try
let lp_solver = Sys.getenv "MCCS_LPSOLVER" |> Printf.sprintf "%S" in
Expand Down
2 changes: 1 addition & 1 deletion test/mccs_test.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(* usage: mccs_test CUDF_FILE [SOLVER [CRITERIA]] *)

let (preamble, universe, request) as cudf =
let (_preamble, _universe, _request) as cudf =
match Cudf_parser.load_from_file Sys.argv.(1) with
| Some a, b, Some c -> a, b, c
| None, b, Some c -> Cudf.default_preamble, b, c
Expand Down
Loading