Fwd: ROOT_NUMPY

72 views
Skip to first unread message

Piti Ongmongkolkul

unread,
Apr 18, 2013, 7:34:14 PM4/18/13
to rootp...@googlegroups.com, Guillermo Rangel
I'm forwarding this to rootpy-dev group. I think I tried to install it on 10.5 once and it worked. But the error looks innocuous enough. Here is some funny stuff that happens

1) Somehow it picks gcc instead of g++. Is it alias on OSX 10.5?
2) It fails on a very innocent looking line 

       void Print()
        {
            cout << colname << " - " << rttype << endl; // <---There
        }

Here are some questions for you
1) What is your OSX version
2) What is your gcc/g++ version
3) Most likely there is a problem with your compiler. How did you install gcc g++ etc.?
Can you compile

#include <iostream>
#include <string>
using namespace std;
int main(){
string hello="hello";
cout << hello << "world" << endl;
return 0;
}

I also believe EPD Python is 32 bit. You might run into problem of linking it later on. 


Piti

Begin forwarded message:

From: Guillermo Rangel <cub...@gmail.com>
Subject: Re: ROOT_NUMPY
Date: April 18, 2013 4:13:37 PM PDT
To: Piti Ongmongkolkul <pit...@gmail.com>

Hi Piti

Ok I did that and now I get a different error. Perhaps this doesn't work with numpy version 1.7.1

admins-MacBook-Pro:root_numpy cubreto$ sudo python setup.py install
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
running install
running build
running build_py
creating build
creating build/lib.macosx-10.5-x86_64-2.7
creating build/lib.macosx-10.5-x86_64-2.7/root_numpy
copying root_numpy/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/root_numpy
copying root_numpy/info.py -> build/lib.macosx-10.5-x86_64-2.7/root_numpy
copying root_numpy/OrderedDict.py -> build/lib.macosx-10.5-x86_64-2.7/root_numpy
copying root_numpy/root_numpy.py -> build/lib.macosx-10.5-x86_64-2.7/root_numpy
copying root_numpy/root_numpy_warnings.py -> build/lib.macosx-10.5-x86_64-2.7/root_numpy
copying root_numpy/util.py -> build/lib.macosx-10.5-x86_64-2.7/root_numpy
creating build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests
copying root_numpy/tests/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests
copying root_numpy/tests/test.py -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests
creating build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/doubletree1.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/fixed1.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/fixed2.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/hvector.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/single1.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/single2.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/sprtest.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/test.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/vary1.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
copying root_numpy/tests/data/vary2.root -> build/lib.macosx-10.5-x86_64-2.7/root_numpy/tests/data
running build_ext
building 'root_numpy._librootnumpy' extension
creating build/temp.macosx-10.5-x86_64-2.7
creating build/temp.macosx-10.5-x86_64-2.7/root_numpy
creating build/temp.macosx-10.5-x86_64-2.7/root_numpy/src
gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -DNDEBUG -g -O3 -arch x86_64 -I/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include -I/Users/cubreto/Downloads/rootv5/include -Iroot_numpy/src -I/Library/Frameworks/EPD64.framework/Versions/7.3/include/python2.7 -c root_numpy/src/_librootnumpy.cpp -o build/temp.macosx-10.5-x86_64-2.7/root_numpy/src/_librootnumpy.o
In file included from /Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
                 from /Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from /Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
                 from root_numpy/src/_librootnumpy.cpp:256:
/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
root_numpy/src/_librootnumpy.cpp: In function ‘PyObject* newarrayobject(PyTypeObject*, Py_ssize_t, arraydescr*)’:
root_numpy/src/_librootnumpy.cpp:1217: warning: deprecated conversion from string constant to ‘char*’
root_numpy/src/Column.h: At global scope:
root_numpy/src/Column.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
root_numpy/src/Column.h:107:   instantiated from here
root_numpy/src/Column.h:107: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
root_numpy/src/Column.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
root_numpy/src/Column.h:107:   instantiated from here
root_numpy/src/Column.h:107: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
root_numpy/src/Column.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
root_numpy/src/Column.h:107:   instantiated from here
root_numpy/src/Column.h:107: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
error: command 'gcc' failed with exit status 1
admins-MacBook-Pro:root_numpy cubreto$ 


On Thu, Apr 18, 2013 at 3:19 PM, Piti Ongmongkolkul <pit...@gmail.com> wrote:
ROOT comes with root-config command which can be used to ask root about that configuration of your installation. In your terminal
Type

which root

This should give something along the line of /usr/local/root/bin or some path
Then in your .bash_profile which define all your environment variables
add the output from the above command to a line that looks like

export PATH="/output/from/that/command:{$PATH}"

Piti
On Apr 18, 2013, at 1:46 PM, Guillermo Rangel <cub...@gmail.com> wrote:

>
> Hi Piti:
>
> I'm trying to install this ROOT_NUMPY from github but I'm getting the following error. I'm using python version 2.7 thru EPD (Enthought) and I'm using ROOT 5.34 latest patch.
>
>
>
>
> admins-MacBook-Pro:root_numpy cubreto$ sudo python setup.py install
> dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo) is setuid or setgid
> Password:
> Traceback (most recent call last):
>   File "setup.py", line 17, in <module>
>     rootsys = os.environ['ROOTSYS']
>   File "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/UserDict.py", line 23, in __getitem__
>     raise KeyError(key)
> KeyError: 'ROOTSYS'
>
> Thank you
> Guillermo
>
>
>



Piti

unread,
Apr 18, 2013, 7:39:20 PM4/18/13
to rootp...@googlegroups.com, Guillermo Rangel
My other guess is that you just upgrade your OS but you didn't upgrade your compiler. If this is the problem, download the latest XCode and
go to Preference --> Downloads --> and install Command Line Tools

Piti

Piti Ongmongkolkul

unread,
Apr 18, 2013, 7:47:02 PM4/18/13
to rootp...@googlegroups.com, Guillermo Rangel
Can you compile this code?

Piti Ongmongkolkul

unread,
Apr 18, 2013, 7:48:20 PM4/18/13
to rootp...@googlegroups.com, Guillermo Rangel
My other guess is that EPD is linked with some old version of C++ library. Making them incompatible.

Piti

Christoph Deil

unread,
Apr 19, 2013, 2:59:03 AM4/19/13
to rootp...@googlegroups.com, Guillermo Rangel
Hi Guillermo,

you could give MacPorts ( http://www.macports.org ) or the free version of Anaconda ( https://store.continuum.io/cshop/anaconda ) a try.

I have no experience with EPD, but if you use Macports and do
$ sudo port install root py27-numpy
$ python setup.py install --user
it might just work (because it then uses the same gcc from Macports to compile Python, ROOT, numpy and root_numpy) or if it doesn't I might be able to help.

Another piece of advice: get a new Mac with OS X 10.8  :-) , getting recent software to build on OS X 10.5 is no fun.

Christoph

--
You received this message because you are subscribed to the Google Groups "rootpy dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rootpy-dev+...@googlegroups.com.
To post to this group, send email to rootp...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Piti Ongmongkolkul

unread,
Apr 19, 2013, 4:16:53 AM4/19/13
to rootp...@googlegroups.com, Guillermo Rangel
After several more emails exchange with Guillermo. He actually use 10.8 with llvm.

I believe the problem is that EPD is linked against some really old libstdc++ which came with OSX 10.5 SDK(10.5) and this SDK doesn't exists anymore in the wild. Furthermore, setuptools that came with EPD isn't configured correctly.

I'd suggest just uninstall EPD and follow instruction given here

(you don't need scipy and scikit-learn) 

Piti

Piti Ongmongkolkul

unread,
Apr 19, 2013, 4:26:33 AM4/19/13
to rootp...@googlegroups.com, rootp...@googlegroups.com, Guillermo Rangel
Or it could be Root that is static linked against some funny version of c++

On Apr 18, 2013, at 11:59 PM, Christoph Deil <deil.ch...@googlemail.com> wrote:

Reply all
Reply to author
Forward
0 new messages