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

Fix macOS LAMMPS plugin loading issue #72

Merged
merged 7 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions .azure-pipelines/azure-pipelines-linux.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .azure-pipelines/azure-pipelines-osx.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tensorflow:
zip_keys:
- - c_compiler_version
- cxx_compiler_version
- cdt_name
- cuda_compiler
- cuda_compiler_version
- cdt_name
- docker_image
5 changes: 4 additions & 1 deletion .ci_support/migrations/cuda120.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ cxx_compiler_version: # [linux and os.environ.get("CF_CUDA_ENABLED", "F
fortran_compiler_version: # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
- 12 # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]

c_stdlib_version: # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
- 2.17 # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]

cdt_name: # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]
- cos7 # [linux and os.environ.get("CF_CUDA_ENABLED", "False") == "True"]

Expand All @@ -87,4 +90,4 @@ docker_image: # [os.environ.get("BUILD_PLAT
- quay.io/condaforge/linux-anvil-aarch64 # [aarch64 and os.environ.get("BUILD_PLATFORM") == "linux-aarch64"]
# case: cross-compilation (build != target)
- quay.io/condaforge/linux-anvil-cos7-x86_64 # [ppc64le and os.environ.get("BUILD_PLATFORM") == "linux-64"]
- quay.io/condaforge/linux-anvil-cos7-x86_64 # [aarch64 and os.environ.get("BUILD_PLATFORM") == "linux-64"]
- quay.io/condaforge/linux-anvil-cos7-x86_64 # [aarch64 and os.environ.get("BUILD_PLATFORM") == "linux-64"]
6 changes: 3 additions & 3 deletions .scripts/build_steps.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions build-locally.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions recipe/3473.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
From adf640a49cad144d707686e629f24756e28968f6 Mon Sep 17 00:00:00 2001
From: Chenxing Luo <[email protected]>
Date: Sat, 16 Mar 2024 18:53:43 -0400
Subject: [PATCH] Fix LAMMPS plugin symlink path on macOS platform

---
source/lmp/plugin/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/lmp/plugin/CMakeLists.txt b/source/lmp/plugin/CMakeLists.txt
index bfc2253412..4fdae7ac5b 100644
--- a/source/lmp/plugin/CMakeLists.txt
+++ b/source/lmp/plugin/CMakeLists.txt
@@ -126,7 +126,7 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION)
install(
CODE "execute_process( \
COMMAND ${CMAKE_COMMAND} -E create_symlink \
- ../${CMAKE_SHARED_LIBRARY_PREFIX}${libname}${CMAKE_SHARED_LIBRARY_SUFFIX} \
+ ../${CMAKE_SHARED_MODULE_PREFIX}${libname}${CMAKE_SHARED_MODULE_SUFFIX} \
${CMAKE_INSTALL_PREFIX}/lib/${libname}/${PLUGINNAME} \
)")
endif()
27 changes: 0 additions & 27 deletions recipe/in_plugin.lammps

This file was deleted.

11 changes: 6 additions & 5 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ package:
source:
- url: https://github.com/deepmodeling/{{ name }}/archive/v{{ version }}.tar.gz
sha256: b14419367905b6dd938b9c54f91977c59c25da905a34a7b42585af4805fc4077
patches:
- 3473.patch
- url: https://github.com/lammps/lammps/archive/{{ lammps_version }}.tar.gz
sha256: 48dc8b0b0583689e80ea2052275acbc3e3fce89707ac557e120db5564257f7df
folder: lammps

build:
number: 0
number: 1
{% if mpi != 'nompi' %}
{% set mpi_prefix = "mpi_" + mpi %}
{% else %}
Expand All @@ -31,6 +33,7 @@ build:

requirements:
build:
- {{ stdlib("c") }}
njzjz marked this conversation as resolved.
Show resolved Hide resolved
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ compiler('cuda') }} # [cuda_compiler_version != "None"]
Expand Down Expand Up @@ -77,8 +80,7 @@ test:
files:
- water_se_a.json
- water.lmp
- in.lammps # [linux and mpi == 'mpich']
- in_plugin.lammps # [osx and mpi == 'mpich']
- in.lammps # [mpi == 'mpich']
source_files:
- examples/water/data
imports:
Expand All @@ -95,8 +97,7 @@ test:
- mv examples/water/data/data_0 ./data
- dp train water_se_a.json
- dp freeze -o frozen_model.pb
- mpiexec -n 1 lmp_mpi -in in.lammps # [linux and mpi == 'mpich']
- mpiexec -n 1 lmp_mpi -in in_plugin.lammps # [osx and mpi == 'mpich']
- mpiexec -n 1 lmp_mpi -in in.lammps # [mpi == 'mpich']

about:
home: https://github.com/deepmodeling/deepmd-kit
Expand Down
Loading