Mitsuba2 On Tumbleweed

I’m trying to install mitsuba2 on tumbleweed, but it looks more complex that it should be.
First most of the package are for debian and I can’t find them on zypper.
Second I try to compile and I receive this:
– The CXX compiler identification is Clang 11.0.0
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - failed
– Check for working CXX compiler: /usr/bin/clang++
– Check for working CXX compiler: /usr/bin/clang++ - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:59 (message):
The C++ compiler

"/usr/bin/clang++"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /home/bombadil/Documents/Programms/mitsuba2/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_490a6 && [1/2] Building CXX object CMakeFiles/cmTC_490a6.dir/testCXXCompiler.cxx.o
[2/2] Linking CXX executable cmTC_490a6
FAILED: cmTC_490a6 
: && /usr/bin/clang++   CMakeFiles/cmTC_490a6.dir/testCXXCompiler.cxx.o -o cmTC_490a6   && :
/usr/bin/ld: cannot find -lstdc++
clang-11.0: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)

Did someone have more fortune on compiling mistuba2?

Hello,

See this is your first post here. Welcome to the openSUSE forums.

I am not sure that the computer texts you show will help in understanding what you are doing. I get the strong idea that there is only output from a command, but the command itself is missing. Also we have a feature here that is not easy to find, but it is very important to use when posting computer text.

Please in the future use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

An example is here: Using CODE tags Around your paste.

Regards,

Hi and welcome to the Forum :slight_smile:
The following should get you going…


mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE="Release" \
      -DCMAKE_C_COMPILER="clang" \
      -DCMAKE_CXX_COMPILER="clang++" \
      -DCMAKE_MAKE_PROGRAM="ninja" \
      -DCMAKE_INSTALL_PREFIX:PATH=usr \
      -DCMAKE_INSTALL_LIBDIR:PATH=lib64 \
      -GNinja \
      ..
ninja -v

Or just export the paths as required (I see it’s in the mitsuba2 compile information)…

hi malcolmlewis,
thanks for the respond, I tried but I got this

-- The CXX compiler identification is Clang 11.0.0 
-- Detecting CXX compiler ABI info 
-- Detecting CXX compiler ABI info - failed 
-- Check for working CXX compiler: /usr/bin/clang++ 
-- Check for working CXX compiler: /usr/bin/clang++ - broken 
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:59 (message): 
  The C++ compiler 

    "/usr/bin/clang++" 

  is not able to compile a simple test program. 

  It fails with the following output: 

    Change Dir: /home/bombadil/Documents/Programms/mitsuba2/build/CMakeFiles/CMakeTmp 
     
    Run Build Command(s):ninja cmTC_0cfc7 && [1/2] Building CXX object CMakeFiles/cmTC_0cfc7.dir/testCXXCompiler.cxx.o 
    [2/2] Linking CXX executable cmTC_0cfc7 
    FAILED: cmTC_0cfc7  
    : && /usr/bin/clang++   CMakeFiles/cmTC_0cfc7.dir/testCXXCompiler.cxx.o -o cmTC_0cfc7   && : 
    /usr/bin/ld: cannot find -lstdc++ 
    clang-11.0: error: linker command failed with exit code 1 (use -v to see invocation) 
    ninja: build stopped: subcommand failed. 
     
     

   

  CMake will not be able to correctly generate this project. 
Call Stack (most recent call first): 
  CMakeLists.txt:3 (project) 


-- Configuring incomplete, errors occurred! 
See also "/home/bombadil/Documents/Programms/mitsuba2/build/CMakeFiles/CMakeOutput.log". 
See also "/home/bombadil/Documents/Programms/mitsuba2/build/CMakeFiles/CMakeError.log". 
You have changed variables that require your cache to be deleted. 
Configure will be re-run and you may have to reset some variables. 
The following variables have changed: 
CMAKE_C_COMPILER= clang 

-- Generating done 
CMake Warning: 
  Manually-specified variables were not used by the project: 

    CMAKE_INSTALL_LIBDIR 


CMake Generate step failed.  Build files cannot be regenerated correctly.


what should I do?

Hi


cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" -DCMAKE_MAKE_PROGRAM="ninja" -DCMAKE_INSTALL_PREFIX="/usr" -GNinja ..

-- The C compiler identification is Clang 11.0.0
-- The CXX compiler identification is Clang 11.0.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python3.8 (found version "3.8.5") 
-- Found PythonLibs: /usr/lib64/libpython3.8.so
-- Building the following variants of Mitsuba:
--  * scalar_rgb
--  * scalar_spectral
-- Mitsuba: using libc++.
-- Mitsuba: building the Python plugin.
-- Enoki: building the Python plugin.
-- pybind11 v2.4.dev4
-- LTO disabled (not supported by the compiler and/or linker)
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib64/libpng.so (found version "1.6.37") 
-- Found JPEG: /usr/lib64/libjpeg.so (found version "62") 
-- TBB: using libc++.
-- Mitsuba: using builtin implementation for CPU ray tracing.
-- Mitsuba: LTO not supported by the compiler.
-- Check if the system is big endian
-- Searching 16 bit integer
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Mitsuba: sampling profiler enabled.
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
-- Found Sphinx: /usr/bin/sphinx-build  
-- Configuring done
-- Generating done
-- Build files have been written to: mitsuba2-2.2.1+git20201109.8fa0a80a/build

I suspect you have not installed libstdc+±devel and libc++abi-devel

yes you were right, I finaly got it to compile but the

 ninja -v 

says that I can’t find Pyhton.h.
Therefore I installed python-dev but still nothing, what would you suggest?

Hi
Needs to be python3-devel.

Hi, I installed python3-devel, still the same problem

Hi
So in the cmake output log from the command in post #5, how does it compare, likely still some python packages missing…

I build here via rpm (well osc) and to build I use;


BuildRequires:  clang
BuildRequires:  cmake
BuildRequires:  libc++abi-devel
BuildRequires:  libstdc++-devel
BuildRequires:  ninja
BuildRequires:  python3-devel
BuildRequires:  python3-numpy
BuildRequires:  python3-pytest-xdist
BuildRequires:  python3-Sphinx
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libpng16)
BuildRequires:  pkgconfig(zlib)

The package is not designed upstream to install… I would have to do a bit of patching to the cmake files for or the correct links etc…

A tip if you see pkgconfig(some_package), zypper handles it but you have to esc the brackets, eg;


zypper in pkgconfig\(zlib\)

So even installing all the dependencies that you showed me didn’t work, but I think I know why it’s not working. When I run ninja I see that clang includes /usr/inlcude/python3.8, but this directory can’t be found on my system, I find this strange because if I install python3 with zypper this tells me that is already up to date even if it shows that is at python3.6.
This is the error from ninja


1/650] Building CXX object ext_build/enoki/CMakeFiles/enoki-python-dynamic.dir/src/python/dynamic.cpp.o 
FAILED: ext_build/enoki/CMakeFiles/enoki-python-dynamic.dir/src/python/dynamic.cpp.o  
/usr/bin/clang++ -DENOKI_BUILD=1 -Denoki_python_dynamic_EXPORTS -I/usr/include/libcxxabi -I../ext/enoki/include -I../ext/pybind11/inc
lude -I/usr/include/python3.8 -stdlib=libc++ -D_LIBCPP_VERSION -std=c++17 -O3 -DNDEBUG -fPIC -fvisibility=hidden -march=native -fno-s
tack-protector -fomit-frame-pointer -fno-math-errno -ffp-contract=fast -g0 -Os -std=gnu++17 -MD -MT ext_build/enoki/CMakeFiles/enoki-
python-dynamic.dir/src/python/dynamic.cpp.o -MF ext_build/enoki/CMakeFiles/enoki-python-dynamic.dir/src/python/dynamic.cpp.o.d -o ext
_build/enoki/CMakeFiles/enoki-python-dynamic.dir/src/python/dynamic.cpp.o -c ../ext/enoki/src/python/dynamic.cpp 
In file included from ../ext/enoki/src/python/dynamic.cpp:1: 
In file included from ../ext/enoki/src/python/common.h:12: 
In file included from ../ext/pybind11/include/pybind11/pybind11.h:44: 
In file included from ../ext/pybind11/include/pybind11/attr.h:13: 
In file included from ../ext/pybind11/include/pybind11/cast.h:13: 
In file included from ../ext/pybind11/include/pybind11/pytypes.h:12: 
../ext/pybind11/include/pybind11/detail/common.h:112:10: fatal error: 'Python.h' file not found 
#include <Python.h> 
         ^~~~~~~~~~ 
1 error generated.




Hi
Not used the likes of pip? What does the following show?


ls -la `which python3`
python3 --version

At the end the problem was the absence of python3.8, I solved this by installing python38-devel

zypper install python38-devel