Install support for openEMS
Moderators: thorsten, sebastian
-
doom
- Posts: 5
- Joined: Sun 23 Apr 2017, 16:21
Post
by doom » Tue 27 Jun 2017, 23:52
Hi,
I try to install Python interface and I have the following problem.
Seems that one file is missing ...
Code: Select all
python setup.py install
Compiling CSXCAD/CSPrimitives.pyx because it changed.
Compiling CSXCAD/CSProperties.pyx because it changed.
Compiling CSXCAD/CSRectGrid.pyx because it changed.
Compiling CSXCAD/CSTransform.pyx because it changed.
Compiling CSXCAD/CSXCAD.pyx because it changed.
Compiling CSXCAD/ParameterObjects.pyx because it changed.
Compiling CSXCAD/Utilities.pyx because it changed.
[1/7] Cythonizing CSXCAD/CSPrimitives.pyx
[2/7] Cythonizing CSXCAD/CSProperties.pyx
[3/7] Cythonizing CSXCAD/CSRectGrid.pyx
[4/7] Cythonizing CSXCAD/CSTransform.pyx
[5/7] Cythonizing CSXCAD/CSXCAD.pyx
[6/7] Cythonizing CSXCAD/ParameterObjects.pyx
[7/7] Cythonizing CSXCAD/Utilities.pyx
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/CSXCAD
copying CSXCAD/__init__.py -> build/lib.linux-x86_64-2.7/CSXCAD
copying CSXCAD/SmoothMeshLines.py -> build/lib.linux-x86_64-2.7/CSXCAD
copying CSXCAD/CSXCAD.pxd -> build/lib.linux-x86_64-2.7/CSXCAD
copying CSXCAD/CSProperties.pxd -> build/lib.linux-x86_64-2.7/CSXCAD
copying CSXCAD/CSTransform.pxd -> build/lib.linux-x86_64-2.7/CSXCAD
copying CSXCAD/CSRectGrid.pxd -> build/lib.linux-x86_64-2.7/CSXCAD
copying CSXCAD/ParameterObjects.pxd -> build/lib.linux-x86_64-2.7/CSXCAD
copying CSXCAD/CSPrimitives.pxd -> build/lib.linux-x86_64-2.7/CSXCAD
running build_ext
building 'CSXCAD.CSPrimitives' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/CSXCAD
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c CSXCAD/CSPrimitives.cpp -o build/temp.linux-x86_64-2.7/CSXCAD/CSPrimitives.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
CSXCAD/CSPrimitives.cpp:266:37: fatal error: CSXCAD/ParameterObjects.h: Aucun fichier ou dossier de ce type
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
So I tried to copy from src
but same error :
Code: Select all
python setup.py install
running install
running build
running build_py
running build_ext
building 'CSXCAD.CSPrimitives' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c CSXCAD/CSPrimitives.cpp -o build/temp.linux-x86_64-2.7/CSXCAD/CSPrimitives.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
CSXCAD/CSPrimitives.cpp:266:37: fatal error: CSXCAD/ParameterObjects.h: Aucun fichier ou dossier de ce type
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Thanks for your help !!
D.
-
thorsten
- Posts: 1506
- Joined: Mon 27 Jun 2011, 12:26
Post
by thorsten » Wed 28 Jun 2017, 07:01
I think you have to specify where to find the header? Because I think this one was just the first. The compiler is not finding any I guess...
try:
Code: Select all
python setup.py build_ext -I/opt/openEMS/include -L/opt/openEMS/lib -R/opt/openEMS/lib"
pyhton setup.py install
Where "/opt/openEMS" is obviously where you installed openEMS by the usual means...
regards
Thorsten
-
doom
- Posts: 5
- Joined: Sun 23 Apr 2017, 16:21
Post
by doom » Wed 28 Jun 2017, 23:58
Hi,
Thanks for your answer, but it seems that there's another problem
Code: Select all
python setup.py build_ext -I/home/nana/opt/openEMS/include -L/home/nana/opt/openEMS/lib -R/home/nana/opt/openEMS/lib
running build_ext
building 'CSXCAD.CSPrimitives' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/nana/opt/openEMS/include -I/usr/include/python2.7 -c CSXCAD/CSPrimitives.cpp -o build/temp.linux-x86_64-2.7/CSXCAD/CSPrimitives.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-Bsymbolic-functions -Wl,-z,relro -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/CSXCAD/CSPrimitives.o -L/home/nana/opt/openEMS/lib -Wl,-R/home/nana/opt/openEMS/lib -lCSXCAD -o build/lib.linux-x86_64-2.7/CSXCAD/CSPrimitives.so
building 'CSXCAD.CSProperties' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/home/nana/opt/openEMS/include -I/usr/include/python2.7 -c CSXCAD/CSProperties.cpp -o build/temp.linux-x86_64-2.7/CSXCAD/CSProperties.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
CSXCAD/CSProperties.cpp: In function ‘int __pyx_pf_6CSXCAD_12CSProperties_12CSProperties_4__init__(__pyx_obj_6CSXCAD_12CSProperties_CSProperties*, __pyx_obj_6CSXCAD_16ParameterObjects_ParameterSet*, PyObject*, PyObject*, PyObject*)’:
CSXCAD/CSProperties.cpp:3622:61: error: ‘class CSProperties’ has no member named ‘GetParameterSet’
__pyx_v_self->__paraset->thisptr = __pyx_v_self->thisptr->GetParameterSet();
^
CSXCAD/CSProperties.cpp: In function ‘PyObject* __pyx_pf_6CSXCAD_12CSProperties_12CSProperties_24SetFillColor(__pyx_obj_6CSXCAD_12CSProperties_CSProperties*, PyObject*, PyObject*)’:
CSXCAD/CSProperties.cpp:4926:81: error: no matching function for call to ‘CSProperties::SetFillColor(unsigned char&, unsigned char&, unsigned char&, unsigned char&)’
_pyx_v_self->thisptr->SetFillColor(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8);
^
In file included from /home/nana/opt/openEMS/include/CSXCAD/ContinuousStructure.h:32:0,
from CSXCAD/CSProperties.cpp:285:
/home/nana/opt/openEMS/include/CSXCAD/CSProperties.h:140:7: note: candidate: void CSProperties::SetFillColor(RGBa)
void SetFillColor(RGBa color);
^
/home/nana/opt/openEMS/include/CSXCAD/CSProperties.h:140:7: note: candidate expects 1 argument, 4 provided
CSXCAD/CSProperties.cpp: In function ‘PyObject* __pyx_pf_6CSXCAD_12CSProperties_12CSProperties_26SetEdgeColor(__pyx_obj_6CSXCAD_12CSProperties_CSProperties*, PyObject*, PyObject*)’:
CSXCAD/CSProperties.cpp:5100:81: error: no matching function for call to ‘CSProperties::SetEdgeColor(unsigned char&, unsigned char&, unsigned char&, unsigned char&)’
_pyx_v_self->thisptr->SetEdgeColor(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8);
^
In file included from /home/nana/opt/openEMS/include/CSXCAD/ContinuousStructure.h:32:0,
from CSXCAD/CSProperties.cpp:285:
/home/nana/opt/openEMS/include/CSXCAD/CSProperties.h:145:7: note: candidate: void CSProperties::SetEdgeColor(RGBa)
void SetEdgeColor(RGBa color);
^
/home/nana/opt/openEMS/include/CSXCAD/CSProperties.h:145:7: note: candidate expects 1 argument, 4 provided
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
D.
-
thorsten
- Posts: 1506
- Joined: Mon 27 Jun 2011, 12:26
Post
by thorsten » Thu 29 Jun 2017, 17:52
I assume the installed version of openEMS is the latest version from master branch as well? Not the last released version?
-
eltonjorn
- Posts: 1
- Joined: Wed 07 Oct 2020, 08:43
Post
by eltonjorn » Wed 07 Oct 2020, 08:45
doom wrote: ↑Tue 27 Jun 2017, 23:52
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Most of the time these are dependency-issues. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding
Python in applications. When encountering this error please note before the error it may say you are missing a package or header file — you should find those and install them and verify if it works
For Python 2.x use:
If you using python3, try to replace python-dev with python3-dev
For a specific version of Python 3, replace x with the minor version in
Code: Select all
$ sudo apt-get install python3.x-dev
-
cnkz
- Posts: 2
- Joined: Sun 14 Feb 2021, 20:37
Post
by cnkz » Sun 14 Feb 2021, 20:43
I have the same problem, both with the v0.0.35 released version as of with the latest git version. Unfortunately i have no experience with the cython build environment. So any help is appreciated.
One observation is that the CSXCAD folder in the build directory is empty.
The missing file do exists in the /opt/include/CSXCAD directory.
Here the setup output:
Code: Select all
$ python3 setup.py build_ext -I/opt/include -L/opt/lib -R/opt/lib
running build_ext
building 'CSXCAD.CSPrimitives' extension
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/opt/include -I/usr/include/python3.8 -c CSXCAD/CSPrimitives.cpp -o build/temp.linux-x86_64-3.8/CSXCAD/CSPrimitives.o
CSXCAD/CSPrimitives.cpp:633:10: fatal error: CSXCAD/ParameterObjects.h: No such file or directory
633 | #include "CSXCAD/ParameterObjects.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
python3-dev is installed
-
thorsten
- Posts: 1506
- Joined: Mon 27 Jun 2011, 12:26
Post
by thorsten » Sun 14 Feb 2021, 20:57
Well the command looks fine to me. I assume the file "/opt/include/CSXCAD/ParameterObjects.h" is indeed available?
-
cnkz
- Posts: 2
- Joined: Sun 14 Feb 2021, 20:37
Post
by cnkz » Mon 15 Feb 2021, 13:11
Yes, the file "ParameterObjects.h" is in the include folder given by the -I flag to the compiler, but the compiler seems not to use the folder given by -I. (i tried different install targets not only /opt but also $HOME/opt/openems to avoid access problems)