Compiling pythonmodule

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
voctemic
Posts: 3
Joined: Sun Mar 11, 2018 1:48 pm

Compiling pythonmodule

Post by voctemic » Sun Mar 11, 2018 3:01 pm

Hello,

I am able to compile the root OpenSees targets without issue, but I am getting the following error when trying to compile the included python module

in SRC/interpreter with "make pythonmodule"

/usr/bin/g++ -rdynamic -shared PythonModule.o PythonWrapper.o 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 \
/home/ubuntu/lib/libOpenSees.a -L/usr/local/lib -L/home/ubuntu/lib -lpython2.7 \
-lm /home/ubuntu/lib/libArpack.a /home/ubuntu/lib/libSuperLU.a /home/ubuntu/lib/libUmfpack.a /home/ubuntu/lib/libCSparse.a /home/ubuntu/lib/libLapack.a /home/ubuntu/lib/libBlas.a /home/ubuntu/lib/libCBlas.a /home/ubuntu/lib/libAMD.a -ldl -lgfortran \
-o opensees.so

/usr/bin/ld: /home/ubuntu/lib/libOpenSees.a(STEELDR.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/home/ubuntu/lib/libOpenSees.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:41: recipe for target 'pythonmodule' failed
make: *** [pythonmodule] Error 1

Has anyone else encountered this issue?

Thanks,
Greg Zynda

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Compiling pythonmodule

Post by fmk » Mon Mar 19, 2018 10:04 am

i have updated various Makefile .. the Makefille.def.EC2-UBUNTU contains steps on how to build the python module and OpenSees on a freash ubuntu machine

voctemic
Posts: 3
Joined: Sun Mar 11, 2018 1:48 pm

Re: Compiling pythonmodule

Post by voctemic » Fri Jun 15, 2018 2:14 pm

Hello,

I am once again having trouble compiling using the Makefile.def.EC2-UBUNTU file.

make[1]: Leaving directory '/home/jovyan/OpenSees/OTHER/METIS'
LIBRARIES BUILT ... NOW LINKING OpenSees PROGRAM
make[1]: Entering directory '/home/jovyan/OpenSees/SRC/tcl'
make[1]: Nothing to be done for 'tcl'.
make[1]: Leaving directory '/home/jovyan/OpenSees/SRC/tcl'
make[1]: Entering directory '/home/jovyan/OpenSees/SRC/modelbuilder/tcl'
make[2]: Entering directory '/home/jovyan/OpenSees/SRC/tcl'
make[2]: Nothing to be done for 'tcl'.
make[2]: Leaving directory '/home/jovyan/OpenSees/SRC/tcl'
/home/jovyan/OpenSees/SRC/recorder/TclRecorderCommands.o: In function `TclCreateRecorder(void*, Tcl_Interp*, int, char const**, Domain&, Recorder**)':
TclRecorderCommands.cpp:(.text+0x8179): undefined reference to `OPS_MPCORecorder()'
/home/jovyan/lib/libOpenSees.a(FEM_ObjectBrokerAllClasses.o): In function `FEM_ObjectBrokerAllClasses::getPtrNewRecorder(int)':
FEM_ObjectBrokerAllClasses.cpp:(.text+0x540c): undefined reference to `MPCORecorder::MPCORecorder()'
collect2: error: ld returned 1 exit status
Makefile:13: recipe for target 'tcl' failed
make[1]: Leaving directory '/home/jovyan/OpenSees/SRC/modelbuilder/tcl'
make[1]: *** [tcl] Error 1
make: *** [all] Error 2
Makefile:48: recipe for target 'all' failed

Let me know if you are able to reproduce. It looks like MPCORecorder is not getting linked?

-Greg

voctemic
Posts: 3
Joined: Sun Mar 11, 2018 1:48 pm

Re: Compiling pythonmodule

Post by voctemic » Mon Jul 09, 2018 7:11 am

Hello,

Up until r6744, I have been getting the

TclRecorderCommands.cpp:(.text+0x8179): undefined reference to `OPS_MPCORecorder()'
/home/jovyan/lib/libOpenSees.a(FEM_ObjectBrokerAllClasses.o): In function `FEM_ObjectBrokerAllClasses::getPtrNewRecorder(int)':
FEM_ObjectBrokerAllClasses.cpp:(.text+0x540c): undefined reference to `MPCORecorder::MPCORecorder()'

error when trying to compile OpenSees. Starting with r6744 and forward, everything compiles, but when loading the opensees module in python

>>> import opensees
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: /opt/conda/lib/python3.6/site-packages/opensees.so: undefined symbol: ops_getnumeigen_

Can you recommend a revision that compiles and works correctly? Also, is there a reason that all development is taking place on the main branch without even release tags?

Thanks,
Greg

Post Reply