compiling OpenVSP on Debian land

206 views
Skip to first unread message

Ricardo Reis

unread,
Mar 30, 2018, 10:27:56 AM3/30/18
to OpenVSP
Hi all

I have divided into the posts here, the wiki and around the web, maybe you could help me finish this compile

I am compiling OpenVSP in a debian machine

I am using the latest git version;

Pre-compile the libs according to:

cmake -DCMAKE_BUILD_TYPE=Release \
-DVSP_USE_SYSTEM_CPPTEST=true \
-DVSP_USE_SYSTEM_LIBXML2=false \
-DVSP_USE_SYSTEM_EIGEN=false \
-DVSP_USE_SYSTEM_FLTK=true \
-DVSP_USE_SYSTEM_GLM=false \
-DVSP_USE_SYSTEM_GLEW=true \
-DVSP_USE_SYSTEM_CMINPACK=true \
-DVSP_USE_SYSTEM_CODEELI=false \
-DVSP_USE_SYSTEM_LIBIGES=false \
../repo/Libraries

But I am having a problem linking part of the results with the message bellow:


[  2%] Built target STEPCODE
[  3%] Built target glfont2
[  3%] Built target stb_image
[  4%] Built target cartesian
[  4%] Built target triangle
[  6%] Built target sixseries
[  7%] Built target tritri
[  7%] Built target clipper
[  7%] Built target wavedragEL
[ 16%] Built target Angelscript
[ 26%] Built target vsp_graphic
[ 34%] Built target screens
[ 40%] Built target util
[ 41%] Built target xmlvsp
[ 56%] Built target geom_core
[ 60%] Built target cfd_mesh
[ 76%] Built target gui_and_draw
[ 77%] Built target geom_api_g
[ 78%] Built target geom_api
[ 79%] Built target gui_interface_g
[ 79%] Linking CXX executable vspscript
../geom_core/libgeom_core.a(XSec.cpp.o): In function `XSec::EncodeXSec(_xmlNode*&)':
XSec.cpp:(.text+0x65a): undefined reference to `xmlNewChild'
../geom_core/libgeom_core.a(XSec.cpp.o): In function `XSec::EncodeXml(_xmlNode*&)':
XSec.cpp:(.text+0x11ca0): undefined reference to `xmlNewChild'
XSec.cpp:(.text+0x11ce6): undefined reference to `xmlNewChild'
../geom_core/libgeom_core.a(XSec.cpp.o): In function `XSec::CopyFrom(XSec*)':
XSec.cpp:(.text+0x11d8d): undefined reference to `xmlNewNode'
XSec.cpp:(.text+0x11e77): undefined reference to `xmlFreeNode'
../geom_core/libgeom_core.a(DesignVarMgr.cpp.o): In function `DesignVarMgrSingleton::WriteDesVarsXDDM(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
DesignVarMgr.cpp:(.text+0x521): undefined reference to `xmlNewDoc'
DesignVarMgr.cpp:(.text+0x537): undefined reference to `xmlNewNode'
DesignVarMgr.cpp:(.text+0x547): undefined reference to `xmlDocSetRootElement'
DesignVarMgr.cpp:(.text+0x5e6): undefined reference to `xmlSetProp'
DesignVarMgr.cpp:(.text+0x61c): undefined reference to `xmlSetProp'
DesignVarMgr.cpp:(.text+0x632): undefined reference to `xmlSetProp'
DesignVarMgr.cpp:(.text+0x691): undefined reference to `xmlNewChild'
DesignVarMgr.cpp:(.text+0x757): undefined reference to `xmlSetProp'
DesignVarMgr.cpp:(.text+0x7ec): undefined reference to `xmlSetProp'
DesignVarMgr.cpp:(.text+0x8a7): undefined reference to `xmlNewChild'
DesignVarMgr.cpp:(.text+0x986): undefined reference to `xmlSaveFormatFile'
DesignVarMgr.cpp:(.text+0x98e): undefined reference to `xmlFreeDoc'

(bla bla bla)


../xmlvsp/libxmlvsp.a(XmlUtil.cpp.o): In function `XmlUtil::GetNumArray(_xmlNode*, char)':
XmlUtil.cpp:(.text+0xafc): undefined reference to `xmlNodeListGetString'
XmlUtil.cpp:(.text+0xb4d): undefined reference to `xmlFree'
../xmlvsp/libxmlvsp.a(XmlUtil.cpp.o): In function `XmlUtil::ExtractDoubleArray(_xmlNode*, char, double*, int)':
XmlUtil.cpp:(.text+0xb94): undefined reference to `xmlNodeListGetString'
XmlUtil.cpp:(.text+0xc6a): undefined reference to `xmlFree'
../xmlvsp/libxmlvsp.a(XmlUtil.cpp.o): In function `XmlUtil::ExtractIntArray(_xmlNode*, char, int*, int)':
XmlUtil.cpp:(.text+0xcd4): undefined reference to `xmlNodeListGetString'
XmlUtil.cpp:(.text+0xda9): undefined reference to `xmlFree'
../xmlvsp/libxmlvsp.a(XmlUtil.cpp.o): In function `XmlUtil::SetStringProp(_xmlNode*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)':
XmlUtil.cpp:(.text+0xad4): undefined reference to `xmlSetProp'
collect2: error: ld returned 1 exit status
make[2]: *** [vsp/CMakeFiles/vspscript.dir/build.make:141: vsp/vspscript] Error 1
make[1]: *** [CMakeFiles/Makefile2:1442: vsp/CMakeFiles/vspscript.dir/all] Error 2
make: *** [Makefile:152: all] Error 2



I have traced xmlSetProp to the libxml2 library and thats why I have compile the version from OpenVSP

Is it a linker probem? does it has any similarity to the one reported here: https://forums.fedoraforum.org/showthread.php?246434-Compiling-from-source-fails-(DSO)


thanks for all the help,

rreis














CMakeCache.txt
make.log

Ricardo Reis

unread,
Apr 3, 2018, 4:38:16 PM4/3/18
to OpenVSP
For reference, this post solved the problem: https://groups.google.com/forum/#!searchin/openvsp/libxml2|sort:date/openvsp/0PpAq3Wac7M/kNFkwpfjAwAJ

I am using the build libs first strategy

I have added an extra line to CMakecache.txt as bellow:

//Path to a file.
LIBXML2_INCLUDE_DIR:PATH=/opt/OpenVSP/blibs/LIBXML2-prefix/include/libxml2

LIBXML2_LIBRARIES:FILEPATH=/opt/OpenVSP/blibs/LIBXML2-prefix/lib/libxml2.a # new line

Also, the following use of the libraries from OpenVSP helped:

cmake -DCMAKE_BUILD_TYPE=Release \
-DVSP_USE_SYSTEM_CPPTEST=false \
-DVSP_USE_SYSTEM_LIBXML2=true \

-DVSP_USE_SYSTEM_EIGEN=false \
-DVSP_USE_SYSTEM_FLTK=true \
-DVSP_USE_SYSTEM_GLM=false \
-DVSP_USE_SYSTEM_GLEW=true \
-DVSP_USE_SYSTEM_CMINPACK=true \
-DVSP_USE_SYSTEM_CODEELI=false \
-DVSP_USE_SYSTEM_LIBIGES=false \
../repo/Libraries

kind regards

Ricardo Reis


Tim Molteno

unread,
Apr 25, 2018, 10:00:22 AM4/25/18
to OpenVSP
I still haven't quite got this building on Debian buster.

I have tried several variants. Are you sure about the DVSP_USE_SYSTEM_LIBXML2=true line above? I get linker errors.

Below are instructions which get almost all the way, failing to link after successfully building the libraries, but fails with

[ 97%] Linking CXX executable apitest_g
[ 97%] Built target apitest_g
[ 98%] Linking CXX shared module _vsp_g.so
/usr/bin/ld: /home/tim/OpenVSP/buildlibs/LIBXML2-prefix/lib/libxml2.a(uri.o): relocation R_X86_64_PC32 against symbol `xmlFree' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value

collect2: error: ld returned 1 exit status



Kind Regards,
Tim

Below are the complete instructions...





# Trying to build on debian buster
sudo apt-get install git git-gui cmake libxml2-dev libfltk1.3-dev g++ libjpeg-dev libglm-dev libeigen3-dev libcminpack-dev libglew-dev swig doxygen


# Building the Libraries first

mkdir OpenVSP
cd OpenVSP
mkdir repo build buildlibs
git clone https://github.com/OpenVSP/OpenVSP.git repo

################################## BUILD LIBRARIES ##############################################

cd buildlibs

cmake -DCMAKE_BUILD_TYPE=Release \
-DVSP_USE_SYSTEM_CPPTEST=false \
-DVSP_USE_SYSTEM_LIBXML2=false \

-DVSP_USE_SYSTEM_EIGEN=false \
-DVSP_USE_SYSTEM_FLTK=true \
-DVSP_USE_SYSTEM_GLM=false \
-DVSP_USE_SYSTEM_GLEW=true \
-DVSP_USE_SYSTEM_CMINPACK=true \
-DVSP_USE_SYSTEM_CODEELI=false \
-DVSP_USE_SYSTEM_LIBIGES=false \
../repo/Libraries

make -j 4

cd ../build

cmake ../repo/src/ -DVSP_LIBRARY_PATH=/home/tim/OpenVSP/buildlibs -DCMAKE_BUILD_TYPE=Release

make -j 4

# This fails because of a fluid issue. See
# https://github.com/OpenVSP/OpenVSP/issues/87

cp ../buildlibs/FLTK-prefix/bin/fluid ../repo/src/vsp_aero/viewer/
cp ../buildlibs/FLTK-prefix/bin/fluid ../repo/src/fltk_screens/

make -j4

# Now XML fails to work (note we are NOT using the system libxml2 (as that doesn't work - see DVSP_USE_SYSTEM_LIBXML2=false)
# Following https://groups.google.com/forum/#!topic/openvsp/1dUUzURY1ko, which suggests.
# Add line to CMakeCache (in buildlibs) to fix the libxml problem.
# and correct the path to the LIBXML2_INCLUDE_DIR
LIBXML2_INCLUDE_DIR:PATH=/home/tim/OpenVSP/buildlibs/LIBXML2-prefix/include/libxml2
LIBXML2_LIBRARIES:FILEPATH=/home/tim/OpenVSP/buildlibs/LIBXML2-prefix/lib/libxml2.a

make -j4   # FAILS HERE

Ricardo Reis

unread,
Apr 25, 2018, 10:48:58 AM4/25/18
to OpenVSP
I have rechecked and I am using the system libraries.

The modification still applies though because the second line is missing from the OpenVSP CMake process. try with the system Libxml2 and the line bellow... tell me if it works

//Path to a file.
LIBXML2_INCLUDE_DIR:PATH=/usr/include/libxml2

LIBXML2_LIBRARIES:FILEPATH=/usr/lib/x86_64-linux-gnu/libxml2.so


kind regards ricardo reis

Tim Molteno

unread,
Apr 27, 2018, 8:04:34 AM4/27/18
to ope...@googlegroups.com
Success!

Many many thanks. I had been tearing my hair out on that one!. Attached are updated installation instructions
for debian buster.

Once again. Many thanks!

Kind Regards
Tim

--
You received this message because you are subscribed to the Google Groups "OpenVSP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openvsp+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Tim Molteno
Electronics Research
Department of Physics
University of Otago
openvsp_build.txt
Reply all
Reply to author
Forward
0 new messages