VRM4U icon indicating copy to clipboard operation
VRM4U copied to clipboard

if someone has managed to build assimp on Linux, please drop it. I'm having build errors.

Open MEMSITO opened this issue 11 months ago • 9 comments

Describe the bug Good day! Please tell me, does your plugin work with linux OS? I'm just trying to run it and I get an error.

Screenshots, log image **UnrealEngine Version:**ee58d743) UnrealEngine Version: [e.g. UE5.5.1]

MEMSITO avatar Jan 12 '25 09:01 MEMSITO

image this error appears after I click yes.

MEMSITO avatar Jan 12 '25 09:01 MEMSITO

Am I doing this right?

MEMSITO avatar Jan 12 '25 09:01 MEMSITO

I created a new project and now a see this message image What I need to do?

MEMSITO avatar Jan 12 '25 11:01 MEMSITO

HI. I have not tested the build for editors and cannot support it. If you want to try it, please refer to the instructions for use on a Mac, build assimp, and link to it when building the plugin.

https://ruyo-github-io.translate.goog/VRM4U/03_mac/?_x_tr_sl=ja&_x_tr_tl=en&_x_tr_hl=ja

ruyo avatar Jan 12 '25 12:01 ruyo

So, assimp issues appear during the build. image

Do you know how to fix it?

MEMSITO avatar Jan 12 '25 15:01 MEMSITO

image it exists, but writes during the build that it does not exist.

MEMSITO avatar Jan 12 '25 18:01 MEMSITO

@ruyo Sorry to bother you, but it looks like assimp is broken, I tried to build it on mac os and got the same error as on linux.

So, assimp issues appear during the build. image

Do you know how to fix it?

MEMSITO avatar Jan 13 '25 09:01 MEMSITO

there was no way to record the screen from the mac

MEMSITO avatar Jan 13 '25 09:01 MEMSITO

can u give me builded libasssimp.a file? This would make it easier for me to build the plugin.

MEMSITO avatar Jan 13 '25 09:01 MEMSITO

[EDIT: this causes the plugin build to fail, see the updated method in my next comment]

Assimp builds for me on Ubuntu 24 if I change #include "revision.h" to #include <assimp/revision.h> in code/Common/Version.cpp

I used

mkdir build
cd build
cmake -DASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT=OFF -DASSIMP_WARNINGS_AS_ERRORS=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release ..
make

I haven't tried to build the plugin with this assimp yet. I was actually able to use the plugin to get VMC tracking working with SlimeVR and WiVRn in the VRM4U_VMC.umap example map without building assimp, but importing VRMs didn't work (unrecognized extension error). I see that some of the plugin components (VRM4UImporter and VRM4ULoader) are whitelisted only for Windows and MacOS in VRM4U.uplugin, but trying to whitelist Linux for them gave me a bunch of errors about missing functions or something.

user-vm avatar Aug 01 '25 14:08 user-vm

I was able to finally build a version of libassimp.a that can actually be linked when building the plugin, and allows VRM models to be imported into Unreal 5.6.0 and 5.5.4 on Ubuntu 24.

It requires building assimp with the Unreal toolchain, which uses clang, not gcc - building it with gcc leads to unknown symbol errors when building the plugin with it.

I was only able to build it using Unreal 5.6.0 built from source, as it has the required toolchain. I was not able to use the 5.5.4 toolchain to build it (because it is missing libc++.so), but I WAS able to use the resulting libassimp.a in a 5.5.4 project.

mkdir build
cd build
export UE_ROOT=~/apps/UnrealEngine-5.6.0-release #change to your Unreal 5.6.0 location
export UE_TC=$UE_ROOT/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v25_clang-18.1.0-rockylinux8/x86_64-unknown-linux-gnu
export UE_SYSROOT=$UE_TC
export CC=$UE_TC/bin/clang
export CXX=$UE_TC/bin/clang++
cmake .. -G Ninja   -DCMAKE_SYSROOT="$UE_SYSROOT"   -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX"   -DCMAKE_CXX_FLAGS="--target=x86_64-unknown-linux-gnu -stdlib=libc++ -fPIC"   -DCMAKE_C_FLAGS="--target=x86_64-unknown-linux-gnu -fPIC"   -DASSIMP_BUILD_ZLIB=ON   -DASSIMP_BUILD_NO_OWN_ZLIB=OFF   -DASSIMP_BUILD_TESTS=OFF -DASSIMP_BUILD_ASSIMP_TOOLS=OFF   -DASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT=OFF   -DASSIMP_WARNINGS_AS_ERRORS=OFF  -DBUILD_SHARED_LIBS=OFF
ninja -j$(nproc)

The resulting libassimp.a is in build/lib/libassimp.a. I don't think Ninja is required, you should probably be able to exclude -G Ninja from the cmake command, and then use make -j$(nproc) instead of Ninja. The resulting library seems pretty large, I think it's because it has zlib linked statically inside it (it kept picking up the system libz.so otherwise, which was built with gcc and caused failures during the plugin build).

To build the plugin, I had to whitelist Linux in VRM4U.uplugin (for VRM4UImporter and VRM4ULoader). I also had to add an entry for Linux in VRM4ULoader.Build.cs:

		if (Target.Platform == UnrealTargetPlatform.Linux)
		{
			// static lib
			string PlatformString = "Linux";
			PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, "assimp", "lib", PlatformString, "libassimp.a"));
		}

I placed libassimp.a in VRM4U/ThirdParty/assimp/lib/Linux.

I think this should work on other Linux distributions, since it is using the Unreal toolchain: https://drive.google.com/file/d/1yGlDv4hOtw4KALY-wdTo0i3YXnKvLAhX/view?usp=sharing

user-vm avatar Aug 09 '25 20:08 user-vm

Image

This was my issue, of cause, add the whitelisting in the .uplugin file Then build assimp Edit this

i made it work for 5.6 and can now import VRM models

Idk if it'll work for others but hopefully it can help a few, just edit the #include

TheSuperHyrax avatar Dec 16 '25 15:12 TheSuperHyrax