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

Compile against realthunder/coin #14

Open
ceremcem opened this issue Mar 11, 2021 · 10 comments
Open

Compile against realthunder/coin #14

ceremcem opened this issue Mar 11, 2021 · 10 comments

Comments

@ceremcem
Copy link
Owner

When "View/Draw Style/Shadow" mode is enabled, following error is seen on the console window:

Coin info in SoGLSLShaderObject::printInfoLog(): GLSLfragmentShader  log: '0:67(1): error: no function with name 'DirectionalLight'
Coin error in SoGLSLShaderProgram::ensureLinking(): error: 'GL_INVALID_VALUE' (set envvar COIN_GLERROR_DEBUGGING=1 and re-run to get more information)

This coin3d shading error seems to be known and solved if realthunders coin fork is used.
https://github.com/realthunder/coin

Originally posted by @wohltat in #11 (comment)

@ceremcem
Copy link
Owner Author

First try is not successful:

/home/aea/fc-build/Release/bin/FreeCAD: error while loading shared libraries: libCoin.so.80: cannot open shared object file: No such file or directory

Script to install Coin3D:

#!/bin/bash
set -ue

cd $HOME
[[ -d coin ]] \
    || git clone --recurse-submodules https://github.com/realthunder/coin coin \
    && (cd coin; git pull)
cmake \
    -Hcoin \
    -Bcoin_build \
    -G "Unix Makefiles" \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DCMAKE_BUILD_TYPE=Release \
    -DCOIN_BUILD_DOCUMENTATION=OFF

cd coin_build
make
sudo make install

@wohltat
Copy link

wohltat commented Mar 12, 2021

The sun is shining and it casts shadows :)
image

To install realthunders coin lib, i followed the INSTALL documentation which is pretty much the same as your script. Beforehand i removed the libcoin-dev and libcoin80c packages.

But after that i rebuild FreeCAD manually. The build.sh script is trying to install libcoin-dev (and libcoin80c). This maybe leads to some problems.

The location of the libCoin files are like so:

freecad@fc:~/fc2-build$ locate libCoin
/home/freecad/coin_build/lib/libCoin.so
/home/freecad/coin_build/lib/libCoin.so.80
/home/freecad/coin_build/lib/libCoin.so.80.0.1
/usr/lib/x86_64-linux-gnu/libCoin.so
/usr/lib/x86_64-linux-gnu/libCoin.so.4.0.0
/usr/lib/x86_64-linux-gnu/libCoin.so.80c
/usr/local/lib/libCoin.so
/usr/local/lib/libCoin.so.80

FreeCAD looks in the following directory for libCoin

freecad@fc:~/fc2-build$ sudo strace -t -e trace=file -o fc-file-access.strace -vvv -s 1024 -ff -- bin/FreeCAD report > /dev/null
freecad@fc:~/fc2-build$ grep libCoin fc-file-access.strace*
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/hdf5/openmpi/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/openmpi/lib/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "/home/freecad/fc2-build/lib/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "tls/x86_64/x86_64/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "tls/x86_64/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "tls/x86_64/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "tls/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "x86_64/x86_64/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "x86_64/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "x86_64/libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "libCoin.so.80", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fc-file-access.strace.136594:15:20:15 openat(AT_FDCWD, "/usr/local/lib/libCoin.so.80", O_RDONLY|O_CLOEXEC) = 3

Now there are just some mounting problems left.

@ceremcem
Copy link
Owner Author

Wow, great news!

Beforehand i removed the libcoin-dev and libcoin80c packages.

I think my mistake was not removing libcoin80c. However, when I compiled again, I can not find /usr/lib/x86_64-linux-gnu/libCoin.so.80c:

$ find /usr -name "libCoin*"
/usr/local/lib/libCoin.so.80.0.1
/usr/local/lib/libCoin.so.80
/usr/local/lib/libCoin.so

@ceremcem
Copy link
Owner Author

The build.sh script is trying to install libcoin-dev (and libcoin80c). This maybe leads to some problems.

Btw, you can skip using build.sh and use build-fc.sh, which will skip trying to install the dependencies listed in packages.txt.

@wohltat
Copy link

wohltat commented Mar 12, 2021

However, when I compiled again, I can not find /usr/lib/x86_64-linux-gnu/libCoin.so.80c

i think the libCoin.so.80c is some kind of remnant. Also the 4.0.0 is the version of the older repository lib version (libCoin.so.4.0.0). The version of the realthunder coin lib is 4.0.1.

The make install doesn't mention it. Only the following libs:

...
-- Up-to-date: /usr/local/share/Coin/scxml/navigation/plane.xml
-- Up-to-date: /usr/local/share/Coin/profiler
-- Installing: /usr/local/lib/libCoin.so.80.0.1
-- Installing: /usr/local/lib/libCoin.so.80
-- Up-to-date: /usr/local/lib/libCoin.so
-- Up-to-date: /usr/local/lib/pkgconfig/Coin.pc
-- Up-to-date: /usr/local/bin/coin-config
...

@ceremcem
Copy link
Owner Author

Did you build from scratch instead of performing an incremental build after installing realthunder's Coin?

@wohltat
Copy link

wohltat commented Mar 13, 2021

Yes i build FreeCAD from scratch afterwards. But i guess it should also work with incremental building, but i didn't try.

@ceremcem
Copy link
Owner Author

I tried the same compilation 3 times now (starting from same backup) and all went wrong. However, this time I also run ldconfig, and now FreeCAD launches at least.

Currently I'm getting <class 'ModuleNotFoundError'>: No module named 'pivy' error.

How come we use the same build environment (Debian Buster, right?) and the same build scripts and we get different results? What are you possibly doing something differently?

@wohltat
Copy link

wohltat commented Mar 13, 2021

How come we use the same build environment (Debian Buster, right?) and the same build scripts and we get different results? What are you possibly doing something differently?

Yes, it's the build environment according to your instructions, Debian Buster.
I used cmake like

freecad@fc:~/fc2-build$ cmake ../FreeCAD/ -DBUILD_QT5=ON -DPYTHON_EXECUTABLE=/usr/bin/python3cmake

and then just make

I don't know what could be the reason for the difference.
If you feel archeological you can try to find something in my console log:
lxc_debian_freecad_build.log

@ceremcem
Copy link
Owner Author

That's very good idea to keep your entire command line history with outputs.

The only thing I didn't try is compiling from scratch. Now it's being compiled.

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

2 participants