@@ -12,15 +12,15 @@ SPDX-License-Identifier: Apache-2.0
12
12
13
13
<!-- vim: set tabstop=8 shiftwidth=4 expandtab sts=4 filetype=ant fdm=marker: -->
14
14
<project name =" publish-solvers-cvc5" basedir =" ." xmlns : ivy =" antlib:org.apache.ivy.ant" >
15
-
16
15
<import file =" macros.xml" />
17
16
17
+ <property name =" cvc5.distDir" value =" ${ivy.solver.dist.dir}/cvc5" />
18
+
18
19
<!-- Build options for CVC5, Reasoning:
19
20
- 'production' enable optimization, disables assertions and tracing,
20
21
- 'static' build libcvc5 and all dependencies statically,
21
22
- 'java-bindings' build the JNI bindings,
22
23
- 'auto-download' load all dependencies automatically,
23
- - 'statistics' for the new statistics stuff,
24
24
- 'prefix' because I don't want it to use system installed or install system-wide,
25
25
Theoretically CVC5s performance should be improvable by using -best (uses the best
26
26
known general performance/dependencies) but this can not be combined with auto-download.
@@ -41,6 +41,8 @@ SPDX-License-Identifier: Apache-2.0
41
41
The custom revision has to be unique amongst the already known version
42
42
numbers from the ivy repository. The script will append the git revision.
43
43
</fail >
44
+ <checkPathOption pathOption =" jdk-linux-arm64.path" defaultPath =" /path/to/jdk" targetName =" JDK source folder (Linux arm64 version)" />
45
+ <checkPathOption pathOption =" jdk-windows-x64.path" defaultPath =" /path/to/jdk" targetName =" JDK source folder (Windows x64 version)" />
44
46
45
47
<!-- get the short commit hash of the cvc5 version used -->
46
48
<exec executable =" git" dir =" ${cvc5.path}" outputproperty =" cvc5.revision" failonerror =" true" >
@@ -51,47 +53,113 @@ SPDX-License-Identifier: Apache-2.0
51
53
<property name =" cvc5.version" value =" ${cvc5.customRev}-g${cvc5.revision}" />
52
54
<echo message =" Building CVC5 in version '${cvc5.version}'" />
53
55
54
- <!-- build CVC5 -->
55
- <echo message =" Cleaning old build files" />
56
- <exec executable =" rm" dir =" ${cvc5.path}" failonerror =" true" >
56
+ <!-- set a path to the build folder and make sure there are no previous build files -->
57
+ <property name =" cvc5.buildDir" location =" ${cvc5.path}/build" />
58
+ <fail message =" Found `/build` directory in ${cvc5.path}. Please make sure that -Dcvc5.path points to a clean checkout of CVC5 without any build files." >
59
+ <condition >
60
+ <available file =" ${cvc5.buildDir}" type =" dir" />
61
+ </condition >
62
+ </fail >
63
+
64
+ <!-- build CVC5 for x64 linux -->
65
+ <echo message =" Building CVC5 for x64 linux" />
66
+ <property name =" cvc5.installDir.x64-linux" location =" ${cvc5.path}/install/x64-linux" />
67
+ <exec executable =" ./configure.sh" dir =" ${cvc5.path}" failonerror =" true" >
68
+ <arg value =" production" />
69
+ <arg value =" --static" />
70
+ <arg value =" --java-bindings" />
71
+ <arg value =" --auto-download" />
72
+ <arg value =" --prefix=${cvc5.installDir.x64-linux}" />
73
+ </exec >
74
+ <exec executable =" make" dir =" ${cvc5.buildDir}" failonerror =" true" >
75
+ <arg value =" -j4" />
76
+ <arg value =" install" />
77
+ </exec >
78
+ <exec executable =" rm" failonerror =" true" >
57
79
<arg value =" -rf" />
58
- <arg value =" build" />
80
+ <arg value =" ${cvc5.buildDir}" />
81
+ </exec >
82
+ <exec executable =" strip" dir =" ${cvc5.installDir.x64-linux}/lib" failonerror =" true" >
83
+ <arg value =" libcvc5jni.so" />
59
84
</exec >
60
85
61
- <echo message =" Configuring and building CVC5 in version '${cvc5.version}'" />
86
+ <!-- build CVC5 for arm64 linux -->
87
+ <echo message =" Building CVC5 for arm64 linux" />
88
+ <property name =" cvc5.installDir.arm64-linux" location =" ${cvc5.path}/install/arm64-linux" />
62
89
<exec executable =" ./configure.sh" dir =" ${cvc5.path}" failonerror =" true" >
90
+ <env key =" JNI_HOME" value =" ${jdk-linux-arm64.path}" />
63
91
<arg value =" production" />
92
+ <arg value =" --arm64" />
64
93
<arg value =" --static" />
65
94
<arg value =" --java-bindings" />
66
95
<arg value =" --auto-download" />
67
- <arg value =" --statistics" />
68
- <arg value =" --prefix=${cvc5.path}/build/install" />
96
+ <arg value =" --prefix=${cvc5.installDir.arm64-linux}" />
97
+ </exec >
98
+ <exec executable =" make" dir =" ${cvc5.buildDir}" failonerror =" true" >
99
+ <arg value =" -j4" />
100
+ <arg value =" install" />
101
+ </exec >
102
+ <exec executable =" rm" failonerror =" true" >
103
+ <arg value =" -rf" />
104
+ <arg value =" ${cvc5.buildDir}" />
69
105
</exec >
70
- <exec executable =" make" dir =" ${cvc5.path}/build/" failonerror =" true" >
71
- <arg value =" -j4" />
106
+ <exec executable =" aarch64-linux-gnu-strip" dir =" ${cvc5.installDir.arm64-linux}/lib" failonerror =" true" >
107
+ <arg value =" libcvc5jni.so" />
108
+ </exec >
109
+
110
+ <!-- build CVC5 for x64 windows -->
111
+ <echo message =" Building CVC5 for x64 windows" />
112
+ <property name =" cvc5.installDir.x64-windows" location =" ${cvc5.path}/install/x64-windows" />
113
+ <exec executable =" ./configure.sh" dir =" ${cvc5.path}" failonerror =" true" >
114
+ <env key =" JNI_HOME" value =" ${jdk-windows-x64.path}" />
115
+ <arg value =" production" />
116
+ <arg value =" --win64" />
117
+ <arg value =" --static" />
118
+ <arg value =" --java-bindings" />
119
+ <arg value =" --auto-download" />
120
+ <arg value =" --prefix=${cvc5.installDir.x64-windows}" />
121
+ </exec >
122
+ <exec executable =" make" dir =" ${cvc5.buildDir}" failonerror =" true" >
123
+ <arg value =" -j4" />
124
+ <arg value =" install" />
125
+ </exec >
126
+ <exec executable =" rm" failonerror =" true" >
127
+ <arg value =" -rf" />
128
+ <arg value =" ${cvc5.buildDir}" />
129
+ </exec >
130
+ <exec executable =" x86_64-w64-mingw32-strip" dir =" ${cvc5.installDir.x64-windows}/bin" failonerror =" true" >
131
+ <arg value =" cvc5jni.dll" />
72
132
</exec >
73
133
74
134
<!-- get the actual jar location as cvc5.jar is just a link -->
75
- <exec executable =" readlink" dir =" ${cvc5.path}/build/src/api /java" outputproperty =" cvc5.jar" failonerror =" true" >
135
+ <exec executable =" readlink" dir =" ${cvc5.installDir.x64-linux}/share /java" outputproperty =" cvc5.jar" failonerror =" true" >
76
136
<arg value =" -f" />
77
137
<arg value =" cvc5.jar" />
78
138
</exec >
79
139
80
140
<!-- copy library files into directory to be published for IVY -->
81
- <echo message =" Copying artifact files into current directory" />
82
- <copy file =" ${cvc5.path}/build/src/api/java/libcvc5jni.so" tofile =" libcvc5j-${cvc5.version}.so" />
83
- <copy file =" ${cvc5.jar}" tofile =" cvc5-${cvc5.version}.jar" />
84
-
85
- <!-- remove unneeded symbols -->
86
- <echo message =" Strip unneeded symbols" />
87
- <exec executable =" strip" dir =" ./" failonerror =" true" >
88
- <arg value =" libcvc5j-${cvc5.version}.so" />
89
- </exec >
141
+ <echo message =" Copying artifact for Ivy release" />
142
+ <copy file =" ${cvc5.jar}" tofile =" ${cvc5.distDir}/cvc5-${cvc5.version}.jar" />
143
+ <copy file =" ${cvc5.installDir.x64-linux}/lib/libcvc5jni.so" tofile =" ${cvc5.distDir}/x64/libcvc5j-${cvc5.version}.so" />
144
+ <copy file =" ${cvc5.installDir.arm64-linux}/lib/libcvc5jni.so" tofile =" ${cvc5.distDir}/arm64/libcvc5j-${cvc5.version}.so" />
145
+ <copy file =" ${cvc5.installDir.x64-windows}/bin/cvc5jni.dll" tofile =" ${cvc5.distDir}/x64/libcvc5j-${cvc5.version}.dll" />
90
146
</target >
91
147
92
148
<target name =" publish-cvc5" depends =" package-cvc5, load-ivy"
93
- description =" Publish CVC5 binaries to Ivy repository." >
94
- <ivy : resolve conf =" solver-cvc5" file =" solvers_ivy_conf/ivy_cvc5.xml" />
95
- <publishToRepository solverName =" CVC5" solverVersion =" ${cvc5.version}" />
149
+ description =" Publish CVC5 binaries to Ivy repository." >
150
+ <ivy : resolve conf =" solver-cvc5" file =" solvers_ivy_conf/ivy_cvc5.xml" />
151
+ <publishToRepository solverName =" CVC5" solverVersion =" ${cvc5.version}" distDir =" ${cvc5.distDir}" />
152
+
153
+ <!--
154
+ We additionally provide x64-files without arch-attribute for backwards compatibility,
155
+ such that applications can load dependencies without changing their Ivy configuration.
156
+ Those files are not part of any direct configuration, but will be resolved if the
157
+ arch-attribute is not used.
158
+ -->
159
+ <copy todir =" repository/${ivy.organisation}/${ivy.module}/" >
160
+ <fileset dir =" repository/${ivy.organisation}/${ivy.module}/x64/" >
161
+ <include name =" *-${cvc5.version}.*" />
162
+ </fileset >
163
+ </copy >
96
164
</target >
97
165
</project >
0 commit comments