pablode / gatling

Hydra-enabled GPU path tracer that supports MaterialX and MDL
GNU General Public License v3.0
295 stars 19 forks source link

Compile errors on Linux #1

Closed ib00 closed 2 years ago

ib00 commented 2 years ago

I am trying to compile on Linux (Manjaro) with gcc 11.

I am getting two errors:

  1. src/hdGatling/src/Camera.cpp:39

    error: ‘atanf’ is not a member of ‘std’

This can be easily fixed by using atanf and not std::atanf.

  1. Linking error:

Linking CXX shared library ../../bin/hdGatling.so /usr/bin/ld: ../../bin/libshadergen.a(MdlHlslCodeGen.cpp.o): warning: relocation against _ZN2sg19MATERIAL_STATE_NAMEE' in read-only section.text' /usr/bin/ld: ../../bin/libgi.a(gi.c.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC

Any ideas?

ib00 commented 2 years ago

I have sorted out the second problem by manually editing CMake files and change everything from "STATIC" to "SHARED".

I turned option "SHARED" in the top level CMake file, but it didn't seem to propagate to other dependencies.

pablode commented 2 years ago

Hi @ib00, thanks for reporting this.

I've fixed the issues in d9f61a6 and 255422a, respectively. Tested under Ubuntu 20.04 with GCC 11.1.0.