errorr gcc compiler

Welcome to the forum for Stat-JR users. Feel free to post your question about Stat-JR here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

We will add further support to the Stat-JR website, such as FAQs and tutorials, as soon as it is available; the Stat-JR website can be found here: http://www.bristol.ac.uk/cmm/software/statjr/
frasera69
Posts: 1
Joined: Fri Feb 14, 2014 11:27 am

errorr gcc compiler

Post by frasera69 »

Dear all,
we dowloaded Stat JR in our virtual desktop service (epiLab).
We followed the installation instrucions.
i was able to load the dataset and set the model, but in
the run phase I'm getting the following error:

Traceback (most recent call last):
File "webtest.py", line 411, in go
File "C:\StatJR\packages\eStat.py", line 1160, in run
self.runcode(str(self.eng.outputs['modelcode.cpp'].content), self.vars[chainnum], self.data)
File "C:\StatJR\packages\eStat.py", line 790, in runcode
extra_compile_args = ['-w', '-O3', '-std=c++11' ])
File "c:\Python27\lib\site-packages\scipy\weave\inline_tools.py", line 361, in inline
File "c:\Python27\lib\site-packages\scipy\weave\inline_tools.py", line 491, in compile_function
File "c:\Python27\lib\site-packages\scipy\weave\ext_tools.py", line 373, in compile
File "c:\Python27\lib\site-packages\scipy\weave\build_tools.py", line 242, in build_extension
File "c:\Python27\lib\site-packages\scipy\weave\platform_info.py", line 125, in get_compiler_dir
ValueError: The 'gcc' compiler was not found.

Any suggestions?
Thank you for the help.
Francesco
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: errorr gcc compiler

Post by ChrisCharlton »

It looks like step 3 of the installation instructions (http://www.bris.ac.uk/cmm/software/stat ... stallation) hasn't worked. You can confirm this by opening a command prompt and typing in g++. If step 3 was successful you will see:

Code: Select all

C:\>g++
g++: fatal error: no input files
compilation terminated.
Otherwise:

Code: Select all

C:\>g++
'g++' is not recognized as an internal or external command,
operable program or batch file.
One possibility is that you already had a user PATH defined, in which case you would need to edit that to add the MinGW path, instead of adding it as a new variable as in the instructions.

You can check whether MinGW can be found in the path by typing ECHO %PATH% in a command prompt.
mithuabanerjee
Posts: 6
Joined: Fri Aug 22, 2014 4:59 pm

Re: errorr gcc compiler

Post by mithuabanerjee »

I installed Stat-JR and tried to execute the example using the antenatal.dta dataset. I followed the directions using the eStat engine. I also went to install MinGW and followed ALL the steps 1 through 5 as mentioned in the previous posting link (.../statjr/order-statjr#installation). The error I get still is this that gcc compiler not found (see last line of the error message):

Traceback (most recent call last):
File "webtest.py", line 416, in go
File "C:\StatJR\packages\eStat.py", line 1208, in run
self.runcode(str(self.eng.outputs['modelcode.cpp'].content), self.vars[chainnum], self.data)
File "C:\StatJR\packages\eStat.py", line 838, in runcode
extra_compile_args = ['-w', '-O3', '-std=c++11' ])
File "c:\Python27\lib\site-packages\scipy\weave\inline_tools.py", line 361, in inline
def attempt_function_call(code,local_dict,global_dict):
File "c:\Python27\lib\site-packages\scipy\weave\inline_tools.py", line 491, in compile_function
del sys.path[0]
File "c:\Python27\lib\site-packages\scipy\weave\ext_tools.py", line 373, in compile
return os.path.abspath(module_file)
File "c:\Python27\lib\site-packages\scipy\weave\build_tools.py", line 242, in build_extension
distutils.dir_util.mkpath(temp_dir)
File "c:\Python27\lib\site-packages\scipy\weave\platform_info.py", line 125, in get_compiler_dir
ValueError: The 'gcc' compiler was not found.

I also checked by typing at C:\>g++ with the result:
g++: fatal error: no input files
compilation terminated.

I also wanted to add one point that the user name has no spaces, but a hyphen like "u707-10299".

So I don't have an idea where the error is coming from. Any idea ?

Kind regards,
Soutrik.
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: errorr gcc compiler

Post by ChrisCharlton »

I'm not sure what is going on here, the compiler is installed by default into C:\MinGW, so your user name should not affect finding it. Do you have any other compilers installed (for example with Cygwin/Rtools/etc)?

Could you repeat the test that you did for g++ with gcc as this file should also exist and it's possible that the installer missed adding it?
mithuabanerjee
Posts: 6
Joined: Fri Aug 22, 2014 4:59 pm

Re: errorr gcc compiler

Post by mithuabanerjee »

1. The C:\MinGW is installed well - I did this twice to recheck everything. I also did the entire process in another PC, but the same errors persist unfortunately !

2. No other compliers are installed - Gygwin, Rtools, etc.

3. I had done the run -> cmd -> (in the root directory) g++, where I got exactly the same message as you posted above.
C:\>g++
g++: fatal error: no input files
compilation terminated.

4. However the problem persists. Again, in another computer, it blacks out and crashes each time with eStat -> clicking "run" engine with forced rebooting in the safe/normal mode, but in the current one, this doesn't happen fortunately.

5. There's no problem with the hyphen in the name, because in the other computer, it's a 6-letter word without any special character or space.

Kind regards,
Soütrik Banerjee.
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: errorr gcc compiler

Post by ChrisCharlton »

Thank you for the additional information. Would it be possible for you to replace the StatJR\packages\eStat.py file with the version in the attached zip file and then attempt to run the model again? This version has extra debugging messages turned on, which might help to pinpoint where the problem is occurring.
Attachments
eStat.zip
(14.3 KiB) Downloaded 710 times
mithuabanerjee
Posts: 6
Joined: Fri Aug 22, 2014 4:59 pm

Re: errorr gcc compiler

Post by mithuabanerjee »

I replaced the eStat.py, which was the only file in the zip attachment you provided, and reran the same process (not replacing eStat.pyc). I copy-paste the error log:

Traceback (most recent call last):
File "webtest.py", line 416, in go
File "C:\StatJR\packages\eStat.py", line 1208, in run
self.runcode(str(self.eng.outputs['modelcode.cpp'].content), self.vars[chainnum], self.data)
File "C:\StatJR\packages\eStat.py", line 838, in runcode
extra_compile_args = ['-w', '-O3', '-std=c++11' ])
File "c:\Python27\lib\site-packages\scipy\weave\inline_tools.py", line 361, in inline
def attempt_function_call(code,local_dict,global_dict):
File "c:\Python27\lib\site-packages\scipy\weave\inline_tools.py", line 491, in compile_function
del sys.path[0]
File "c:\Python27\lib\site-packages\scipy\weave\ext_tools.py", line 373, in compile
return os.path.abspath(module_file)
File "c:\Python27\lib\site-packages\scipy\weave\build_tools.py", line 242, in build_extension
distutils.dir_util.mkpath(temp_dir)
File "c:\Python27\lib\site-packages\scipy\weave\platform_info.py", line 125, in get_compiler_dir
ValueError: The 'gcc' compiler was not found.
richardparker
Posts: 61
Joined: Fri Oct 23, 2009 1:49 pm

Re: errorr gcc compiler

Post by richardparker »

Hi - thanks for trying that out; sorry you're still having problems.

I've attached a command file which starts up the Stat-JR:TREE interface and explicitly sets the path to MinGW (assuming all saved in default locations). If you unzip it and copy the command file into the directory in which Stat-JR is installed (e.g. C:\StatJR\TREE command.cmd), and then execute it, that should work, but please let us know the outcome either way.

Many thanks,

Richard
Attachments
TREE command.zip
(181 Bytes) Downloaded 780 times
mithuabanerjee
Posts: 6
Joined: Fri Aug 22, 2014 4:59 pm

Re: errorr gcc compiler

Post by mithuabanerjee »

Dear Richard,
Thanks for the file and sorry to reply late. I installed the new file as you mentioned in the default location C:\StatJR\TREE command.cmd and then executed it. After it ran, it automatically opened the Stat-JR "begin" start page. So I executed the analysis as I did before, but I still unfortunately got the same errors (which only appear with eStat engine):

Kind regards,
Soutrik.

Traceback (most recent call last):
File "webtest.py", line 416, in go
File "C:\StatJR\packages\eStat.py", line 1208, in run
self.runcode(str(self.eng.outputs['modelcode.cpp'].content), self.vars[chainnum], self.data)
File "C:\StatJR\packages\eStat.py", line 838, in runcode
extra_compile_args = ['-w', '-O3', '-std=c++11' ])
File "c:\Python27\lib\site-packages\scipy\weave\inline_tools.py", line 361, in inline
def attempt_function_call(code,local_dict,global_dict):
File "c:\Python27\lib\site-packages\scipy\weave\inline_tools.py", line 491, in compile_function
del sys.path[0]
File "c:\Python27\lib\site-packages\scipy\weave\ext_tools.py", line 373, in compile
return os.path.abspath(module_file)
File "c:\Python27\lib\site-packages\scipy\weave\build_tools.py", line 242, in build_extension
distutils.dir_util.mkpath(temp_dir)
File "c:\Python27\lib\site-packages\scipy\weave\platform_info.py", line 125, in get_compiler_dir
ValueError: The 'gcc' compiler was not found.
richardparker
Posts: 61
Joined: Fri Oct 23, 2009 1:49 pm

Re: errorr gcc compiler

Post by richardparker »

Hi - could you check what version of g++ you're running? Typing

Code: Select all

g++ --version
at the command prompt should do it.

Thanks,

Richard
Post Reply