Support #1748

make error

Added by Maier Gernot over 8 years ago. Updated over 8 years ago.

Status:ClosedStart date:03/22/2016
Priority:NormalDue date:
Assigned To:-% Done:

100%

Category:-
Target version:-
Duration:

Description

Hello,

I am trying to compile ctools (cloned today) on linux and get the following errors when running 'make’:

Include multi-wavelength interface in gammalib Python module.
Include CTA instrument interface in gammalib Python module.
Include Fermi/LAT instrument interface in gammalib Python module.
Include COMPTEL instrument interface in gammalib Python module.
running build_ext
building '_app’ extension
creating build
creating build/temp.linux-x86_64-3.4
creating build/temp.linux-x86_64-3.4/gammalib
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I../include -I/afs/ifh.de/group/cta/VERITAS/software/FITS/cfitsio/include -I../inst/mwl/include -I../inst/cta/include -I../inst/lat/include -I../inst/com/include -I/afs/ifh.de/group/cta/cta/software/Anaconda/anaconda3/include/python3.4m -c gammalib/app_wrap.cpp -o build/temp.linux-x86_64-3.4/gammalib/app_wrap.o -fopenmp
cc1plus: warning: command line option "-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
gammalib/app_wrap.cpp: In function ‘swig_module_info* SWIG_Python_GetModule()’:
gammalib/app_wrap.cpp:2452: error: ‘PyCObject_Import’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘void SWIG_Python_SetModule(swig_module_info*)’:
gammalib/app_wrap.cpp:2521: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope
gammalib/app_wrap.cpp:2512: warning: unused variable ‘swig_empty_runtime_method_table’
gammalib/app_wrap.cpp: In function ‘swig_type_info* SWIG_Python_TypeQuery(const char*)’:
gammalib/app_wrap.cpp:2544: error: ‘PyCObject_AsVoidPtr’ was not declared in this scope
gammalib/app_wrap.cpp:2549: error: ‘PyCObject_FromVoidPtr’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_new_GLog_SWIG_1(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:6121: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:6122: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:6126: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_new_GLog_SWIG_2(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:6175: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:6176: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:6180: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_new_GLog(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:6276: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:6295: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* _wrap_GLog_open
_SWIG_0(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:6489: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:6490: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:6494: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_GLog_open_SWIG_1(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:6551: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:6552: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:6556: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_GLog_open(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:6607: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:6631: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* _wrap_new_GApplicationPars
_SWIG_1(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:8784: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:8785: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:8789: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_new_GApplicationPars_SWIG_2(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:8836: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:8837: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:8841: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_new_GApplicationPars(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:8945: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:8964: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* _wrap_GApplicationPars_load
_SWIG_0(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:9810: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:9811: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:9815: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_GApplicationPars_load_SWIG_1(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:9870: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:9871: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:9875: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* wrap_GApplicationPars_load(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:9934: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:9958: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* _wrap_GApplicationPars_save(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:10006: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:10007: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:10011: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* _wrap_GApplicationPar_filename
_SWIG_0(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:11028: error: ‘PyString_Check’ was not declared in this scope
gammalib/app_wrap.cpp:11029: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp:11033: error: ‘PyString_AsString’ was not declared in this scope
gammalib/app_wrap.cpp: In function ‘PyObject* _wrap_GApplicationPar_filename(PyObject*, PyObject*)’:
gammalib/app_wrap.cpp:11606: error: ‘PyString_Check’ was not declared in this scope
error: command 'gcc’ failed with exit status 1

I am using gcc (GCC) 4.4.7

Thanks for the help

Gernot

gammalib.make.log.gz (155 KB) Maier Gernot, 03/23/2016 11:41 AM


Recurrence

No recurrence.


Related issues

Related to GammaLib - Action #1763: Add swig version requirement to user documentation New 04/14/2016

History

#1 Updated by Knödlseder Jürgen over 8 years ago

It happens when compiling gammalib, right?

I suspect that it’s a Python - swig compatibility issue. What Python version are you compiling for and what swig version have you installed?

#2 Updated by Maier Gernot over 8 years ago

Hi Juergen,

solved, thanks for your help.

Was a mixture of two things:

- you were right with swig: the default installed version on my system was very old (1.3.40). Installing a newer one (3.0.8) resolved things.
- a mixup of python versions due to a recent installation of ctapipe.

'make’ works now. I guess the many hundreds of warnings like the one below is ok?

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:503: warning: will never be executed
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/allocator.h:109: warning: will never be executed

best regards,

Gernot

#3 Updated by Maier Gernot over 8 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#4 Updated by Knödlseder Jürgen over 8 years ago

Maier Gernot wrote:

'make’ works now. I guess the many hundreds of warnings like the one below is ok?

/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/basic_string.h:503: warning: will never be executed
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/allocator.h:109: warning: will never be executed

I have never seen such warnings. What OS are you using? Could you also provide the complete console output of the make so that I can see where the warnings arise?

#5 Updated by Maier Gernot over 8 years ago

I’ve attached the output from make.

This is my system:
Linux wgs01.ifh.de 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 08:24:23 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)

best regards,

Gernot

#6 Updated by Knödlseder Jürgen over 8 years ago

Maier Gernot wrote:

I’ve attached the output from make.

This is my system:
Linux wgs01.ifh.de 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 08:24:23 CST 2015 x86_64 x86_64 x86_64 GNU/Linux
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)

best regards,

Gernot

Thanks. I found that: http://stackoverflow.com/questions/14591778/g-warning-will-never-be-executed.

Looks like this comes form the option -Wunreachable-code that is passed to gcc, for example in

gcc -pthread -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I../include -I/afs/ifh.de/group/cta/VERITAS/software/FITS/cfitsio/include -I../inst/mwl/include -I../inst/cta/include -I../inst/lat/include -I../inst/com/include -I/afs/ifh.de/group/cta/cta/software/Anaconda/anaconda3/envs/cta/include/python3.5m -c gammalib/app_wrap.cpp -o build/temp.linux-x86_64-3.5/gammalib/app_wrap.o -fopenmp

GammaLib does not control the gcc options when building the Python module, but takes whatever was used for compiling Python using the distutils Python module. So I guess that your Python version was compiled with this, but your gcc compiler does not support this option properly (the http link mentions broken code in gcc, removed from gcc-4.5 on).

So I think it’s save to ignore the warnings.

#7 Updated by Knödlseder Jürgen over 8 years ago

  • Status changed from Resolved to Closed

#8 Updated by Knödlseder Jürgen over 8 years ago

  • Related to Action #1763: Add swig version requirement to user documentation added

Also available in: Atom PDF