-
Notifications
You must be signed in to change notification settings - Fork 179
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
cc: No valid input files specified, no output generated #927
Comments
This is certainly the correct place. The first thing that we need to address is what is the official compiler for Python on sun? I assume it is CC but it has been years since I used a sun system. There is a requirement that all Python modules use the same compiler (or variant of in the case of C++). If our platform is gcc then using the vendor compiler would be a bad start. There are ways to get this both from command line and also from internal Python module variables. https://stackoverflow.com/questions/15350780/how-to-check-which-compiler-was-used-to-build-python The makefile that we build with |
Hello again Thrameos, Checking the compiler for python from the link you provided returns:
Calling the interpreter returns
Seeing it's just C, would that be cc? Which I believe is the c compiler for Solaris. Some more details about my attempt at compiling with CC: For starters,I tried removing -std=c99 from the command, and I also set every include to the full path. My thought process was that the include file was cpp, while "cc" is a the C compiler (not CPP). This was the output/command i'm currently working with:Should I go back to cc? The errors make me think it's compatibility issues going from dos to unix. Side note, I did try fixing a few by the time I did this run. Adding a new line does make these go away. Not sure about the
One additional detail, since you mentioned the systems python this might be relevant.The system has Python 3.5.2 installed by default for python3. I also have a python 3.8.0 directory, and debated trying the compile with that in the path instead. |
Compiler
WarningsThe warnings are just about unterminated lines. This isn't a dos or unix issue. It is simply that the files were formatted without a newline at the end which appears to be a warning for this compiler. I believe those are safe to ignore. ErrorsThe errors indicate that CC does not recognize the C++ keyword "override" https://en.cppreference.com/w/cpp/language/override
Looking over the docs for Developer Studio 12.4 it seems like adding https://docs.oracle.com/cd/E37069_01/html/E37071/gndfg.html Of course having once been a sysadmin for sun and HPUX machines I know that frequently vendors are misleading about the level of compliance. If that is the case then you would have to try adding AdviceUnfortunately you are diving into deep water. Porting to a new compiler is usually non-trivial. The expected errors will be one of
I am not saying "Abandon all hope all ye who enter here" but there is a non-trivial possibility that you could start the porting work and get to point that is very challenging to proceed. Depending on your level of technical comfort it may not be worth your effort. As a programmer with 25 years of experience I have been outside by comfort zone at times and taken weeks to find nasty compatibility bugs. That said I will try my best to advise you on these issues as porting to other platforms is always appreciated. I just can't guarantee success. |
I'm struggling, but I like to think I/we have gotten somewhere. I'm not quite 25 years of experience, but I am grateful for all your help. From what you mentionedI tried adding --std=c++11, but it still failed (Showed the same override errors) Re/defining the override in the jype header file allowed the command to run with zero errors (Just the warnings we discussed). Trying to force setup.py to use CC/GCCI tried using Here is the output of CC working manually in the terminal:
I am looking into getting gcc installed on the system.It looks like Developer Studio 12.6 (What is installed on the system) is the latest Oracle has to offer. Would I need to do something in particular with python3 in order to make the compilation work against gcc instead of cc/CC? |
Manual buildIf you can get it to compile without errors, then just edit the makefile, call make, and it will build the module. Typically you will find the resulting module under Getting setup.py to use settingsThe compiler is typically controlled by the setuptools/distutils that come with Python. They have a lot of options and such, but the documentation is often so bad that I end up having to go read the source code until I figure out how they intended for it to work. Your guess on setting cc=CC seems very reasonable but you have to get into build_ext in distutils (and the patches that get added in setuptools) to see what env variable it pulls. It is a real pain because you have to read through the layering caused by the distutils, distutils/ccompiler, distutils/unixcompiler.py, setuptools/*, and then the project copy (setupext/build_ext). But if you got it to a makefile and got it working once I can likely guide you how to alter platform.py to make that the default for the system. https://docs.python.org/3/extending/building.html My guess is the the export cc is only used for C compilation and that Python looks at a different variable for C++ compilation. As this is challenging I will show you how I go about it... Starting from distutils lets grep for "cc" which takes us to this section. From unixcompiler.py
So now we know that there is a map which has the default "compiler_cxx" so lets grep again to see where it interacts with environ calls. This leads us to sysconfig.py
(You would then have to trace down set_executables and so forth if we wanted to understand the whole process, but I think we have our answer) So you need to use Using gccYou shouldn't have any issue using gcc so long as your Python was also compiled with the same compiler tools. Mixing and matching usually gives less that desirable results as ABIs do not mix unless they are pure C code. Of course that depends on figuring out how to get Python to compiler with a different compiler. |
I wanted to let you know I was able to get this to compile on Solaris. I ended up having to get cc installed. Eventually I needed another package installed on the system and it wound up in IT while I waited for them to install it. I tried again today and was able to compile and import Jpype! Thank you for all your help Thrameos! |
I hope this is the correct place to post Jpype compile issues like this, if not I am all ears and will move this ASAP.
Bit of Background
I sent a pull request a few days ago in regards to having sunos in the platform.py file.
Now that I have cc installed, I am able to use that update. I put print statements in those lines to see that they were working that's the "SUN OS Detected" output.
Issue/Error
I am running into an issue with the _jpype module compiling, giving the following error:
What I have done
I did some research, and was only able to find this post. Unfortunately, I was unable to tell if my issue was similar.
I tried creating my own Makefile with:
python setup.py build_ext --makefile
and even after changing the line endings to LR, instead of CRLR. I was still unable to compile. I stopped, for fear I was getting into the weeds.
System Info
uname -a returns:
SunOS krowvin 5.11 11.4.5.3.0 sun4v sparc sun4v
My version of cc that I am using is: Developer Studio 12.6
You can see at the end I tried manually running the command with CC (the C++ compiler for Solaris.
Terminal Output
The text was updated successfully, but these errors were encountered: