OCLint got compile errors in html report file, but my project build success. WHY - objective-c

xcodebuild -workspace ${myworkspace} -scheme ${myscheme} \
-sdk iphonesimulator \
-derivedDataPath ./build/derivedData \
-configuration Debug \
COMPILER_INDEX_STORE_ENABLE=NO \
| xcpretty -r json-compilation-database -o compile_commands.json
I run the command line above to build my project, it build success, but when i run the command line below to generate oclint html report file, get 15 compiler errors.
oclint-json-compilation-database -e Pods -- \
-extra-arg=-Wno-error=everything \
-report-type html \
-rc LONG_LINE=200 \
-rule MultipleUnaryOperator \
-max-priority-1=0 \
-max-priority-2=10 \
-max-priority-3=20 \
-o ./oclint_report.html

try this
oclint-json-compilation-database <YOUR OPTIONS HERE> -- -extra-arg=-Wno-everything
as:
oclint-json-compilation-database -e Pods -- \
-extra-arg=-Wno-error=everything \
-report-type html \
-rc LONG_LINE=200 \
-rule MultipleUnaryOperator \
-max-priority-1=0 \
-max-priority-2=10 \
-max-priority-3=20 \
-extra-arg=-Wno-everything \
-o ./oclint_report.html

Related

CPPFLAGS set from configure.ac are ignored in Makefile.am

I am trying to build TerraGear with self-made AutoTools files (configure script). TerraGear is split into several subprojects. For each, I create a different set of configure.ac and Makefile.am files, but they are all almost the same.
Consider the following two files:
configure.ac
AC_PREREQ([2.69])
AC_INIT([TerraGear libterragear], [2.1.0], [])
AC_CONFIG_SRCDIR([airport.cxx])
AC_CONFIG_FILES([Makefile])
AM_INIT_AUTOMAKE([foreign])
AC_PROG_CXX
PKG_CHECK_MODULES([ZLIB], [zlib])
PKG_CHECK_MODULES([GDAL], [gdal])
AC_ARG_WITH([simgear-dir], [AS_HELP_STRING(
[--with-simgear-dir=prefix],
[installation prefix of SimGear])],
[
SIMGEAR_CPPFLAGS="-I${withval}/include"
SIMGEAR_LIBRARY="-L${withval}/lib"
]
)
AC_MSG_NOTICE([simgear cppflags : ${SIMGEAR_CPPFLAGS}])
AC_OUTPUT
Makefile.am
bin_PROGRAMS = genapts850
genapts850_SOURCES = airport.cxx \
apt_math.cxx \
closedpoly.cxx \
debug.cxx \
elevations.cxx \
helipad.cxx \
lights.cxx \
linearfeature.cxx \
linked_objects.cxx \
main.cxx \
object.cxx \
output.cxx \
parser.cxx \
runway.cxx \
rwy_simple.cxx \
rwy_gen.cxx \
scheduler.cxx \
taxiway.cxx
genapts850_LDADD = -L$(top_srcdir)/../../Lib/terragear \
$(SIMGEAR_LIBRARY) \
-lSimGearCore \
-lSimGearScene \
-lterragear \
$(ZLIB_LIBRARY) \
$(GDAL_LIBRARY)
genapts850_CXXFLAGS = -I$(top_srcdir)/../../Lib \
-I$(top_srcdir)/../../Lib/terragear \
$(SIMGEAR_CPPFLAGS) \
$(ZLIB_CFLAGS) \
$(GDAL_CFLAGS)/gdal
I run autoreconf:
autoreconf -vfi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
then run the configure script:
./configure --with-simgear-dir=/path/to/simgear/installation/prefix
[...]
configure: simgear cppflags : -I/path/to/simgear/installation/prefix/include
[...]
then I run make:
make
g++ -DPACKAGE_NAME=\"TerraGear\ libterragear\" -DPACKAGE_TARNAME=\"terragear-libterragear\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"TerraGear\ libterragear\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"terragear-libterragear\" -DVERSION=\"2.1.0\" -I. -I./../../Lib -I./../../Lib/terragear -Ig++ -DPACKAGE_NAME=\"TerraGear\ libterragear\" -DPACKAGE_TARNAME=\"terragear-libterragear\" -DPACKAGE_VERSION=\"2.1.0\" -DPACKAGE_STRING=\"TerraGear\ libterragear\ 2.1.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"terragear-libterragear\" -DVERSION=\"2.1.0\" -I. -I./../../Lib -I./../../Lib/terragear -I/path/to/simgear/installation/prefix/include/gdal -g -O2 -MT genapts850-airport.o -MD -MP -MF .deps/genapts850-airport.Tpo -c -o genapts850-airport.o `test -f 'airport.cxx' || echo './'`airport.cxx
airport.cxx:6:10: fatal error: simgear/compiler.h: Datei oder Verzeichnis nicht gefunden
6 | #include <simgear/compiler.h>
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:471: genapts850-airport.o] Fehler 1
(simgear/compiler.h resides inside /path/to/simgear/installation/prefix/include)
What am I doing wrong ? I'm banging my head into the screen for three hours now without being able to figure out the problem. Please help …
Not all shell variables defined in configure are forwarded to output files. Generally speaking, you need to use AC_SUBST() to tell Autoconf that a shell variable should be an output variable:
AC_SUBST([SIMGEAR_CPPFLAGS])
AC_SUBST([SIMGEAR_LIBRARY])

Use makeindex with pandoc while creating a PDF from a Markdown file

I have got a markdown file and like to convert it to pdf. I need an index. For this I found makeindx
I am using this command for creating a pdf from a markdown file:
pandoc "test.md" \
--from markdown --to latex \
--toc \
--toc-depth=1 \
--include-in-header index.tex \
--include-in-header chapter_break.tex \
--include-in-header inline_code.tex \
--include-in-header bullet_style.tex \
--include-in-header pdf_properties.tex \
--highlight-style pygments.theme \
-V toc-title='Inhaltsverzeichnis' \
-V title='Mein Titel' \
-V author='Ich' \
-V book=true \
-V date="24. Mai 2021" \
-V classoption='oneside' \
--template ./eisvogel.latex \
--listings \
-o "test.pdf"
The template Eisvogel I found on github. I asked the question in an issue here, too.
The file index.tex has this content:
\usepackage{makeidx}
\makeindex
In my document I use
Installation\index{Installation}
and at the end
\printindex
Unfortunately, no index is printed.
Am I doing something wrong?
Edit I found a temporarily solution:
First I create a *.latex.
pandoc JoomlaEnPDF.en.md \
-o 1.en.tex \
--from markdown \
--template ./eisvogel.latex \
--listings \
--toc \
--toc-depth=1 \
-V toc-title="Content" \
--top-level-division="part" \
--number-sections \
Then I run the commands manually.
pdflatex 1.en.tex
pdflatex 1.en.tex
makeindex 1.en.idx
cat ./1.en.ind >> JoomlaEnPDF.en.md
Then I create the pdf
pandoc JoomlaEnPDF.en.md \
-o 1.en.pdf \
--from markdown \
--template ./eisvogel.latex \
--listings \
--toc \
--toc-depth=1 \
-V toc-title="Table of Contents" \
--top-level-division="part" \
--number-sections \

How to convert configure options for use with cmake

I have a script for building a project that I need to upgrade from using configure to cmake. The original configure command is
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--with-clang \
--prefix=$PREFIX \
--libdir=$PREFIX/lib${LIBDIRSUFFIX} \
--incdir=$PREFIX/include \
--mandir=$PREFIX/man/man1 \
--etcdir=$PREFIX/etc/root \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--enable-roofit \
--enable-unuran \
--disable-builtin-freetype \
--disable-builtin-ftgl \
--disable-builtin-glew \
--disable-builtin-pcre \
--disable-builtin-zlib \
--disable-builtin-lzma \
$GSL_FLAGS \
$FFTW_FLAGS \
$QT_FLAGS \
--enable-shared \
--build=$ARCH-slackware-linux
I am not familiar enough with cmake to know how to do the equivalent. I would prefer a command line option but am open to modifying the CMakeLists.txt file as well.

(Cmake, Trilinos)clang: error: unsupported option '-fopenmp'

platform:macOS 11.1
when I tried to configure Trilinos, I met a problem and I can not handle it.
The following command is used to compile Trilinos:
#!/bin/bash
rm -rf CMakeCache.txt
rm -rf CMakeFiles
rm -rf CMakeCache.txt
cmake \
-D CMAKE_INSTALL_PREFIX:PATH=/Users/weiqiangguo/Downloads/Trilinos/build \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS:BOOL=ON \
\
-D TPL_ENABLE_MPI:BOOL=ON \
-D TPL_ENABLE_BLAS:BOOL=ON \
-D TPL_ENABLE_LAPACK:BOOL=ON \
-D TPL_ENABLE_Pthread:BOOL=ON \
-D TPL_ENABLE_HWLOC:BOOL=ON \
-D TPL_ENABLE_HDF5:BOOL=ON \
-D TPL_ENABLE_SCALAPACK:BOOL=ON \
-D TPL_ENABLE_SuperLU:BOOL=ON \
-D TPL_ENABLE_SuperLUDist:BOOL=ON \
-D TPL_ENABLE_METIS:BOOL=ON \
-D TPL_ENABLE_ParMETIS:BOOL=ON \
\
-D ML_ENABLE_SuperLU:BOOL=OFF \
\
-D CMAKE_C_COMPILER:STRING="mpicc" \
-D CMAKE_CXX_COMPILER:FILEPATH=/usr/local/bin/mpicxx \
-D CMAKE_Fortran_COMPILER:STRING="mpif90" \
-D CMAKE_CXX_FLAGS:STRING="-O3 -g -fopenmp" \
\
-D TPL_SCALAPACK_LIBRARIES='/usr/local/lib/libscalapack.dylib' \
\
-D Teuchos_ENABLE_COMPLEX=ON \
\
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
-D Trilinos_ENABLE_ML:BOOL=ON \
-D Trilinos_ENABLE_Belos:BOOL=ON \
-D Trilinos_ENABLE_Epetra:BOOL=ON \
-D Trilinos_ENABLE_EpetraExt:BOOL=ON \
-D Trilinos_ENABLE_Ifpack:BOOL=ON \
-D Trilinos_ENABLE_Amesos:BOOL=ON \
-D Trilinos_ENABLE_Anasazi:BOOL=ON \
-D Trilinos_ENABLE_NOX:BOOL=ON \
-D Trilinos_ENABLE_Teko:BOOL=ON \
-D Trilinos_ENABLE_Galeri:BOOL=ON \
-D Trilinos_ENABLE_OpenMP:BOOL=OFF \
-D Trilinos_ENABLE_PyTrilinos:BOOL=ON \
\
-D MPI_BASE_DIR:FILEPATH="/usr/local/Cellar/open-mpi" \
-D PYTHON_EXECUTABLE:FILEPATH="/usr/bin/python3" \
-D SuperLU_LIBRARY_DIRS:FILEPATH="/usr/local/lib" \
-D SuperLU_INCLUDE_DIRS:FILEPATH="/usr/local/include" \
-D SuperLUDist_LIBRARY_DIRS:FILEPATH="/usr/local/lib" \
-D SuperLUDist_INCLUDE_DIRS:FILEPATH="/usr/local/include" \
../
The error information is shown below:
Probing the environment ...
-- USE_XSDK_DEFAULTS='FALSE'
-- BUILD_SHARED_LIBS='ON'
-- CMAKE_BUILD_TYPE='Release'
-- MPI_BASE_DIR='/usr/local/Cellar/open-mpi'
-- MPI_BIN_DIR='/usr/local/Cellar/open-mpi/bin'
-- MPI_USE_COMPILER_WRAPPERS='ON'
-- Leaving current CMAKE_C_COMPILER=mpicc since it is already set!
-- Leaving current CMAKE_CXX_COMPILER=/usr/local/bin/mpicxx since it is already set!
-- Leaving current CMAKE_Fortran_COMPILER=mpif90 since it is already set!
-- MPI_EXEC='/usr/local/bin/mpiexec'
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/bin/mpicc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CMAKE_C_COMPILER_ID='AppleClang'
-- CMAKE_C_COMPILER_VERSION='12.0.0.12000032'
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/local/bin/mpicxx
-- Check for working CXX compiler: /usr/local/bin/mpicxx - broken
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.20/Modules/CMakeTestCXXCompiler.cmake:59 (message):
The C++ compiler
"/usr/local/bin/mpicxx"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/weiqiangguo/Downloads/Trilinos/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_690b0/fast && /Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_690b0.dir/build.make CMakeFiles/cmTC_690b0.dir/build
Building CXX object CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o
/usr/local/bin/mpicxx -O3 -g -fopenmp -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -std=gnu++14 -MD -MT CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o -c /Users/weiqiangguo/Downloads/Trilinos/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
clang: error: unsupported option '-fopenmp'
make[1]: *** [CMakeFiles/cmTC_690b0.dir/testCXXCompiler.cxx.o] Error 1
make: *** [cmTC_690b0/fast] Error 2
CMake will not be able to correctly generate this project.
I really don't know how to fix it. I also tried to set gcc complier as homebrew gcc instead of clang.
Could anyone help me with this?
Xcode toolchains have no support for OpenMP.
There is no technical reason other than that they want you to use the Apple specific APIs instead (which are obviously not equivalent).
To use OpenMP, you can use LLVM Clang/libc++/libopenmp which you should be able to install through Homebrew:
brew install --with-toolchain llvm
or build from source yourself.

yum stopped working with error No module named transactioninfo

Removed the following files by mistake and as a result yum stopped working.
Any idea what rpms exactly we need to re-install?
./abrt_exception_handler.pyo
./abrt_exception_handler.pyc
./abrt.pth
./abrt_exception_handler.py
./yum/sqlitesack.pyo
./yum/rpmsack.pyo
./yum/packages.pyo
./yum/misc.pyo
./yum/metalink.pyo
./yum/__init__.pyo
./yum/history.pyo
./yum/depsolve.pyo
./rpmUtils/miscutils.pyo
./yum/yumRepo.pyo
./yum/yumRepo.pyc
./yum/yumRepo.py
./yum/update_md.pyo
./yum/update_md.pyc
./yum/update_md.py
./yum/transactioninfo.pyo
./yum/transactioninfo.pyc
./yum/transactioninfo.py
./yum/sqlutils.pyo
./yum/sqlutils.pyc
./yum/sqlutils.py
Ok, found the solution. Since I don't know exactly which python modules belongs to which rpm, I did a re-install of most of the dependent rpms. Here it goes.
#!/bin/bash
for file in \
elfutils-0.152-1.el6.x86_64.rpm \
elfutils-libs-0.152-1.el6.x86_64.rpm \
expat-2.0.1-11.el6_2.x86_64.rpm \
gmp-4.3.1-7.el6_2.2.x86_64.rpm \
libxml2-2.7.6-8.el6_3.4.x86_64.rpm \
libxml2-python-2.7.6-8.el6_3.4.x86_64.rpm \
m2crypto-0.20.2-9.el6.x86_64.rpm \
python-2.6.6-36.el6.x86_64.rpm \
python-iniparse-0.3.1-2.1.el6.noarch.rpm \
python-urlgrabber-3.9.1-8.el6.noarch.rpm \
readline-6.0-4.el6.x86_64.rpm \
rpm-4.8.0-32.el6.x86_64.rpm \
rpm-libs-4.8.0-32.el6.x86_64.rpm \
rpm-python-4.8.0-32.el6.x86_64.rpm \
sqlite-3.6.20-1.el6.x86_64.rpm \
yum-3.2.29-40.el6.centos.noarch.rpm \
yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
do wget http://mirror.centos.org/centos-6/6/os/x86_64/Packages/$file;
done
rpm -Uvh *.rpm --force