Build Tensorflow iOS with env_time.cc:19:10: fatal error: 'windows.h' file not found - c++

I tried to build Tensorflow iOS on El Capitan and got into many errors. I have followed the changes in https://github.com/tensorflow/tensorflow/pull/3382/files and https://github.com/tensorflow/tensorflow/pull/2936/files#r67559693 until I get to this error when running tensorflow/contrib/makefile/build_all_ios.sh:
gcc --std=c++11 -I. -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/downloads/ -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/downloads/eigen -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/downloads/gemmlowp -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/gen/host_obj/ -I/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/gen/protobuf-host/include -I/usr/local/include -c tensorflow/core/platform/windows/env_time.cc -o /Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/gen/host_obj/tensorflow/core/platform/windows/env_time.o
tensorflow/core/platform/windows/env_time.cc:19:10: fatal error: 'windows.h' file not
found
#include <windows.h>
^
1 error generated.
make: *** [/Users/myusername/tfv1/tensorflow/tensorflow/contrib/makefile/gen/host_obj/tensorflow/core/platform/windows/env_time.o] Error 1
+ '[' 2 -ne 0 ']'
+ echo 'armv7 compilation failed.'
armv7 compilation failed.
+ exit 1
Does anyone know how to get pass that? I am assuming it's trying to build for Windows on Mac.

I simply solved the problem by deleting everything and started from scratch with these:
brew install bazel
brew install automake
brew install autoconf
brew uninstall libtool && brew install libtool
git clone https://github.com/tensorflow/tensorflow
tensorflow/contrib/makefile/download_dependencies.sh
tensorflow/contrib/makefile/build_all_ios.sh

Related

make: *** [port-target] Error 2 When trying to install GDAL for GeoDjango using Ubuntu 18.04

I am trying to install GeoDjango to use in my project. I am using Ubuntu 18.04 through VirtualBox. I am also using the GeoDjango installlation Guide to install Gdal. I have GEOS and PROJ.4 installled.
I have successfully run the below commands :
$ wget http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz #success
$ tar xzf gdal-1.11.2.tar.gz #success
$ cd gdal-1.11.2 #success
Later I am supposed to do the below (according to the documentation):
$ ./configure
$ make # Go get some coffee, this takes a while.
$ sudo make install
$ cd ..
However, when I run these lines:
$ ./configure #success
$ make # Go get some coffee, this takes a while. #ERROR SEE BELOW
I get the below error:
samir#samir-VirtualBox:~/gdal-1.11.2$ make # Go get some coffee, this takes a while.
(cd port; make)
make[1]: Entering directory '/home/samir/gdal-1.11.2/port'
/bin/bash /home/samir/gdal-1.11.2/libtool --mode=compile --tag=CXX g++ -std=c++98 -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DOGR_ENABLED -I/home/samir/gdal-1.11.2/port -I../frmts/zlib -DHAVE_LIBZ -c -o cpl_error.lo cpl_error.cpp
libtool: compile: g++ -std=c++98 -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DOGR_ENABLED -I/home/samir/gdal-1.11.2/port -I../frmts/zlib -DHAVE_LIBZ -c cpl_error.cpp -fPIC -DPIC -o .libs/cpl_error.o
cpl_error.cpp: In function 'void CPLErrorV(CPLErr, int, const char*, __va_list_tag*)':
cpl_error.cpp:190:20: error: incompatible types in assignment of '__va_list_tag*' to 'va_list {aka __va_list_tag [1]}'
wrk_args = args;
^~~~
cpl_error.cpp:226:24: error: incompatible types in assignment of '__va_list_tag*' to 'va_list {aka __va_list_tag [1]}'
wrk_args = args;
^~~~
../GDALmake.opt:568: recipe for target 'cpl_error.lo' failed
make[1]: *** [cpl_error.lo] Error 1
make[1]: Leaving directory '/home/samir/gdal-1.11.2/port'
GNUmakefile:53: recipe for target 'port-target' failed
make: *** [port-target] Error 2
Below is a Screenshot of the error. so you can see it in color
How can I resolve this error ?
Please make sure you have ubuntu installed on your computer. If you
are using windows, install VirtualBox and download Ubuntu (Its a Linux
OS). You might have to do a basic course on Ubuntu either on YouTube
or Udemy then do
sudo apt install geos
sudo apt install proj4
sudo apt install gdal
sudo-apt install postgressql
sudo-apt install till postgis
that's it.. you are done as simple as that..
then download pgadmin3 (pgadmin4 is not available on ubuntu at the
time of this comment)
make the database on pgadmin3 (its way simpler than psql)
In your Virtual Env do
pip install dj-database-url
pip install psycopg2
pip install pillow
I suffered 2 weeks figuring this out.. Hopefully you don't have to
Trying this on Windows is next to impossible. Don't follow the
GeoDjango documents for installing GeoDjango with make and
make-install as that is very difficult.

gRPC installation fails at "make"

I am following the Built From Source instructions to install grpc
$ git clone -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc
success
$ cd grpc
success
$ git submodule update --init
success
$ make
fails after building a few source files
third_party/boringssl/crypto/rand/urandom.c:62:2: error: #error "system call number for getrandom is not the expected value"
#error "system call number for getrandom is not the expected value"
^
In file included from /usr/include/x86_64-linux-gnu/sys/syscall.h:31:0,
from third_party/boringssl/crypto/rand/urandom.c:32:
third_party/boringssl/crypto/rand/urandom.c: In function ‘init_once’:
third_party/boringssl/crypto/rand/urandom.c:128:15: error: ‘__NR_getrandom’ undeclared (first use in this function)
syscall(SYS_getrandom, &dummy, sizeof(dummy), GRND_NONBLOCK);
^
third_party/boringssl/crypto/rand/urandom.c:128:15: note: each undeclared identifier is reported only once for each function it appears in
third_party/boringssl/crypto/rand/urandom.c: In function ‘fill_with_entropy’:
third_party/boringssl/crypto/rand/urandom.c:258:21: error: ‘__NR_getrandom’ undeclared (first use in this function)
r = syscall(SYS_getrandom, out, len, 0 /* no flags */);
^
Makefile:2564: recipe for target '/home/usrnm/grpc/objs/opt/third_party/boringssl/crypto/rand/urandom.o' failed
make: *** [/home/usrnm/grpc/objs/opt/third_party/boringssl/crypto/rand/urandom.o] Error 1
OS: Linux 4.4.0-0 SMP Debian 4.4.16-1
GCC version: gcc (Debian 4.9.2-10) 4.9.2
I couldn't find any open issues or any help about this error on the internet.
You might have better luck without the embedded BoringSSL. Try building with:
EMBED_OPENSSL=false make
If you get errors about missing packages, make sure you have libssl-dev installed.
The problem seems to happen while compiling boringssl . We use the version given by $ git submodule, which at the time of this writing is be2ee342d3781ddb954f91f8a7e660c6f59e87e5 third_party/boringssl (version_for_cocoapods_7.0-526-gbe2ee342). Are you able to compile boringssl on its own?

Error while installing boost and PyUblas on mac os x

I have installed boost_1_55 using macport with the following command
"sudo port install boost"
no errors.
I am now trying to install PyUblas on my mac but i keep getting the following error
> src/wrapper/main.cpp:16:10: fatal error: 'boost/python.hpp' file not
> found
#include <boost/python.hpp>
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
can anyone help?
Installing boost from packages (Macports, Brew, etc) did not work for me, but installing from source did.
Download source from http://sourceforge.net/projects/boost/files/boost/1.55.0/
cd into folder, then install with:
./bootstrap.sh
./b2
./b2 install

python installation "cc1.exe: error: unrecognized command line option '-mno-cygwin'"

Hi guys i'm trying to install rrdtool (for PYTHON 2.7) on my windows 7 system , i install it using this command line.
python setup.py install build --compiler=mingw32
it gives me the following output:
running install
running build
running build_ext
running build_configure
building 'rrdtoolmodule' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Irrdtool-1.4.7/src -IC:\Python2
7\include -IC:\Python27\PC -c rrdtool-1.4.7/bindings/python/rrdtoolmodule.c -o b
uild\temp.win32-2.7\Release\rrdtool-1.4.7\bindings\python\rrdtoolmodule.o
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
i have tried many solutions to solve this, but had no success.i'm using mingw version 4.6.2
can anyone pls help me .
See this answer: https://stackoverflow.com/a/6035864/1516291
you need to edit distutils\cygwinccompiler.py in your Python directory to remove all instances of -mno-cygwin
good luck

Problem building Festival (Text to Speech) on Ubuntu

I set up a Ubuntu VM today just to build Festival on Ubuntu (I never ran it before) Then I did the following setups
On the Terminal window I wrote following to install GNU C++ Compiler
sudo apt-get install build-essential
To test the g++ I wrote a sample hello world and compiled it using g++ and run it and it worked as expected.
I downloaded all the files from listed on festival download page
Unpacked all to the home directory(~) using
tar -zxvf *.tar.gz
Then wrote following 3 commands to configure and make speech_tools
cd speech_tools
./configure
make
But make returns with following errors
/lib -leststring -lcurses -ldl -lncurses -lm -lstdc++ -lgcc
/usr/bin/ld: cannot find -lcurses
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make[1]: *** [ch_lab] Error 1
make: *** [main] Error 2
What am I missing? being a newbie to Ubuntu or any other Unix platform I may missed some important configuration, before that I have successfully built festival on my windows machine using Cygwin.
You probably need to install the development packages for libncurses. Try
sudo apt-get install libncurses5-dev