Can't compile cx_Freeze on a Python built from source - python-3.x

Here's my situation. I'm trying to package a game for Linux (on Ubuntu 13.04) written in Python 3.3 via cx_Freeze. Fine. I installed it via sudo apt-get install cx-freeze. Even though it installed, it didn't show up. So it's the Python 2 version. Fine. I then downloaded the source code from the website and tried to compile it with python3 ./setup.py build. This is where things fall apart. I get this error from the compiler:
/usr/bin/ld: cannot find -lpython3.3
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
I'm using Python 3.3.2, which I compiled from source. Any tips?

Reposting as an answer:
In general, I'd recommend using the Python packages from your distribution, which are already compiled in a way that cx_Freeze can work with. In Ubuntu, you can install python3 and python3-dev.
If you need to compile your own Python interpreter, then you'll need to compile it with a shared library, like this:
./configure --enable-shared
There are more instructions on compiling in the CPython devguide.

Related

Compiling Rust with pcap in Alma Linux

I'm trying to run a rust program that I've been using on Ubuntu on an AlmaLinux distro.
It utilizes the pcap crate, which is installed.
When I try to compile the application, I'm getting a
/user/bin/ld: cannot find -lpcap
collect2: error: ld returned 1 exit status
My initial thought was that libpcap was not installed on this machine, but in fact, it is. I've uninstalled and reinstalled it just in case there was something wrong with the initial install.
Any ideas on what could be wrong?
You need to install pcap with lib and header, on AlmaLinux this mean devel package. You can use https://pkgs.org/search/?q=pcap to search what packet you need to install, on your case probably https://almalinux.pkgs.org/9/almalinux-crb-x86_64/libpcap-devel-1.10.0-4.el9.i686.rpm.html. This package require you activate CRB repository, see doc https://wiki.almalinux.org/repos/AlmaLinux.html.
dnf config-manager --set-enabled crb
dnf install libpcap-devel

Problems between fftw-2.1.5 libraries and OpenMPI

I am trying to install the MPI FFTW2 libraries (fftw2.1.5) as I need them for a program that only works with that version. The specific library I need is "drfftw_mpi.h" so I try the followed:
./configure --enable-mpi --enable-type-prefix
But it always gives me the following error:
configure: error: couldn't find mpi library for --enable-mpi
In a previous question they solve it by running sudo ldconfig before, but for me it does not work giving the same error. For other mpi software they solve it in this post by passing mpicc as the right compiler to ./configure, with the CC flag CC=mpicc, something that does not work for me.
I have installed Open MPI version 4.0.3 on a Ubuntu 20.04 LTS, and when --enable-mpi is not used I was able to install "dfftw.h" "drfftw.h" "fftw.h" and "rfftw.h", do you have an idea of what I am doing wrong or what should I do to install "drfftw_mpi.h"?

Unable to get python include path python executable for GalSim

I am trying to install (update) my local version of GalSim software on Ubuntu 14.04 by running SCons. I have all the dependencies (boost, TMV etc.) installed and have used it for quite a while now. I use Python2.7. But now, when I run scons from the terminal, I get the following error:
scons: Reading SConscript files ...
SCons is version 2.3.0 using python version 2.7.6
Python is from /usr/include/python
Using the following (non-default) scons options:
PYPREFIX = /usr/lib/python2.7/dist-packages/
TMV_DIR = /media/arunkannawadi/Acads_CMU/Cosmology/WFIRST_Project/tmv0.72/
These can be edited directly in the file gs_scons.conf.
Type scons -h for a full list of available options.
Using python = /usr/bin/python
Using compiler: /usr/bin/g++
compiler version: 4.8.2
Determined that a good number of jobs = 4
Checking for C++ header file fftw3.h... yes
Checking for correct FFTW linkage... yes
Checking for boost header files... yes
Boost version is 1.54.0
Checking for C++ header file TMV.h... yes
TMV version is 0.72
Using TMV_LINK file: /media/arunkannawadi/Acads_CMU/Cosmology /WFIRST_Project/tmv0.72/share/tmv-link
-ltmv -lblas -lgfortran -lpthread -fopenmp
Checking for correct TMV linkage... (this may take a little while)
Checking for correct TMV linkage... yes
Checking if we can build against Python...
Unable to get python include path python executable:
/usr/bin/python
Please fix the above error(s) and rerun scons.
Note: you may want to look through the file INSTALL.md for advice.
Also, if you are having trouble, please check the INSTALL FAQ at
https://github.com/GalSim-developers/GalSim/wiki/Installation%20FAQ
The output of which python is /usr/bin/python and the output of python --version is Python 2.7.6.
Upon further investigation, this question is not about GalSim per se, but rather points out an oddity of later Ubuntu versions.
After going over the config.log file from the failed installation (not posted here), it became apparent that the tests of the installation were passing, but there was a failure in parsing the outputs of those tests. The error message was
sh: 1: Syntax error: Bad fd number
A search pointed me to this other question about that error message:
sh: Syntax error: Bad fd number
which points out that that in Ubuntu 11.x /bin/sh is linked to /bin/dash and not to bin bash. So, the fix for this apparent problem with GalSim installation is to use the solution on that page to correctly link /bin/sh to bash.

Cannot compile an OS for ARM on OSX

Github page for the OS is here: https://github.com/rellermeyer/course_os
From the wiki in the Github page, it indicates me to install glib and texinfo. It also indicates me how to build the toolchain.
On my first attempt at building, it told me I needed wget and I installed using HomeBrew. When issuing the command $ brew list, I get:
$ brew list
cloog018 glib make postgresql wget
coreutils gmp4 mpfr2 python
gcc48 isl011 openssl readline
gdbm libffi ossp-uuid sqlite
gettext libmpc08 pkg-config texinfo
Which shows me I have everything I need. However, on the second attempt it gives me an error:
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: Systems/course_os/toolchain/arm-none-eabi
checking build system type... Invalid configuration `Systems/course_os/toolchain/arm-none-eabi': machine `Systems/course_os/toolchain/arm-none' not recognized
configure: error: /bin/sh ../../src/gcc-4.8.1/config.sub Systems/course_os/toolchain/arm-none-eabi failed
I don't understand the warning and what it is it's missing. Additionally, when I try to do the same steps with Ubuntu, it runs perfectly and I'm able to go on to building the kernel and run Hello World. What does Ubuntu have that OSX doesn't that makes the OS run? Could it be an issue with gcc?
Note: I'm running OSX Yosemite 10.10 and Ubuntu 14.04.
I found an answer to my problem. There was an issue with one of my target folders being two words. I changed it from Operating System to OS and it ran perfectly. Thanks!

Trying to compile linux build of project, cannot find library

I am trying to build a project written in c++ on Linux Mint 16, using...
make -f ./Makefile
and I keep getting this error
/usr/bin/ld: cannot find -ludev
collect2: error: ld returned 1 exit status
make: *** [BINARY] Error 1
I was getting a lot more of the /usr/bin/ld: cannot find -foo, but I checked in my Makefile and, using the synaptic package manager, installed all the other necessary libraries, eliminating all but this error. I cant seem to find it anywhere, although perhaps I am not looking in the right places.
Thanks.
I had the some problem, right after updating to Linux Mint 17.1. I was trying to build an application with Qt 5 serial port module. Solved by installing: libudev-dev .
try:
sudo apt-get install udev
I don't know how to do that in synaptic, but it should be easier, right?

Resources