SolveSpace Logo SOLVESPACE -- parametric 2d/3d CAD
Examples
Tutorials
Features
Download
Reference
Technology
Library
Forum
Contact
USER FORUM

(you are viewing a thread; or go back to list of threads)

linux compile (almost) (by John Griessen)
Hi,

I am trying out recommendations to compile on debian linux
by setting some flags, and using configure settings for static building.

I had changed Makefile.am per http://www.circuitousroot.com/...ing/useful/packages/index.html but was getting errors suggesting a problem of
running make in the solvespace dir, so I changed to using a separate
build dir, and also started from a fresh copy of https://gitorious.org/solvespace/solvespace.git

I run .autogen.sh in solvespace then do not touch it further.

I set environment vars:
libs=-lGL
LDFLAGS=-lGL


from the build dir, I run:

./solvespace/configure --enable-shared=no --enable-static=yes

make runs without errors:
=================make=================
$make
.
.
.
g++ -DHAVE_CONFIG_H -I. -I../../solvespace/exposed -I.. -DLIBRARY -I../../solvespace/src -g -O2 -MT ../src/constrainteq.o -MD -MP -MF $depbase.Tpo -c -o ../src/constrainteq.o ../../solvespace/exposed/../src/constrainteq.cpp &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo ../src/system.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I../../solvespace/exposed -I.. -DLIBRARY -I../../solvespace/src -g -O2 -MT ../src/system.o -MD -MP -MF $depbase.Tpo -c -o ../src/system.o ../../solvespace/exposed/../src/system.cpp &&\
mv -f $depbase.Tpo $depbase.Po
rm -f libslvs.a
ar cru libslvs.a lib.o ../src/util.o ../src/entity.o ../src/expr.o ../src/constraint.o ../src/constrainteq.o ../src/system.o
ranlib libslvs.a
depbase=`echo CDemo.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I../../solvespace/exposed -I.. -DLIBRARY -I../../solvespace/src -g -O2 -MT CDemo.o -MD -MP -MF $depbase.Tpo -c -o CDemo.o ../../solvespace/exposed/CDemo.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -L. -lGL -o CDemo CDemo.o ../src/fltk/fltkutil.o -lslvs /usr/lib/x86_64-linux-gnu/libfltk_images.a -lpng -lz -ljpeg /usr/lib/x86_64-linux-gnu/libfltk_gl.a -lGL /usr/lib/x86_64-linux-gnu/libfltk_forms.a /usr/lib/x86_64-linux-gnu/libfltk.a -lXext -lXft -lfontconfig -lfontconfig -lXinerama -ldl -lm -lX11
libtool: link: g++ -g -O2 -o CDemo CDemo.o ../src/fltk/fltkutil.o -L. -lslvs /usr/lib/x86_64-linux-gnu/libfltk_images.a -lpng -lz -ljpeg /usr/lib/x86_64-linux-gnu/libfltk_gl.a -lGL /usr/lib/x86_64-linux-gnu/libfltk_forms.a /usr/lib/x86_64-linux-gnu/libfltk.a -lXext -lXft -lfontconfig -lXinerama -ldl -lm -lX11
make[2]: Leaving directory '/usr/local/src/solv-build/exposed'
make[2]: Entering directory '/usr/local/src/solv-build'
make[2]: Leaving directory '/usr/local/src/solv-build'
make[1]: Leaving directory '/usr/local/src/solv-build'
=================make=================

install has problems:
=================make install=================
$ sudo make install
[sudo] password for john:
Making install in src
make[1]: Entering directory '/usr/local/src/solv-build/src'
make install-am
make[2]: Entering directory '/usr/local/src/solv-build/src'
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -lGL -o solvespace bsp.o clipboard.o confscreen.o constraint.o constrainteq.o describescreen.o draw.o drawconstraint.o drawentity.o entity.o export.o exportstep.o exportvector.o expr.o file.o generate.o glhelper.o graphicswin.o group.o groupmesh.o mesh.o modify.o mouse.o polygon.o request.o solvespace.o style.o system.o textscreens.o textwin.o toolbar.o ttf.o undoredo.o util.o view.o srf/boolean.o srf/curve.o srf/merge.o srf/ratpoly.o srf/raycast.o srf/surface.o srf/surfinter.o srf/triangulate.o fltk/xFl_Gl_Window_Group.o fltk/fltkmain.o fltk/fltkutil.o /usr/lib/x86_64-linux-gnu/libfltk_images.a -lpng -lz -ljpeg /usr/lib/x86_64-linux-gnu/libfltk_gl.a -lGL /usr/lib/x86_64-linux-gnu/libfltk_forms.a /usr/lib/x86_64-linux-gnu/libfltk.a -lXext -lXft -lfontconfig -lfontconfig -lXinerama -ldl -lm -lX11 -lGLU
libtool: link: g++ -g -O2 -o solvespace bsp.o clipboard.o confscreen.o constraint.o constrainteq.o describescreen.o draw.o drawconstraint.o drawentity.o entity.o export.o exportstep.o exportvector.o expr.o file.o generate.o glhelper.o graphicswin.o group.o groupmesh.o mesh.o modify.o mouse.o polygon.o request.o solvespace.o style.o system.o textscreens.o textwin.o toolbar.o ttf.o undoredo.o util.o view.o srf/boolean.o srf/curve.o srf/merge.o srf/ratpoly.o srf/raycast.o srf/surface.o srf/surfinter.o srf/triangulate.o fltk/xFl_Gl_Window_Group.o fltk/fltkmain.o fltk/fltkutil.o /usr/lib/x86_64-linux-gnu/libfltk_images.a -lpng -lz -ljpeg /usr/lib/x86_64-linux-gnu/libfltk_gl.a -lGL /usr/lib/x86_64-linux-gnu/libfltk_forms.a /usr/lib/x86_64-linux-gnu/libfltk.a -lXext -lXft -lfontconfig -lXinerama -ldl -lm -lX11 -lGLU
graphicswin.o:(.rodata+0xc18): undefined reference to `Constraint::MenuConstrain(int)'
graphicswin.o:(.rodata+0xc38): undefined reference to `Constraint::MenuConstrain(int)'
graphicswin.o:(.rodata+0xc58): undefined reference to `Constraint::MenuConstrain(int)'
graphicswin.o:(.rodata+0xc78): undefined reference to `Constraint::MenuConstrain(int)'
graphicswin.o:(.rodata+0xcb8): undefined reference to `Constraint::MenuConstrain(int)'
graphicswin.o:(.rodata+0xcd8): more undefined references to `Constraint::MenuConstrain(int)' follow
collect2: error: ld returned 1 exit status
Makefile:599: recipe for target 'solvespace' failed
make[2]: *** [solvespace] Error 1
make[2]: Leaving directory '/usr/local/src/solv-build/src'
Makefile:806: recipe for target 'install' failed
make[1]: *** [install] Error 2
make[1]: Leaving directory '/usr/local/src/solv-build/src'
Makefile:448: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
=================make install=================

The executable ./exposed/CDemo runs OK:

$ ./exposed/CDemo
solved okay
line from (10.000 11.180) to (10.000 -18.820)
arc center (101.114 119.042) start (116.477 111.762) finish (117.409 114.197)
circle center (200.000 200.000) radius 17.000
6 DOF

Has a GUI been made? Where is its executable if so?
Sun Feb 22 2015, 19:18:36
(no subject) (by yugami)
The gui has not been made. Having a look at contraint.cpp shows that that specific object file will not have the function in question defined if LIBRARY is defined. Your earlier build messages show it was defined.

delete contraint.o and rebuild it without -DLIBRARY and the rest should finish
Sun Feb 22 2015, 23:08:06
linux compile (almost) (by John Griessen)
$ locate constraint.o
/usr/local/src/solv-build/src/constraint.o
/usr/local/src/solv-build/src/drawconstraint.o

Delete both files, or just /usr/local/src/solv-build/src/constraint.o
?

John
Tue Feb 24 2015, 22:04:24
linux compile (almost) (by John Griessen)
"rebuild it without -DLIBRARY and the rest should finish "

Do you mean redo the configure also, or just the make?
Tue Feb 24 2015, 22:05:59
(no subject) (by yugami)
/usr/local/src/solv-build/src/constraint.o

Its been a while since I've built on linux so I'm guessing the configure but I'm not seeing where -DLIBRARY is getting generated from.

you may be able to edit one of the generated Makefiles and fix that. I never mastered learning the autoconf/automake system so I'm at a bit of a loss
Tue Feb 24 2015, 22:19:23
linux compile (almost) (by John Griessen)
Today I noticed some of the library flag specs have been added to the makefiles, so I got a fresh copy of the repo, ran autogen.sh left that dir and configured from a separate build directory:

$ export LDFLAGS=-lGL
john@toolbench64:/usr/local/src/solv-build$ ../solvespace/configure --enable-shared=yes

solvespace-2.1 configuration summary:

Install prefix ......... : /usr/local
C++ preprocessor ....... : g++ -E
C++ compiler ........... : g++
Linker ................. : /usr/bin/ld -m elf_x86_64
C preprocessor flags ... :
C++ compiler flags ..... : -g -O2
Linker flags ........... : -lGL

=================================
run make

errors:
==================================
.
.
.
g++ -DHAVE_CONFIG_H -I. -I../../solvespace/src -I.. -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT -g -O2 -MT fltk/fltkutil.o -MD -MP -MF $depbase.Tpo -c -o fltk/fltkutil.o ../../solvespace/src/fltk/fltkutil.cpp &&\
mv -f $depbase.Tpo $depbase.Po
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -lGL -o solvespace bsp.o clipboard.o confscreen.o constraint.o constrainteq.o describescreen.o draw.o drawconstraint.o drawentity.o entity.o export.o exportstep.o exportvector.o expr.o file.o generate.o glhelper.o graphicswin.o group.o groupmesh.o mesh.o modify.o mouse.o polygon.o request.o solvespace.o style.o system.o textscreens.o textwin.o toolbar.o ttf.o undoredo.o util.o view.o srf/boolean.o srf/curve.o srf/merge.o srf/ratpoly.o srf/raycast.o srf/surface.o srf/surfinter.o srf/triangulate.o fltk/fltkmain.o fltk/fltkutil.o -lfltk_images -lfltk_gl -lfltk_forms -lfltk -lX11 -lX11 -lGL -lGLU
libtool: link: g++ -g -O2 -o solvespace bsp.o clipboard.o confscreen.o constraint.o constrainteq.o describescreen.o draw.o drawconstraint.o drawentity.o entity.o export.o exportstep.o exportvector.o expr.o file.o generate.o glhelper.o graphicswin.o group.o groupmesh.o mesh.o modify.o mouse.o polygon.o request.o solvespace.o style.o system.o textscreens.o textwin.o toolbar.o ttf.o undoredo.o util.o view.o srf/boolean.o srf/curve.o srf/merge.o srf/ratpoly.o srf/raycast.o srf/surface.o srf/surfinter.o srf/triangulate.o fltk/fltkmain.o fltk/fltkutil.o -lfltk_images -lfltk_gl -lfltk_forms -lfltk -lX11 -lGL -lGLU
/usr/bin/ld: style.o: undefined reference to symbol 'png_set_sig_bytes@@PNG12_0'
//lib/x86_64-linux-gnu/libpng12.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:593: recipe for target 'solvespace' failed
make[3]: *** [solvespace] Error 1
make[3]: Leaving directory '/usr/local/src/solv-build/src'
Makefile:466: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/local/src/solv-build/src'
Makefile:448: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/solv-build'
Makefile:379: recipe for target 'all' failed
make: *** [all] Error 2


Any ideas? Should I try deleting .o files for the fltk packages, leaving only the .a
files and compile static linked again?

John Griessen
Fri Feb 27 2015, 13:28:54
results deleting the fltk .so files -- "libfltk.a(Fl_x.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5'" (by John Griessen)
$rm -rf ./*
$ ../solvespace/configure --enable-static=yes


.
.
.
solvespace-2.1 configuration summary:

Install prefix ......... : /usr/local
C++ preprocessor ....... : g++ -E
C++ compiler ........... : g++
Linker ................. : /usr/bin/ld -m elf_x86_64
C preprocessor flags ... :
C++ compiler flags ..... : -g -O2
Linker flags ........... : -lGL
Extra libraries ........ :



$make

.
.
.
g++ -DHAVE_CONFIG_H -I. -I../../solvespace/src -I.. -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT -g -O2 -MT fltk/fltkutil.o -MD -MP -MF $depbase.Tpo -c -o fltk/fltkutil.o ../../solvespace/src/fltk/fltkutil.cpp &&\
mv -f $depbase.Tpo $depbase.Po
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -lGL -o solvespace bsp.o clipboard.o confscreen.o constraint.o constrainteq.o describescreen.o draw.o drawconstraint.o drawentity.o entity.o export.o exportstep.o exportvector.o expr.o file.o generate.o glhelper.o graphicswin.o group.o groupmesh.o mesh.o modify.o mouse.o polygon.o request.o solvespace.o style.o system.o textscreens.o textwin.o toolbar.o ttf.o undoredo.o util.o view.o srf/boolean.o srf/curve.o srf/merge.o srf/ratpoly.o srf/raycast.o srf/surface.o srf/surfinter.o srf/triangulate.o fltk/fltkmain.o fltk/fltkutil.o -lfltk_images -lfltk_gl -lfltk_forms -lfltk -lX11 -lX11 -lGL -lGLU
libtool: link: g++ -g -O2 -o solvespace bsp.o clipboard.o confscreen.o constraint.o constrainteq.o describescreen.o draw.o drawconstraint.o drawentity.o entity.o export.o exportstep.o exportvector.o expr.o file.o generate.o glhelper.o graphicswin.o group.o groupmesh.o mesh.o modify.o mouse.o polygon.o request.o solvespace.o style.o system.o textscreens.o textwin.o toolbar.o ttf.o undoredo.o util.o view.o srf/boolean.o srf/curve.o srf/merge.o srf/ratpoly.o srf/raycast.o srf/surface.o srf/surfinter.o srf/triangulate.o fltk/fltkmain.o fltk/fltkutil.o -lfltk_images -lfltk_gl -lfltk_forms -lfltk -lX11 -lGL -lGLU
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libfltk.a(Fl_x.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:593: recipe for target 'solvespace' failed
make[3]: *** [solvespace] Error 1
make[3]: Leaving directory '/usr/local/src/solv-build/src'
Makefile:466: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/usr/local/src/solv-build/src'
Makefile:448: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/usr/local/src/solv-build'
Makefile:379: recipe for target 'all' failed
make: *** [all] Error 2

So now I need to repair my fltk install, ( I need it for other programs)
and go back to trying to get a samba share working for a Win7 VM...
Fri Feb 27 2015, 13:38:41
(no subject) (by Roland Lutz)
The GUI application and libslvs share some object files (constraint.cpp, constrainteq.cpp, entity.cpp, expr.cpp, system.cpp, util.cpp) which are compiled twice with different preprocessor flags. Usually, per-target compilation flags cause object files to be renamed, so you get solvespace-constraint.o and libslvs_a-constraint.o etc. In this case, the compilation runs are controlled by two different Makefiles, so using different AM_CPPFLAGS seems to work at first. However, when building libslvs, the object files for use with the GUI application are overwritten, so a subsequent �make install� will fail.

Since libslvs and the CDemo application aren't installed, you can simply remove the object files and recompile the GUI.
Sun Mar 1 2015, 10:29:57
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):
© 2008-2022 SolveSpace contributors. Most recent update June 2 2022.