Skip to content

Commit 3c6eed6

Browse files
authored
Merge pull request #1 from tmmsartor/main
Various updates
2 parents 207d7c6 + 831881c commit 3c6eed6

File tree

16 files changed

+982
-602
lines changed

16 files changed

+982
-602
lines changed

.github/workflows/build.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
name: build
22

3-
on: [push, pull_request]
3+
permissions: write-all
4+
5+
on: push
46

57
jobs:
68
build:
79
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
810
runs-on: ${{ matrix.os }}
911
timeout-minutes: 60
10-
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
11-
actions: write
12-
contents: read
1312
strategy:
1413
fail-fast: false
1514
matrix:
1615
version:
17-
- '1.10'
16+
- '1.10.4'
1817
os:
1918
- windows-2022
2019
- ubuntu-20.04
21-
#- macos-11
20+
- macos-12
21+
- macos-14
2222
arch:
2323
- x64
2424
steps:
2525
- uses: actions/checkout@v4
26+
with:
27+
submodules: true
2628
- uses: julia-actions/setup-julia@v2
2729
with:
2830
version: ${{ matrix.version }}
@@ -33,22 +35,26 @@ jobs:
3335
julia --startup-file=no --project=compiler -e 'using Pkg; Pkg.instantiate()'
3436
julia --startup-file=no --project=compiler compiler/build.jl foo
3537
# Upload as release asset
36-
- uses: vimtor/[email protected]
38+
#- uses: vimtor/[email protected]
39+
# with:
40+
# files: foo/
41+
# recursive: true
42+
# dest: foo.zip
43+
- name: zip_with_symlinks
44+
run: |
45+
zip --symlinks -r foo.zip foo/
46+
- uses: actions/[email protected]
3747
with:
38-
files: foo/
39-
recursive: true
40-
dest: foo.zip
41-
48+
name: madnlp-jl${{ matrix.version}}-${{ matrix.os }}-${{ matrix.arch }}
49+
path: foo.zip
50+
- name: Inject slug/short variables
51+
uses: rlespinasse/[email protected]
4252
- name: Upload files to a GitHub release
4353
uses: svenstaro/[email protected]
4454
with:
4555
overwrite: true
46-
tag: v0.1
56+
tag: nightly-${{ env.GITHUB_REF_SLUG }}
4757
file: foo.zip
4858
asset_name: madnlp-jl${{ matrix.version}}-${{ matrix.os }}-${{ matrix.arch }}.zip
4959
prerelease: true
50-
51-
- uses: actions/[email protected]
52-
with:
53-
name: madnlp-jl${{ matrix.version}}-${{ matrix.os }}-${{ matrix.arch }}
54-
path: foo
60+
repo_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
.ccls-cache
3+
compile_commands.json
4+
.*.sw[a-z]
5+
target/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "MadNLP.jl"]
2+
path = MadNLP.jl
3+
url = https://github.com/tmmsartor/MadNLP.jl.git

CMakeLists.txt

Lines changed: 83 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,91 @@
11
cmake_minimum_required(VERSION 3.12)
2-
project(MadNLP_C VERSION 1.0.0) # Adjust the version as necessary
2+
project(MadNLP_C VERSION 0.1.0) # Adjust the version as necessary
33

4-
set(Julia_EXECUTABLE julia)
4+
message(CHECK_START "Check Julia Executable")
5+
set(JULIA_EXECUTABLE "julia" CACHE STRING "Julia executable default")
6+
if (JULIA_EXECUTABLE STREQUAL "julia")
7+
execute_process(
8+
COMMAND which julia
9+
OUTPUT_STRIP_TRAILING_WHITESPACE
10+
OUTPUT_VARIABLE JULIA_EXECUTABLE_PARSED
11+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
12+
)
13+
set(JULIA_EXECUTABLE ${JULIA_EXECUTABLE_PARSED} CACHE STRING "Julia executable" FORCE)
14+
endif()
15+
message(CHECK_PASS ${JULIA_EXECUTABLE})
16+
17+
message(CHECK_START "Check Julia binary dir")
18+
set(JULIA_BIN_DIR "nd" CACHE STRING "Julia runtime binary dir default")
19+
if (JULIA_BIN_DIR STREQUAL "nd")
20+
execute_process(
21+
COMMAND ${JULIA_EXECUTABLE} --startup-file=no -e "print(dirname(Sys.BINDIR))"
22+
OUTPUT_VARIABLE JULIA_BIN_DIR_PARSED
23+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
24+
)
25+
set(JULIA_BIN_DIR ${JULIA_BIN_DIR_PARSED} CACHE STRING "Julia runtime binary dir" FORCE)
26+
endif()
27+
message(CHECK_PASS ${JULIA_BIN_DIR})
28+
29+
message(CHECK_START "Check MadNLP.jl version")
30+
set(MADNLP_VERSION "nd" CACHE STRING "MadNLP Julia Library Version")
31+
if (MADNLP_VERSION STREQUAL "nd")
32+
execute_process(
33+
COMMAND ${JULIA_EXECUTABLE} --startup-file=no --project=./ -e "using Pkg; Pkg.instantiate();m=Pkg.dependencies();v=m[findfirst(v->v.name==\"MadNLP\",m)].version; print(v);"
34+
OUTPUT_VARIABLE MADNLP_VERSION_PARSED
35+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
36+
)
37+
set(MADNLP_VERSION ${MADNLP_VERSION_PARSED} CACHE STRING "MadNLP Julia Library Version" FORCE)
38+
endif()
39+
message(CHECK_PASS ${MADNLP_VERSION})
40+
41+
set(MADNLP_C_FULLNAME madnlp_c-${MADNLP_VERSION}-${PROJECT_VERSION})
42+
set(BUILD_SCRIPT ${PROJECT_SOURCE_DIR}/compiler/build.jl)
543

644
add_custom_command(
7-
OUTPUT FOO
8-
COMMAND ${Julia_EXECUTABLE} --startup-file=no --project=compiler -e "using Pkg; Pkg.instantiate()"
45+
OUTPUT ${PROJECT_BINARY_DIR}/MadNLP_env_status.txt
46+
DEPENDS ${PROJECT_SOURCE_DIR}/Manifest.toml
47+
COMMAND ${JULIA_EXECUTABLE} --startup-file=no --project=./ -e "using Pkg; Pkg.instantiate()"
48+
COMMAND ${JULIA_EXECUTABLE} --startup-file=no --project=./ -e "using Pkg; Pkg.status()" > ${PROJECT_BINARY_DIR}/MadNLP_env_status.txt
949
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
10-
COMMENT "Instantiating Julia packages"
50+
COMMENT "Instantiate Julia packages"
51+
VERBATIM
1152
)
1253

54+
add_custom_command(
55+
OUTPUT ${PROJECT_BINARY_DIR}/MadNLP_C_parses.txt
56+
DEPENDS ${PROJECT_SOURCE_DIR}/Manifest.toml
57+
DEPENDS ${PROJECT_BINARY_DIR}/MadNLP_env_status.txt
58+
COMMAND ${JULIA_EXECUTABLE} --startup-file=no --project=./ compiler/generate_precompile.jl > ${PROJECT_BINARY_DIR}/MadNLP_C_parses.txt
59+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
60+
COMMENT "Parses Julia packages"
61+
VERBATIM
62+
)
1363

64+
add_custom_command(
65+
OUTPUT ${PROJECT_BINARY_DIR}/PackageCompiler_env_status.txt
66+
DEPENDS ${PROJECT_BINARY_DIR}/MadNLP_C_parses.txt
67+
DEPENDS ${PROJECT_SOURCE_DIR}/compiler/Manifest.toml
68+
COMMAND ${JULIA_EXECUTABLE} --startup-file=no --project=compiler -e "using Pkg; Pkg.instantiate()"
69+
COMMAND ${JULIA_EXECUTABLE} --startup-file=no --project=compiler -e "using Pkg; Pkg.status()" > ${PROJECT_BINARY_DIR}/PackageCompiler_env_status.txt
70+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
71+
COMMENT "Instantiate Julia build packages"
72+
VERBATIM
73+
)
74+
75+
add_custom_command(
76+
OUTPUT ${PROJECT_BINARY_DIR}/library_precompilation_dummy.txt
77+
DEPENDS ${PROJECT_BINARY_DIR}/PackageCompiler_env_status.txt
78+
DEPENDS ${PROJECT_SOURCE_DIR}/src/MadNLP_C.jl
79+
DEPENDS ${PROJECT_SOURCE_DIR}/compiler/build.jl
80+
DEPENDS ${PROJECT_SOURCE_DIR}/compiler/generate_precompile.jl
81+
DEPENDS ${PROJECT_SOURCE_DIR}/.git/modules/MadNLP.jl/HEAD
82+
COMMAND echo 1 > ${PROJECT_BINARY_DIR}/library_precompilation_dummy.txt
83+
COMMAND ${JULIA_EXECUTABLE} --startup-file=no --project=compiler ${BUILD_SCRIPT} ${PROJECT_BINARY_DIR}/${MADNLP_C_FULLNAME}
84+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
85+
COMMENT "Create Madnlp precompiled library sysimage"
86+
VERBATIM
87+
)
88+
89+
add_custom_target(madnlp_c ALL
90+
DEPENDS ${PROJECT_BINARY_DIR}/library_precompilation_dummy.txt
91+
)

MadNLP.jl

Submodule MadNLP.jl added at 5d54c15

Manifest.toml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.10.3"
3+
julia_version = "1.10.4"
44
manifest_format = "2.0"
5-
project_hash = "2dcfd936fdff6ca235a0071d4470e333b9cac885"
5+
project_hash = "11e2fdfc8c6a8311d5289aad1e318ca97da92785"
66

77
[[deps.AMD]]
88
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"]
@@ -109,15 +109,15 @@ version = "0.14.1+0"
109109

110110
[[deps.CUDSS]]
111111
deps = ["CEnum", "CUDA", "CUDSS_jll", "LinearAlgebra", "SparseArrays"]
112-
git-tree-sha1 = "2ddfb9e1bab8cd6a049c4bd0bc0f5f7d91640e9c"
112+
git-tree-sha1 = "dcb28fb99501ce47c7a4e25e5fdf94b0e8dfa749"
113113
uuid = "45b445bb-4962-46a0-9369-b4df9d0f772e"
114-
version = "0.1.6"
114+
version = "0.3.1"
115115

116116
[[deps.CUDSS_jll]]
117117
deps = ["Artifacts", "CUDA_Runtime_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"]
118-
git-tree-sha1 = "7d82cd3ec956d1dc36bdb1887561112fa1b10df7"
118+
git-tree-sha1 = "b4c1defa52f8806ac674ac72c793e9b5599c6e81"
119119
uuid = "4889d778-9329-5762-9fec-0578a5d30366"
120-
version = "0.1.0+0"
120+
version = "0.3.0+0"
121121

122122
[[deps.CUSOLVERRF]]
123123
deps = ["CUDA", "KLU", "LinearAlgebra", "SparseArrays"]
@@ -259,9 +259,9 @@ uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
259259

260260
[[deps.GPUArrays]]
261261
deps = ["Adapt", "GPUArraysCore", "LLVM", "LinearAlgebra", "Printf", "Random", "Reexport", "Serialization", "Statistics"]
262-
git-tree-sha1 = "04661708f5301394a1f1be86a07a89e835900db6"
262+
git-tree-sha1 = "a74c3f1cf56a3dfcdef0605f8cdb7015926aae30"
263263
uuid = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
264-
version = "10.2.3"
264+
version = "10.3.0"
265265

266266
[[deps.GPUArraysCore]]
267267
deps = ["Adapt"]
@@ -276,16 +276,17 @@ uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
276276
version = "0.26.7"
277277

278278
[[deps.InlineStrings]]
279-
deps = ["Parsers"]
280-
git-tree-sha1 = "86356004f30f8e737eff143d57d41bd580e437aa"
279+
git-tree-sha1 = "45521d31238e87ee9f9732561bfee12d4eebd52d"
281280
uuid = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48"
282-
version = "1.4.1"
281+
version = "1.4.2"
283282

284283
[deps.InlineStrings.extensions]
285284
ArrowTypesExt = "ArrowTypes"
285+
ParsersExt = "Parsers"
286286

287287
[deps.InlineStrings.weakdeps]
288288
ArrowTypes = "31f734f8-188a-4ce0-8406-c8a06bd891cd"
289+
Parsers = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
289290

290291
[[deps.InteractiveUtils]]
291292
deps = ["Markdown"]
@@ -475,24 +476,24 @@ uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
475476
version = "0.5.13"
476477

477478
[[deps.MadNLP]]
478-
deps = ["LDLFactorizations", "LinearAlgebra", "Logging", "NLPModels", "Pkg", "Printf", "SolverCore", "SparseArrays", "SuiteSparse"]
479-
git-tree-sha1 = "fa67a762e22c9c6c726b87ca8a335659ea6a69e0"
479+
deps = ["LDLFactorizations", "LinearAlgebra", "Logging", "NLPModels", "Pkg", "Printf", "RelocatableFolders", "SolverCore", "SparseArrays", "SuiteSparse"]
480+
path = "MadNLP.jl"
480481
uuid = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6"
481-
version = "0.8.3"
482+
version = "0.8.4"
482483
weakdeps = ["MathOptInterface"]
483484

484485
[deps.MadNLP.extensions]
485486
MadNLPMOI = "MathOptInterface"
486487

487488
[[deps.MadNLPGPU]]
488489
deps = ["AMD", "CUDA", "CUDSS", "CUSOLVERRF", "KernelAbstractions", "LinearAlgebra", "MadNLP", "MadNLPTests", "Metis", "SparseArrays"]
489-
git-tree-sha1 = "ddb1981f1c7a2ba78e480d4d210353133b013d98"
490+
git-tree-sha1 = "542846a6ecbaa6cbd7f3dbc6f86301b82b934a78"
490491
uuid = "d72a61cc-809d-412f-99be-fd81f4b8a598"
491-
version = "0.7.2"
492+
version = "0.7.3"
492493

493494
[[deps.MadNLPMumps]]
494-
deps = ["LinearAlgebra", "MUMPS_seq_jll", "MadNLP", "OpenBLAS32_jll"]
495-
git-tree-sha1 = "a32f32cbd0ee36becf88368ce9d1e84e9bc6a0c1"
495+
deps = ["LinearAlgebra", "MUMPS_seq_jll", "MadNLP", "OpenBLAS32_jll", "RelocatableFolders"]
496+
path = "MadNLP.jl/lib/MadNLPMumps"
496497
uuid = "3b83494e-c0a4-4895-918b-9157a7a085a1"
497498
version = "0.4.1"
498499

@@ -681,6 +682,12 @@ git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
681682
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
682683
version = "1.2.2"
683684

685+
[[deps.RelocatableFolders]]
686+
deps = ["SHA", "Scratch"]
687+
git-tree-sha1 = "ffdaf70d81cf6ff22c2b6e733c900c3321cab864"
688+
uuid = "05181044-ff0b-4ac5-8273-598c1e38db00"
689+
version = "1.0.1"
690+
684691
[[deps.Requires]]
685692
deps = ["UUIDs"]
686693
git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
@@ -789,10 +796,10 @@ uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
789796
version = "1.0.1"
790797

791798
[[deps.Tables]]
792-
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"]
793-
git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d"
799+
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "OrderedCollections", "TableTraits"]
800+
git-tree-sha1 = "598cd7c1f68d1e205689b1c2fe65a9f85846f297"
794801
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
795-
version = "1.11.1"
802+
version = "1.12.0"
796803

797804
[[deps.Tar]]
798805
deps = ["ArgTools", "SHA"]
@@ -810,9 +817,9 @@ uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
810817
version = "0.5.24"
811818

812819
[[deps.TranscodingStreams]]
813-
git-tree-sha1 = "60df3f8126263c0d6b357b9a1017bb94f53e3582"
820+
git-tree-sha1 = "96612ac5365777520c3c5396314c8cf7408f436a"
814821
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
815-
version = "0.11.0"
822+
version = "0.11.1"
816823
weakdeps = ["Random", "Test"]
817824

818825
[deps.TranscodingStreams.extensions]

Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ version = "0.1.0"
55

66
[deps]
77
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
8+
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"
89
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
910
MadNLP = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6"
1011
MadNLPGPU = "d72a61cc-809d-412f-99be-fd81f4b8a598"
1112
MadNLPMumps = "3b83494e-c0a4-4895-918b-9157a7a085a1"
1213
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6"
1314
UnsafePointers = "e17b2a0c-0bdf-430a-bd0c-3a23cae4ff39"
15+
16+
[extras]
17+
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"

Readme.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
Project.toml is manually created
22
Manifest.toml is generated automatically from
3-
julia> using Pkg
4-
julia> Pkg.activate(".")
5-
julia> Pkg.instantiate()
63

7-
8-
something similar in compiler
9-
10-
11-
julia --startup-file=no --project=compiler compiler/build.jl foo
4+
```
5+
julia --startup-file=no --project=. -e "using Pkg; Pkg.instantiate()"
6+
julia --startup-file=no --project=compiler -e "using Pkg; Pkg.instantiate()"
7+
julia --startup-file=no --project=compiler compiler/build.jl target/
8+
```

compiler/Manifest.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.10.3"
3+
julia_version = "1.10.4"
44
manifest_format = "2.0"
55
project_hash = "9ddee98f4175ce3934d72d17e69fc38f7697d471"
66

@@ -88,9 +88,11 @@ version = "1.2.0"
8888

8989
[[deps.PackageCompiler]]
9090
deps = ["Artifacts", "Glob", "LazyArtifacts", "Libdl", "Pkg", "Printf", "RelocatableFolders", "TOML", "UUIDs", "p7zip_jll"]
91-
git-tree-sha1 = "48d4429862157ad5500c4f61444db1b8c32e0a2b"
91+
git-tree-sha1 = "abee35bbb4be5c9c670bae87dee6a2384398cd64"
92+
repo-rev = "xcode-flag-fix"
93+
repo-url = "https://github.com/jayscook/PackageCompiler.jl"
9294
uuid = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
93-
version = "2.1.17"
95+
version = "2.1.18"
9496

9597
[[deps.Pkg]]
9698
deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]

0 commit comments

Comments
 (0)