zhuminjie / OpenSeesPyDoc

OpenSeesPy Documentation
http://openseespydoc.readthedocs.io
Other
142 stars 105 forks source link

Source code for compile #78

Open cedavidyang opened 5 years ago

cedavidyang commented 5 years ago

Hi zhuminjie,

I managed to compile the source code on MacOS. However, the source code mentioned in the documentation (https://github.com/steva44/OpenSees/archive/master.zip) seems to be an older version, e.g., logFile is not working. Can you please provide the updated link for the source code so that I can compile the newest version?

Best, David

zhuminjie commented 5 years ago

The source code can be found in https://github.com/OpenSees/OpenSees

cedavidyang commented 5 years ago

Hi Minjie, thanks for your reply and information. I am aware of the source code. Using the source code, I was able to compile OpenSees, OpenSeesSP, and OpenSeesMP on my computer using similar Makefile.def file to https://github.com/ucgmsim/OpenSees_Makefiles/blob/master/Makefile.def.MacOS10.11_Accelerate_Homebrew. However, when I was trying to compile OpenSeesPy using make OpenSeesPy, I got the following error while generating opensees.so :

Undefined symbols for architecture x86_64:
  "_PyBool_Type", referenced from:
      PythonModule::getInt(int*, int) in PythonModule.o
      PythonModule::getDouble(double*, int) in PythonModule.o
  "_PyErr_Clear", referenced from:
      PythonModule::getInt(int*, int) in PythonModule.o
      PythonModule::getDouble(double*, int) in PythonModule.o
  "_PyErr_NewExceptionWithDoc", referenced from:
      _PyInit_opensees in PythonModule.o
  "_PyErr_Occurred", referenced from:
      PythonModule::getInt(int*, int) in PythonModule.o
      PythonModule::getDouble(double*, int) in PythonModule.o
  "_PyErr_Print", referenced from:
      PythonRV::PythonRV(int, double, double, char const*, char const*) in libReliability.a(PythonRV.o)
      PythonRV::PythonRV(int, Vector const&, char const*, char const*) in libReliability.a(PythonRV.o)
  "_PyErr_SetString", referenced from:
      PythonStream::operator<<(void const*) in PythonModule.o
  "_PyFloat_AsDouble", referenced from:
      PythonModule::getDouble(double*, int) in PythonModule.o
      PythonRV::getMean() in libReliability.a(PythonRV.o)
      PythonRV::getStdv() in libReliability.a(PythonRV.o)
      PythonRV::getPDFvalue(double) in libReliability.a(PythonRV.o)
      PythonRV::getCDFvalue(double) in libReliability.a(PythonRV.o)
      PythonRV::getInverseCDFvalue(double) in libReliability.a(PythonRV.o)
  "_PyFloat_Type", referenced from:
      PythonModule::getInt(int*, int) in PythonModule.o
      PythonModule::getDouble(double*, int) in PythonModule.o
  "_PyImport_ImportModule", referenced from:
      PythonRV::PythonRV(int, double, double, char const*, char const*) in libReliability.a(PythonRV.o)
      PythonRV::PythonRV(int, Vector const&, char const*, char const*) in libReliability.a(PythonRV.o)
  "_PyList_New", referenced from:
      PythonWrapper::setOutputs(int*, int) in PythonWrapper.o
      PythonWrapper::setOutputs(double*, int) in PythonWrapper.o
  "_PyLong_AsLong", referenced from:
      PythonModule::getInt(int*, int) in PythonModule.o
  "_PyModule_AddObject", referenced from:
      _PyInit_opensees in PythonModule.o
  "_PyModule_Create2", referenced from:
      _PyInit_opensees in PythonModule.o
  "_PyModule_GetState", referenced from:
      opensees_traverse(_object*, int (*)(_object*, void*), void*) in PythonModule.o
      opensees_clear(_object*) in PythonModule.o
      _PyInit_opensees in PythonModule.o
  "_PyObject_CallFunction", referenced from:
      PythonRV::getMean() in libReliability.a(PythonRV.o)
      PythonRV::getStdv() in libReliability.a(PythonRV.o)
      PythonRV::getPDFvalue(double) in libReliability.a(PythonRV.o)
      PythonRV::getCDFvalue(double) in libReliability.a(PythonRV.o)
      PythonRV::getInverseCDFvalue(double) in libReliability.a(PythonRV.o)
  "_PyObject_GetAttrString", referenced from:
      PythonRV::PythonRV(int, double, double, char const*, char const*) in libReliability.a(PythonRV.o)
      PythonRV::PythonRV(int, Vector const&, char const*, char const*) in libReliability.a(PythonRV.o)
  "_PyRun_SimpleStringFlags", referenced from:
      PythonModule::runCommand(char const*) in PythonModule.o
  "_PySys_FormatStderr", referenced from:
      void PythonStream::err_out<char>(char) in PythonModule.o
      void PythonStream::err_out<unsigned char>(unsigned char) in PythonModule.o
      void PythonStream::err_out<signed char>(signed char) in PythonModule.o
      void PythonStream::err_out<char const*>(char const*) in PythonModule.o
      void PythonStream::err_out<unsigned char const*>(unsigned char const*) in PythonModule.o
      void PythonStream::err_out<signed char const*>(signed char const*) in PythonModule.o
      void PythonStream::err_out<void const*>(void const*) in PythonModule.o
      ...
  "_PyTuple_GetItem", referenced from:
      PythonModule::getInt(int*, int) in PythonModule.o
      PythonModule::getDouble(double*, int) in PythonModule.o
      PythonModule::getString() in PythonModule.o
  "_PyTuple_Size", referenced from:
      Py_ops_UniaxialMaterial(_object*, _object*) in PythonWrapper.o
      Py_ops_testUniaxialMaterial(_object*, _object*) in PythonWrapper.o
      Py_ops_setStrain(_object*, _object*) in PythonWrapper.o
      Py_ops_getStrain(_object*, _object*) in PythonWrapper.o
      Py_ops_getStress(_object*, _object*) in PythonWrapper.o
      Py_ops_getTangent(_object*, _object*) in PythonWrapper.o
      Py_ops_getDampTangent(_object*, _object*) in PythonWrapper.o
      ...
  "_PyType_IsSubtype", referenced from:
      PythonModule::getInt(int*, int) in PythonModule.o
      PythonModule::getDouble(double*, int) in PythonModule.o
  "_PyUnicode_AsUTF8", referenced from:
      PythonModule::getString() in PythonModule.o
  "_Py_AtExit", referenced from:
      _PyInit_opensees in PythonModule.o
  "_Py_BuildValue", referenced from:
      PythonWrapper::setOutputs(int*, int) in PythonWrapper.o
      PythonWrapper::setOutputs(double*, int) in PythonWrapper.o
      PythonWrapper::setOutputs(char const*) in PythonWrapper.o
  "__Py_NoneStruct", referenced from:
      PythonWrapper::getResults() in PythonWrapper.o
      Py_ops_UniaxialMaterial(_object*, _object*) in PythonWrapper.o
      Py_ops_testUniaxialMaterial(_object*, _object*) in PythonWrapper.o
      Py_ops_setStrain(_object*, _object*) in PythonWrapper.o
      Py_ops_getStrain(_object*, _object*) in PythonWrapper.o
      Py_ops_getStress(_object*, _object*) in PythonWrapper.o
      Py_ops_getTangent(_object*, _object*) in PythonWrapper.o

I also tried to copy and replace the source file in https://github.com/steva44/OpenSees/archive/master.zip using Qt Creator. No success either. Can you please share more details on what I should do? Thanks!

zhuminjie commented 5 years ago

Do you compile on Mac? It looks like mac machine has some problems to link to the python libraries. I don't have a mac now. I will look into it later. Thank you!