Compile python3 script with Cython | CentOs 6.x - python-3.x

I've previously compiled the script with cython on ubuntu and it works fine on all ubuntu os but it doesnt works on centos, it failes with this error: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory.
So I tried to compile the script on centos but when I try to compile the C source code generated by Cython with the following command gcc -Os -I /usr/include/python3.6m -o a.o script.c -lpython3.6m -lpthread -lm -lutil -ldl
I get this error script.c:4:20: error: Python.h: No such file or directory
script.c:6:6: error: #error Python headers needed to compile C extensions, please install development version of Python..
I've tried to install python3 dev libs but seems like they don't exist for CentOs 6, and search for someone who has the same problem but I haven't found anything usefull so far.
I think I can solve the issuse by installing python3-devel.

SOLUTION: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7
for centos 6 install ius repo like this:
yum install https://repo.ius.io/ius-release-el6.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm -y (source: https://ius.io/setup)

Related

Binaries are not executing after AFL installation in qemu mode

I have recently installed AFL and then its qemu mode, for which I required following packages.
'sudo apt-get install libtool automake bison libglib2.0-dev zlib1g-dev'
With these packages installed qemu installation worked fine. But after its installation whenever I tried to run binary with it, it generated AFL FORK SERVER HANDSHAKE FAILED error. I run my binary independently and it generated this error
cannot execute binary file: Exec format error.
I searched and found out this error is because of conflicting architectures which isn't in my case as I have build and run on same machine. Compiling with libtool also hasnot been a success libtool --mode=compile gcc -c one.c -o testlib.o.
I am also unable to execute any binary I create as default permissions are -rw-rw-r--, so I have to change their mods after creating them. This was not happening before above packages and installations. I even un-installed libtool but no success.
Any suggestions?
This has nothing to do with the libtool installation. I was making a silly mistake by using gcc -c test.c -o test.o which was not performing linking, see this. All I did is use command gcc test.c -o test.o and everything worked fine.

netinet/sctp.h: No such file or directory

I'm unable to include in any of my files. It always fails during compilation.
I got the lksctp-tools package installed.
I run
gcc -Wall -lsctp -o client admin.c deserializer.c input_parser.c main.c receive_response.c send_request.c serializer.c utils.c
And I get:
main.c:2:10: fatal error: netinet/sctp.h: No such file or directory
#include <netinet/sctp.h>
^~~~~~~~~~~~~~~~
compilation terminated.
I'm using Fedora, I don't know if that changes anything.
However the project seems to work fine on CLion.
On ubuntu need to install libsctp-dev.
sudo apt install libsctp-dev
ok turns out I had to do the following:
yum install lksctp-tools-dev
For Amazon Linux 2:
yum -y install lksctp-tools-devel

Compilation error for RISCV gcc when try to include -lcrypto

I am running openssl benchmarks on Ubuntu Linux. Initially, there was some problem with the missing library. Later I fixed it by installing the library with the installation command sudo apt-get install libssl-dev. When I compiled using gcc command gcc sha256t.c -o sha -lcrypto, it generates binary but when compiled using RISCV gcc command riscv64-unknown-elf-gcc sha256.S -o sha.riscv -lcrypto, it throws the following link error.
/home/user_name/fpga-zynq/rocket-chip/riscv-tools/riscv/lib/gcc/riscv64-unknown-elf/6.1.0/../../../../riscv64-unknown-elf/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status.
How to link the -lcrypto in this case.
You need a libcrypto compiled for the riscv64 architecture.
What you installed with sudo apt-get install libssl-dev is a libcrypto compiled for your host architecture (likely x86_64), it cannot be used for cross-compiling.
If you can't find a pre-built libcrypto for riscv64, you might have to compile it yourself, with that same riscv64 cross-compiler you're using.
Automating this is what yocto or buildroot is all about.

R package installation in Linux

I am trying to install a R package in Ubuntu using the following commands:
R CMD INSTALL rpart_4.1-5.tar.gz
install.packages("/home/rpart_4.1-5.tar.gz", repos = NULL, type="source")
* installing to library '/R/library'
* installing *source* package 'rpart' ...
** package 'rpart' successfully unpacked and MD5 sums checked
** libs
sh: make: command not found
ERROR: compilation failed for package 'rpart'
* removing '/R/library/rpart'
I have GCC 4.8.2 installed and the command gcc -v provides the following output:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/tools/stow/gcc-4_8_2-2.x86-64.linux.centos.5/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.8.2/configure --prefix=/mnt/gcc/buildir/gcc-4.8.2
Thread model: posix
gcc version 4.8.2 (GCC)
Last time I face the same issue, installing GCC (same version) solved it (posted a similar query on Stackoverflow on this topic). However, this time it is not working. Could someone please let me know what is causing this issue.
UPDATE: We are trying to manually install the dependencies to see if it works. We have installed Make and GCC 4.8.2:
However, I still get the following error:
* installing to library '/opt/vertica/R/library'
* installing *source* package 'rpart' ...
** package 'rpart' successfully unpacked and MD5 sums checked
** libs
cc -std=gnu99 -I/opt/vertica/R/include -DNDEBUG -I/usr/local/include -fpic -c anova.c -o anova.o
make: cc: Command not found
make: *** [anova.o] Error 127
ERROR: compilation failed for package 'rpart'
* removing '/opt/vertica/R/library/rpart'
Are there any other dependencies that we need to install apart from Make and GCC?
Your system doesn't have make utility for compilation.
Please execute following command to install make in your system.
sudo apt-get install build-essential
If you just do
sudo apt-get install r-base-dev
you all the key dependencies relevant for R package building which is what you want here. This includes the compiler, make etc as part of built-essential as well as specific libraries needed by R. There is a reason we created this package :)
If your machine does not have permanent internet access, look for previously-asked questions about "apt-get without internet access" etc.

trouble linking lapack

i am trying to link lapack and a simple
locate lapack
returns
/usr/lib64/liblapack.so.3
/usr/lib64/liblapack.so.3.2.1
so in am trying to link it with
gfortran -o linreg driver.f90 LFsubroutines.f90 -L/usr/lib64 -llapack -fimplicit-none
but i get the following error:
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -llapack
what is the problem here?
You don't have the liblapack.so or liblapack.a file there (maybe you didn't install dev(el) package). You may try specifying the complete path instead
gfortran -o linreg driver.f90 LFsubroutines.f90 /usr/lib64/liblapack.so.3 -fimplicit-none
Try installing the following packages if you don't have the devel packages installed already on your system.
sudo yum install libgfortran libf2c blas lapack
Give that a shot...

Resources