I'm trying to install pygame with cygwin with the step by step below
http://msdl.cs.mcgill.ca/people/tfeng/svmsccdoc/node49.html
Things are going fine until the last part when I'm running theses 3 lines
export LIBRARY_PATH=/usr/local/lib:$LIBRARY_PATH
export CPATH=/usr/local/include/SDL:$CPATH
python setup.py install build
I have this issue
gcc -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration - fdebug-prefix-map=/usr/src/ports/python/python-2.7.8-1.i686/build=/usr/src/debug/python-2.7.8-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.8-1.i686/src/Python-2.7.8=/usr/src/debug/python-2.7.8-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/NEED_INC_PATH_FIX -I/usr/include/python2.7 -c src/imageext.c -o build/temp.cygwin-1.7.33-i686-2.7/src/imageext.o
src/imageext.c:35:21: erreur fatale: jpeglib.h : No such file or directory
#include <jpeglib.h>
As you can see, the file jpeglib.h is missing
I tried to install the missing file by downloading the lib
apt-cyg install libjpeg62
But to no avail
Does anyone have seen that issue before? I browsed the net but found nothing relevant.
TIA
libjpeg62 doesn't have jpeglib.h. You need libjpeg-devel instead.
You can search for specific files in packages using the package search function on the Cygwin website.
You can download an already compiled version of PyGame and skip these steps. This can be painful sometimes.
Just check this page : http://www.lfd.uci.edu/~gohlke/pythonlibs/
or
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame , to get directly to PyGame section.
The Python extension unofficial windows binaries. You can find alot of Python libraries on this page.
Using theses packages will make you save a lot of time.
Related
I'm working on a project for my graphics class, which the professor provided the base code. He coded it up with our lab computers (Ubuntu 16.04 LTS) in mind. I wanted to work on this project from my own computer at home, but I cant seem to figure out how to run it.
I do know the Makefile he gave us is specific to the lab computers, once again, but I'm not skilled enough to figure out how to alter it for a macOS.
Makefile
CPP = g++ -std=c++11
INC = -I../glslutil -I../mvcutil -I.
C_FLAGS = -fPIC -g -c -DGL_GLEXT_PROTOTYPES $(INC)
LINK = g++ -fPIC -g
LOCAL_UTIL_LIBRARIES = ../lib/libglsl.so
GL_LIB_LOC = -L/usr/lib/nvidia-375
GL_LIBRARIES = $(GL_LIB_LOC) -lglfw -lGLU -lGL
OBJS = project1.o ModelView.o Controller.o GLFWController.o
project1: $(OBJS) $(LOCAL_UTIL_LIBRARIES)
$(LINK) -o project1 $(OBJS) $(LOCAL_UTIL_LIBRARIES) $(GL_LIBRARIES)
../lib/libglsl.so: ../glslutil/ShaderIF.h ../glslutil/ShaderIF.c++
(cd ../glslutil; make)
project1.o: project1.c++
$(CPP) $(C_FLAGS) project1.c++
ModelView.o: ModelView.h ModelView.c++
$(CPP) $(C_FLAGS) ModelView.c++
Controller.o: ../mvcutil/Controller.h ../mvcutil/Controller.c++
$(CPP) $(C_FLAGS) ../mvcutil/Controller.c++
GLFWController.o: ../mvcutil/GLFWController.h
../mvcutil/GLFWController.c++
$(CPP) $(C_FLAGS) ../mvcutil/GLFWController.c++
Although, I'm not even sure that's the problem. I just want to see the graphics on my laptop! :) I appreciate any help!
Overall, I would like to see something similar to this on my mac.
My errors when compiling on my mac.
I, personally, wouldn't go that way, unless you really have to.
I'd go a different path:
download VirtualBox from here: https://www.virtualbox.org/wiki/Downloads
download Ubuntu 16.04 LTS: http://releases.ubuntu.com/16.04/ubuntu-16.04.3-desktop-amd64.iso
ask your teacher what exact packages does he use for the class
install Ubuntu 16.04 inside VirtualBox
install all packages required by your teacher
use VirtualBox installation for this particular class
This way, you will save lots of time and effort.
I suspect this is going to be rather hard to do, and this is only a partial answer, so maybe some other kind folk will know how to do the other half, or 80% - not even sure how much I am missing.
The Makefile looks like it is using glslang and glfw and some Nvidia library. To get some of those packages on a Mac, you would need to:
install Xcode - start AppStore, find and download Xcode for free
install Command Line Tools with xcode-select --install in Terminal
install homebrew - goto Homebrew website
Then you could search for your packages with
brew search glfw
brew search glslang
Then you can find out what the packages are with:
brew info glfw
Sample Output
glfw: stable 3.2.1 (bottled), HEAD
Multi-platform library for OpenGL applications
http://www.glfw.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/glfw.rb
==> Dependencies
Build: cmake ✘
==> Options
--with-examples
Build examples
--with-test
Build test programs
--without-shared-library
Build static library only (defaults to building dylib only)
--HEAD
Install HEAD version
Then install it with:
brew install glfw
You will still probably have a load of problems and I cannot find the Nvidia stuff... maybe someone else can add more help.
I want to install xgboost using anaconda python. In this process, I am trying to install xgboost. While trying to "make" the xgboost i am getting the below error:
C:\GitRepository\xgboost>
g++ -m64 -c -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -fopenmp -fPIC
-o updater.o src/tree/updater.cpp
src/tree/updater.cpp:1:0: warning: -fPIC ignored for target (all code is positio
n independent)
// Copyright 2014 by Contributors
^
src/tree/updater.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in
make: *** [updater.o] Error 1
I understood from the other Stack overflow posts that 32 bit gcc cannot go with the 64bit anaconda that i am using. However when i installed mingw-w64 i could see that it has g++ only for mingw32 and not for mingw-w64. Under the mingw-w64 package, g++ and other applications+folders are present only for mingw32 and not for 64. For mingw-64 only a batch file and a internet short cut is present.
Could you please guide me what is going wrong or guide me to an appropriate place from where i can download for mingw-64.
Thanks in advance.
If you are really using MSYS2, then you should not be downloading separate compilers. You should install 64-bit g++ using MSYS2's package manager, by running pacman -S mingw-w64-x86_64-toolchain. Then make sure that you start the MSYS2 shell using the shortcut that is named something like "MSYS2 Win64 Shell" in your start menu. Type which g++ in Bash and make sure it outputs /mingw64/bin/g++. Then you should be able to compile code for 64-bit Windows.
I'm not sure that this answer is complete. If you need more help with MSYS2, it would be good to post the exact commands you are running to download/extract the source code and build so that others can reproduce the error.
Installed cygwin64, including Python 2.7, on my new computer running Windows10.
Python runs fine, adding modules like matplotlib or bitstream goes fine, but when trying to add scipy the build eventually, after about an hour, having successfully compiled lots of fortran and C/C++ files, fails with:
error: Setup script exited with error: Command "g++ -fno-strict-aliasing -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/build=/usr/src/debug/python-2.7.10-1 -fdebug-prefix-map=/usr/src/ports/python/python-2.7.10-1.x86_64/src/Python-2.7.10=/usr/src/debug/python-2.7.10-1 -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/include/python2.7 -I/usr/lib/python2.7/site-packages/numpy/core/include -Iscipy/spatial/ckdtree/src -I/usr/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c scipy/spatial/ckdtree/src/ckdtree_query.cxx -o build/temp.cygwin-2.2.1-x86_64-2.7/scipy/spatial/ckdtree/src/ckdtree_query.o" failed with exit status 1
I've tried both pip install and easy_install, both result in the same error.
Greatful for any hints on what to try next.
I suffered for days with the same issue. My final solution was to install scipy0.15.1: pip install scipy==0.15.1. Hope it works for you too.
I found this while looking for a solution to the same problem but I could not downgrade to 0.15.1 as suggested because of 1.16 dependencies.
The problem is related to infinity having been defined twice in the official v0.16.1 but it only seems to cause issues for a couple platforms.
It was fixed in this commit. https://github.com/scipy/scipy/commit/832baa20f0b5
You should be able to download and compile the master branch from here on cygwin: https://github.com/scipy/scipy
I just finished installing numpy,scipy,scikit-learn,theano on cygwin.
I would like to call C++ functions in python which return uBLAS vector/matrices.
There is a package to do this called PyUblas,
but am having trouble getting this to work in Ubuntu.
Can anyone walk me through the steps to get this sample to work?
Also, I am somewhat confused with the installation instructions. I did not follow the instructions to install boost and numpy since I have already installed them from the Ubuntu repositories.
I guess that wasn't so hard. Here's what I did to run the small sample on the website and in test/samply.py.
After downloading and unpacking PyUblas, and having the necessary libraries installed, cd into PyUblas-VERSION
./configure.py --help
./configure.py --some-options
sudo python setup.py install
cd test/
g++ -I/usr/include/python2.7 -fPIC -g -fpic -shared sample_ext.cpp -lboost_python -lpython2.7 -o sample_ext.so
python sample.py
It's going to be difficult to help without knowing what exactly your issues are. My first guess if the tests aren't working would be that your config file is not pointing to the right directories/files.
I'm following this tutorial on how to extend Python with C\C++ code.
The section named "Building the extension module with GCC for Microsoft Windows" fails for me with the following error:
fatal error: Python.h: No such file or directory
The section named "Building the extension module using Microsoft Visual C++" also fails with a similar error:
fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
What should I do to solve this?
For Linux, Ubuntu users to resolve the issue of missing Python.h while compiling, simply run the following command in your terminal to install the development package of python:
In Terminal: sudo apt-get install python-dev
Good luck
Do you have the python dev files so that you can find Python.h?
Do you have the location of Python.h specified to your compiler? with gcc this is usually done through a -I path to include.
Figuring out which of those is failing will solve your problem.
from the article you linked:
gcc -c hellomodule.c -I/PythonXY/include
gcc -shared hellomodule.o -L/PythonXY/libs -lpythonXY -o hello.dll
They assumed you installed python in the default location c:\pythonXY(Where X is the major version number and Y is the minor version number).(in your case Python26) If you put python somewhere else replace /PythonXY with where ever you installed it.
The Python official documentation has already made it clear. Check it out here
The header files are typically installed with Python. On Unix, these are located in the directories prefix/include/pythonversion/ and exec_prefix/include/pythonversion/, where prefix and exec_prefix are defined by the corresponding parameters to Python’s configure script and version is '%d.%d' % sys.version_info[:2]. On Windows, the headers are installed in prefix/include, where prefix is the installation directory specified to the installer.
To include the headers, place both directories (if different) on your compiler’s search path for includes. Do not place the parent directories on the search path and then use #include ; this will break on multi-platform builds since the platform independent headers under prefix include the platform specific headers from exec_prefix.
And they have provided a convenient way to get the correct cflags that we should pass to compiler. here
So for example, here is what I got after running the command
root#36fd2072c90a:/# /usr/bin/python3-config --cflags
-I/usr/include/python3.5m -I/usr/include/python3.5m -Wno-unused-result -Wsign-compare -g -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
Pass those flags to the compiler, and it will work.