Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyMinuit does not want to compile #19

Open
GoogleCodeExporter opened this issue Mar 15, 2015 · 12 comments
Open

pyMinuit does not want to compile #19

GoogleCodeExporter opened this issue Mar 15, 2015 · 12 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. running the command:
>python setup.py install --with-minuit=/usr/local/include/Minuit/
doesn't result in the pyminuit module from being built...
2.
3.

What is the expected output? What do you see instead?
A compiled module
The dreaded line:
error: command 'gcc' failed with exit status 1

What version of the product are you using? On what operating system?
Using Minuit-1.7.9 (installs fine) and pyminuit-1.1.0 on Ubuntu 10.04 with GCC 
4.4.3 and GCC 4.3.4 (tried both compiler versions)

Please provide any additional information below.
The full output of the error is in the attached file.





Original issue reported on code.google.com by [email protected] on 23 Jul 2010 at 12:01

Attachments:

@GoogleCodeExporter
Copy link
Author

On Ubuntu Linux version 2.6.31-22-generic (buildd@roseapple) (gcc version 4.4.1 
(Ubuntu 4.4.1-4ubuntu9) ) #68-Ubuntu SMP Tue Oct 26 16:38:35 UTC 2010 (Ubuntu 
2.6.31-22.68-generic), after building Minuit-1_7_9 and installing it in 
/usr/local/lib, I downloaded pyminuit-1.1.0.tgz and (as root) tried 

# python setup.py install --with-minuit=/usr/local/lib

only to get multiple gcc error messages -- see attached file.  

Original comment by [email protected] on 25 Nov 2010 at 5:00

Attachments:

@GoogleCodeExporter
Copy link
Author

Sorry it took a while to figure this out, since I use Ubuntu also and don't 
have these problems.  It's because the header files for Python are not 
installed by default in Ubuntu.  They can be added with the following command:

sudo apt-get install python-dev

I've added that to the instructions so that no one else runs into this problem.

Original comment by [email protected] on 26 Nov 2010 at 1:08

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Thanks!  That did indeed fix the problem.  

Original comment by [email protected] on 5 Dec 2010 at 5:30

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Hi I have a similar error when running the command:

>python setup.py install --with-minuit=/usr/local/include/Minuit/

except the error says:

error: command 'g++' failed with exit status 1

I have installed the python-dev   header files like the above but that doesn't 
seem to help.  I have the same version and operating system as the person above 
too. 

If you could possibly shed some help on this that would be great.

attached is the full error readout

Original comment by kcremin%[email protected] on 4 Aug 2011 at 5:50

Attachments:

@GoogleCodeExporter
Copy link
Author

For Kevin:

The line where the compilation fails is this one:

        /usr/bin/ld: cannot find -llcg_Minuit

The "-L/home/kevin/Packages/Minuit-1_7_9/src/.libs" argument on the previous 
line tells ld which directory to look into to find the "liblcg_Minuit.*" 
libraries, and this is the correct directory.  The "-llcg_Minuit" argument 
tells it to look for "liblcg_Minuit*" libraries in that directory.

If your Minuit-1_7_9/src/.libs directory doesn't have the following files:

        liblcg_Minuit.so.0.0.0
        liblcg_Minuit.so.0 -> liblcg_Minuit.so.0.0.0
        liblcg_Minuit.so -> liblcg_Minuit.so.0.0.0
        liblcg_Minuit.a
        liblcg_Minuit.lai
        liblcg_Minuit.la -> ../liblcg_Minuit.la

then that's the problem.  The Minuit compilation didn't finish successfully.

I hope that helps!
-- Jim

Original comment by [email protected] on 4 Aug 2011 at 2:57

@GoogleCodeExporter
Copy link
Author

Ok,  That is the problem.  I redownloaded the two packages and ran the 
configuration again, but I there isn't even a      Minuit-1_7_9/src/.libs   
directory.

The ./configure works fine but when I run the make command this is what it 
reads at the bottom:


make[2]: Entering directory `/home/kevin/Packages/Minuit-1_7_9/src'
if /bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. 
-I.. -I..    -g -O2 -Wall -MT MnUserTransformation.lo -MD -MP -MF 
".deps/MnUserTransformation.Tpo" -c -o MnUserTransformation.lo 
MnUserTransformation.cpp; \
    then mv -f ".deps/MnUserTransformation.Tpo" ".deps/MnUserTransformation.Plo"; else rm -f ".deps/MnUserTransformation.Tpo"; exit 1; fi
 g++ -DHAVE_CONFIG_H -I. -I. -I.. -I.. -g -O2 -Wall -MT MnUserTransformation.lo -MD -MP -MF .deps/MnUserTransformation.Tpo -c MnUserTransformation.cpp  -fPIC -DPIC -o .libs/MnUserTransformation.o
MnUserTransformation.cpp: In constructor 
'MnUserTransformation::MnUserTransformation(const std::vector<double, 
std::allocator<double> >&, const std::vector<double, std::allocator<double> 
>&)':
MnUserTransformation.cpp:30: error: 'sprintf' is not a member of 'std'
make[2]: *** [MnUserTransformation.lo] Error 1
make[2]: Leaving directory `/home/kevin/Packages/Minuit-1_7_9/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kevin/Packages/Minuit-1_7_9'
make: *** [all] Error 2


I'm not really sure what all that means but could that potentially be the 
problem.  It seems weird that It wouldn't create that directory.

Thanks so much for the help!

Original comment by kcremin%[email protected] on 4 Aug 2011 at 11:04

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Ah, this underlying problem is a known issue: see 
http://code.google.com/p/pyminuit/issues/detail?id=8&q=sprintf (Issue #8).

Are you using the latest version?  On the PyMinuit front page, the latest 
version is Minuit_1_7_9-patch1.tgz.  The "patch1" is my fix of the "sprintf 
problem" (which is straightforward).  Oh, I got it: the HowToInstall wiki page 
still pointed to the old versions.  I just fixed that.

Original comment by [email protected] on 4 Aug 2011 at 11:49

@GoogleCodeExporter
Copy link
Author

That totally fixed everything Thank you!!!

Original comment by kcremin%[email protected] on 5 Aug 2011 at 7:10

@GoogleCodeExporter
Copy link
Author

Is there a way to do this without root access/python-dev?

Original comment by [email protected] on 15 Jun 2012 at 7:40

@GoogleCodeExporter
Copy link
Author

> Is there a way to do this without root access/python-dev?

Yes and no: you can build a Python package without root (I'm assuming you mean 
superuser) access, but you do need the python-dev package or its equivalent.

To build in a personal directory without root access:

python setup.py install --home=/path/that/you/can/write/to --with-minuit=...

This will fill /path/that/you/can/write/to with the "lib", "bin", "include" 
structure that /usr usually has.  (In the case of PyMinuit, I think "lib" is 
the only library.)  But then if you do that, you'll need to explicitly point 
Python to these libraries with PYTHONPATH and LD_LIBRARY_PATH.

Actually, this is all described in 
http://code.google.com/p/pyminuit/wiki/HowToInstall .



Original comment by [email protected] on 15 Jun 2012 at 10:21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant