Skip to content

Commit 1e267b9

Browse files
fixing CD
1 parent 1fa96c6 commit 1e267b9

5 files changed

Lines changed: 164 additions & 4 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ __pycache__/
99

1010
# C extensions
1111
*.so
12+
*.dylib
13+
*.dll
1214

1315
# Distribution / packaging
1416
.Python
@@ -18,7 +20,7 @@ dist/
1820
downloads/
1921
eggs/
2022
.eggs/
21-
lib/
23+
2224
lib64/
2325
parts/
2426
sdist/

build.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,29 @@ def main() -> None:
7272
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
7373
""".strip()
7474
print(install_message_4)
75-
run_command("mvn --batch-mode package -P shared-dll", cwd=vcell_native_dir)
75+
# each profile is guarded by os-type, so only the corresponding os' profile will actually be used
76+
run_command("mvn --batch-mode package -P shared-dll;shared-so;shared-dylib", cwd=vcell_native_dir)
7677

7778
# Copy the shared library to libvcell/lib
7879
for ext in ["so", "dylib", "dll"]:
7980
shared_lib = vcell_native_dir / f"target/libvcell.{ext}"
8081
if shared_lib.exists():
8182
shutil.copy(shared_lib, libvcell_lib_dir / f"libvcell.{ext}")
8283

84+
# Copy the shared library to libvcell/lib
85+
copied = False
86+
for ext in ["so", "dylib", "dll"]:
87+
shared_lib = vcell_native_dir / f"target/libvcell.{ext}"
88+
if shared_lib.exists():
89+
shutil.copy(shared_lib, libvcell_lib_dir / f"libvcell.{ext}")
90+
copied = True
91+
print(f"Copied {shared_lib} to {libvcell_lib_dir}")
92+
93+
if not copied:
94+
print(f"ERROR: No shared library found in {vcell_native_dir / 'target'}", file=sys.stderr)
95+
print(f"Contents: {list((vcell_native_dir / 'target').glob('*'))}", file=sys.stderr)
96+
sys.exit(1)
97+
8398

8499
if __name__ == "__main__":
85100
main()

libvcell/lib/.gitkeep

Whitespace-only changes.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
name = "libvcell"
7-
version = "0.0.13"
7+
version = "0.0.14.3"
88
description = "This is a python package which wraps a subset of VCell Java code as a native python package."
99
authors = ["Jim Schaff <schaff@uchc.edu>", "Ezequiel Valencia <evalencia@uchc.edu>"]
1010
repository = "https://github.com/virtualcell/libvcell"
@@ -39,6 +39,7 @@ mkdocs-material = "^9.5.50"
3939
mkdocstrings = {extras = ["python"], version = "^0.27.0"}
4040

4141
[tool.cibuildwheel]
42+
build-frontend = "pip"
4243
build = "cp311-* cp312-* cp313-*"
4344
manylinux-x86_64-image = "ghcr.io/virtualcell/manylinux_2_28_x86_64:0.0.1"
4445
skip = "cp311-musllinux_x86_64 cp312-musllinux_x86_64 cp313-musllinux_x86_64"

vcell-native/pom.xml

Lines changed: 143 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@
223223

224224
<profiles>
225225
<profile>
226-
<id>native</id>
226+
<id>native-windows</id>
227+
<activation>
228+
<os><family>windows</family></os>
229+
</activation>
227230
<build>
228231
<plugins>
229232
<plugin>
@@ -254,6 +257,9 @@
254257
</profile>
255258
<profile>
256259
<id>shared-dll</id>
260+
<activation>
261+
<os><family>windows</family></os>
262+
</activation>
257263
<build>
258264
<plugins>
259265
<plugin>
@@ -283,5 +289,141 @@
283289
</plugins>
284290
</build>
285291
</profile>
292+
<profile>
293+
<id>native-linux</id>
294+
<activation>
295+
<os><family>unix</family></os>
296+
</activation>
297+
<build>
298+
<plugins>
299+
<plugin>
300+
<groupId>org.graalvm.buildtools</groupId>
301+
<artifactId>native-maven-plugin</artifactId>
302+
<version>${native.maven.plugin.version}</version>
303+
<extensions>true</extensions>
304+
<configuration>
305+
<buildArgs>
306+
<arg>--initialize-at-build-time=org.apache.xerces.parsers.SAXParser</arg>
307+
<arg>-Djava.security.properties=src/main/resources/custom.security</arg>
308+
<arg>-g</arg>
309+
<arg>-H:ConfigurationFileDirectories=target/recording</arg>
310+
</buildArgs>
311+
</configuration>
312+
<executions>
313+
<execution>
314+
<id>build-native</id>
315+
<goals>
316+
<goal>compile-no-fork</goal>
317+
</goals>
318+
<phase>package</phase>
319+
</execution>
320+
</executions>
321+
</plugin>
322+
</plugins>
323+
</build>
324+
</profile>
325+
<profile>
326+
<id>shared-so</id>
327+
<activation>
328+
<os><family>unix</family></os>
329+
</activation>
330+
<build>
331+
<plugins>
332+
<plugin>
333+
<groupId>org.graalvm.buildtools</groupId>
334+
<artifactId>native-maven-plugin</artifactId>
335+
<version>${native.maven.plugin.version}</version>
336+
<extensions>true</extensions>
337+
<configuration>
338+
<buildArgs>
339+
<arg>--initialize-at-build-time=org.apache.xerces.parsers.SAXParser</arg>
340+
<arg>-Djava.security.properties=src/main/resources/custom.security</arg>
341+
<arg>-g</arg>
342+
<arg>--shared</arg>
343+
<arg>-H:ConfigurationFileDirectories=target/recording</arg>
344+
</buildArgs>
345+
</configuration>
346+
<executions>
347+
<execution>
348+
<id>build-native</id>
349+
<goals>
350+
<goal>compile-no-fork</goal>
351+
</goals>
352+
<phase>package</phase>
353+
</execution>
354+
</executions>
355+
</plugin>
356+
</plugins>
357+
</build>
358+
</profile>
359+
<profile>
360+
<id>native-mac</id>
361+
<activation>
362+
<os><family>mac</family></os>
363+
</activation>
364+
<build>
365+
<plugins>
366+
<plugin>
367+
<groupId>org.graalvm.buildtools</groupId>
368+
<artifactId>native-maven-plugin</artifactId>
369+
<version>${native.maven.plugin.version}</version>
370+
<extensions>true</extensions>
371+
<configuration>
372+
<buildArgs>
373+
<arg>--initialize-at-build-time=org.apache.xerces.parsers.SAXParser</arg>
374+
<arg>-Djava.security.properties=src/main/resources/custom.security</arg>
375+
<arg>-g</arg>
376+
<arg>-H:ConfigurationFileDirectories=target/recording</arg>
377+
<arg>-H:CCompilerOption=-mmacosx-version-min=11.0</arg>
378+
</buildArgs>
379+
</configuration>
380+
<executions>
381+
<execution>
382+
<id>build-native</id>
383+
<goals>
384+
<goal>compile-no-fork</goal>
385+
</goals>
386+
<phase>package</phase>
387+
</execution>
388+
</executions>
389+
</plugin>
390+
</plugins>
391+
</build>
392+
</profile>
393+
<profile>
394+
<id>shared-dylib</id>
395+
<activation>
396+
<os><family>mac</family></os>
397+
</activation>
398+
<build>
399+
<plugins>
400+
<plugin>
401+
<groupId>org.graalvm.buildtools</groupId>
402+
<artifactId>native-maven-plugin</artifactId>
403+
<version>${native.maven.plugin.version}</version>
404+
<extensions>true</extensions>
405+
<configuration>
406+
<buildArgs>
407+
<arg>--initialize-at-build-time=org.apache.xerces.parsers.SAXParser</arg>
408+
<arg>-Djava.security.properties=src/main/resources/custom.security</arg>
409+
<arg>-g</arg>
410+
<arg>--shared</arg>
411+
<arg>-H:ConfigurationFileDirectories=target/recording</arg>
412+
<arg>-H:CCompilerOption=-mmacosx-version-min=11.0</arg>
413+
</buildArgs>
414+
</configuration>
415+
<executions>
416+
<execution>
417+
<id>build-native</id>
418+
<goals>
419+
<goal>compile-no-fork</goal>
420+
</goals>
421+
<phase>package</phase>
422+
</execution>
423+
</executions>
424+
</plugin>
425+
</plugins>
426+
</build>
427+
</profile>
286428
</profiles>
287429
</project>

0 commit comments

Comments
 (0)