-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
44 lines (42 loc) · 1.43 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# To compile the LAMMPS Python interface.
#!/usr/bin/env bash
cd lammps/src
if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
dos2unix USER-NEP/Install.sh
dos2unix Depend.sh
dos2unix Fetch.sh
fi
make yes-USER-NEP
cd ..
mkdir build && cd build
if [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
echo "Windows NT"
cmake -C ../cmake/presets/basic.cmake -D BUILD_MPI=no -D BUILD_OMP=no -D BUILD_SHARED_LIBS=yes ../cmake
cmake --build . --config Release --parallel 4
cd ../python
rm ./*.whl
python ./install.py -p lammps -l ../build/Release/liblammps.dll -v ../src/version.h -n
cd ../..
cp lammps/python/lammps*.whl .
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
echo "GNU/Linux"
cmake -C ../cmake/presets/basic.cmake -D BUILD_MPI=no -D BUILD_OMP=no -D BUILD_SHARED_LIBS=yes ../cmake
make -j 4
cd ../python
rm ./*.whl
python ./install.py -p lammps -l ../build/liblammps.so -v ../src/version.h -n
cd ../..
cp lammps/python/lammps*.whl .
elif [ "$(uname)" == "Darwin" ]; then
echo "Mac OS X"
cmake -C ../cmake/presets/basic.cmake -D BUILD_MPI=no -D BUILD_OMP=no -D BUILD_SHARED_LIBS=yes ../cmake
make -j 4
cd ../python
rm ./*.whl
python ./install.py -p lammps -l ../build/liblammps.dylib -v ../src/version.h -n
cd ../..
cp lammps/python/lammps*.whl .
fi
echo "Install wheel..."
pip install ./lammps*.whl
echo "All done!"