Showing posts with label brew. Show all posts
Showing posts with label brew. Show all posts

University of Illinois CS_400: Object-Oriented Data Structures in C++

I decided to take a refresher on my C++ skills.

The University of Illinois (U-C) had a class on Coursera: "Object-Oriented Data Structures in C++"

https://www.coursera.org/learn/cs-fundamentals-1

The funny thing is, that I actually learned C/C++ at the University of Illinois (UIC), just over 20 years ago!


Getting the instructor's code:
Uki@iMac 18:38 Coursera_OO_data_structures_Cpp $ cd ..
Uki@iMac 18:38 _REPOS $ git clone https://github.com/wadefagen/coursera.git coursera-cs400
Cloning into 'coursera-cs400'...


Setting up macOS for C++

I am following these instructions:

Install Apple XCode


$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates


IMPORTANT, if you get Xcode errors when running the make command, execute this command:

sudo xcode-select --reset




by the way, I cannot get XCode IDE because my 2012 iMac is outdated and does not support higher macOS:





Getting BREW


$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


the above will take quite a few minutes.

Once BREW is installed, install the following:

brew install ghostscript
brew link --overwrite freetype
 
brew install imagemagick

brew link --overwrite libtool

 

brew install graphviz 
brew install cmake


brew edit valgrind



This will open your default code editor. In the opened file, change the URL in the head section from https://sourceware.org/git/valgrind.git 
to 
git://sourceware.org/git/valgrind.git 
and run the following:

brew update brew install --HEAD valgrind


Test MAKE



$ cd /Volumes/GoogleDrive/My\ Drive/_REPOS/coursera_wadefagen/cpp-std
cpp-std $ make




xcrun: error: active developer path ("/Volumes/SSD500GB/Applications/Xcode.app/Contents/Developer") does not exist
...





Uki@iMac 02:03 cpp-std $ sudo xcode-select --reset
Password:

Uki@iMac 02:07 cpp-std $ make
g++ -std=c++14 -O0 -pedantic -Wall -Wfatal-errors -Wextra -MMD -MP -g -c main.cpp -o .objs/main.o
g++ -std=c++14 -O0 -pedantic -Wall -Wfatal-errors -Wextra -MMD -MP -g -c Cube.cpp -o .objs/Cube.o
g++ .objs/main.o .objs/Cube.o -std=c++14 -o main
g++ cout.cpp -std=c++14 -o cout
g++ cout2.cpp -std=c++14 -o cout2
Uki@iMac 02:08 cpp-std $ open .



Uki@iMac  02:10 cpp-std $ ls -alt

total 96

drwx------@ 1 Uki  staff    16K Aug 12 02:10 ../

drwx------@ 1 Uki  staff    16K Aug 12 02:08 ./

-rwx------@ 1 Uki  staff    54K Aug 12 02:08 cout*

-rwx------@ 1 Uki  staff    54K Aug 12 02:08 cout2*

-rwx------@ 1 Uki  staff    61K Aug 12 02:08 main*

drwx------@ 1 Uki  staff    16K Aug 12 02:08 .objs/

-rwx------@ 1 Uki  staff    26B Aug 10 18:37 .gitignore*

-rwx------@ 1 Uki  staff   368B Aug 10 18:37 Cube.cpp*

-rwx------@ 1 Uki  staff   312B Aug 10 18:37 Cube.h*

-rwx------@ 1 Uki  staff   228B Aug 10 18:37 Makefile*

-rwx------@ 1 Uki  staff   209B Aug 10 18:37 cout.cpp*

-rwx------@ 1 Uki  staff   248B Aug 10 18:37 cout2.cpp*

-rwx------@ 1 Uki  staff   395B Aug 10 18:37 main.cpp*

Uki@iMac  02:14 cpp-std $ ./main

Volume: 13.824

Surface Area: 34.56





Week 2




2.1 Stack Memory and Pointers
https://www.coursera.org/learn/cs-fundamentals-1/lecture/Iccq3/2-1-stack-memory-and-pointers


I got to use Microsoft Code and Terminal properly




How to make the compiled files execute in the command line?


If you get a similar error, you might have to change the mode to execute the file..

zsh: permission denied: ./addressOf

cpp-memory % chmod +x addressOf
cpp-memory % ./addressOf
Value: 7
Address: 0x7ff7b9eef878



















As an Amazon Associate I earn from qualifying purchases.

Point Cloud Library (PCL) on Mac OS

Install PCL using BREW.

PCL is a Point Cloud Library for C++

$ xcode-select --install

xcode-select: error: command line tools are already installed, use "Software Update" to install updates



After updating Mac OS, please re-install the brew:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"



$ brew update

Already up-to-date.

$ brew tap homebrew/science
Error: homebrew/science was deprecated. This tap is now empty as all its formulae were migrated.

$ brew tap brewsci/science


Cloning into '/usr/local/Homebrew/Library/Taps/brewsci/homebrew-science'...

DANGER (no need to do it if you re-insalled the brew):
$ sudo install -d -o $(whoami) -g admin /usr/local/Frameworks

$ brew reinstall pcl

🍺  /usr/local/Cellar/pcl/1.9.1_4: 1,173 files, 147.4MB


$ brew upgrade pcl

Error: pcl 1.9.1_4 already installed


Compile the Lidar Simulator (Udacity nd313)

cd /Volumes/DATA/_Drive/_REPOS/SFND_Lidar_Obstacle_Detection/build/

build $ rm ../CMakeCache.txt





build $ cmake ../CMakeLists.txt
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking for module 'eigen3'
--   No package 'eigen3' found
-- Found Eigen: /usr/local/include/eigen3 
-- Eigen found (include: /usr/local/include/eigen3, version: 3.3.7)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
-- Boost version: 1.70.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono
--   atomic
--   regex
-- Checking for module 'flann'
--   No package 'flann' found
-- Found FLANN: /usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib 
-- FLANN found (include: /usr/local/Cellar/flann/1.9.1_7/include, lib: optimized;/usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib;debug;/usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib)
-- Checking for module 'flann'
--   No package 'flann' found
-- FLANN found (include: /usr/local/Cellar/flann/1.9.1_7/include, lib: optimized;/usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib;debug;/usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib)
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- Found libusb-1.0: /usr/local/include 
** WARNING ** io features related to libusb-1.0 will be disabled
-- Found Qhull: optimized;/usr/local/lib/libqhull_p.dylib;debug;/usr/local/lib/libqhull_p.dylib 
-- QHULL found (include: /usr/local/include, lib: optimized;/usr/local/lib/libqhull_p.dylib;debug;/usr/local/lib/libqhull_p.dylib)
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework 
-- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'glew'
--   No package 'glew' found
CMake Error at /usr/local/share/pcl-1.9/PCLConfig.cmake:58 (message):
  simulation is required but glew was not found
Call Stack (most recent call first):
  /usr/local/share/pcl-1.9/PCLConfig.cmake:361 (pcl_report_not_found)
  /usr/local/share/pcl-1.9/PCLConfig.cmake:545 (find_external_library)
  CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Volumes/DATA/_Drive/_REPOS/SFND313_Lidar_Obstacle_Detection/CMakeFiles/CMakeOutput.log".
See also "/Volumes/DATA/_Drive/_REPOS/SFND313_Lidar_Obstacle_Detection/CMakeFiles/CMakeError.log".





$ brew install glew

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
No changes to formulae.

Warning: glew 2.1.0 is already installed and up-to-date
To reinstall 2.1.0, run `brew reinstall glew`
(turi) uki  16:17 build $





References











As an Amazon Associate I earn from qualifying purchases.

Point Cloud Library (PCL) on Mac OS

Install PCL using BREW.

PCL is a Point Cloud Library for C++

$ xcode-select --install

xcode-select: error: command line tools are already installed, use "Software Update" to install updates



After updating Mac OS, please re-install the brew:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"



$ brew update

Already up-to-date.

$ brew tap homebrew/science
Error: homebrew/science was deprecated. This tap is now empty as all its formulae were migrated.

$ brew tap brewsci/science


Cloning into '/usr/local/Homebrew/Library/Taps/brewsci/homebrew-science'...

DANGER (no need to do it if you re-insalled the brew):
$ sudo install -d -o $(whoami) -g admin /usr/local/Frameworks

$ brew reinstall pcl

🍺  /usr/local/Cellar/pcl/1.9.1_4: 1,173 files, 147.4MB


$ brew upgrade pcl

Error: pcl 1.9.1_4 already installed


Compile the Lidar Simulator (Udacity nd313)

cd /Volumes/DATA/_Drive/_REPOS/SFND_Lidar_Obstacle_Detection/build/

build $ rm ../CMakeCache.txt





build $ cmake ../CMakeLists.txt
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking for module 'eigen3'
--   No package 'eigen3' found
-- Found Eigen: /usr/local/include/eigen3 
-- Eigen found (include: /usr/local/include/eigen3, version: 3.3.7)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
-- Boost version: 1.70.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono
--   atomic
--   regex
-- Checking for module 'flann'
--   No package 'flann' found
-- Found FLANN: /usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib 
-- FLANN found (include: /usr/local/Cellar/flann/1.9.1_7/include, lib: optimized;/usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib;debug;/usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib)
-- Checking for module 'flann'
--   No package 'flann' found
-- FLANN found (include: /usr/local/Cellar/flann/1.9.1_7/include, lib: optimized;/usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib;debug;/usr/local/Cellar/flann/1.9.1_7/lib/libflann_cpp.dylib)
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- Found libusb-1.0: /usr/local/include 
** WARNING ** io features related to libusb-1.0 will be disabled
-- Found Qhull: optimized;/usr/local/lib/libqhull_p.dylib;debug;/usr/local/lib/libqhull_p.dylib 
-- QHULL found (include: /usr/local/include, lib: optimized;/usr/local/lib/libqhull_p.dylib;debug;/usr/local/lib/libqhull_p.dylib)
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.framework 
-- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.29.2")
-- Checking for module 'glew'
--   No package 'glew' found
CMake Error at /usr/local/share/pcl-1.9/PCLConfig.cmake:58 (message):
  simulation is required but glew was not found
Call Stack (most recent call first):
  /usr/local/share/pcl-1.9/PCLConfig.cmake:361 (pcl_report_not_found)
  /usr/local/share/pcl-1.9/PCLConfig.cmake:545 (find_external_library)
  CMakeLists.txt:10 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Volumes/DATA/_Drive/_REPOS/SFND313_Lidar_Obstacle_Detection/CMakeFiles/CMakeOutput.log".
See also "/Volumes/DATA/_Drive/_REPOS/SFND313_Lidar_Obstacle_Detection/CMakeFiles/CMakeError.log".





$ brew install glew

Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
No changes to formulae.

Warning: glew 2.1.0 is already installed and up-to-date
To reinstall 2.1.0, run `brew reinstall glew`
(turi) uki  16:17 build $





References











As an Amazon Associate I earn from qualifying purchases.

CUDA: late 2013 MacBook Pro GPU: GeForce GT 750M 384 Cores

Installing CUDA on MacBook Pro


$ brew update
$ brew upgrade



$ id -g
20

$ sudo chown -R uki:20 *
Password:

$ brew link pcre

$ brew install coreutils swig
Warning: coreutils-8.26 already installed
==> Downloading https://homebrew.bintray.com/bottles/swig-3.0.11.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring swig-3.0.11.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/swig/3.0.11: 754 files, 5.5M


$ brew cask install cuda
🍺 cuda was successfully installed!


$ brew cask info cuda

cuda: 8.0.55

https://developer.nvidia.com/cuda-zone


$ kextstat | grep -i cuda

... com.nvidia.CUDA (1.1.0) ..


$ cd /usr/local/cuda/samples/
$ sudo make -C 1_Utilities/deviceQuery




Makefile NsightEclipse.xml deviceQuery deviceQuery.cpp deviceQuery.o readme.txt


$ /usr/local/cuda/samples/1_Utilities/deviceQuery/deviceQuery



Device 0: "GeForce GT 750M"
CUDA Driver Version / Runtime Version 8.0 / 8.0
CUDA Capability Major/Minor version number: 3.0
Total amount of global memory: 2048 MBytes (2147024896 bytes)
( 2) Multiprocessors, (192) CUDA Cores/MP: 384 CUDA Cores
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GT 750M
Result = PASS


cuDNN Download

Register.

https://developer.nvidia.com/rdp/cudnn-download

Download file for OSX: cudnn-8.0-osx-x64-v5.1.tgz

and copy the file to your favorite place..

cd ~/Dropbox/dev/NVidia_CUDA/
NVidia_CUDA $ tar zxvf cudnn-8.0-osx-x64-v5.1.tgz
cd $ /cuda/include
$ sudo cp cudnn.h /usr/local/cuda/include/
cd ../lib/
$ sudo cp libcudnn* /usr/local/cuda/lib/

Add to your bash_profile

########## CUDA cuDNN ########## created: February 6, 2017
export DYLD_LIBRARY_PATH="/usr/local/cuda/lib":$DYLD_LIBRARY_PATH


$ brew cask install java
$ brew install bazel





(carnd-term1) uki@Uki-PEs-MacBookPro 16:46 tensorflow $ TF_UNOFFICIAL_SETTING=1 ./configure


Please specify the location of python. [Default is /Users/ukilucas/anaconda3/envs/carnd-term1/bin/python]: /Users/ukilucas/anaconda3/envs/carnd-term1/bin/python


Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:


Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] N


No Google Cloud Platform support will be enabled for TensorFlow


Do you wish to build TensorFlow with Hadoop File System support? [y/N] N


No Hadoop File System support will be enabled for TensorFlow


Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] y


XLA JIT support will be enabled for TensorFlow


Found possible Python library paths:


/Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages


Please input the desired Python library path to use. Default is [/Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages]






Using python library path: /Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages


Do you wish to build TensorFlow with OpenCL support? [y/N] N


No OpenCL support will be enabled for TensorFlow


Do you wish to build TensorFlow with CUDA support? [y/N] Y


CUDA support will be enabled for TensorFlow


Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:


Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to use system default]:


Please specify the location where CUDA toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Please specify the Cudnn version you want to use. [Leave empty to use system default]:


Please specify the location where cuDNN library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Please specify a list of comma-separated Cuda compute capabilities you want to build with.


You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.


Please note that each additional compute capability significantly increases your build time and binary size.


[Default is: "3.5,5.2"]: 3.0


INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.


............


INFO: All external dependencies fetched successfully.


Configuration finished





bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/tensorflow-0.6.0-py2-none-any.whl


As an Amazon Associate I earn from qualifying purchases.

CUDA: late 2013 MacBook Pro GPU: GeForce GT 750M 384 Cores

Installing CUDA on MacBook Pro


$ brew update
$ brew upgrade



$ id -g
20

$ sudo chown -R uki:20 *
Password:

$ brew link pcre

$ brew install coreutils swig
Warning: coreutils-8.26 already installed
==> Downloading https://homebrew.bintray.com/bottles/swig-3.0.11.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring swig-3.0.11.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/swig/3.0.11: 754 files, 5.5M


$ brew cask install cuda
🍺 cuda was successfully installed!


$ brew cask info cuda

cuda: 8.0.55

https://developer.nvidia.com/cuda-zone


$ kextstat | grep -i cuda

... com.nvidia.CUDA (1.1.0) ..


$ cd /usr/local/cuda/samples/
$ sudo make -C 1_Utilities/deviceQuery




Makefile NsightEclipse.xml deviceQuery deviceQuery.cpp deviceQuery.o readme.txt


$ /usr/local/cuda/samples/1_Utilities/deviceQuery/deviceQuery



Device 0: "GeForce GT 750M"
CUDA Driver Version / Runtime Version 8.0 / 8.0
CUDA Capability Major/Minor version number: 3.0
Total amount of global memory: 2048 MBytes (2147024896 bytes)
( 2) Multiprocessors, (192) CUDA Cores/MP: 384 CUDA Cores
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GT 750M
Result = PASS


cuDNN Download

Register.

https://developer.nvidia.com/rdp/cudnn-download

Download file for OSX: cudnn-8.0-osx-x64-v5.1.tgz

and copy the file to your favorite place..

cd ~/Dropbox/dev/NVidia_CUDA/
NVidia_CUDA $ tar zxvf cudnn-8.0-osx-x64-v5.1.tgz
cd $ /cuda/include
$ sudo cp cudnn.h /usr/local/cuda/include/
cd ../lib/
$ sudo cp libcudnn* /usr/local/cuda/lib/

Add to your bash_profile

########## CUDA cuDNN ########## created: February 6, 2017
export DYLD_LIBRARY_PATH="/usr/local/cuda/lib":$DYLD_LIBRARY_PATH


$ brew cask install java
$ brew install bazel





(carnd-term1) uki@Uki-PEs-MacBookPro 16:46 tensorflow $ TF_UNOFFICIAL_SETTING=1 ./configure


Please specify the location of python. [Default is /Users/ukilucas/anaconda3/envs/carnd-term1/bin/python]: /Users/ukilucas/anaconda3/envs/carnd-term1/bin/python


Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:


Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] N


No Google Cloud Platform support will be enabled for TensorFlow


Do you wish to build TensorFlow with Hadoop File System support? [y/N] N


No Hadoop File System support will be enabled for TensorFlow


Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] y


XLA JIT support will be enabled for TensorFlow


Found possible Python library paths:


/Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages


Please input the desired Python library path to use. Default is [/Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages]






Using python library path: /Users/ukilucas/anaconda3/envs/carnd-term1/lib/python3.5/site-packages


Do you wish to build TensorFlow with OpenCL support? [y/N] N


No OpenCL support will be enabled for TensorFlow


Do you wish to build TensorFlow with CUDA support? [y/N] Y


CUDA support will be enabled for TensorFlow


Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:


Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to use system default]:


Please specify the location where CUDA toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Please specify the Cudnn version you want to use. [Leave empty to use system default]:


Please specify the location where cuDNN library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Please specify a list of comma-separated Cuda compute capabilities you want to build with.


You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.


Please note that each additional compute capability significantly increases your build time and binary size.


[Default is: "3.5,5.2"]: 3.0


INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.


............


INFO: All external dependencies fetched successfully.


Configuration finished





bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
pip install /tmp/tensorflow_pkg/tensorflow-0.6.0-py2-none-any.whl


As an Amazon Associate I earn from qualifying purchases.

Mac Groovy installation with brew

$ brew install groovy
==> Downloading https://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.6.zip
######################################################################## 100.0%
==> Caveats
You should set GROOVY_HOME:
  export GROOVY_HOME=/usr/local/opt/groovy/libexec
==> Summary
🍺  /usr/local/Cellar/groovy/2.4.6: 63 files, 27.6M, built in 6 seconds
$ groovy -v
Groovy Version: 2.4.6 JVM: 1.8.0_77 Vendor: Oracle Corporation OS: Mac OS X



If you like this post, please donate 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins



As an Amazon Associate I earn from qualifying purchases.

Mac Groovy installation with brew

$ brew install groovy
==> Downloading https://dl.bintray.com/groovy/maven/apache-groovy-binary-2.4.6.zip
######################################################################## 100.0%
==> Caveats
You should set GROOVY_HOME:
  export GROOVY_HOME=/usr/local/opt/groovy/libexec
==> Summary
🍺  /usr/local/Cellar/groovy/2.4.6: 63 files, 27.6M, built in 6 seconds
$ groovy -v
Groovy Version: 2.4.6 JVM: 1.8.0_77 Vendor: Oracle Corporation OS: Mac OS X



If you like this post, please donate 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:

Donate Bitcoins



As an Amazon Associate I earn from qualifying purchases.

9a. Gradle upgrade

In this tutorial we will overview basics of Gradle build system.

Step 1: verify what Gradle version you have

$ gradle -version

------------------------------------------------------------
Gradle 2.13
------------------------------------------------------------

Build time:   2016-04-25 04:10:10 UTC
Build number: none
Revision:     3b427b1481e46232107303c90be7b05079b05b1c

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_77 (Oracle Corporation 25.77-b03)
OS:           Mac OS X 10.11.4 x86_64



Step 2: update to the newest 

if you are missing entirely (on Mac using brew):

install brew on Mac:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

and now install gradle on Mac

brew install gradle

If you are updating (on Mac using brew):

brew update && brew upgrade gradle
...
==> Downloading https://downloads.gradle.org/distributions/gradle-2.1-bin.zip

######################################################################## 100.0%



$ gradle -version
------------------------------------------------------------
Gradle 2.1
------------------------------------------------------------
Build time:   2014-09-08 10:40:39 UTC
Build number: none
Revision:     e6cf70745ac11fa943e19294d19a2c527a669a53
Groovy:       2.3.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_20-ea (Oracle Corporation 25.20-b05)
OS:           Mac OS X 10.9.4 x86_64

$ which 

gradle/usr/local/bin/gradle



If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:
Donate Bitcoins



As an Amazon Associate I earn from qualifying purchases.

9a. Gradle upgrade

In this tutorial we will overview basics of Gradle build system.

Step 1: verify what Gradle version you have

$ gradle -version

------------------------------------------------------------
Gradle 2.13
------------------------------------------------------------

Build time:   2016-04-25 04:10:10 UTC
Build number: none
Revision:     3b427b1481e46232107303c90be7b05079b05b1c

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_77 (Oracle Corporation 25.77-b03)
OS:           Mac OS X 10.11.4 x86_64



Step 2: update to the newest 

if you are missing entirely (on Mac using brew):

install brew on Mac:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

and now install gradle on Mac

brew install gradle

If you are updating (on Mac using brew):

brew update && brew upgrade gradle
...
==> Downloading https://downloads.gradle.org/distributions/gradle-2.1-bin.zip

######################################################################## 100.0%



$ gradle -version
------------------------------------------------------------
Gradle 2.1
------------------------------------------------------------
Build time:   2014-09-08 10:40:39 UTC
Build number: none
Revision:     e6cf70745ac11fa943e19294d19a2c527a669a53
Groovy:       2.3.6
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_20-ea (Oracle Corporation 25.20-b05)
OS:           Mac OS X 10.9.4 x86_64

$ which 

gradle/usr/local/bin/gradle



If you like this post, please give me your 2 cents ($0.02 litterally) to show token of appreciation and encourage me to write more:
Donate Bitcoins



As an Amazon Associate I earn from qualifying purchases.

Installing Maven

After few years of not needing it, I came back to Maven, reason being that I cannot use Gradle for reasons beyond my control and Ant does not describe complex projects structures required.


As an Amazon Associate I earn from qualifying purchases.

Installing Maven

After few years of not needing it, I came back to Maven, reason being that I cannot use Gradle for reasons beyond my control and Ant does not describe complex projects structures required.


Getting new version of Maven


$ brew install maven
==> Downloading ....
/usr/local/Cellar/maven/3.2.3:
$ mvn -version

Apache Maven 3.2.3
$ which mvn
/usr/local/bin/mvn


Setting M2_HOME


$ echo $M2_HOME
# nada


I added the following in my ~/.profile




# Maven - updated: Oct 20, 2014
export MAVEN_HOME=/usr/local/Cellar/maven/3.2.3/
export PATH=${PATH}:${MAVEN_HOME}/bin
export M2_HOME=/usr/local/Cellar/maven/3.2.3/
export PATH=${PATH}:${M2_HOME}/libexec


and run:

$ echo $M2_HOME
/usr/local/Cellar/maven/3.2.3/



As an Amazon Associate I earn from qualifying purchases.

Thrift: building from source

I was required to build Thrift from sources (to adjust it to generate Parcelable Android model classes)

uki@ thrift $ .git clone https://github.com/apache/thrift.git
uki@ thrift $ cd thrift
uki@ thrift $ .git checkout 0.9.1
uki@ thrift $ ./cleanup.sh
uki@ thrift $ ./bootstrap.sh
uki@ thrift $ ./configure
uki@ thrift $ sudo make
uki@ thrift $ sudo make install

I get an error on my Mac:

./src/thrift/cxxfunctional.h:93:18: error: no member named 'bind' in namespace 'std'; did you mean 'find'?



Attempted solution 1:

I found a post on http://blog.evernote.com/
change file:
thrift/compiler/cpp/src/thriftl.ll
line 51 to #include "thrifty.hh"

src/thriftl.ll:51:10: fatal error: 'thrifty.hh' file not found
#include "thrifty.hh"
THIS SOLUTION CLEARLY DOES NOT WORK

Attempted solution 2:

As I was reading up I found that the version of my C++ might be wrong:

"libc++, the default C++ standard library in 10.9, doesn't include the experimental TR1 headers - just their standardized C++11 versions"

Checking the existing version of C++ on Mac:

 $ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)



Installed newest C++ from brew

$ brew install gcc49


in my ~/.profile I added these 2 lines:

# C++ HOME - updated: Sept 16, 2014
export CPP_HOME=/usr/local/Cellar/gcc/4.9.1/bin/
export PATH=${PATH}:${CPP_HOME}
alias g++="/usr/local/Cellar/gcc/4.9.1/bin/cpp-4.9"
alias gcc="/usr/local/Cellar/gcc/4.9.1/bin/cpp-4.9"


now in the Terminal I can verify this:

uki@ thrift $ gcc --version
cpp-4.9 (Homebrew gcc 4.9.1) 4.9.1



The exercise is not complete yet, so I was not able to verify if this is a fix.




As an Amazon Associate I earn from qualifying purchases.

Thrift: building from source

I was required to build Thrift from sources (to adjust it to generate Parcelable Android model classes)

uki@ thrift $ .git clone https://github.com/apache/thrift.git
uki@ thrift $ cd thrift
uki@ thrift $ .git checkout 0.9.1
uki@ thrift $ ./cleanup.sh
uki@ thrift $ ./bootstrap.sh
uki@ thrift $ ./configure
uki@ thrift $ sudo make
uki@ thrift $ sudo make install

I get an error on my Mac:

./src/thrift/cxxfunctional.h:93:18: error: no member named 'bind' in namespace 'std'; did you mean 'find'?



Attempted solution 1:

I found a post on http://blog.evernote.com/
change file:
thrift/compiler/cpp/src/thriftl.ll
line 51 to #include "thrifty.hh"

src/thriftl.ll:51:10: fatal error: 'thrifty.hh' file not found
#include "thrifty.hh"
THIS SOLUTION CLEARLY DOES NOT WORK

Attempted solution 2:

As I was reading up I found that the version of my C++ might be wrong:

"libc++, the default C++ standard library in 10.9, doesn't include the experimental TR1 headers - just their standardized C++11 versions"

Checking the existing version of C++ on Mac:

 $ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)



Installed newest C++ from brew

$ brew install gcc49


in my ~/.profile I added these 2 lines:

# C++ HOME - updated: Sept 16, 2014
export CPP_HOME=/usr/local/Cellar/gcc/4.9.1/bin/
export PATH=${PATH}:${CPP_HOME}
alias g++="/usr/local/Cellar/gcc/4.9.1/bin/cpp-4.9"
alias gcc="/usr/local/Cellar/gcc/4.9.1/bin/cpp-4.9"


now in the Terminal I can verify this:

uki@ thrift $ gcc --version
cpp-4.9 (Homebrew gcc 4.9.1) 4.9.1



The exercise is not complete yet, so I was not able to verify if this is a fix.




As an Amazon Associate I earn from qualifying purchases.

GIT: installation on Mac

General GIT installation page:

http://git-scm.com/book/en/v2/Getting-Started-Installing-Git

 

Mac Specific:

Install Brew - Mac package installer

This "brew" tool will be useful for many other things...

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Check existing version of git

$ git --version
git version 1.8.5.2 (Apple Git-48)

We can see that I had not the newest GIT (1.8.5), but I want to latest and greatest...

Install the latest and greatest git version

$ brew install git
/usr/local/Cellar/git/1.9.0: 1322 files, 30M

At this point the new GIT is installed, however the old GIT is still being used..

$ git --version
git version 1.8.5.2 (Apple Git-48)

Checking the NEW GIT at different location...

uki@ bin $ /usr/local/Cellar/git/1.9.0/bin/git --version
git version 1.9.0


Edit the PATH so he new GIT tool is found first

Open Applications > Utilities > Terminal.app
We will be editing .profile file located in your home folder (~), this file may not be showing in your Finder, so you might need to do it in vi editor.

edit ~/.profile
export GIT_TOOL=/usr/local/Cellar/git/1.9.0/
export PATH=${GIT_TOOL}/bin:${PATH}
$ git --version
git version 1.9.0




As an Amazon Associate I earn from qualifying purchases.

GIT: installation on Mac

General GIT installation page:

http://git-scm.com/book/en/v2/Getting-Started-Installing-Git

 

Mac Specific:

Install Brew - Mac package installer

This "brew" tool will be useful for many other things...

$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Check existing version of git

$ git --version
git version 1.8.5.2 (Apple Git-48)

We can see that I had not the newest GIT (1.8.5), but I want to latest and greatest...

Install the latest and greatest git version

$ brew install git
/usr/local/Cellar/git/1.9.0: 1322 files, 30M

At this point the new GIT is installed, however the old GIT is still being used..

$ git --version
git version 1.8.5.2 (Apple Git-48)

Checking the NEW GIT at different location...

uki@ bin $ /usr/local/Cellar/git/1.9.0/bin/git --version
git version 1.9.0


Edit the PATH so he new GIT tool is found first

Open Applications > Utilities > Terminal.app
We will be editing .profile file located in your home folder (~), this file may not be showing in your Finder, so you might need to do it in vi editor.

edit ~/.profile
export GIT_TOOL=/usr/local/Cellar/git/1.9.0/
export PATH=${GIT_TOOL}/bin:${PATH}
$ git --version
git version 1.9.0




As an Amazon Associate I earn from qualifying purchases.

apt quotation..