when I re-compile “make mode=shlib serial”, the output:
(base) n2d037977:src leo$ make -j4 mode=shlib serial
make[1]: `libmpi_stubs.a’ is up to date.
Gathering installed package information (may take a little while)
make[1]: `lmpinstalledpkgs.h’ is up to date.
Gathering git version information
Compiling LAMMPS for machine serial
/Library/Developer/CommandLineTools/usr/bin/make - --jobserver-fds=3,4 -j mode=shared serial
make[2]: `libmpi_stubs.a’ is up to date.
Gathering installed package information (may take a little while)
make[2]: `lmpinstalledpkgs.h’ is up to date.
Gathering git version information
Compiling LAMMPS for machine serial
g++ -g -O -std=c++11 main.o -L…/STUBS -L. -llammps_serial -lmpi_stubs -o …/lmp_serial
size …/lmp_serial
__TEXT __DATA __OBJC others dec hex
16384 16384 0 4295000064 4295032832 100010000
After it, “make install-python”, the output is:
Installing LAMMPS Python package version 2021.9.29 into site-packages folder
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/lammps
copying lammps/constants.py → build/lib/lammps
copying lammps/numpy_wrapper.py → build/lib/lammps
copying lammps/init.py → build/lib/lammps
copying lammps/core.py → build/lib/lammps
copying lammps/pylammps.py → build/lib/lammps
copying lammps/formats.py → build/lib/lammps
copying lammps/data.py → build/lib/lammps
creating build/lib/lammps/mliap
copying lammps/mliap/init.py → build/lib/lammps/mliap
copying lammps/mliap/pytorch.py → build/lib/lammps/mliap
copying lammps/mliap/loader.py → build/lib/lammps/mliap
running install_lib
running install_data
running install_egg_info
Removing /opt/anaconda3/lib/python3.8/site-packages/lammps-2021.9.29-py3.8.egg-info
Writing /opt/anaconda3/lib/python3.8/site-packages/lammps-2021.9.29-py3.8.egg-info
Also,
I updated the directory in bashrc file:
"
export PYTHONPATH=$PYTHONPATH:/Users/leo/Desktop/lammps-29Sep2021/python
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/leo/Desktop/lammps-29Sep2021/src
"
I still have the same issue:
Python 3.8.5 (default, Sep 4 2020, 02:22:02)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
import lammps
lmp = lammps.lammps()
Traceback (most recent call last):
File “”, line 1, in
File “/opt/anaconda3/lib/python3.8/site-packages/lammps/core.py”, line 144, in init
self.lib = CDLL(libpath,RTLD_GLOBAL)
File “/opt/anaconda3/lib/python3.8/ctypes/init.py”, line 381, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(liblammps.dylib, 10): image not found
Thanks for your help!
Leo