meson not producing any binary files - meson-build

I have a C project using meson.
The meson file looks like this:
project('camtool', 'c', version : '0.0.1',default_options : ['c_std=c11'])
cxx = meson.get_compiler('c')
systemd_dep = cxx.find_library('systemd')
pthread_dep = cxx.find_library('pthread')
inc = include_directories('include')
subdir('include')
subdir('src')
executable('camtool', './src/test.c',
include_directories : inc,
dependencies : [systemd_dep,pthread_dep])
and my src/test.c looks like this:
#include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!")
return 0;
}
The output of meson build is:
DEPRECATION: c_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: c_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
DEPRECATION: cpp_link_args in the [properties] section of the machine file is deprecated, use the [built-in options] section.
Using 'PKG_CONFIG_PATH' from environment with value: '/opt/poky/3.1.6/sysroots/znver1-poky-linux/usr/lib/pkgconfig:/opt/poky/3.1.6/sysroots/znver1-poky-linux/usr/share/pkgconfig'
The Meson build system
Version: 0.56.0
Source dir: /workspaces/quark-v4l2
Build dir: /workspaces/quark-v4l2/build
Build type: cross build
Project name: camtool
Project version: 0.0.1
Using 'CFLAGS' from environment with value: ' -O2 -pipe -g -feliminate-unused-debug-types '
Using 'LDFLAGS' from environment with value: '-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now'
Using 'CPPFLAGS' from environment with value: ''
C compiler for the host machine: x86_64-poky-linux-gcc -m64 -march=znver1 -mno-fma -mno-avx -mno-f16c -mno-rdrnd -mno-avx2 -mno-prfchw -mno-bmi -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.6/sysroots/znver1-poky-linux (gcc 9.3.0 "x86_64-poky-linux-gcc (GCC) 9.3.0")
C linker for the host machine: x86_64-poky-linux-gcc -m64 -march=znver1 -mno-fma -mno-avx -mno-f16c -mno-rdrnd -mno-avx2 -mno-prfchw -mno-bmi -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/opt/poky/3.1.6/sysroots/znver1-poky-linux ld.bfd 2.34.0.20200220
C compiler for the build machine: cc (gcc 8.3.0 "cc (Debian 8.3.0-6) 8.3.0")
C linker for the build machine: cc ld.bfd 2.31.1
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: x86_64
Host machine cpu: x86_64
Target machine cpu family: x86_64
Target machine cpu: x86_64
Library systemd found: YES
Library pthread found: YES
Build targets in project: 1
Found ninja-1.10.0 at /opt/poky/3.1.6/sysroots/x86_64-pokysdk-linux/usr/bin/ninja
After i run meson build, i run find . | grep camtool but it does not find the binary.
Where do i find the binary produced by meson?

Okay, i found out the reason is i misunderstood some steps in meson.
Meson build seems to be a build setting generating the build folder, but not actually building anything.
To make it build, i had to run ninja from the build directory.
Running ninja gave me an error, as my test.c was missing a semicolon.
After adding the semicolon and rerunning ninja, the binary was produced

Related

CMake and MinGW - "The C Compiler is not able to compile a simple test program"

I am using CMake and MinGW-w64 64-bit to build. I have used this exact same setup with the same compiler on my other PC and it has worked. Not sure what's wrong.
I have the MinGW-w64 bin in my PATH. When I run cmake and do not specify the compiler path, it generates MinGW Makefiles successfully. However, when I specify the compiler (which I know does work, I got it from winlibs.com) it produces the following log. I am running Windows 10.
Detecting C compiler ABI info failed to compile with the following output:
Change Dir: C:/Libraries/Projects/CMakeTest/build/MinGW-10.1.0-64-bit/debug/CMakeFiles/CMakeTmp
Run Build Command(s):C:/MinGW/MinGW-10.1.0-64-bit/bin/mingw32-make.exe cmTC_a01cd/fast && C:/MinGW/MinGW-10.1.0-64-bit/bin/mingw32-make.exe -f CMakeFiles\cmTC_a01cd.dir\build.make CMakeFiles/cmTC_a01cd.dir/build
mingw32-make[1]: Entering directory 'C:/Libraries/Projects/CMakeTest/build/MinGW-10.1.0-64-bit/debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a01cd.dir/CMakeCCompilerABI.c.obj
C:\MinGW\MinGW-10.1.0-64-bit\bin\x86_64-w64-mingw32-gcc.exe -v -o CMakeFiles\cmTC_a01cd.dir\CMakeCCompilerABI.c.obj -c "C:\Program Files\CMake\share\cmake-3.18\Modules\CMakeCCompilerABI.c"
Using built-in specs.
COLLECT_GCC=C:\MinGW\MinGW-10.1.0-64-bit\bin\x86_64-w64-mingw32-gcc.exe
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/R/winlibs64_10.1.0/inst_gcc-10.1.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --with-pkgversion='MinGW-W64 x86_64-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --enable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --enable-default-ssp --disable-rpath --disable-libstdcxx-pch --enable-libstdcxx-time=yes --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,d --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --with-mpc=/d/winlibs64_10.1.0/custombuilt --with-mpfr=/d/winlibs64_10.1.0/custombuilt --with-gmp=/d/winlibs64_10.1.0/custombuilt --with-isl=/d/winlibs64_10.1.0/custombuilt --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --with-libiconv --with-system-zlib --with-build-sysroot=/R/winlibs64_10.1.0/gcc-10.1.0/build_mingw/mingw-w64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.1.0 (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_a01cd.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64'
c:/mingw/mingw-10.1.0-64-bit/bin/../libexec/gcc/x86_64-w64-mingw32/10.1.0/cc1.exe -quiet -v -iprefix c:\mingw\mingw-10.1.0-64-bit\bin\../lib/gcc/x86_64-w64-mingw32/10.1.0/ -D_REENTRANT C:\Program Files\CMake\share\cmake-3.18\Modules\CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles\cmTC_a01cd.dir\CMakeCCompilerABI.c.obj -version -o C:\Users\gvcal\AppData\Local\Temp\ccHRxkpy.s
GNU C17 (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) version 10.1.0 (x86_64-w64-mingw32)
compiled by GNU C version 10.1.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "c:/mingw/mingw-10.1.0-64-bit/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.1.0/include"
ignoring nonexistent directory "R:/winlibs64_10.1.0/inst_gcc-10.1.0/share/gcc/include"
ignoring nonexistent directory "/R/winlibs64_10.1.0/inst_gcc-10.1.0/share/gcc/include"
ignoring duplicate directory "c:/mingw/mingw-10.1.0-64-bit/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.1.0/include-fixed"
ignoring duplicate directory "c:/mingw/mingw-10.1.0-64-bit/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
c:\mingw\mingw-10.1.0-64-bit\bin\../lib/gcc/x86_64-w64-mingw32/10.1.0/include
c:\mingw\mingw-10.1.0-64-bit\bin\../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../include
c:\mingw\mingw-10.1.0-64-bit\bin\../lib/gcc/x86_64-w64-mingw32/10.1.0/include-fixed
c:\mingw\mingw-10.1.0-64-bit\bin\../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/include
End of search list.
GNU C17 (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) version 10.1.0 (x86_64-w64-mingw32)
compiled by GNU C version 10.1.0, GMP version 6.2.0, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 21a8d9a0add79f637093bff9641d5f35
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_a01cd.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64'
c:/mingw/mingw-10.1.0-64-bit/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o CMakeFiles\cmTC_a01cd.dir\CMakeCCompilerABI.c.obj C:\Users\gvcal\AppData\Local\Temp\ccHRxkpy.s
GNU assembler version 2.34 (x86_64-w64-mingw32) using BFD version (Binutils for MinGW-W64 x86_64, built by Brecht Sanders) 2.34
COMPILER_PATH=c:/mingw/mingw-10.1.0-64-bit/bin/../libexec/gcc/x86_64-w64-mingw32/10.1.0/;c:/mingw/mingw-10.1.0-64-bit/bin/../libexec/gcc/;c:/mingw/mingw-10.1.0-64-bit/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=c:/mingw/mingw-10.1.0-64-bit/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/;c:/mingw/mingw-10.1.0-64-bit/bin/../lib/gcc/;c:/mingw/mingw-10.1.0-64-bit/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/lib/../lib/;c:/mingw/mingw-10.1.0-64-bit/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../lib/;c:/mingw/mingw-10.1.0-64-bit/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../../x86_64-w64-mingw32/lib/;c:/mingw/mingw-10.1.0-64-bit/bin/../lib/gcc/x86_64-w64-mingw32/10.1.0/../../../
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_a01cd.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=x86-64'
Linking C executable cmTC_a01cd.exe
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_a01cd.dir\link.txt --verbose=1
"C:\Program Files\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_a01cd.dir/objects.a
CMAKE_AR-NOTFOUND cr CMakeFiles\cmTC_a01cd.dir/objects.a #CMakeFiles\cmTC_a01cd.dir\objects1.rsp
Error running link command: The system cannot find the file specified
mingw32-make[1]: *** [CMakeFiles\cmTC_a01cd.dir\build.make:107: cmTC_a01cd.exe] Error 2
mingw32-make[1]: Leaving directory 'C:/Libraries/Projects/CMakeTest/build/MinGW-10.1.0-64-bit/debug/CMakeFiles/CMakeTmp'
mingw32-make: *** [makefile:140: cmTC_a01cd/fast] Error 2
Determining if the C compiler works failed with the following output:
Change Dir: C:/Libraries/Projects/CMakeTest/build/MinGW-10.1.0-64-bit/debug/CMakeFiles/CMakeTmp
Run Build Command(s):C:/MinGW/MinGW-10.1.0-64-bit/bin/mingw32-make.exe cmTC_f77ee/fast && C:/MinGW/MinGW-10.1.0-64-bit/bin/mingw32-make.exe -f CMakeFiles\cmTC_f77ee.dir\build.make CMakeFiles/cmTC_f77ee.dir/build
mingw32-make[1]: Entering directory 'C:/Libraries/Projects/CMakeTest/build/MinGW-10.1.0-64-bit/debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_f77ee.dir/testCCompiler.c.obj
C:\MinGW\MinGW-10.1.0-64-bit\bin\x86_64-w64-mingw32-gcc.exe -o CMakeFiles\cmTC_f77ee.dir\testCCompiler.c.obj -c C:\Libraries\Projects\CMakeTest\build\MinGW-10.1.0-64-bit\debug\CMakeFiles\CMakeTmp\testCCompiler.c
Linking C executable cmTC_f77ee.exe
"C:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_f77ee.dir\link.txt --verbose=1
"C:\Program Files\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_f77ee.dir/objects.a
CMAKE_AR-NOTFOUND cr CMakeFiles\cmTC_f77ee.dir/objects.a #CMakeFiles\cmTC_f77ee.dir\objects1.rsp
Error running link command: The system cannot find the file specified
mingw32-make[1]: *** [CMakeFiles\cmTC_f77ee.dir\build.make:108: cmTC_f77ee.exe] Error 2
mingw32-make[1]: Leaving directory 'C:/Libraries/Projects/CMakeTest/build/MinGW-10.1.0-64-bit/debug/CMakeFiles/CMakeTmp'
mingw32-make: *** [makefile:140: cmTC_f77ee/fast] Error 2
My PATH and complete command line used:
Path:
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\MATLAB\R2019b\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\CMake\bin;C:\MinGW\MinGW-10.1.0-64-bit\bin;C:\Users\gvcal\AppData\Local\Microsoft\WindowsApps;
Command line:
"C:\Program Files\CMake\bin\cmake.EXE" -Hc:/Libraries/Projects/CMakeTest -Bc:/Libraries/Projects/CMakeTest/build -G "MinGW Makefiles"
I think this may be a bug with CMake and MinGW Makefiles. Still not entirely sure what it is.
Anyways, I switched to the Ninja build system (https://ninja-build.org/) and all is working fine now.

How to build the psa-arch-tests with the cmake and armclang in the cygwin?

After Installing several softwares for building the compilation environment according to the Software Requirements Document which is in the "https://github.com/ARM-software/psa-arch-tests/blob/master/api-tests/docs/sw_requirements.md", when I compiled the source code psa-arch-tests of PSA API compliance test suite, the cygwin prompted the following error result:
luofeng66ok#DESKTOP ~/TFMB/psa-arch-tests/api-tests/build
$ cmake ../ -G"Unix Makefiles" -DTOOLCHAIN=ARMCLANG -DTARGET=tgt_dev_apis_tfm_an521 -DCPU_ARCH=armv8m_ml -DSUITE=CRYPTO -DPSA_INCLUDE_PATHS="/cygdrive/c/cygwin64/home/anpengfei/TFMB/trusted-firmware-m/interface/include/psa/crypto.h"
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/cygwin64/home/luofeng66ok/TFMB/psa-arch-tests/api-tests/BUILD/CMakeF
iles/CMakeOutput.log".
See also "C:/cygwin64/home/luofeng66ok/TFMB/psa-arch-tests/api-tests/BUILD/CMakeF
iles/CMakeError.log".
How to resolve this error?
CMakeError.log contains:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/cygwin64/bin/cc
Build flags:
Id flags:
The output was:
拒绝访问。
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: C:/cygwin64/bin/cc
Build flags:
Id flags: -c
The output was:
拒绝访问。
......
My installed software are:
Host Operating System: Windows 10 64bit
Scripting tools:
luofeng66ok#DESKTOP-STB70QG ~/TFMB/psa-arch-tests/api-tests/build
$ Python --version
Python 3.7.0
Cross Compiler toolchain :
luofeng66ok#DESKTOP-STB70QG ~/TFMB/psa-arch-tests/api-tests/build
$ armclang --version
Product: MDK Plus 5.29
Component: ARM Compiler 6.13.1
Tool: armclang [5d895d00]
Target: unspecified-arm-none-unspecified
Build tools :
luofeng66ok#DESKTOP-STB70QG ~/TFMB/psa-arch-tests/api-tests/build
$ cmake --version
cmake version 3.10.0-rc1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ cygcheck --version
cygcheck (cygwin) 3.1.4
and I have imported Arm Compiler in my environment variable,
At the same time, I also imported Arm Compiler by this way:
C:\cygwin64\home\luofeng66ok\.bashrc:
export PATH=/cygdrive/c/Keil/ARM/ARMCLANG/bin:$PATH
export PATH=/cygdrive/c/cmake/bin:$PATH
export PATH=/cygdrive/c/armgcc/bin:$PATH
My steps for building psa-arch-tests are:
git clone https://github.com/ARM-software/psa-arch-tests.git
git clone https://github.com/laurencelundblade/QCBOR.git (I do not why do this)
cd <TF-M base folder>
git clone https://git.trustedfirmware.org/trusted-firmware-m.git
git clone https://github.com/ARMmbed/mbed-crypto.git -b mbedcrypto-3.0.1
git clone https://github.com/ARM-software/CMSIS_5.git -b 5.5.0
git-lfs
My directory tfmb contains:
luofeng66ok#DESKTOP-STB70QG ~/tfmb
$ ls
CMSIS_5 mbed-crypto psa-arch-tests trusted-firmware-m
Start compiling psa-arch-tests
cd api-tests
mkdir BUILD
cd BUILD
cmake ../ -G"Unix Makefiles" -DTOOLCHAIN=ARMCLANG -DTARGET=tgt_dev_apis_tfm_an521 -DCPU_ARCH=armv8m_ml -DSUITE=CRYPTO -DPSA_INCLUDE_PATHS="/cygdrive/c/cygwin64/home/anpengfei/TFMB/trusted-firmware-m/interface/include/psa/crypto.h"
as the errors above shows in my cygwin, I do not why?
luofeng66ok#DESKTOP-STB70QG ~/TFMB/psa-arch-tests/api-tests/build
$ cmake ../ -G"Unix Makefiles" -DTOOLCHAIN=ARMCLANG -DTARGET=tgt_dev_apis_tfm_an521 -DCPU_ARCH=armv8m_ml -DSUITE=CRYPTO -DPSA_INCLUDE_PATHS="/cygdrive/c/cygwin64/home/anpengfei/TFMB/trusted-firmware-m/interface/include/psa/crypto.h"
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/cygwin64/home/luofeng66ok/TFMB/psa-arch-tests/api-tests/BUILD/CMakeF
iles/CMakeOutput.log".
See also "C:/cygwin64/home/luofeng66ok/TFMB/psa-arch-tests/api-tests/BUILD/CMakeF
iles/CMakeError.log".

Include error when building TensorFlow from source with a different GCC than the system one

I have been trying to build TensorFlow 2.0 from the master branch on a Red Hat Linux Enterprise edition cluster.
The default GCC available is 4.8.5, and it is not possible to compile TensorFlow with it because it uses explicit
std=c++14
flag which is not available in GCC 4.8.5
Hence, I started using gcc/8.3.0 using a modulefile, which is configured as follows :
(tensorflow2.0-master) -bash-4.2$ module show gcc/8.3.0/gcc-4.8.5
-------------------------------------------------------------------
/gpfslocalsup/pub/modules-idris/modulefiles/linux-rhel7-x86_64/gcc/8.3.0/gcc-4.8.5:
module-whatis The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, and Go, as well as libraries for these languages.
conflict gcc
prepend-path PATH /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin
prepend-path MANPATH /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/share/man
prepend-path LD_LIBRARY_PATH /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib
prepend-path LIBRARY_PATH /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib
prepend-path LD_LIBRARY_PATH /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib64
prepend-path LIBRARY_PATH /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib64
prepend-path CPATH /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/include
prepend-path CMAKE_PREFIX_PATH /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/
setenv CC /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/gcc
setenv CXX /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/g++
setenv FC /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/gfortran
setenv F77 /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/gfortran
setenv F90 /gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/gfortran
-------------------------------------------------------------------
To compile TensorFlow, I first compiled bazel-0.29.1 and for that I modified the
tools/cpp/cc_toolchain_config.bzl
file as follows :
I replaced all occourances of /usr/bin/gcc, /usr/bin/gcov, /usr/bin/nm, /usr/bin/ar, /usr/bin/cpp with the binaries in PATH as shown above.
I added the include path as shown above, to the list of cxx_builtin_include_directory present in the file.
After that I proceeded to build TensorFlow.
The command used was :
CC=/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/gcc bazel --output_user_root=/tmp/ujjwal-builds build --config=opt --config=cuda --config=mkl --config=numa //tensorflow/tools/pip_package:build_pip_package --verbose_failures
This ended up giving me the following error :
INFO: Analyzed target //tensorflow/tools/pip_package:build_pip_package (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /tmp/ujjwal-builds/7d993f307acf01aa765c32a6dcabd368/external/gif/BUILD.bazel:8:1: undeclared inclusion(s) in rule '#gif//:gif':
this rule is missing dependency declarations for the following files included by 'external/gif/gif_err.c':
'/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/stddef.h'
'/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/stdarg.h'
'/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/stdbool.h'
'/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/stdint.h'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 2.152s, Critical Path: 1.63s
INFO: 7 processes: 7 local.
FAILED: Build did NOT complete successfully
I have tried to search for solutions online but there are no satisfactory solutions. Can anyone please help me with what is going on here as it is important for me.
If it helps, I have attached the output of gcc and g++ include paths below :
gcc -E -xc++ - -v
Reading specs from /gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.0/specs
COLLECT_GCC=gcc
Target: x86_64-pc-linux-gnu
Configured with: /gpfs7kw/linkhome/idris/softmgr/softmgr01/spack/var/spack/stage/gcc-8.3.0-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/spack-src/configure --prefix=/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3 --disable-multilib --enable-languages=c,c++,fortran --with-mpfr=/gpfslocalsup/spack_soft/mpfr/3.1.6/gcc-4.8.5-vwx7snyrzymeg5n6f7dg5tbpgk35do3k --with-gmp=/gpfslocalsup/spack_soft/gmp/6.1.2/gcc-4.8.5-5odxtlxihbfjtj4dxo52oz5f7r6ir6jk --enable-lto --with-quad --with-system-zlib --with-mpc=/gpfslocalsup/spack_soft/mpc/1.1.0/gcc-4.8.5-pogagquauxex67doa7v2mkas2gcs5xut --with-isl=/gpfslocalsup/spack_soft/isl/0.18/gcc-4.8.5-3wslknueis6r2nx3tasaizgda2ianxfa
Thread model: posix
gcc version 8.3.0 (GCC)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64'
/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../libexec/gcc/x86_64-pc-linux-gnu/8.3.0/cc1plus -E -quiet -v -iprefix /gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.0/ -D_GNU_SOURCE - -mtune=generic -march=x86-64
ignoring nonexistent directory "/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory "/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0"
ignoring duplicate directory "/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/x86_64-pc-linux-gnu"
ignoring duplicate directory "/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/backward"
ignoring duplicate directory "/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.3.0/include"
ignoring duplicate directory "/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.3.0/include-fixed"
ignoring nonexistent directory "/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory "/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/gpfslocalsys/intel/parallel_studio_xe_2019_update5_cluster_edition/compilers_and_libraries_2019.5.281/linux/mkl/include
/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0
/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/x86_64-pc-linux-gnu
/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../include/c++/8.3.0/backward
/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.0/include
/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/x86_64-pc-linux-gnu/8.3.0/include-fixed
/usr/local/include
/gpfs7kro/gpfslocalsup/spack_soft/gcc/8.3.0/gcc-4.8.5-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/bin/../lib/gcc/../../include
/usr/include
End of search list.
You could try using this PR from within spack for this : https://github.com/spack/spack/pull/14681

Error Building Giraffe (Chess Program): /opt/local/bin/as: assembler (/opt/local/bin/clang) not installed

I'm trying to build the Giraffe Deep Belief Chess Playing program which I downloaded from Mercurial.
From README.md:
Tested on Linux (GCC 4.9), OS X (GCC 4.9), Windows (MinGW-W64 GCC 5.1). GCC versions earlier than 4.8 are definitely NOT supported, due to broken regex implementation in libstdc++.
Here's the error:
David-Laxers-MacBook-Pro:giraffe davidlaxer$ make
g++ -Wall -Wextra -Wno-unused-function -std=gnu++11 -mtune=native -Wa,-q -ffast-math -pthread -fopenmp -DHGVERSION="\"efceca80bf74\"" -O3 -march=native -Wa,-q -I. -c backend.cpp -o obj/backend.o
/opt/local/bin/as: assembler (/opt/local/bin/clang) not installed
make: *** [obj/backend.o] Error 1
I'm on OS X 10.10.5.
port select --list clang
Available versions for clang:
mp-clang-3.5
mp-clang-3.7
none (active)
David-Laxers-MacBook-Pro:giraffe davidlaxer$ ls -l /opt/local/bin/as
-r-xr-xr-x 1 root admin 28012 Feb 15 2015 /opt/local/bin/as
David-Laxers-MacBook-Pro:giraffe davidlaxer$ /opt/local/bin/as -v
Apple Inc version cctools-862, GNU assembler version 1.38
David-Laxers-MacBook-Pro:giraffe davidlaxer$ file /opt/local/bin/as
/opt/local/bin/as: Mach-O 64-bit executable x86_64
David-Laxers-MacBook-Pro:giraffe davidlaxer$ g++ --version
g++ (MacPorts gcc49 4.9.3_0) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
From Makefile:
#CXX=g++-4.9 # I changed this - dbl
CXX=g++
# this is used to build gtb only
CC=gcc-4.9
HGVERSION:= $(shell hg parents --template '{node|short}')
CXXFLAGS_BASE = \
-Wall -Wextra -Wno-unused-function -std=gnu++11 -mtune=native -Wa,-q -ffast-math \
-pthread -fopenmp -DHGVERSION="\"${HGVERSION}\""
Here is what I did to solve this issue using Brew,
$ clang
zsh: no such file or directory: clang
$ brew install llvm --with-clang --with-asan
==> Downloading http://llvm.org/releases/3.5.0/llvm-3.5.0.src.tar.xz
######################################################################## 100.0%
🍺 /usr/local/Cellar/llvm/3.5.0: 1235 files, 171M, built in 16.8 minutes
$ clang -v
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

Compile C++ code to run on ESXi 3.5

I'm trying to compile a simple c++ program to run inside ESXi 3.5 console window. It seems I'm linking with wrong libraries... Is there a setup described somewhere - which version of G++ and libraries do I have to be using in order to do so?
Here's how I resolved the issue. I did following to compile:
Compiled using gcc under ubuntu
Ran ldd on executable
Copied all libraries that showed up as dependencies to subfolder ESXi-3.5-lib. In my case they were:
ld-linux.so.2
libc.so.6
libgcc_s.so.1
libm.so.6
libstdc++.so.5
Added following switches to gcc:
-nodefaultlibs (to not attempt to link with default libs)
-lc (prevented link error in some crt library)
-fno-stack-protector (prevented another error, some other function was missing)
Following was my final build command:
g++ file1.cpp file2.cpp file3.cpp -o output-biinary-file-name \
ESXi-3.5-lib/ld-linux.so.2 ESXi-3.5-lib/libc.so.6 ESXi-3.5-lib/libgcc_s.so.1\
ESXi-3.5-lib/libm.so.6 ESXi-3.5-lib/libstdc++.so.5 \
-nodefaultlibs -lc -m32 -fno-stack-protector