Compiling meshlab on Centos EL7 - qt

I'm have trouble compiling meshlab-2016.12 on Centos.EL7.
I got some of the way.
Updated QT to Qt-5.9.1 as latest on Centos is Qt version 5.6.1 - which I had previously installed
sudo yum install qt5-qtbase
sudo yum install qt5-qtx11extras
sudo yum install qt5-qtbase-devel
However at least Qt5.7 is needed for meshlab
Then set these env. variables
setenv QTDIR /usr/local/Qt-5.9.1
setenv QTINC /usr/local/Qt-5.9.1/include
setenv QTLIB /usr/local/Qt-5.9.1/lib
setenv PATH /usr/local/Qt-5.9.1/bin:$PATH
setenv PATH /usr/local/bin:/usr/local/Qt-5.9.1/bin:$PATH
Then followed instructions on a test machine, installing into /opt/TESTING
Installed vcglib into /opt/TESTING
downloaded meshlab-2016.12 into /opt/TESTING and unpacked it there
Ran the following
qmake -project
(This picks up the correct version of QT)
qmake src/external/external.pro
(To make the external libraries - including jhead-2.95
gmake
gmake install
(To make the external libraries - including jhead-2.95 )
qmake src/meshlab_mini.pro
(To build meshlab with a minimal set of plugins )
This is where it fails, as below;
../../vcglib/vcg/complex/algorithms/clean.h:1789:0:
warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
pragma omp parallel for schedule(dynamic, 10)
g++ -Wl,-O1 -Wl,-z,origin -Wl,-rpath,\$ORIGIN/../distrib -Wl,-rpath,
/usr/local/Qt-5.9.1/lib -o ../distrib/meshlab main.o mainwindow_Init.o
mainwindow_RunTime.o glarea.o multiViewer_Container.o plugindialog.o
customDialog.o filterScriptDialog.o saveSnapshotDialog.o layerDialog.o
savemaskexporter.o changetexturename.o stdpardialog.o ml_std_par_dialog.o
xmlstdpardialog.o additionalgui.o xmlgeneratorgui.o ml_render_gui.o
ml_rendering_actions.o ml_default_decorators.o ml_selection_buffers.o
trackball.o trackmode.o coordinateframe.o glarea_setting.o filterthread.o
qrc_meshlab.o moc_interfaces.o moc_mainwindow.o moc_glarea.o
moc_multiViewer_Container.o moc_plugindialog.o moc_customDialog.o
moc_filterScriptDialog.o moc_saveSnapshotDialog.o moc_savemaskexporter.o
moc_changetexturename.o moc_layerDialog.o moc_stdpardialog.o
moc_ml_std_par_dialog.o moc_xmlstdpardialog.o moc_additionalgui.o
moc_xmlgeneratorgui.o moc_ml_render_gui.o moc_ml_rendering_actions.o
moc_filterthread.o -L../external/lib/linux-g++ -ljhead -L../distrib
-lcommon -lGLU -L/usr/local/Qt-5.9.1/lib -lQt5OpenGL -lQt5Widgets -lQt5Gui
-lQt5Xml -lQt5XmlPatterns -lQt5Network -lQt5Script -lQt5Core -lGL -lpthread
/bin/ld: cannot find -ljhead
collect2: error: ld returned 1 exit status
gmake[1]: *** [../distrib/meshlab] Error 1
gmake[1]: Leaving directory `/opt/TESTING/meshlab-2016.12/meshlab'
gmake: *** [sub-meshlab-make_first-ordered] Error 2
So it's saying ld can't find ljhead. Other parts of the compile do seem to be finding it though eg
-I../src/external/glew-1.7.0/include -I../src/external/jhead-2.95
Looking at ld
/bin/ld -V
GNU ld version 2.25.1-22.base.el7
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
and
/
usr/bin/ld -V
GNU ld version 2.25.1-22.base.el7
Supported emulations:
elf_x86_64
elf32_x86_64
elf_i386
i386linux
elf_l1om
elf_k1om
Any advice would be useful at this point. Hopefully I've just missed something out
Updated:
Tried workaround from William Brown below, which gave some progress. Failed at later point
gmake[1]: Leaving directory `/opt/src/meshlab/meshlabplugins/filter_layer'
cd meshlabplugins/filter_measure/ && ( test -e Makefile || /opt/bin/Qt5.7.1/5.7/gcc_64/bin/qmake
/opt/src/meshlab/src/meshlabplugins/filter_measure/filter_measure.pro -o Makefile ) && gmake -f Makefile
gmake[1]: Entering directory `/opt/src/meshlab/meshlabplugins/filter_measure'
gmake[1]: *** No rule to make target `filter_measure.xml', needed by `../../distrib/plugins/libfilter_measure.so'. Stop.
gmake[1]: Leaving directory `/opt/src/meshlab/meshlabplugins/filter_measure'
gmake: *** [sub-meshlabplugins-filter_measure-make_first-ordered] Error 2

I have managed to get past that problem on Centos 7 (7.3.1611).
There seem to be 2 issues, and I don't claim that this is the right fix, just a work-around.
After unpacking the tar file I cd to the top level (I have unpacked to /local/meshlab). I then create a link:
# ln -s ./src/external eternal
The reason being that the -L in the statement that fails seems to be pointed to an external folder at that top level, not in ./src.
Having done that I can build external.pro without any problem, and the output .a files all go into /local/meshlab/lib/linux-g++. Without the link they were deep down in a temporary build folder.
However the -L doesn't look there, it looks in /local/meshlab/src/external/lib/linux-g++/, where there are some pre-shipped .a files already. So I copy the .a files to there:
# cp /local/meshlab/lib/linux-g++/*.a /local/meshlab/src/external/lib/linux-g++/
Now when I use:
# qmake src/meshlab_mini.pro
# gmake
It works and builds a runnable meshlab binary in /local/meshlab/distrib.

Related

How to fix: gawk: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory

I was running make and encountered the following error:
gawk: error while loading shared libraries: libreadline.so.4: cannot open shared object file: No such file or directory
config.status: error: could not create mjson.pc
Reaping losing child 0x564b30cbed70 PID 48255
make[1]: *** [Makefile:44: libmjson] Error 1
Removing child 0x564b30cbed70 PID 48255 from chain.
make[1]: Leaving directory '/home/minipc/econet/apps/public/libjson-1.5'
The libreadline.so.4 is too old to install in my current Linux machine (Ubuntu 20.04). So instead I installed libreadline.so.8, and created a symbolic link to libreadline.so.4. And I checked, it works:
lrwxrwxrwx 1 root root 25 Aug 12 21:17 /lib32/libreadline.so.4 -> /lib32/libreadline.so.8.0
lrwxrwxrwx 1 root root 18 Feb 25 2020 /lib32/libreadline.so.8 -> libreadline.so.8.0
-rw-r--r-- 1 root root 311884 Feb 25 2020 /lib32/libreadline.so.8.0
And the relevant part in Makefile is the following:
./configure --prefix=/home/minipc/econet/apps/public/libjson-1.5 --libdir=/lib32 --includedir=/lib32 --disable-static --enable-shared \
And I checked it in the console output when running the make.
So why it still can't find libreadline.so.4? Is it because libreadline.so.8.0 too new to be linked by libreadline.so.4 so the program doesn't recognize it?
Also, when I run
$ ldconfig -p|grep libreadline
libreadline.so.8 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.8
libreadline.so.8 (libc6) => /lib32/libreadline.so.8
libreadline.so.5 (libc6,x86-64) => /lib/x86_64-linux-gnu/libreadline.so.5
Only libreadline.so.5 and libreadline.so.4 appears. So the softlink would not be recognized by the system?
The libreadline.so.8 maybe too new to be used as the source of symbolic link of libreadline.so.4. Or it may need to be in another directory such as /lib to be linked by gawk.
I try $gawk return command not found . Then I run $sudo apt install gawk and check the gawk is of version GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0). I run $make again and found the same error.
Then I try $export $AWKPATH and find out that there is another path to store the gawk bin. Then I enter the directory and run $gawk, the same error pop out. I copy the /usr/bin/gawk ( the newly installed gawk) to update the gawk in the directory, and then run $gawk, it is the newest one.
Then I run $make again and the issue got solved.

compile tensorrt sample not found NvOnnxParserTypedefs.h

i have install tensorrt
i have already checked python -c "import tensorrt"
but when i compile tensorrt sample
make
it throws out
../../include/NvOnnxParser.h:27:10: fatal error: NvOnnxParserTypedefs.h: No such file or directory
#include "NvOnnxParserTypedefs.h"
i find include file in the dictionary
ls ../../include
the result is
NvCaffeParser.h NvInferPlugin.h NvOnnxParser.h NvUffParser.h
NvInfer.h NvOnnxConfig.h NvOnnxParserRuntime.h NvUtils.h
who can help me?
there maybe some useful resources
https://github.com/NVIDIA/TensorRT/blob/release/6.0/samples/opensource/sampleMNIST/README.md
https://docs.nvidia.com/deeplearning/sdk/tensorrt-sample-support-guide/index.html#mnist_sample
https://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html#installing-tar
https://github.com/NVIDIA/TensorRT/tree/release/5.1
https://github.com/onnx/onnx-tensorrt/tree/5.1
https://github.com/NVIDIA/TensorRT/blob/release/6.0/samples/opensource/sampleMNIST/README.md
i fixed this issues
may be your compiler not found the NvOnnxParserTypedefs.h file
try
sudo find / -name NvOnnxParserTypedefs.h
and do the follow script
sudo cp /your/path/to/NvOnnxParserTypedefs.h /your_tensorrt_path/include/
and it may work

R package with C code on Windows (win-build) fails to compile, ar: Command not found

I have a package that I'm trying to build on Windows using win-builder for CRAN. The compilation fails with this message:
ar -crs libmseed.a fileutils.o genutils.o gswap.o lmplatform.o lookup.o msrutils.o pack.o packdata.o traceutils.o tracelist.o parseutils.o unpack.o unpackdata.o selection.o logging.o
make[1]: ar: Command not found
This is my Makevars.win file:
PKG_CFLAGS=
PKG_CPPFLAGS=-Ilibmseed
PKG_LIBS=-Llibmseed -lmseed
$(SHLIB): libmseed/libmseed.a
libmseed/libmseed.a:
#(cd libmseed && $(MAKE) static CC="$(CC)" CFLAGS="$(CFLAGS)" AR="$(AR)")
clean:
#(cd libmseed && $(MAKE) clean)
I have also tried modifying the Makevars.win file using AR="ar mingw" and without AR specified. I get the same "ar: Command not found" message. Does anyone know a solution to this problem?
This is solved. I changed the Makefile from
ar -crs $(LIB_A) $(LIB_OBJS)
to
$(AR) -crs $(LIB_A) $(LIB_OBJS)
and now it compiles.

Error in installing nachos 4.0 c++ version

I have been trying to install nachos 4.0 (c++ version), but on running the "make" command, I get the following error:
gcc -E -I../userprog -I../threads start.cc > _/strt.s
mips-xgcc/as -mips2 -o _/start.o /strt.s
make[1]: execvp: mips-xgcc/as: Permission denied
make[1]: * [/start.o] Error 127
make: * [all] Error 2
I also tried giving all the permissions to the mentioned folder (mips-xgcc), but to no avail.
Also I had doubts regarding running user-processes. There is a sample code in the test folder, which performs matrix multiplication. To run this program one needs to convert the binary which is .coff format to .noff format (where .coff is the format of any a.out file in linux). My doubt is that since the example code contains statements which are peculiar to the MIPS architecture (e.g: Exit(C[Dim-1][Dim-1]) in "matmult.c"), how can we first compile the program as normal gcc and then use coff2noff to convert it into ".noff" format.
Is it possible that user-level process doesn't run because of the error mentioned in "1."
Any help would be appreciated.
Thank You

QtCreator 1.3, Qt 4.6.2 and build problem with cmake on windows

I'm trying to build a cmake project from QtCreator. When I open the project I need to give an argument to cmake otherwise Qt is not detected:
-DQT_QMAKE_EXECUTABLE=D:/Qt/4.6.2/bin/qmake.exe
The build step halts with this error:
Running build steps for project CollidingMice...
Starting: D:/Qt/2010.02/bin/jom.exe
"C:\Programmi\CMake 2.8\bin\cmake.exe" -HC:\devel\SRC\collidingmice_cmake -BC:\devel\SRC\collidingmice_cmake\qtcreator-build --check-build-system CMakeFiles\Makefile.cmake 0
"C:\Programmi\CMake 2.8\bin\cmake.exe" -E cmake_progress_start C:\devel\SRC\collidingmice_cmake\qtcreator-build\CMakeFiles C:\devel\SRC\collidingmice_cmake\qtcreator-build\CMakeFiles\progress.marks
D:\Qt\2010.02\bin\jom.exe -f CMakeFiles\Makefile2 /nologo - all
D:\Qt\2010.02\bin\jom.exe -f CMakeFiles\collidingmice.dir\build.make /nologo -L CMakeFiles\collidingmice.dir\depend
"C:\Programmi\CMake 2.8\bin\cmake.exe" -E cmake_progress_report C:\devel\SRC\collidingmice_cmake\qtcreator-build\CMakeFiles 4
[ 25] Generating qrc_mice.cxx
d:\Qt\4.6.2\bin\rcc.exe -name mice -o C:/devel/SRC/collidingmice_cmake/qtcreator-build/qrc_mice.cxx C:/devel/SRC/collidingmice_cmake/mice.qrc
"C:\Programmi\CMake 2.8\bin\cmake.exe" -E cmake_depends "NMake Makefiles" C:\devel\SRC\collidingmice_cmake C:\devel\SRC\collidingmice_cmake C:\devel\SRC\collidingmice_cmake\qtcreator-build C:\devel\SRC\collidingmice_cmake\qtcreator-build C:\devel\SRC\collidingmice_cmake\qtcreator-build\CMakeFiles\collidingmice.dir\DependInfo.cmake --color=
Scanning dependencies of target collidingmice
D:\Qt\2010.02\bin\jom.exe -f CMakeFiles\collidingmice.dir\build.make /nologo -L CMakeFiles\collidingmice.dir\build
"C:\Programmi\CMake 2.8\bin\cmake.exe" -E cmake_progress_report C:\devel\SRC\collidingmice_cmake\qtcreator-build\CMakeFiles 1
[ 50] Building CXX object CMakeFiles/collidingmice.dir/main.cpp.obj
C:\PROGRA~1\MICROS~1.0\VC\bin\cl.exe #C:\DOCUME~1\NICOLA~1\IMPOST~1\Temp\main.cpp.obj.461273.jom
jom 0.8.3 - empower your cores
command failed with exit code 2
command failed with exit code 2
command failed with exit code 2
command failed with exit code 2
Exited with code 2.
Error while building project CollidingMice
When executing build step 'Make'
The project I'm tring to build is the collingmice qt example and it builds from qt prompt. Here there is the CMakeLists:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(CollidingMice)
################################################# QT4 Handling
FIND_PACKAGE(Qt4 REQUIRED)
#this include set all the qt variable need to compile qt
INCLUDE(${QT_USE_FILE})
#Put here all headers files that need moc
SET( Qt4_SRC
)
#Put here .ui form files
SET( Qt4_UI
)
#Put here .qrc resource files
SET( Qt4_RES mice.qrc
)
#Cmake macro
QT4_WRAP_CPP(MOC_CPP ${Qt4_SRC})
QT4_WRAP_UI(UI_CPP ${Qt4_UI})
QT4_ADD_RESOURCES(RES_H ${Qt4_RES})
################################################# CPack
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "My funky project")
SET(CPACK_PACKAGE_VENDOR "Me, myself, and I")
#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt")
#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "3")
SET(CPACK_PACKAGE_VERSION_PATCH "2")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
# sure there is at least one set of four (4) backlasshes.
SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} My Famous Project")
SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.my-project-home-page.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.my-personal-home-page.com")
SET(CPACK_NSIS_CONTACT "me#my-personal-home-page.com")
SET(CPACK_NSIS_MODIFY_PATH ON)
ELSE(WIN32 AND NOT UNIX)
SET(CPACK_STRIP_FILES "bin/MyExecutable")
SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)
SET(CPACK_PACKAGE_EXECUTABLES "MyExecutable" "My Executable")
INCLUDE(CPack)
################################################# General
SET(CMAKE_BUILD_TYPE Release)
SET(CMAKE_CXX_FLAGS "-Wall")
INCLUDE_DIRECTORIES( . )
SET( SRC
main.cpp
mouse.cpp
${MOC_CPP}
${UI_CPP}
${RES_H}
)
SET( LIB
${QT_LIBRARIES}
)
ADD_EXECUTABLE(collidingmice ${SRC})
TARGET_LINK_LIBRARIES( collidingmice ${LIB} )
It's not clear from the Jom output what the error is.
Try running the latest version of Qt Creator (2.0) and also adding the Qt bin/ directory into your PATH.

Resources