build chromium on Mac then I got cannot execute binary file - c++

I am trying to build Google Chromium on a Mac.
To get Chromiumum I did the following steps:
fetch chromium on a Google Cloud Ubuntu Server.
git fetch origin tag <tag> on the server.
Zip the downloaded source and then download the zipped source to my local machine
Unzip the source on my local machine.
This process is need due to bad network connection in China which meant git clone can experience packet loss.
To build, I did the following steps:
gclient sync
gn gen out/Default
autoninja -C out/Default chrome
When doing this I get the following error;
[1/48575] CC obj/third_party/libwebp/libwebp_dsp_sse41/dec_sse41.o
FAILED: obj/third_party/libwebp/libwebp_dsp_sse41/dec_sse41.o
../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/libwebp/libwebp_dsp_sse41/dec_sse41.o.d -D_LIBCPP_HAS_NO_ALIGNED_ALLOCATION -DCR_XCODE_VERSION=1220 -DCR_CLANG_REVISION=\"llvmorg-12-init-11462-g418f18c6-1\" -DCOMPONENT_BUILD -D_LIBCPP_ENABLE_NODISCARD -D_LIBCPP_DEBUG=0 -DCR_LIBCXX_REVISION=375504 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES=0 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWEBP_NEAR_LOSSLESS=0 -DWEBP_DISABLE_STATS -DWEBP_REDUCE_SIZE -DWEBP_REDUCE_CSP -DWEBP_EXTERN=extern -I../.. -Igen -I../../third_party/libwebp -I../../third_party/libwebp/src -msse4.1 -fno-strict-aliasing -fstack-protector-strong -fcolor-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0 -fcomplete-member-pointers -arch x86_64 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -O0 -fno-omit-frame-pointer -gdwarf-4 -g2 -isysroot ../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -mmacosx-version-min=10.10.0 -ftrivial-auto-var-init=pattern -fvisibility=hidden -Xclang -add-plugin -Xclang find-bad-constructs -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Werror -Wall -Wno-unused-variable -Wno-misleading-indentation -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-psabi -Wno-ignored-pragma-optimize -Wno-implicit-int-float-conversion -Wno-final-dtor-non-final-class -Wno-builtin-assume-aligned-alignment -Wno-deprecated-copy -Wno-non-c-typedef-for-linkage -Wno-max-tokens -std=c11 -Wno-implicit-fallthrough -c ../../third_party/libwebp/src/dsp/dec_sse41.c -o obj/third_party/libwebp/libwebp_dsp_sse41/dec_sse41.o
/bin/sh: ../../third_party/llvm-build/Release+Asserts/bin/clang: cannot execute binary file
I'm working on this over 5 days, pls help me.

It works, I found a solution.
I remove src/third_party/llvm-build directory, then gclient sync again.
It will download executable clang program.
thx everybody.

Related

x86_64-conda_cos6-linux-gnu-cc: error trying to exec 'cc1plus': execvp: No such file or directory

I am trying to install a python library but I am getting an error
building '_pyFlask' extension
/home/lisa/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/lisagoh/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/lisa/anaconda3/include -fPIC -DFLASKCOMMIT="33a2752" -DHEALPIX_DATA="/mnt/c/Users/lisa_/OneDrive/Documents/Healpix_3.70/data" -DUSEXCOMPLEX=0 -DUSEMAP2TGA=0 -I/home/lisa/anaconda3/include/python3.8 -I/mnt/c/Users/lisa_/OneDrive/Documents/Healpix_3.70/include/healpix_cxx -c src/pyFlask_wrap.cxx -o build/temp.linux-x86_64-3.8/src/pyFlask_wrap.o -fopenmp
x86_64-conda_cos6-linux-gnu-cc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command '/home/lisa/anaconda3/bin/x86_64-conda_cos6-linux-gnu-cc' failed with exit status 1
I've tried sudo apt-get g++, sudo apt-get upgrade,sudo apt-get update and they tell me I have the latest versions but it still doesn't work.
When I try g++ --print-prog-name=cc1plus I get /usr/lib/gcc/x86_64-linux-gnu/9/cc1plus but when I try to find the cc1plus file it does not exist. I'm using the Ubunto 20.04 on a Windows OS.
I'm new to Linux and any help will be greatly appreciated thank you!

Why this .c file just have one line "../xx/xx.c"?

I want to build mesa3d source code for some reason. I follow the guide on https://mesa3d.org/install.html and the build environment is fedora31 and gcc9.2, but there are some build error when I trying to build the code with running ninja install.
FAILED: src/mesa/drivers/dri/r200/58cd8d4##r200#sta/radeon_buffer_objects.c.o
cc -Isrc/mesa/drivers/dri/r200/58cd8d4##r200#sta -Isrc/mesa/drivers/dri/r200 -I../src/mesa/drivers/dri/r200 -Iinclude -I../include -Isrc -I../src -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -Isrc/mesa/drivers/dri/common -I../src/mesa/drivers/dri/common -Isrc/util -I../src/util -I../src/mesa/drivers/dri/r200/server -Isrc/util/xmlpool -I/usr/include/libdrm -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c99 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="20.0.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/issues"' -DUSE_ELF_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_UINT128 -D_GNU_SOURCE -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DUSE_X86_64_ASM -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_EXECINFO_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_RANDOM_R -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_PROGRAM_INVOCATION_NAME -DHAVE_POSIX_MEMALIGN -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="9.0.0"' -DHAVE_VALGRIND -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Wno-missing-field-initializers -Wno-format-truncation -fno-math-errno -fno-trapping-math -Werror=format -Wformat-security -fPIC -fvisibility=hidden -DRADEON_R200 -MD -MQ 'src/mesa/drivers/dri/r200/58cd8d4##r200#sta/radeon_buffer_objects.c.o' -MF 'src/mesa/drivers/dri/r200/58cd8d4##r200#sta/radeon_buffer_objects.c.o.d' -o 'src/mesa/drivers/dri/r200/58cd8d4##r200#sta/radeon_buffer_objects.c.o' -c ../src/mesa/drivers/dri/r200/radeon_buffer_objects.c
../src/mesa/drivers/dri/r200/radeon_buffer_objects.c:1:1: error: expected identifier or '(' before '.' token
1 | ../radeon/radeon_buffer_objects.c
| ^
Then I check the radeon_buffer_objects.c, and this file just have one file path in it.
../radeon/radeon_buffer_objects.c
I'm not very familier with gcc and clang. What is that mean? And how can I resolve this build error?
As AnthonySottile's comment said, this error is about the symbol link support. I have cloned this repo to windows before and upload to my own git server. And the error occured when I trying to build the source code from my git.
I try to clone the repo from mesa3d.org, and the issue resolved.
Thanks for the help, guys.

Code base not finding standard C++ library header

I am compiling an example application from the SDK repository of a third party vendor. I receive an error that one of the C++ header's (algorithm) cannot be found:
if [ ! -d .deps/ ]; then mkdir -p .deps/; fi
/opt/llvm-3.8.0/bin/clang++ -M -isystem/opt/tbricks/sdk/include64 -I../../.. -I../../../.. -I./../../../.. -DLINUX -DLINUX64 -DTB_USE_RCU -DURCU_INLINE_SMALL_FUNCTIONS -DU_USING_ICU_NAMESPACE=0 -DNDEBUG -D_POSIX_PTHREAD_SEMANTICS -fPIC -D_GNU_SOURCE -DTB_USE_RCU -DTB_USE_RCU -D_GLIBCXX_USE_CXX11_ABI=0 -m64 --gcc-toolchain=/opt/gcc-5.2.0 -flto=full -std=gnu++14 -D_GLIBCXX_DEPRECATED= -pipe -fno-omit-frame-pointer -ffast-math -fno-finite-math-only -pthread -march=core2 -mtune=corei7 -g -O3 -Qunused-arguments -fnon-call-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Wshadow -Wpointer-arith -Wno-self-assign -Wno-unused-function -Wno-gnu-empty-initializer -Wno-unused-parameter -Wno-ignored-qualifiers -Wno-mismatched-tags -Wno-unused-local-typedef -Wno-parentheses-equality -Wno-unused-private-field -Wno-missing-field-initializers -Wno-missing-braces -Werror=return-type -Werror=overloaded-virtual -DSTRATEGY_BUILD_PROFILE=\"release\" ../../../../shared/Helpers.cpp > .deps/Helpers.o.d
../../../../shared/Helpers.cpp:14:10: fatal error: 'algorithm' file not found
#include <algorithm>
What sets the location path to search for C++ header files, such as algorithm? Is there anything I can grep for within makefiles?
Either install g++ alongside (you need libstdc++) or use LLVM libc++ and specify it with -stdlib=libc++

Compilation error when using Xcode 9.0 with clang (cannot specify -o when generating multiple output files)

I updated my Xcode yesterday (version 9.0) and since then I cannot compile my code with clang anymore. It works great with with apple native compiler, but gives a compilation error with clang from macports. I will explain with more details now...
I usually use clang 4.0 because it has openmp support and I change in Xcode by creating a user-defined setting as in the following figure.
Image with how to use clang 4.0 from macports in Xcode
This has been working perfectly for some time until I updated to Xcode 9.0. Now, I get the following error from clang compiler:
cannot specify -o when generating multiple output files.
I researched a bit and a lot of people say this is because you may have .h files in the compilation table. I double checked and this is not my case. I also would think that this error would have happened with and older Xcode version.
Next, I am attaching the complete compilation command given by Xcode (it's a bit big though!).
CompileC /Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel/lib/ISET.build/Debug/scieng.build/Objects-normal/x86_64/ComplexFloat.o SciEng/Algebra/ComplexFloat.C normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver
export LANG=en_US.US-ASCII
/opt/local/bin/clang-mp-4.0 -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DCMAKE_INTDIR=\"Debug\" -DVECLIB_MAXIMUM_THREADS=8 -DPARALLEL_ON -DNUM_PROC=8 -DUSE_VTK -DvtkDomainsChemistry_AUTOINIT=1(vtkDomainsChemistryOpenGL2) -DvtkRenderingContext2D_AUTOINIT=1(vtkRenderingContextOpenGL2) -DvtkRenderingCore_AUTOINIT=3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2) -DvtkRenderingOpenGL2_AUTOINIT=1(vtkRenderingGL2PSOpenGL2) -DvtkRenderingVolume_AUTOINIT=1(vtkRenderingVolumeOpenGL2) -DUSE_CGAL -DCGAL_USE_MPFR -DCGAL_USE_GMP -DUSE_CGAL_EXACT_ARITHMETIC -DMKL_VERSION_11 -DUSE_PARDISO_MKL -DMKL_NUM_THREADS=8 -DXLC_QNOTEMPINC -DNO_IMPLICIT_TEMPLATE -DSCIENG_CHECK_SUBSCRIPTS -DBOOST_DEBUG=1 -DSET_DEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.13 -g -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -index-store-path /Users/Nathan/Library/Developer/Xcode/DerivedData/ISET-eireryvadmfrwyarbuzbnkopwhid/Index/DataStore -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel/lib/Debug/include -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Algebra -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Array -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/AutoDeriv -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/DataModeling -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Function -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/LapackWrap -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/SciEng -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Units -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Vector -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/include -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/analysis -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/cholmod -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/cosys -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/crackmg2 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/crgeoeng -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/crgeoeng2 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/crgrphysics -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/extract -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/fiber_gfem -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/grgeoeng -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/integration -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/ma27solver -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/material -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/material2 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/mesh -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/mesh2 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/pardiso -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/post -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/pre -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/python -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/renumber -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/tNewtonRaphason -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/topology -I/opt/local/include -I/opt/local/include/vtk-7.1 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/python2.7 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel -I/Users/Nathan/Documents/Programming/CGAL_CleanVersions/CGAL-4.10/compileXcode/include -I/Users/Nathan/Documents/Programming/CGAL_CleanVersions/CGAL-4.10/include -I/opt/intel/compilers_and_libraries_2016.2.146/mac/mkl/include -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel/lib/ISET.build/Debug/scieng.build/DerivedSources/x86_64 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel/lib/ISET.build/Debug/scieng.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel/lib/Debug -m64 -fopenmp -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Algebra -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Array -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/AutoDeriv -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/DataModeling -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Function -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/LapackWrap -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/SciEng -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Units -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Vector -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/include -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/analysis -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/cholmod -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/cosys -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/crackmg2 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/crgeoeng -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/crgeoeng2 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/crgrphysics -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/extract -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/fiber_gfem -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/grgeoeng -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/integration -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/ma27solver -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/material -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/material2 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/mesh -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/mesh2 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/pardiso -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/post -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/pre -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/python -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/renumber -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/tNewtonRaphason -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/topology -isystem /opt/local/include -I/opt/local/include/vtk-7.1 -I/usr/include/python2.7 -I/Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel -I/Users/Nathan/Documents/Programming/CGAL_CleanVersions/CGAL-4.10/compileXcode/include -I/Users/Nathan/Documents/Programming/CGAL_CleanVersions/CGAL-4.10/include -I/opt/intel/compilers_and_libraries_2016.2.146/mac/mkl/include -MMD -MT dependencies -MF /Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel/lib/ISET.build/Debug/scieng.build/Objects-normal/x86_64/ComplexFloat.d --serialize-diagnostics /Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel/lib/ISET.build/Debug/scieng.build/Objects-normal/x86_64/ComplexFloat.dia -c /Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/SetSolver/SciEng/Algebra/ComplexFloat.C -o /Users/Nathan/Documents/Programming/ISET_CoupledFormulationMerged/ProjectXcodeParallel/lib/ISET.build/Debug/scieng.build/Objects-normal/x86_64/ComplexFloat.o
Note: I use CMake to generate the project.
I can supply any more information that might be needed
Thanks for the help!
Nathan
Xcode 9.0 adds -index-store-path to the build command. It's not supported in clang yet. See this explanation.
You can remove it by disabling the build option Index-While-Building Functionality in Xcode.

Quickly Build Package Repeatedly in R

I have a package I'm writing in R that has a boatload of complicated C++ code which takes a while to compile.
When I change the code, I'd like to quickly rebuild the package so I can test it. However, R CMD build seems to start from scratch each time, rather than using my code's makefiles to do only what is needed.
Is there a way to quickly do repeated builds of a package in R for testing?
I am a little overdue a short blog post on this, but I mentioned it a couple of times before: use ccache. It helps dramatically when the files don't change (ie when you just alter help pages), or when few files changes. Caching is a very clever trick, and package is robust.
On Ubuntu/Debian: sudo apt-get install ccache followed by e.g. this in your ~/.R/Makevars:
VER=
CCACHE=ccache
#CCACHE=
CC=$(CCACHE) gcc$(VER)
CXX=$(CCACHE) g++$(VER)
CXX11=$(CCACHE) g++$(VER)
CXX14=$(CCACHE) g++$(VER)
That also allows to switch between g++ versions. Changing it to clang++ is left as an exercise to the reader ;-)
Besides this, see the options to R CMD build and R CMD INSTALL to skip vignette and/or manual building to further speed up re-builds.
Illustration: Here is re-install of Rcpp itself (fresh from a git pull) where the first installation takes 21.9 seconds on my (decent) machine at work, the second then only takes 1.4 seconds thanks to ccache:
~/git/rcpp(master)$ time R CMD INSTALL .
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘Rcpp’ ...
** libs
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c Date.cpp -o Date.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c Module.cpp -o Module.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c Rcpp_init.cpp -o Rcpp_init.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c api.cpp -o api.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c attributes.cpp -o attributes.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c barrier.cpp -o barrier.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/Rcpp/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (Rcpp)
real 0m21.917s
user 0m21.388s
sys 0m2.304s
~/git/rcpp(master)$ ./cleanup
~/git/rcpp(master)$ time R CMD INSTALL .
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘Rcpp’ ...
** libs
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c Date.cpp -o Date.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c Module.cpp -o Module.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c Rcpp_init.cpp -o Rcpp_init.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c api.cpp -o api.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c attributes.cpp -o attributes.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O3 -Wall -pipe -pedantic -Wextra -Wno-empty-body -Wno-unused -c barrier.cpp -o barrier.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/Rcpp/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (Rcpp)
real 0m1.444s
user 0m1.380s
sys 0m1.452s
~/git/rcpp(master)$
Dirk's answer above pointed me in the right direction, but was insufficient. Since he has requested that I not append the final steps I required, I do so here.
My question could not have been answered without the following.
Dirk's answer did not work off the bat for me. If compilation still seems slow to you, try running:
ccache -s
The result will look a little like this
cache directory /home/myuser/.ccache
primary config /home/myuser/.ccache/ccache.conf
secondary config (readonly) /etc/ccache.conf
cache hit (direct) 0
cache hit (preprocessed) 0
cache miss 989
cache hit rate 0 %
called for link 12
preprocessor error 12
cleanups performed 16
files in cache 177
cache size 31.1 MB
max cache size 5.0 GB
Note that cache isn't getting hit, which means ccache isn't doing anything.
You can use:
export CCACHE_LOGFILE=ccache.log
R CMD build .
to do some debugging, though this wasn't helpful for me.
What fixed things was to run:
export CCACHE_NOHASHDIR=true
R CMD build .
As it turns out, ccache sometimes takes the location of a file into account. R CMD build . appears to build in a temporary directory, so the location of the files was changing each time.