Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibreDWG build on Ubuntu 20 #467

Closed
AndreiCherniaev opened this issue May 9, 2022 · 6 comments
Closed

LibreDWG build on Ubuntu 20 #467

AndreiCherniaev opened this issue May 9, 2022 · 6 comments

Comments

@AndreiCherniaev
Copy link

AndreiCherniaev commented May 9, 2022

I try to build LibreDWG for my Ubuntu 20 x86_64 using instruction:
git clone https://git.savannah.gnu.org/git/libredwg.git
cd libredwg
mkdir build
cd build
cmake ..
make
make install (or use checkinstall, or simply locate & copy the dwg2dxf utility to your executables path, it will be then autodetected by FreeCAD)

But there is error during building:
[ 25%] Building C object CMakeFiles/redwg.dir/src/in_json.c.o
/home/a/snap/freecad/common/libredwg/src/in_json.c:54:10: fatal error: ../jsmn/jsmn.h: No such file or directory
54 | #include "../jsmn/jsmn.h"
| ^~~~~~~~~~~~~~~~
compilation terminated.

Looks like I forgot install some dependents on my system. But I want to say that it will be perfect if buildsystem checked which dependents are not is user's system now, istn't it?

@rurban
Copy link
Contributor

rurban commented May 10, 2022

you missed ./autogen.sh, see the README
you can also check how the Docker or CI builds are doing it.

@rurban rurban closed this as completed May 10, 2022
@AndreiCherniaev
Copy link
Author

you missed ./autogen.sh, see the README you can also check how the Docker or CI builds are doing it.

Now I try to build using readme:
In new folder1 I try:
$ sh ./autogen.sh (if you checked out the source code from git)
$ ./configure [--enable-trace] [--disable-write] [--disable-shared]
$ make -j3

Making all in doc
make[2]: Entering directory '/home/a/snap/freecad/common/libredwg/doc'
echo make regen-dynapi might be needed
make regen-dynapi might be needed
Updating ./version.texi
MAKEINFO LibreDWG.info
/home/a/snap/freecad/common/libredwg/build-aux/missing: line 81: makeinfo: command not found
WARNING: 'makeinfo' is missing on your system.
You should only need it if you modified a '.texi' file, or
any other file indirectly affecting the aspect of the manual.
You might want to install the Texinfo package:
https://www.gnu.org/software/texinfo/
The spurious makeinfo call might also be the consequence of
using a buggy 'make' (AIX, DU, IRIX), in which case you might
want to install GNU make:
https://www.gnu.org/software/make/
make[2]: *** [Makefile:465: LibreDWG.info] Error 127
make[2]: Leaving directory '/home/a/snap/freecad/common/libredwg/doc'
make[1]: *** [Makefile:675: all-recursive] Error 1
make[1]: Leaving directory '/home/a/snap/freecad/common/libredwg'
make: *** [Makefile:558: all] Error 2

In new folder2 I try:
$ sh ./autogen.sh (if you checked out the source code from git)
$ ./configure --enable-trace --disable-write --disable-shared
$ make

make[2]: Entering directory '/home/a/snap/freecad/common/libredwg/programs'
CC dwgread.o
CCLD dwgread
/usr/bin/ld: ../src/.libs/libredwg.a(decode_r11.o): in function decode_preR13': /home/a/snap/freecad/common/libredwg/src/decode_r11.c:697: undefined reference to dwg_add_Document'
/usr/bin/ld: ../src/.libs/libredwg.a(decode_r11.o): in function decode_preR13_section': /home/a/snap/freecad/common/libredwg/src/decode_r11.c:325: undefined reference to dwg_add_BLOCK_HEADER'
/usr/bin/ld: /home/a/snap/freecad/common/libredwg/src/decode_r11.c:365: undefined reference to dwg_add_LAYER' /usr/bin/ld: /home/a/snap/freecad/common/libredwg/src/decode_r11.c:377: undefined reference to dwg_add_STYLE'
/usr/bin/ld: /home/a/snap/freecad/common/libredwg/src/decode_r11.c:399: undefined reference to dwg_add_LTYPE' /usr/bin/ld: /home/a/snap/freecad/common/libredwg/src/decode_r11.c:434: undefined reference to dwg_add_VIEW'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:717: dwgread] Error 1
make[2]: Leaving directory '/home/a/snap/freecad/common/libredwg/programs'
make[1]: *** [Makefile:675: all-recursive] Error 1
make[1]: Leaving directory '/home/a/snap/freecad/common/libredwg'
make: *** [Makefile:558: all] Error 2

@rurban
Copy link
Contributor

rurban commented May 10, 2022

./configure --enable-trace --disable-write --disable-shared
does not work yet.

try ./configure or any configuration from the CI's. e.g. from .github/workflows/main.yml, .cirrus.yml or .appveyor.yml

@AndreiCherniaev
Copy link
Author

./configure --enable-trace --disable-write --disable-shared does not work yet.

try ./configure or any configuration from the CI's. e.g. from .github/workflows/main.yml, .cirrus.yml or .appveyor.yml

I use empty folder and try
sh ./autogen.sh (if you checked out the source code from git)
./configure
make -j3
And there is error.

But works after
sudo apt-get install texinfo
I can build now.

@AndreiCherniaev
Copy link
Author

AndreiCherniaev commented May 10, 2022

After build I try execute
dwg2dxf
dwg2dxf: error while loading shared libraries: libredwg.so.0: cannot open shared object file: No such file or directory

But I do
sudo ldconfig

And now if I call dwg2dxf I get
Usage: dwg2dxf [-v[N]] [--as rNNNN] [-m|--minimal] [-b|--binary] DWGFILES...

But if I use FreeCAD I still got
ODA (formerly Teigha) File Converter not found, DWG support is disabled

log.txt
@rurban

@chinhuat
Copy link

But if I use FreeCAD I still got ODA (formerly Teigha) File Converter not found, DWG support is disabled

That's not a libredwg issue, have you configured FreeCAD to use to libredwg? See: https://wiki.freecadweb.org/Import_Export_Preferences#DWG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants