Community
Arnold General Rendering Forum
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Compiling shaders using mingw

11 ANTWORTEN 11
Antworten
Nachricht 1 von 12
zenop
940 Aufrufe, 11 Antworten

Compiling shaders using mingw

Hi there,

Is it possible to compile shaders to windows .dll's from Linux? I've been trying through mingw, but even though the compilation succeeds, it seems the shader can't be loaded (unable to load dynamic library some_shader.dll: The specified module could not be found.)

I've been trying with x86_64-w64-mingw32-g++ .

Has anyone had any luck on this front? Is this supposed to work?

Tags (1)
Beschriftungen (1)
11 ANTWORTEN 11
Nachricht 2 von 12
hitecom8172
als Antwort auf: zenop

Lol you are a shading god, I loved your tutorials on flipperd normals. Shouldn't windows be used to compile dll's is using Linux really right?

@zeno pelgrims

Nachricht 3 von 12
Stephen.Blair
als Antwort auf: zenop

Don't the dependencies (ai.lib) have to be cross-compiled too?



// Stephen Blair
// Arnold Renderer Support
Nachricht 4 von 12
maxtarpini
als Antwort auf: zenop

Use (http://www.dependencywalker.com/depends22_x64.zip) to check what your dll is missing that is preventing it to be seen/loaded.

Nachricht 5 von 12
zenop
als Antwort auf: zenop

@stephenblair, is this something that is possible to do from a user perspective?

@maxtarpini, thanks for that pointer - I checked with https://github.com/lucasg/Dependencies (an up to date version of dependency walker) and it does seem there's some clearly crucial missing dependencies:

- libgcc_s_seh-1.dll

- libstdc++-6.dll

- ai.dll

The quest continues!

Nachricht 6 von 12
zenop
als Antwort auf: zenop

I think Stephen is correct - I don't think it's possible after all to link MSVC libs (e.g arnold) to mingw, unless solidangle compiles arnold on their side in mingw.

Nachricht 7 von 12
hitecom8172
als Antwort auf: zenop

@Zeno Pelgrims I think you are better off using OSL for all of your shading needs. dll's dont always are the best option.

Nachricht 8 von 12
maxtarpini
als Antwort auf: zenop

Zeno said : "I don't think it's possible after all to link MSVC libs (e.g arnold) to mingw, unless solidangle compiles arnold on their side in mingw."

Not necessarly.

It would be like that if you call the DLL explicitly at runtime not if you use an 'import library' like ai.lib that contains additional info for the linker at compile time.

Having compiled a simple shader in fact it simply loads correctly and is available from maya UI and all of that. It even renders :leicht_lächelndes_Gesicht:

Compiled with: /opt/mingw64/bin/x86_64-w64-mingw32-g++ romboMix2Shaders.cpp -I"/home/max/git/RomboArnold/romboext/_aisdk/include" -std=c++11 -fpic -O3 -c

Linked with: /opt/mingw64/bin/x86_64-w64-mingw32-g++ -shared -o romboTESTlib.dll romboMix2Shaders.o -l:ai.lib (note the colon ':' to be able to explicitely spec the lib name)

Rename rombotestlib.txt to rombotestlib.dll and check it to see it has been compiled with mingw.

However some other shader could crash at arnold runtime because of some other stuff that's assumed to be 'windows' alike and where maybe mingw is not fully compliant.. aka threading, alignments, handlers etc.

For example I just tested that if I use arnold 'closures' it badly crashes.

Nachricht 9 von 12
zenop
als Antwort auf: zenop

@Max Tarpini you legend! I'll try that out when I get home. This is super helpful man, much appreciated.

Nachricht 10 von 12
zenop
als Antwort auf: hitecom8172

I appreciate the input but in this case OSL can't be used.

Nachricht 11 von 12
zenop
als Antwort auf: zenop

I tested this and while I'm able to load the plugin, it crashes as soon as it's executed. Was worth the try anyway.

Nachricht 12 von 12
maxtarpini
als Antwort auf: zenop

yep also it looks like latest mingw uses gcc 4.9 which is 6 years old so all 'modern' c++ is barely supported (ie. only a subset of C++11). Btw if your problem is cross-compilation you can use cmake as your builder on linux and then use visual studio that from 2017 support cmake projects.

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report