improve consistency between CMake and GNU make build. Must explicitly link python when building a static mdi lib
This commit is contained in:
@ -44,7 +44,7 @@ if(DOWNLOAD_MDI)
|
||||
ExternalProject_Add(mdi_build
|
||||
URL ${MDI_URL}
|
||||
URL_MD5 ${MDI_MD5}
|
||||
CMAKE_ARGS ${CMAKE_REQUEST_PIC}
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
@ -54,6 +54,7 @@ if(DOWNLOAD_MDI)
|
||||
-Dlanguage=C
|
||||
-Dlibtype=STATIC
|
||||
-Dmpi=${MDI_USE_MPI}
|
||||
-Dplugins=ON
|
||||
-Dpython_plugins=${MDI_USE_PYTHON_PLUGINS}
|
||||
UPDATE_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
|
||||
@ -2,10 +2,11 @@ These are examples that work the MDI package in LAMMPS which uses the
|
||||
MolSSI MDI library for coupling codes together and communicating
|
||||
between them with MDI messages.
|
||||
|
||||
In MDI lingo, one code is the driver and another code is the engine.
|
||||
The 2 codes can be written in any language; C++ (LAMMPS) and Python
|
||||
are illustrated here. The 2 codes can each be stand-alone codes, in
|
||||
which case they can be run on different numbers of processors. The 2
|
||||
Within the MDI context, one code is the driver and another code is
|
||||
the engine. The 2 codes can be written in any language; C++ (LAMMPS)
|
||||
and Python are illustrated here. The 2 codes can each be stand-alone
|
||||
codes, in which case they can be run on different numbers of processors.
|
||||
The 2
|
||||
codes can communicate either via TCP (sockets) or via MPI. For the
|
||||
TCP case, the driver and engine need to be launched separately,
|
||||
e.g. in 2 windows on your desktop machine. For the MPI case, a single
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
SHELL = /bin/sh
|
||||
|
||||
# which file will be copied to Makefile.lammps
|
||||
|
||||
EXTRAMAKE = Makefile.lammps.empty
|
||||
|
||||
# ------ MAKE PROCEDURE ------
|
||||
|
||||
lib: $(OBJ)
|
||||
mkdir -p build
|
||||
cd build; cmake -Dlibtype=STATIC -Dlanguage=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++ ../MDI_Library; make
|
||||
@cp $(EXTRAMAKE) Makefile.lammps
|
||||
|
||||
# ------ CLEAN ------
|
||||
|
||||
clean:
|
||||
-rm *.o *.h $(LIB)
|
||||
-rm -r build
|
||||
@ -8,7 +8,7 @@ EXTRAMAKE = Makefile.lammps.empty
|
||||
|
||||
lib: $(OBJ)
|
||||
mkdir -p build
|
||||
cd build; cmake -Dlibtype=STATIC -Dlanguage=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D CMAKE_C_COMPILER=gcc ../MDI_Library; make
|
||||
cd build && cmake -D libtype=STATIC -D language=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D mpi=ON -D plugins=ON -D python_plugins=ON -D CMAKE_C_COMPILER=gcc ../MDI_Library && make
|
||||
@cp $(EXTRAMAKE) Makefile.lammps
|
||||
|
||||
# ------ CLEAN ------
|
||||
|
||||
@ -8,7 +8,7 @@ EXTRAMAKE = Makefile.lammps.empty
|
||||
|
||||
lib: $(OBJ)
|
||||
mkdir -p build
|
||||
cd build; cmake -Dlibtype=STATIC -Dlanguage=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D CMAKE_C_COMPILER=icc -D CMAKE_CXX_COMPILER=icpc ../MDI_Library; make
|
||||
cd build && cmake -D libtype=STATIC -D language=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D mpi=ON -D plugins=ON -D python_plugins=ON -D CMAKE_C_COMPILER=icc ../MDI_Library && make
|
||||
@cp $(EXTRAMAKE) Makefile.lammps
|
||||
|
||||
# ------ CLEAN ------
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
# Settings that the LAMMPS build will import when this package library is used
|
||||
|
||||
mdi_SYSINC =
|
||||
mdi_SYSLIB =
|
||||
mdi_SYSPATH =
|
||||
mdi_python_SYSLIB = $(shell which python3-config > /dev/null 2>&1 && python3-config --ldflags --embed > /dev/null 2>&1 && python3-config --ldflags --embed || (which python3-config > /dev/null 2>&1 && python3-config --ldflags || :) )
|
||||
|
||||
mdi_SYSINC =
|
||||
mdi_SYSLIB = $(mdi_python_SYSLIB)
|
||||
mdi_SYSPATH =
|
||||
|
||||
@ -8,7 +8,7 @@ EXTRAMAKE = Makefile.lammps.empty
|
||||
|
||||
lib: $(OBJ)
|
||||
mkdir -p build
|
||||
cd build; cmake -Dlibtype=STATIC -Dlanguage=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D CMAKE_C_COMPILER=mpicc -D CMAKE_CXX_COMPILER=mpicxx ../MDI_Library; make
|
||||
cd build && cmake -D libtype=STATIC -D language=C -D CMAKE_POSITION_INDEPENDENT_CODE=yes -D mpi=ON -D plugins=ON -D python_plugins=ON -D CMAKE_C_COMPILER=mpicc ../MDI_Library && make
|
||||
@cp $(EXTRAMAKE) Makefile.lammps
|
||||
|
||||
# ------ CLEAN ------
|
||||
|
||||
Reference in New Issue
Block a user