Hi
I encountered this error. I tried to solve it many days, but I cannot find the solution.
Traceback (most recent call last):
File "libopt/solve.py", line 9, in libopt.solve
File "/root/.local/lib/python3.6/site-packages/ortools/linear_solver/pywraplp.py", line 13, in <module>
from . import _pywraplp
ImportError: /root/.local/lib/python3.6/site-packages/ortools/linear_solver/_pywraplp.so: undefined symbol: _ZN19operations_research22ExportModelAsMpsFormatERKNS_12MPModelProtoERKNS_20MPModelExportOptionsE
Here is our system setting.
------- Dockerfile ----------
FROM centos:8
...
RUN dnf -y groupinstall 'Development Tools'
RUN yum -y install pkgconfig
...
RUN yum install -y python36-devel python3-wheel
--------------------------------------
Golang code is calling a shared file (xxx.so: our program calling ortools, written in python), via c file by using cgo.
// #cgo pkg-config: python3
// #cgo CFLAGS : -I./ -I/usr/include/python3.6m
// #cgo LDFLAGS: -L/usr/local/lib64/python3.6/site-packages/ortools/linear_solver -L${SRCDIR}/lib/model -lmodelpython -L${SRCDIR}/lib/libopt -loptimisationpython -L${SRCDIR}/lib -lcython -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -L/usr/lib -lpython3.6m -lpthread -ldl -lutil -lm
* When I call the xxx.so file, called from python code, it was working properly.
but if we call xxx.so file from c code, then it returns the above error.
------------------------------------------
I found similar issues.
https://groups.google.com/g/or-tools-discuss/c/YtXsfIJvK04/m/mhNNUuPs2pIJ
Did anyone encounter similar issue, and managed to solve it?
Appreciated your help.
Thank you.
Regards,
Min