Skip to content

Commit

Permalink
Makefiles for making openseespy binary
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuminjie committed Feb 13, 2020
1 parent b7679bc commit 9c3ed19
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
15 changes: 15 additions & 0 deletions Makefile
Expand Up @@ -91,6 +91,21 @@ endif
@$(ECHO) LIBRARIES BUILT ... NOW LINKING OpenSeesPy Module;
@$(CD) $(FE)/interpreter; $(MAKE) pythonmodule;

pythonmain:
ifdef MKDIR
$(MKDIR) $(HOME)/bin
$(MKDIR) $(HOME)/lib
endif
@( \
for f in $(DIRS); \
do \
$(CD) $$f; \
$(MAKE); \
$(CD) ..; \
done );
@$(ECHO) LIBRARIES BUILT ... NOW LINKING OpenSeesPy Module;
@$(CD) $(FE)/interpreter; $(MAKE) python;

libs:
@( \
for f in $(DIRS); \
Expand Down
30 changes: 6 additions & 24 deletions SRC/interpreter/Makefile
@@ -1,18 +1,10 @@

include ../../Makefile.def

OBJS = DL_Interpreter.o \
TclInterpreter.o \
PythonInterpreter.o \
OpenSeesCommandsTcl.o \
OpenSeesCommandsPython.o \
OpenSeesUniaxialMaterialCommands.o \
PythonModelBuilder.o PythonAnalysisBuilder.o

OBJS = DL_Interpreter.o OpenSeesCommands.o OpenSeesUniaxialMaterialCommands.o OpenSeesElementCommands.o OpenSeesTimeSeriesCommands.o OpenSeesPatternCommands.o OpenSeesSectionCommands.o OpenSeesOutputCommands.o OpenSeesCrdTransfCommands.o OpenSeesBeamIntegrationCommands.o OpenSeesNDMaterialCommands.o OpenSeesMiscCommands.o OpenSeesParameterCommands.o OpenSeesFrictionModelCommands.o OpenSeesReliabilityCommands.o

TclOBJS = tclMain.o TclInterpreter.o TclWrapper.o $(OBJS)
PythonOBJS = pythonMain.o PythonInterpreter.o PythonWrapper.o $(OBJS)
PythonOBJS = pythonMain.o PythonModule.o PythonWrapper.o $(OBJS)
PythonModuleOBJS = PythonModule.o PythonWrapper.o $(OBJS)

# Compilation control
Expand All @@ -24,35 +16,25 @@ tcl: $(TclOBJS)
$(FE_LIBRARY) $(MACHINE_LINKLIBS) $(TCL_LIBRARY) \
$(MACHINE_NUMERICAL_LIBS) $(MACHINE_SPECIFIC_LIBS) $(PARALLEL_LIB) \
$(INTERPRETER_LIBS_MPI_PARAMETERS) \
-o tclInterpreter
-o openseestcl

#PYTHON_LIBRARY = -framework Python
PYTHON_LIBRARY =

python: $(PythonOBJS)
$(LINKER) $(LINKFLAGS) $(PythonOBJS) \
$(RM) $(RMFLAGS) openseespy;
$(LINKER) $(LINKFLAGS) -Wl,-rpath,\$$ORIGIN/../lib $(PythonOBJS) \
$(FE_LIBRARY) $(MACHINE_LINKLIBS) $(PYTHON_LIBRARY) \
$(MACHINE_NUMERICAL_LIBS) $(MACHINE_SPECIFIC_LIBS) $(PARALLEL_LIB) \
$(INTERPRETER_LIBS_MPI_PARAMETERS) \
-o pythonInterpreter
-o openseespy

# $(CC++) $(OS_FLAG) -dynamiclib $(INCLUDES) -Wl,-undefined,suppress,-flat_namespace pythonExample.cpp $(OUTSIDE_OBJS) -current_version 1.0 -compatibility_version 1.0 -fvisibility=hidden -o fmkSum.dylib

OBJSm = OpenSeesCommandsPython.o OpenSeesUniaxialMaterialCommands.o PythonModelBuilder.o PythonAnalysisBuilder.o

LINKFLAGS = -Wl,-rpath,\$$ORIGIN/lib

pythonmodule: $(PythonModuleOBJS)
$(RM) $(RMFLAGS) opensees.so;
@( \
for f in $(DIRS); \
do \
$(CD) $$f; \
$(MAKE); \
$(CD) ..; \
done );
$(CD) $(FE)/interpreter;
$(LINKER) $(LINKFLAGS) -shared $(PythonModuleOBJS) \
$(LINKER) $(LINKFLAGS) -Wl,-rpath,\$$ORIGIN/lib -shared $(PythonModuleOBJS) \
$(FE_LIBRARY) $(MACHINE_LINKLIBS) $(PYTHON_LIBRARY) \
$(MACHINE_NUMERICAL_LIBS) $(MACHINE_SPECIFIC_LIBS) $(PARALLEL_LIB) \
$(INTERPRETER_LIBS_MPI_PARAMETERS) \
Expand Down

0 comments on commit 9c3ed19

Please sign in to comment.