I decided to give russimp-sys a try on clean Mac environment and encountered lots of small build issues. Solving ones could potentially make life a bit easier.
So I’ve include the sys crate in my project and got this error
--- stderr
wrapper.h:1:10: fatal error: 'assimp/aabb.h' file not found
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ClangDiagnostic("wrapper.h:1:10: fatal error: 'assimp/aabb.h' file not found\n")', /Users/mxpv/.cargo/registry/src/index.crates.io-6f17d22bba15001f/russimp-sys-2.0.0/build.rs:181:10
Apparently assimp headers must be included even when not building from source.
536fa43 Includes headers in the crate package, so it no longer fails.
After the fix above, I started seeing linker problems (on MacOS)
= note: ld: library 'assimp' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So I ran brew install assimp, but that did not help.
Looks like the build script doesn’t take into account brew directories,
4537f5d adds brew to search paths.
and lastly ZLib.
zlib feature is enabled by default, but it makes sense only when building from source code, which is disabled by default. If we’re not building from source, we should expect zlib to exist (same as assimp).
I confirmed this to work on both Intel and M1 macs (with just brew install assimp as prerequisite).
```bash
❯ cargo test
Compiling russimp-sys v2.0.0 (/Users/mxpv/Github/russimp-sys)
Finished test [unoptimized + debuginfo] target(s) in 3.54s
Running unittests src/lib.rs (target/debug/deps/russimp_sys-37468f7323fd3374)
running 46 tests
test bindgen_test_layout_aiAABB ... ok
test bindgen_test_layout_aiBone ... ok
test bindgen_test_layout_aiAnimMesh ... ok
test bindgen_test_layout_aiColor3D ... ok
test bindgen_test_layout_aiAnimation ... ok
test bindgen_test_layout_aiCamera ... ok
test bindgen_test_layout_aiColor4D ... ok
test bindgen_test_layout_aiExportDataBlob ... ok
test bindgen_test_layout_aiExportFormatDesc ... ok
test bindgen_test_layout_aiFace ... ok
test bindgen_test_layout_aiFileIO ... ok
test bindgen_test_layout_aiFile ... ok
test bindgen_test_layout_aiImporterDesc ... ok
test bindgen_test_layout_aiLogStream ... ok
test bindgen_test_layout_aiLight ... ok
test bindgen_test_layout_aiMaterial ... ok
test bindgen_test_layout_aiMaterialProperty ... ok
test bindgen_test_layout_aiMatrix3x3 ... ok
test bindgen_test_layout_aiMatrix4x4 ... ok
test bindgen_test_layout_aiMemoryInfo ... ok
test bindgen_test_layout_aiMesh ... ok
test bindgen_test_layout_aiMeshAnim ... ok
test bindgen_test_layout_aiMeshKey ... ok
test bindgen_test_layout_aiMeshMorphAnim ... ok
test bindgen_test_layout_aiMeshMorphKey ... ok
test bindgen_test_layout_aiMetadata ... ok
test bindgen_test_layout_aiMetadataEntry ... ok
test bindgen_test_layout_aiNode ... ok
test bindgen_test_layout_aiNodeAnim ... ok
test bindgen_test_layout_aiPlane ... ok
test bindgen_test_layout_aiPropertyStore ... ok
test bindgen_test_layout_aiQuatKey ... ok
test bindgen_test_layout_aiQuaternion ... ok
test bindgen_test_layout_aiRay ... ok
test bindgen_test_layout_aiScene ... ok
test bindgen_test_layout_aiSkeleton ... ok
test bindgen_test_layout_aiSkeletonBone ... ok
test bindgen_test_layout_aiString ... ok
test bindgen_test_layout_aiTexel ... ok
test bindgen_test_layout_aiTexture ... ok
test bindgen_test_layout_aiUVTransform ... ok
test bindgen_test_layout_aiVector2D ... ok
test bindgen_test_layout_aiVector3D ... ok
test bindgen_test_layout_aiVectorKey ... ok
test bindgen_test_layout_aiVertexWeight ... ok
test tests::test_version ... ok
test result: ok. 46 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running unittests bin/package/main.rs (target/debug/deps/package-8557b93c4a9b2be6)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
```
I decided to give
russimp-sys
a try on clean Mac environment and encountered lots of small build issues. Solving ones could potentially make life a bit easier.So I’ve include the sys crate in my project and got this error
Apparently assimp headers must be included even when not building from source. 536fa43 Includes headers in the crate package, so it no longer fails.
After the fix above, I started seeing linker problems (on MacOS)
So I ran
brew install assimp
, but that did not help. Looks like the build script doesn’t take into accountbrew
directories, 4537f5d adds brew to search paths.and lastly ZLib.
zlib feature is enabled by default, but it makes sense only when building from source code, which is disabled by default. If we’re not building from source, we should expect zlib to exist (same as assimp).
I confirmed this to work on both Intel and M1 macs (with just
brew install assimp
as prerequisite).