Building the FBX SDK on Linux - linux

Trying to get one of the samples compiled on Ubuntu 12.04
I’m using
make -f Makefile-x64-static
However, I get the error
make: gcc4: Command not found
I tried switching from gcc4 to gcc in the makefile.
However, I get the compile errors
note: #pragma message: IMPORTANT NOTE: The FBX SDK API changed substantially. Please define FBXSDK_NEW_API in your project and fix compilation errors as instructed in fbxsdk_compatibility.h.
And the link error
/usr/bin/ld: cannot find -luuid
Any tips would be appreciated.

Pre-requisites
sudo apt-get install uuid-dev
sudo apt-get install libxmu-dev libxi-dev
sudo apt-get install libx11-dev
Makefile modifications required
Change gcc4 to gcc
CC = gcc
LD = gcc
add -lX11 to LIBS
LIBS = -lfbxsdk-$(LIBFBXVERSION)$(STATIC) -lm -lrt -luuid -lc -lstdc++ -lpthread -ldl -lglut_gcc34-amd64 -lGLEW_amd64 -lGLU -lGL -lXmu -lX11
add -DFBXSDK_NEW_API to C_FLAGS and CXX_FLAGS
CFLAGS = -m64 -DFBXSDK_NEW_API
CXXFLAGS = -m64 -DFBXSDK_NEW_API

Related

compile pybind11 with g++ fails inside docker

Summary: I'm unable to get an example from the pybind11 documentation to compile with g++ inside Docker.
I have a directory with two files, hello.cpp and Dockerfile. The contents of the Dockerfile are
FROM phusion/baseimage:0.11
# Use baseimage-docker's init system
CMD ["/sbin/my_init"]
# Update and install packages
RUN apt update && apt -y upgrade && apt -y install \
build-essential \
python3-dev \
python3-pip
RUN pip3 install pybind11
# Clean up apt mess
RUN apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
The c++ file hello.cpp contains
#include <pybind11/embed.h> // everything needed for embedding
namespace py = pybind11;
int main() {
py::scoped_interpreter guard{}; // start the interpreter and keep it alive
py::print("Hello, World!"); // use the Python API
}
The .cpp content comes from the pybind11 tutorial
To compile inside the container, I figured out where pybind11 lives using
python3 -c "import pybind11; print(pybind11.get_include());"
Then I figured out where Python.h lives using
python3-config --includes
I also am using the flags specified by
python3-config --cflags --ldflags
When I run the following I get an error.
g++ -I /usr/local/lib/python3.6/dist-packages/pybind11/include \
-I /usr/include/python3.6m \
-Wno-unused-result -Wsign-compare -g -fdebug-prefix-map=/build/python3.6-e9shER/python3.6-3.6.9=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector -Wformat -Werror=format-security -DNDEBUG -g -fwrapv -O3 -Wall -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu \
-L/usr/lib -lpython3.6m -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions \
-std=c++14 \
-fPIC \
hello.cpp
I'm showing a snippet of the top and bottom of the messages.
call_calc.cpp: In function ‘int main()’:
call_calc.cpp:13:9: warning: unused variable ‘n’ [-Wunused-variable]
int n = result.cast<int>();
^
/tmp/ccpr9DIE.o: In function `pybind11_static_get':
/usr/local/lib/python3.6/dist-packages/pybind11/include/pybind11/detail/class.h:48: undefined reference to `PyProperty_Type'
/tmp/ccpr9DIE.o: In function `pybind11_static_set':
/usr/local/lib/python3.6/dist-packages/pybind11/include/pybind11/detail/class.h:54: undefined reference to `PyProperty_Type'
/tmp/ccpr9DIE.o: In function `pybind11::cast_error::set_error() const':
/usr/local/lib/python3.6/dist-packages/pybind11/include/pybind11/detail/common.h:722: undefined reference to `PyExc_RuntimeError'
/usr/local/lib/python3.6/dist-packages/pybind11/include/pybind11/detail/common.h:722: undefined reference to `PyErr_SetString'
/tmp/ccpr9DIE.o: In function `pybind11::detail::translate_exception(std::__exception_ptr::exception_ptr)':
...snipped...
/usr/local/lib/python3.6/dist-packages/pybind11/include/pybind11/cast.h:1052: undefined reference to `PyNumber_Check'
/usr/local/lib/python3.6/dist-packages/pybind11/include/pybind11/cast.h:1053: undefined reference to `PyNumber_Long'
/usr/local/lib/python3.6/dist-packages/pybind11/include/pybind11/cast.h:1056: undefined reference to `PyErr_Clear'
/tmp/ccpr9DIE.o: In function `main':
/usr/local/lib/python3.6/dist-packages/pybind11/include/pybind11/pybind11.h:942: undefined reference to `PyImport_ImportModule'
collect2: error: ld returned 1 exit status
There are a couple related questions 1,2,3 but I am unable to apply those to my situation.
I am able to get the simple function example to work.
When I use
g++ -O3 -Wall -shared -std=c++17 -fPIC `python3 -m pybind11 --includes` example_hello_world_py_inside.cpp
I do get a binary but running the binary triggers a segmentation fault.

DBD-Oracle-1.76 installation issue

I am setting up a new server for POSTGRESQL, so we have to migrate from ORACLE to POSTGRES while installing DBD-Oracle-1.76 package. However, we are getting error even though we have exported ORACLE_BASE, ORACLE_HOME, LD_LIBRARY, LD_LIBRARY_PATH.
Here is what I have tried:
make
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro Oracle.o dbdimp.o oci8.o -o blib/arch/auto/DBD/Oracle/Oracle.so \
-L/optware/oracle/12.2.0.1/client_1/lib -lclntsh -ldl -lm -lpthread -lnsl -lirc -limf -lirc -lrt -laio -lresolv -lsvml \
Here is the error:
/bin/ld: cannot find -laio
collect2: error: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/Oracle/Oracle.so] Error 1
Any ideas? Any help would be greatly appreciated!
If you're on Redhat/Fedora/RHEL/CentOS then try this before make:
sudo yum install libaio-devel
If Ubuntu (or Debian?) try:
sudo apt install libaio-dev
...or sudo apt-get install libaio libaio1 libaio-dev
I also needed:
export ORACLE_HOME=/wherever/oracle18-instantclient/instantclient_18_5
export LD_LIBRARY_PATH="$ORACLE_HOME:/usr/lib/x86_64-linux-gnu/"
Error while installing DBD::Oracle might be helpful.

Installing ApkStudio on Linux(Ubuntu 15.04)

I tried installing APK Studio on my Ubuntu 15.04 machine but keep getting this error message:
g++ -c -m64 -pipe -O2 -Wall -W -D_REENTRANT -DAPP_REV_SHORT=\"0978cd4\" -DAPP_REV_LONG=\"0978cd4653fcfed5601d57b8e0f7cfade7f64d7a\" -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -o adb.o src/adb.cpp
In file included from ./include/adb.h:5:0,
from src/adb.cpp:1:
./include/process.h:4:30: fatal error: QRegularExpression: No such file or directory
#include <QRegularExpression>
^
compilation terminated.
Makefile:474: recipe for target 'adb.o' failed
make: *** [adb.o] Error 1.
How can I resolve this issue?
You are probably using an unsupported QT version, check your version with:
$ qmake -version
QMake version 2.01a
Using Qt version 4.8.6 in /usr/lib/x86_64-linux-gnu
Make sure you have GCC 4.6+, QT 5.2+
On Ubuntu, you can run:
$ sudo apt-get install qt5-qmake qt5-default libqt5opengl5-dev
$ qmake -version
QMake version 3.0
Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu
Running make again should build ApkStudio with no errors.

While using make command to install touch egg

I'm trying to install touchegg,
Following is the error i'm getting while trying to use make command in su mode:
root#PG04954:/home/esrsank/Downloads/touchegg-1.1# make
g++ -m64 -Wl,-O1 -o touchegg Config.o GestureCollector.o GestureHandler.o
GestureFactory.o Gesture.o GestureTypeEnum.o GestureDirectionEnum.o
ActionTypeEnum.o ActionFactory.o MinimizeWindow.o CloseWindow.o
MaximizeRestoreWindow.o ShowDesktop.o SendKeys.o ChangeDesktop.o
ResizeWindow.o MoveWindow.o RunCommand.o DragAndDrop.o ChangeViewport.o
MouseClick.o Scroll.o WindowListener.o Main.o Touchegg.o moc_GestureCollector.o
moc_GestureHandler.o moc_GestureTypeEnum.o moc_GestureDirectionEnum.o
moc_ActionTypeEnum.o moc_WindowListener.o moc_Touchegg.o -
L/usr/lib/x86_64-linux-gnu -lutouch-geis -lX11 -lXtst -lXext -lQtXml -lQtGui
-lQtCore -lpthread
/usr/bin/ld: cannot find -lutouch-geis
collect2: ld returned 1 exit status
make: *** [touchegg] Error 1
Any Solutions?
It can't find libutouch-geis, either because it isn't installed or because the location of this library isn't in the linker path.
The instructions on this page suggest installing the following:
$ sudo apt-get install build-essential libqt4-dev utouch libgeis-dev libx11-6 libxtst-dev
then running:
$ qmake
$ make
$ sudo make install

Compiling Gettext on Fedora 20 don't work

I have an error when I'm trying to compile gettext on Fedora 20.
Firstly, I type make and I have this error:
[anthony#localhost ms-sys-2.3.0]$ make
cc -O2 -ansi -pedantic -Wall -c -I inc -D PACKAGE=\"ms-sys\" -D LOCALEDIR=\"/usr/local/share/locale\" -idirafter include-fallback -D_FILE_OFFSET_BITS=64 -o obj/fat32fd.o src/fat32fd.c
make: cc: Command not found
make: *** [obj/fat32fd.o] Error 127
Please help me!
Install gcc by running yum
yum install gcc
Use gcc instead of cc in your makefile and cli

Resources