TensorFlow: Compile Error for OpenCl Install from Source - compilation

Hello I have followed the Instructions to install from source and after running ./configure with clang/++ and ComputeCpp path provided and Yes to OpenCL.
With Bazel command :
bazel build --config opt --config=sycl //tensorflow/tools /pip_package:build_pip_package
I get the following compile error:
clang++: symbol lookup error: /usr/bin/clang++: undefined symbol: LLVMInitializeMipsAsmParser
I looked up the Symbol and it belongs to Rust which is not installed on my system nor can I see how to install it or the library required by this Install of TensorFlow. It only happens when I install for OpenCL. So it seems it is used for OpenCL along with ComputeCpp. I am installing on Fedora 25 (Yey)
Any ideas would be greatly appreciated. Also how do you stop it from downloading everytime you run ./Configure can it not just read that it already has the files downloaded and if so where?
Thanks
Hbyte

First off all, Fedora 25 is not officially supported by ComputeCpp yet. Although, we will do all we can to help.
You shouldn't need to change any of the bazel build files.
Could you confirm where is ComputeCpp installed?
I inserted ompute++ and have now found that header files located in my /usr/include path are not being used.
Do you mean that your system headers are not picked after configuring TF to use OpenCL?
From TensorFlow set up point of view you should point
./configure to what's the location.. there is no need to copy headers / binaries anywhere.
for instance my ComputeCpp is in my home directory
Do you wish to build TensorFlow with OpenCL support? [y/N] y
OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N]
No CUDA support will be enabled for TensorFlow
which: no clang++-3.6 in (/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/luke/.local/bin:/home/luke/bin)
Please specify which C++ compiler should be used as the host C++ compiler. [Default is ]: /usr/bin/clang++
Please specify which C compiler should be used as the host C compiler. [Default is /usr/local/bin/clang-3.6]: /usr/bin/clang
Please specify the location where ComputeCpp for SYCL 1.2 is installed. [Default is /usr/local/computecpp]: /home/luke/ComputeCpp-CE-0.1.2-Linux
As of the whl package, it boils down to Google, but as far as I am aware TensorFlow is not officially supporting Fedora 25 either.
If you have a fix for the build system please create Pull Request :)
What happens if you choose GCC for your host compiler?
Would it be possible to open an issue on GitHub to track the progress of this?

Related

Octave io package installation on macOS

I've searched the web high and low to no avail so I'm resorting to asking here..
I want to install the io package to Octave 4.4.1 on MacOS Catalina (10.15.5). I've tried installing directly from the Forge and again from the .gz file, but I get the following error every time:
configure: error: in `/var/folders/rh/y2fddn916sg3v_8pkln9z7jr0000gq/T/oct-JsL8yQ/io-2.6.1/src':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
checking for mkoctfile... /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/bin/mkoctfile-4.4.1
checking for octave-config... /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/bin/octave-config-4.4.1
checking whether the C++ compiler works... no
pkg: error running the configure script for io.
error: called from
configure_make at line 82 column 9
install at line 184 column 7
pkg at line 437 column 9
I know I need to provide the config.log file to troubleshoot but I cannot for my life find this anywhere. So:
Where do I find the config file?
How do I get io to install?
I don't pretend to know anything about programming so less-technical answers appreciated if possible. I installed Octave using the native mac app version from the website.
configure: error: C++ compiler cannot create executables
...
checking whether the C++ compiler works... no
This generally means that either you have Xcode installed but have not yet run it and accepted the EULA (which you must do once before using Xcode for anything, including command line work), and/or don't have the Xcode Command Line Tools installed (which you can do using sudo xcode-select --install).
That being said, there are outstanding issues with installing several Octave Forge packages on macOS. If you have further trouble with it, you can drop by the Octave.app repo on GitHub for support.

Differences between Apple LLVM and LLVM

I have Apple's command line tools version 9.1 installed and am working through an LLVM tutorial. I need to use some libraries like llvm/ADT and llvm/IR but get an error when I run the code.
main.cpp:1:10: fatal error: 'llvm/ADT/APFloat.h' file not found
#include "llvm/ADT/APFloat.h"
^~~~~~~~~~~~~~~~~~~~
1 error generated.
I also don't seem to have tools such as the assembler. Are these things not usable with Apple's version? And can I install LLVM without conflicting with Apple's version?
Apple's fork misses most of the library,headers and command-line tools in the llvm trunk.
I suggest you compile a new llvm copy from trunk.
Conflicting depends on how you configure everything. You can:
Install your new copy to global location, where your $PATH configuration is responsible for choosing which version to use.
Install as a separate Xcode Toolchain.
Here is a build script I've been using:
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DLLVM_APPEND_VC_REV=on -DLLVM_ENABLE_EH=on -DLLVM_ENABLE_RTTI=on -DLLVM_CREATE_XCODE_TOOLCHAIN=on -DCMAKE_INSTALL_PREFIX=~/Library/Developer/ ../LLVM
Running ninja install will install to global location, otherwise run ninja install-xcode-toolchain to install as a separate toolchain
In your case I suggest installing to global location to avoid the trouble of messing with CFLAGS/LDFLAGS/Header Search Path. Then remove the installation manually after you are done with the tutorial
EDIT: You might also want to check out the official build guide https://llvm.org/docs/CMake.html
For your use case, in-tree building is also a feasible option(Providing you are familiar with write cmake configs)
Actually, there is no need to build the LLVM yourself. You can get prebuilt version for your platform here: http://releases.llvm.org
In your case it would be something like this:
cd /opt
wget http://releases.llvm.org/5.0.0/clang+llvm-5.0.0-x86_64-apple-darwin.tar.xz
tar xvf clang+llvm-5.0.0-x86_64-apple-darwin.tar.xz
mv clang+llvm-5.0.0-x86_64-apple-darwin llvm-5.0.0
After that you will have everything under /opt/llvm-5.0.0, e.g.:
/opt/llvm-5.0.0/bin/clang
/opt/llvm-5.0.0/bin/llvm-config
/opt/llvm-5.0.0/lib/libc++.a
etc.
P.S. I use /opt just as an example, feel free to pick any other directory that fits you best.

Trouble installing hmatrix through MSYS2 on Windows 10

I've been trying to install hmatrix on my (64-bit) Windows 10 computer; after searching through and trying many possible solutions (including the instructions under "Windows" and "Alternative Windows Build" given here), I decided to pursue the course of action given on this Reddit thread.
However, when I type in the command
cabal install hmatrix -fopenblas --extra-lib-dir=${c:\msys64\mingw64\bin} --extra-include-dir=${c:\msys64\mingw64\include}
into the MSYS2 shell, the following log is given:
Resolving dependencies...
Configuring hmatrix-0.17.0.2...
Failed to install hmatrix-0.17.0.2
Build log ( C:\Users\Christian\AppData\Roaming\cabal\logs\hmatrix-0.17.0.2.log ):
Configuring hmatrix-0.17.0.2...
cabal.exe: Missing dependency on a foreign library:
* Missing C library: libopenblas
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal: Leaving directory 'C:\msys64\tmp\cabal-tmp-4244\hmatrix-0.17.0.2'
cabal.exe: Error: some packages failed to install:
hmatrix-0.17.0.2 failed during the configure step. The exception was:
ExitFailure 1
However, when I check the directory c:\msys64\mingw64\bin, I see that libopenblas.dll is right there; I don't know why cabal can't seem to find it.
Any insight into why this is not working or what to do?
UPDATE:
The files libopenblas.dll.a and libopenblas.a are in the directory c:\msys64\mingw64\lib. Is it possible I need to somehow include this directory as well? (If I do, how would I do that?)
I also downloaded the files in Alex Vorobiev's comment below and put them in c:\msys64\mingw64\bin if they are .dlls or c:\msys64\mingw64\lib if they are .libs. The header files were already contained in c:\msys64\include\openblas.
I tried several variations on the command in the original post after making these changes, including switching \bin with \lib and switching \include with \include\openblas, but all of them still give the same error.
I'm a bit suspicious about the
if os(windows)
if flag(openblas)
extra-libraries: libopenblas
in the cabal file, could you unpack it and remove the "lib" part? If that doesn't work please post a log with -v3 output. I've seen quite a few people with troubles installing this package. So could you also open a ticket on the GHC bug tracker if this doesn't work (and CC me "Phyx-")?
Secondly, you never said which version of GHC you're using. 8.0.1 should have far less trouble (and won't need the hack to get it working in GHCi) since the runtime linker has been overhauled and should be much better on Windows. 8.0.2 will likely include the new import libraries support as well.

Install Boost.Compute on Mac OS

I'm following this link and trying to install Boost Compute on Mac OS. It says it can be installed with make install but I cannot find a Makefile.
I added the path to the boost-compute folder to the header search path in the Xcode project. But now boost-compute is dependent on boost in my computer, and cannot link to the boost already installed.
Thanks in advance.
No it doesn't, it says it's a header-only library that requires no compilation. It also says that :
Boost.Compute is a header-only library, so no linking is required. To use the library just add the include directory to the compilation flags and link with the system's OpenCL library.

Is it possible to set up GStreamer for use in MinGW, similar to how it's done in Linux?

Apologies for the tardy title, I'm not quite sure how to phrase this question. At its most basic, I'm attempting to compile a program with GStreamer. When running the configure script for said program I get the following error:
0:20.39 configure: checking for gstreamer-1.0 >= 1.0
0:20.39 gstreamer-app-1.0
0:20.39 gstreamer-plugins-base-1.0
0:20.39 configure: error: gstreamer and gstreamer-plugins-base development pack
ages are needed to build gstreamer backend. Install them or disable gstreamer su
pport with --disable-gstreamer
The build environment I'm compiling in:
Windows 7 (64-Bit)
MINGW & MSYS
Visual C/C++ 2010 SP1 (command line)
Now if this error occurred on a Linux distro, - say Ubuntu - it could be remedied by running the following commands:
apt-get install libgstreamer-plugins-base1.0-dev
apt-get install libgstreamer1.0-dev
What is the equivalent for Windows? I've found two type of versions that can be used: The gstreamer bin from the developer website, which has the following structure:
bin
include
lib
share
And a dynamic library of gstreamer for mingw with the following structure:
bin
lib
How am I supposed to let mingw/msys know that the gstreamer library is installed? Do I place the folders above in the relevant MSYS directories? Then, how does the configure know that it's installed and ready to be used?
I hope what I'm asking makes sense, please let me know if anything is confused. Cheers!
Using the first solution (official binaries from GStreamer), you need to tell the configure script where everything is located.
The simplest way is to set the environment variable PKG_CONFIG_PATH to where the .pc files are located. Generally it's in
$install_directory/lib/pkgconfig/
Replace $install_directory with the actual location, ex if it's installed in /c/GStreamer :
PKG_CONFIG_PATH=/c/GStreamer/lib/pkgconfig ./configure
That should make configure figure out everything

Resources