LuxCoreRender / LinuxCompile

LuxCoreRender Linux Compilation Environment
10 stars 6 forks source link

OpenImageIO compilation issue - Debian Testing #2

Closed stig-atle closed 6 years ago

stig-atle commented 6 years ago

I've tried to build as best I can tonight with the script, but I cannot seem to get rid of this error:

[ 83%] Building CXX object src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/ptex.imageio/ptex/PtexTriangleKernel.cpp.o
cd /tmp/luxbuild/oiio-Release-1.3.14/build/linux64/src/libOpenImageIO && /usr/bin/c++  -DEMBED_PLUGINS=1 -DUSE_BOOST_ASIO=1 -DUSE_FREETYPE -DUSE_OPENEXR_VERSION2=1 -DUSE_TBB=0 -isystem /home/steffensensa/development/LinuxCompile/target-64-sse2/include -I/home/steffensensa/development/LinuxCompile/target-64-sse2/include/OpenEXR -I/tmp/luxbuild/oiio-Release-1.3.14/src/include -I/tmp/luxbuild/oiio-Release-1.3.14/build/linux64/include -I/home/steffensensa/development/LinuxCompile/target-64-sse2/include/freetype2  -mtune=generic -std=c++11 -mmmx -msse -msse2 -O2 -pipe -mfpmath=sse -fPIC -O3 -DNDEBUG   -Wall -Wno-error=unused-local-typedefs -UUSE_FIELD3D -o CMakeFiles/OpenImageIO.dir/__/ptex.imageio/ptex/PtexTriangleKernel.cpp.o -c /tmp/luxbuild/oiio-Release-1.3.14/src/ptex.imageio/ptex/PtexTriangleKernel.cpp
src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/build.make:2198: recipe for target 'src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/psd.imageio/psdinput.cpp.o' failed
make[3]: *** [src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/psd.imageio/psdinput.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/tmp/luxbuild/oiio-Release-1.3.14/build/linux64'
CMakeFiles/Makefile2:981: recipe for target 'src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/all' failed
make[2]: *** [src/libOpenImageIO/CMakeFiles/OpenImageIO.dir/all] Error 2
make[2]: Leaving directory '/tmp/luxbuild/oiio-Release-1.3.14/build/linux64'
Makefile:162: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/tmp/luxbuild/oiio-Release-1.3.14/build/linux64'
Makefile:233: recipe for target 'cmake' failed
make: *** [cmake] Error 2
 !!! openimageio compilation failed

I'm not completely sure if it's a issue on my end, or a issue with the script, either way I decided to add it here to get some help getting things resolved. I built latest openimageio (oiio) from source, just to see if that would build standalone - and it did work, so I'm not entirely sure what the problem is with the build script version to be honest.

Dade916 commented 6 years ago

The error is strange (because there isn't one !). After the "cd /tmp/luxbuild/oiio-Release-1.3.14/build/linux64/src/libOpenImageIO && /usr/bin/c++ ..", I would expect some kind of compilation error message but I can not see one.

What Debian are you using ? I may be able to reproduce the problem on a VM.

stig-atle commented 6 years ago

Hi, thank you for checking, the OS I run is Debian Testing (Buster), install from: https://cdimage.debian.org/cdimage/buster_di_alpha1/amd64/iso-cd/debian-buster-DI-alpha1-amd64-netinst.iso

Dade916 commented 6 years ago

The problem is Debian uses GCC 7 and GCC 7 is by default C++11. OpenImageIO is known to not be compatible with C++11. I will check how to force plain old C++ compilation.

Theverat commented 6 years ago

Should be -std=c++98 Or -std=gnu++98 if OpenImageIO needs GNU extensions to compile.

Dade916 commented 6 years ago

-std=c++98 wasn't enough but -std=gnu++98 worked.

@stig-atle it should now work but it may be a lot simpler for you to just fire up an Ubuntu 14.04 VM and compile there because you have, otherwise, to install a lot of missing packages (i.e. Debian installs plain nothing by default). Once you have the binaries and DLLs you can use them anywhere because they are statically linked.

stig-atle commented 6 years ago

I would like to not have to make a vm just for compiling, I know things might be a bit easier to do in ubuntu compared to debian, but most of it works similar. Also I have very limited specs on my current machine, and it's already struggling to compile it directly (6gb ram, caches on disks), and it would be much worse if I had to run a VM on top of that.

But as you say - packages are needed, I can later on make a clean install then note the packages needed for debian, that way it can be added to the readme file, so that devs can just copy\paste all package names, or we can make a script that does it.

I like the way blender does it, just clone it, run the 'get deps' script, that one sets up everything that might be needed on your system, then you just compile. Very easy for new devs to get up and running.

We could maybe do what blender does, create a script that checks what OS (package manager) you have on your system, then fetches all those packages for you (obviously it'll ask first). I think things like that really helps others too, that wants to compile from source quickly.

I got a bit further now, but it fails on this last step:

[100%] Linking CXX shared module ../../lib/pyluxcore.so
/usr/bin/ld: cannot find -lIex
/usr/bin/ld: cannot find -lHalf
/usr/bin/ld: cannot find -lImath
/usr/bin/ld: cannot find -lIlmThread
/usr/bin/ld: cannot find -lOpenImageIO
collect2: error: ld returned 1 exit status
src/luxcore/CMakeFiles/pyluxcore.dir/build.make:296: recipe for target 'lib/pyluxcore.so' failed
make[3]: *** [lib/pyluxcore.so] Error 1
CMakeFiles/Makefile2:345: recipe for target 'src/luxcore/CMakeFiles/pyluxcore.dir/all' failed
make[2]: *** [src/luxcore/CMakeFiles/pyluxcore.dir/all] Error 2
CMakeFiles/Makefile2:357: recipe for target 'src/luxcore/CMakeFiles/pyluxcore.dir/rule' failed
make[1]: *** [src/luxcore/CMakeFiles/pyluxcore.dir/rule] Error 2
Makefile:196: recipe for target 'pyluxcore' failed
make: *** [pyluxcore] Error 2
 !!! luxrays luxcore pyluxcore luxcoreui compilation failed

I did a fully clean build again just to make sure, it still stops at this. Do you know what's causing that?

The libs it complains about seems to be located in this folder: /development/LinuxCompile/target-64-sse2/lib/


libIex.a
libIex.la

libHalf.a
libHalf.la

libIexMath.a
libIexMath.la

libIlmThread.a
libIlmThread.la

libOpenImageIO.a
libOpenImageIOBase.a
Theverat commented 6 years ago

Yes, such a "get deps" script would be awesome.

Dade916 commented 6 years ago

If we had a linux maintainer (and with the patience to test a couple of Ubuntu, Debian, etc.)...

About the last problem, there is something broken in Debian 9 and LDFLAGS seems to not work with make. I have added a workaround, try to compile with the latest LinuxCompile and LuxCore repository.

stig-atle commented 6 years ago

I'm sorry to say that the issue remains the same, I compiled everything from scratch.

Where it stops:

[ 99%] Linking CXX shared module ../../lib/pyluxcore.so
/usr/bin/ld: cannot find -lIex
/usr/bin/ld: cannot find -lHalf
/usr/bin/ld: cannot find -lImath
/usr/bin/ld: cannot find -lIlmThread
/usr/bin/ld: cannot find -lOpenImageIO
collect2: error: ld returned 1 exit status
src/luxcore/CMakeFiles/pyluxcore.dir/build.make:296: recipe for target 'lib/pyluxcore.so' failed
make[2]: *** [lib/pyluxcore.so] Error 1
CMakeFiles/Makefile2:345: recipe for target 'src/luxcore/CMakeFiles/pyluxcore.dir/all' failed
make[1]: *** [src/luxcore/CMakeFiles/pyluxcore.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
 !!! luxrays luxcore pyluxcore luxcoreui compilation failed
stig-atle commented 6 years ago

I do understand that it can be a pain to get things to work on several distros, especially 'testing' version that I currently run. So instead of being stubborn and causing more work then needed right now I will install ubuntu on a older laptop that I've got, and compile there. That way I can help out by compiling when needed, and then later on test more on Debian. I'm also considering moving my Debian testing installs over to Debian stable, because it will make things easier. I do not intend to cause a lot of extra work to a already small team.

Dade916 commented 6 years ago

Ok, we will check again this problem in the future.