-
Notifications
You must be signed in to change notification settings - Fork 7
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
Python package #1
Comments
Hi Raphael, Can you please let me know which exact version of g++ are you using? In addition, please try using the
Try also with I'll make a point on adding a bit of documentation about this additional environment variable. |
Hi, Thanks, that has got me a bit further, I was trying to edit the environment variable using os.environ(). My g++ version is I think the most recent version of clang: mps017431:examples rs548$ g++ -v I have just moved over to a mac so am a bit inexperienced I'm afraid. It now throws these two warnings but then seems to have installed correctly: Using -std=c++11 to enable C++11 support but then when I run python usage.py in examples I get the following: Traceback (most recent call last): Many thanks for your help. I aim to extend your code to fitting two galaxy profiles in blended images so will eventually be wanting to add a c++ class. I have included the full output from setup.py below incase it is helpful. Best regards, Raphael. mps017431:pyprofit rs548$ CC=g++ PYPROFIT_CXX11="-std=c++11" python setup.py install Installed /Users/rs548/anaconda/lib/python3.5/site-packages/pyprofit-1.0-py3.5-macosx-10.6-x86_64.egg |
Hi Raphael, Thanks for the information. The compilation warnings are fine, and the module indeed compiled successfully, so the original problem I would say it is fixed, and I'm closing this ticket accordingly. You were using g++ which is usually the name for the GNU C++ compiler, so I thought you were using that one. If you keep using clang, use cland/clang++ for compiling C/C++ programs. Maybe that would have picked up the correct standard automatically already. Regarding the new problem, I'll create a second ticket to record it. I've seen this issue before elsewhere and I think I have an idea of what might be causing it. On a final note, if you are actually planning to work mostly on C++ you might want to use libprofit (ICRAR/libprofit repository) directly instead of pyprofit, which simply wraps libprofit. |
Great, thanks. I wondered if there might be python 3 issue. We may decide to use c++ but plan on possibly using some old python code and python is our preferred code here for development. Thanks again for your help. Best, Raphael. |
Hello,
Thank you very much for making this software available. I am trying to use the software with a view to applying it to galaxy deblending problems we are working on at the University of Sussex Astronomy Centre.
I am struggling to install the python package using 'python setup.py install' which throws the following error:
/var/folders/zx/nzb1wy_d0yj1g8wznhz1ns68000930/T/tmplanbqx8y.cpp:4:21: error: cannot deduce type of initializer list because
std::initializer_list was not found; include <initializer_list>
for(auto i: {0,1,2}) {
^
1 error generated.
/var/folders/zx/nzb1wy_d0yj1g8wznhz1ns68000930/T/tmplanbqx8y.cpp:4:21: error: cannot deduce type of initializer list because
std::initializer_list was not found; include <initializer_list>
for(auto i: {0,1,2}) {
^
1 error generated.
/var/folders/zx/nzb1wy_d0yj1g8wznhz1ns68000930/T/tmplanbqx8y.cpp:4:13: warning: 'auto' type specifier is a C++11 extension
[-Wc++11-extensions]
for(auto i: {0,1,2}) {
^
/var/folders/zx/nzb1wy_d0yj1g8wznhz1ns68000930/T/tmplanbqx8y.cpp:4:19: warning: range-based for loop is a C++11 extension
[-Wc++11-extensions]
for(auto i: {0,1,2}) {
^
/var/folders/zx/nzb1wy_d0yj1g8wznhz1ns68000930/T/tmplanbqx8y.cpp:4:21: error: cannot deduce type of initializer list because
std::initializer_list was not found; include <initializer_list>
for(auto i: {0,1,2}) {
^
2 warnings and 1 error generated.
No C/C++ compiler with C++11 support found. Use the CC environment variable to specify a different compiler if you have one
Using None to enable C++11 support
It is clearly a c++ compiler problem. I seem to be able to compile the test code in the setup.py file using g++ on a mac with 'g++ -std=c++ main.cpp' but when that is run in setup.py it throws the error after setting the CC envirnoment variable to g++.
Do you have any suggestions for fixing this problem. I get the same errors when I try to use pip.
Sorry if I'm doing something stupid.
Best regards,
Dr Raphael Shirley
University of Sussex
raphael.shirley@sussex.ac.uk
The text was updated successfully, but these errors were encountered: