Building python external module using cygwin - windows

I am trying to build a python (2.7) module using cygwin:
D:\Python27\python.exe setup.py build -c cygwin
However I get the following error:
running build
running build_ext
building 'mod' extension
D:\cygwin64\bin\gcc.exe -mcygwin -mdll -O -Wall -ID:\Python27\include -ID:\Python27\PC -c my_mod.c -o build\temp.win32-2.7\Release\my_mod.o
gcc: error: unrecognized command line option '-mcygwin'
error: command 'D:\\cygwin64\\bin\\gcc.exe' failed with exit status 1
What does this mean? How do I fix it?

Related

ERROR: Could not build wheels for pymssql, which is required to install pyproject.toml-based projects In Mac M1

I`m using MacBook with M1 chip and seems like multiple things arent optimised for it.
pyodbc didnt work for me, so I wanted to use pymssql.
Though, I encountered this issue when I tried to run pip install pymssql.
The error is as below.
Using cached pymssql-2.2.2.tar.gz (170 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pymssql
Building wheel for pymssql (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
Your project path and someinfo about it.
Complete output (25 lines):
setup.py: platform.system() => Darwin
setup.py: platform.architecture() => ('64bit', '')
setup.py: platform.libc_ver() => ('', '')
setup.py: include_dirs => []
setup.py: library_dirs => []
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-3.9
creating build/lib.macosx-10.9-universal2-3.9/pymssql
copying src/pymssql/__init__.py -> build/lib.macosx-10.9-universal2-3.9/pymssql
running build_ext
cythoning src/pymssql/_mssql.pyx to src/pymssql/_mssql.c
cythoning src/pymssql/_pymssql.pyx to src/pymssql/_pymssql.c
building 'pymssql._mssql' extension
creating build/temp.macosx-10.9-universal2-3.9
creating build/temp.macosx-10.9-universal2-3.9/src
creating build/temp.macosx-10.9-universal2-3.9/src/pymssql
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/lakshayrohilla/SMS Project Files /cracs-backend/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/pymssql/_mssql.c -o build/temp.macosx-10.9-universal2-3.9/src/pymssql/_mssql.o -DMSDBLIB
src/pymssql/_mssql.c:682:10: fatal error: 'sqlfront.h' file not found
#include "sqlfront.h"
^~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
**ERROR: Failed building wheel for pymssql**
Failed to build pymssql
**ERROR: Could not build wheels for pymssql, which is required to install pyproject.toml-based projects**
On trying loads of solutions for fixing this issue, Seems like something worked out for me.
I`m providing the code below for solving this issue.
Important Note:
Change the path as per your system.
1. brew install freetds
2. brew install openssl
3. export LDFLAGS="-L/opt/homebrew/Cellar/freetds/1.3.3/lib -L/opt/homebrew/Cellar/openssl#1.1/1.1.1l_1/lib"
4. export CFLAGS="-I/opt/homebrew/Cellar/freetds/1.3.3/include"
5. pip install pymssql
Just run the above commands & it should solve your issue, as it worked out for me.
Running the following commands fixed my issue
$ brew install freetds openssl
$ echo 'export LDFLAGS="-L/opt/homebrew/opt/freetds/lib -L/opt/homebrew/opt/openssl#3/lib"' >> ~/.zshrc
$ echo 'export CFLAGS="-I/opt/homebrew/opt/freetds/include"' >> ~/.zshrc
$ echo 'export CPPFLAGS="-I/opt/homebrew/opt/openssl#3/include"' >> ~/.zshrc
$ source ~/.zshrc
$ pip3 install pymssql

Unable to build project for ESP32

I am trying to build project esp-obd-emulator I always get the following error, maybe someone can help me with that.
I am using esp-idf to build project.
C:\Users\edvar\Desktop\esp-idf-2\examples\emu>idf.py build
Checking Python dependencies...
Python requirements from C:\Users\edvar\Desktop\esp-idf-2\requirements.txt are satisfied.
Executing action: all (aliases: build)
Running ninja in directory c:\users\edvar\desktop\esp-idf-2\examples\emu\build
Executing "ninja all"...
[1/5] Performing build step for 'bootloader'
ninja: no work to do.
[2/3] Linking CXX executable emu.elf
FAILED: emu.elf
cmd.exe /C "cd . && C:\Users\edvar\.espressif\tools\xtensa-esp32-elf\esp-2019r2-8.2.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address -nostdlib #CMakeFiles\emu.elf.rsp -o emu.elf && cd ."
c:/users/edvar/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp32/libesp32.a(cpu_start.c.obj):(.literal.main_task+0x18): undefined reference to `app_main'
c:/users/edvar/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp32/libesp32.a(cpu_start.c.obj): in function `main_task':
C:/Users/edvar/Desktop/esp-idf-2/components/esp32/cpu_start.c:539: undefined reference to `app_main'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
esp-obd-emulator seems to not have been ported to ESP-IDF 2.0; it seems to still be using Make instead of CMake. Either compile this with an old version of ESP-IDF, or ask it to be updated to CMake.

Error installing devtools, dplyr,ggplot2 on R-devel 3.4.0 on Windows

I will submitting my package to CRAN. I have already built with R 3.2.4 and I now am trying to build on R-devel 3.4.0 before submitting to CRAN as required. I am having problems installing packages. I have installed Rtools33.exe for Windows. But I get an errors when installing the following packages - devtools, dplyr, ggplot2 etc. Here are the errors for devtools
> install.packages("devtools")
also installing the dependencies ‘mime’, ‘openssl’, ‘httr’, ‘memoise’, ‘digest’, ‘jsonlite’, ‘git2r’
* installing *source* package 'mime' ...
** package 'mime' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
d:/Compiler/gcc-4.9.3/mingw_32/bin/gcc -I"C:/software/R/R- DEVE~1/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O3 -Wall -std=gnu99 -mtune=core2 -c rawmatch.c -o rawmatch.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/gcc: not found
make: *** [rawmatch.o] Error 127
Warning: running command 'make -f "C:/software/R/R-DEVE~1/etc/i386/Makeconf" -f "C:/software/R/R-DEVE~1/share/make/winshlib.mk" SHLIB="mime.dll" OBJECTS="rawmatch.o"' had status 2
ERROR: compilation failed for package 'mime'
* removing 'C:/software/R/R-devel-Mar30/library/mime'
Warning in install.packages :
running command '"C:/software/R/R-DEVE~1/bin/x64/R" CMD INSTALL -l "C:\software\R\R-devel-Mar30\library" C:\Users\Ganesh\AppData\Local\Temp\Rtmpq4DzNw/downloaded_packages/mime_0.4.tar.gz' had status 1
Warning in install.packages :
installation of package ‘mime’ had non-zero exit status
* installing *source* package 'openssl' ...
** package 'openssl' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
"C:/software/R/R-DEVE~1/bin/i386/Rscript.exe" "../tools/winlibs.R"
d:/Compiler/gcc-4.9.3/mingw_32/bin/gcc -I"C:/software/R/R-DEVE~1/include" -DNDEBUG -I../windows/openssl-1.0.2d/include -I"d:/Compiler/gcc-4.9.3/local330/include" -O3 -Wall -std=gnu99 -mtune=core2 -c win32/ipv6.c -o win32/ipv6.o
d:/Compiler/gcc-4.9.3/mingw_32/bin/gcc: not found
make: *** [win32/ipv6.o] Error 127
Warning: running command 'make -f "Makevars.win" -f "C:/software/R/R- DEVE~1/etc/i386/Makeconf" -f "C:/software/R/R-DEVE~1/share/make/winshlib.mk" SHLIB="openssl.dll" OBJECTS="aes.o base64.o bignum.o cert.o envelope.o error.o hash.o info.o keygen.o onload.o openssh.o rand.o read.o rsa.o signing.o ssl.o stream.o write.o"' had status 2
ERROR: compilation failed for package 'openssl'
* removing 'C:/software/R/R-devel-Mar30/library/openssl'
Warning in install.packages :
running command '"C:/software/R/R-DEVE~1/bin/x64/R" CMD INSTALL -l "C:\software\R\R-devel-Mar30\library" C:\Users\Ganesh\AppData\Local\Temp\Rtmpq4DzNw/downloaded_packages/openssl_0.9.2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘openssl’ had non-zero exit status
* installing *source* package 'digest' ...
** package 'digest' successfully unpacked and MD5 sums checked
** libs
Similar errors regarding gcc occurs. Please let me know what needs to be done
Since R 3.4.0 is still in early development stages the errors are expected. This is the response I got from CRAN. As of now we need to build on a more stable R 3.3.0

Make error in caffe

Output for 'make all'
[root#parags-pc caffe]# make all
CXX src/caffe/layers/batch_norm_layer.cpp
CXX src/caffe/layers/sigmoid_layer.cpp
CXX src/caffe/layer.cpp
CXX src/caffe/layer_factory.cpp
CXX src/caffe/data_transformer.cpp
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
/usr/bin/ld: cannot find -lcblas
/usr/bin/ld: cannot find -latlas
collect2: error: ld returned 1 exit status
Makefile:544: recipe for target '.build_release/lib/libcaffe.so' failed
make: *** [.build_release/lib/libcaffe.so] Error 1
[root#parags-pc caffe]#
I have been trying to install caffe on fedora 21 with little success. On running the following make command I get the errors as given in the screenshot.
I have tried the following to fix this but have had no success.
[root#parags-pc caffe]# export LDFLAGS=-L/lib64/atlas/
[root#parags-pc caffe]# ld -lcblas --verbose
==================================================
attempt to open /usr/x86_64-redhat-linux/lib64/libcblas.so failed
attempt to open /usr/x86_64-redhat-linux/lib64/libcblas.a failed
attempt to open /usr/local/lib64/libcblas.so failed
attempt to open /usr/local/lib64/libcblas.a failed
attempt to open /lib64/libcblas.so failed
attempt to open /lib64/libcblas.a failed
attempt to open /usr/lib64/libcblas.so failed
attempt to open /usr/lib64/libcblas.a failed
attempt to open /usr/x86_64-redhat-linux/lib/libcblas.so failed
attempt to open /usr/x86_64-redhat-linux/lib/libcblas.a failed
attempt to open /usr/lib64/libcblas.so failed
attempt to open /usr/lib64/libcblas.a failed
attempt to open /usr/local/lib/libcblas.so failed
attempt to open /usr/local/lib/libcblas.a failed
attempt to open /lib/libcblas.so failed
attempt to open /lib/libcblas.a failed
attempt to open /usr/lib/libcblas.so failed
attempt to open /usr/lib/libcblas.a failed
ld: cannot find -lcblas
[root#parags-pc caffe]#
The contents of /lib64/atlas/ are as shown below I am not sure though if these are the required libraries.
[root#parags-pc caffe]# ls /lib64/atlas/
libsatlas.so.3 libsatlas.so.3.10 libtatlas.so.3 libtatlas.so.3.10
Google say's to make use of -L to link command. But I don't know which command should be used, how that command is to be used and which libraries should be linked.
I need help please. Thanks!
cd /lib64/atlas
sudo ln -s libtatlas.so /lib/libatlas.so
sudo ln -s libtatlas.so /lib/libcblas.so
The new Atlas ver3 is bundled with both atlas and cblas. Thus there is no need to include both of them separately.
Either you can follow the above method or remove calling the cblas library in your makefile.
I think the reason is you use make to compile, which makes caffe's python port only find libraries in this catalog. Maybe you use cmaketo compile and it could work.
$make clean
$cd caffe-master
$mkdir build
$cd build
$cmake ..
$make all -j8
I hope I could help you!

GODI-Batteries: Installation problems

I am trying to install godi-batteries using GODI console. I seem to have all dependencies sorted (like Camomile). I get the following error within Godi's interface:
> ocamlfind ocamlopt -shared -linkall -package camomile,num,str -o src/batteries_uni.cmxs src/batteries_uni.cmxa
> + ocamlfind ocamlopt -shared -linkall -package camomile,num,str -o src/batteries_uni.cmxs src/batteries_uni.cmxa
> ld: warning: -read_only_relocs cannot be used with x86_64
> ld: codegen problem, can't use rel32 to external symbol _caml_negf_mask in .L101 from src/batteries_uni.a(batFloat.o)
> collect2: ld returned 1 exit status
> File "caml_startup", line 1, characters 0-1:
> Error: Error during linking
> Command exited with code 2.
> make[7]: *** [all] Error 10
> Error: Exec error: File /Users/surikator/godi/build/godi/godi-batteries/./../../mk/bsd.pkg.mk, line 1039: Command returned with non-zero exit code
> Error: Exec error: File /Users/surikator/godi/build/godi/godi-batteries/./../../mk/bsd.pkg.mk, line 1378: Command returned with non-zero exit code
I'm using Mac OS X 10.6.4. and I have a 64 bit machine.
Any ideas on how to go around this?
Thanks,
Surikator.
For some reason, OSX OCaml can't build shared libraries. You'll have to disable batteries' building of shared libraries with
BATTERIES_NATIVE_SHLIB=no make
This problem has been fixed in git commit 92b323, and will be included in the next release.

Resources