summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-30 22:22:52 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-30 22:22:52 +0800
commitd604302d942d26ccfd8e0e5de548fa437d1425d5 (patch)
tree2775bb4bbe583499ae0cf5591df4e24dab139945
parent1713ef9a05cdbda684a045af1ffa96aff86fd7b4 (diff)
Fix Error: Dae parsing issue - see log for details
https://megapahit.com/show_bug.cgi?id=76 It seems like we have to use LL's Collada DOM 2.3. Make sure minizip is installed on macOS. It should be safe to uninstall your system Collada DOM package now. The CMake arguments might have to be completed for non-Darwin platforms in a next commit.
-rw-r--r--README.md12
-rw-r--r--indra/cmake/LLPrimitive.cmake74
-rw-r--r--indra/llprimitive/lldaeloader.cpp8
-rw-r--r--indra/newview/FixBundle.cmake.in6
-rw-r--r--indra/newview/FixPackage.cmake.in6
5 files changed, 76 insertions, 30 deletions
diff --git a/README.md b/README.md
index d94d67df7d..22d144b46f 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ $ cd build-`uname -s|tr '[:upper:]' '[:lower:]'`-`uname -m`
### macOS
```
-$ sudo port install cmake pkgconfig freealut +universal apr-util +universal boost181 +universal -no_static collada-dom +universal glm hunspell +universal freetype +universal openjpeg +universal uriparser +universal libvorbis +universal xxhashlib
+$ sudo port install cmake pkgconfig freealut +universal apr-util +universal boost181 +universal -no_static glm hunspell +universal freetype +universal minizip +universal openjpeg +universal uriparser +universal libvorbis +universal xxhashlib
$ export LL_BUILD="-O3 -gdwarf-2 -stdlib=libc++ -mmacosx-version-min=11 -iwithsysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -std=c++17 -fPIC -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -DNDEBUG -DPIC -DLL_DARWIN=1"
$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DUSE_FMODSTUDIO:BOOL=OFF -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=newview/Megapahit.app/Contents/Resources -DCMAKE_OSX_ARCHITECTURES:STRING=`uname -m` -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11 -DENABLE_SIGNING:BOOL=ON -DSIGNING_IDENTITY:STRING=- ../indra
$ sudo port deactivate boost
@@ -49,7 +49,7 @@ $ open newview/Megapahit.app
### Debian
```
-$ sudo apt install cmake pkg-config libxml2-utils libalut-dev libaprutil1-dev libboost-fiber1.81-dev libboost-json1.81-dev libboost-program-options1.81-dev libboost-regex1.81-dev libcollada-dom-dev libexpat1-dev libfltk1.3-dev libfontconfig-dev libfreetype-dev libglu1-mesa-dev libhunspell-dev libjpeg-dev libmeshoptimizer-dev libnghttp2-dev libpipewire-0.3-dev libpng-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxft-dev libxmlrpc-epi-dev libxxhash-dev
+$ sudo apt install cmake pkg-config libxml2-utils libalut-dev libaprutil1-dev libboost-fiber1.81-dev libboost-json1.81-dev libboost-program-options1.81-dev libboost-regex1.81-dev libexpat1-dev libfltk1.3-dev libfontconfig-dev libfreetype-dev libglu1-mesa-dev libhunspell-dev libjpeg-dev libmeshoptimizer-dev libnghttp2-dev libpipewire-0.3-dev libpng-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxft-dev libxmlrpc-epi-dev libxxhash-dev
$ export LL_BUILD="-O3 -std=c++17 -fPIC -DLL_LINUX=1"
$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DUSE_FMODSTUDIO:BOOL=OFF -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../indra
$ make -j`nproc`
@@ -61,7 +61,7 @@ $ megapahit
### Ubuntu
```
-$ sudo apt install cmake pkg-config libxml2-utils libaprutil1-dev libboost-fiber-dev libboost-json-dev libboost-program-options-dev libboost-regex-dev libcollada-dom-dev libexpat1-dev libfltk1.3-dev libfontconfig-dev libfreetype-dev libglu1-mesa-dev libhunspell-dev libjpeg-dev libmeshoptimizer-dev libnanosvg-dev libnghttp2-dev libpipewire-0.3-dev libpng-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxft-dev libxmlrpc-epi-dev libxxhash-dev
+$ sudo apt install cmake pkg-config libxml2-utils libaprutil1-dev libboost-fiber-dev libboost-json-dev libboost-program-options-dev libboost-regex-dev libexpat1-dev libfltk1.3-dev libfontconfig-dev libfreetype-dev libglu1-mesa-dev libhunspell-dev libjpeg-dev libmeshoptimizer-dev libnanosvg-dev libnghttp2-dev libpipewire-0.3-dev libpng-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxft-dev libxmlrpc-epi-dev libxxhash-dev
$ export LL_BUILD="-O3 -std=c++17 -fPIC -DLL_LINUX=1"
$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../indra
$ make -j`nproc`
@@ -73,7 +73,7 @@ $ megapahit
### Fedora
```
-$ sudo dnf install cmake gcc-c++ patchelf apr-util-devel boost-devel collada-dom-devel expat-devel fltk-devel mesa-libGLU-devel hunspell-devel libnghttp2-devel nanosvg-devel openjpeg-devel pipewire-devel pulseaudio-libs-devel SDL2-devel uriparser-devel vlc-devel libvorbis-devel xmlrpc-epi-devel xxhash-devel
+$ sudo dnf install cmake gcc-c++ patchelf apr-util-devel boost-devel expat-devel fltk-devel mesa-libGLU-devel hunspell-devel libnghttp2-devel nanosvg-devel openjpeg-devel pipewire-devel pulseaudio-libs-devel SDL2-devel uriparser-devel vlc-devel libvorbis-devel xmlrpc-epi-devel xxhash-devel
$ export LL_BUILD="-O3 -std=c++17 -fPIC -DLL_LINUX=1"
$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../indra
$ make -j`nproc`
@@ -87,13 +87,13 @@ $ megapahit
```
$ setenv LL_BUILD "-O3 -std=c++17 -fPIC"
$ sudo su -
-# portmaster devel/cmake devel/pkgconf audio/freealut devel/apr1 devel/collada-dom x11-toolkits/fltk math/glm textproc/hunspell misc/meshoptimizer graphics/nanosvg graphics/openjpeg devel/sdl20 net/uriparser multimedia/vlc audio/libvorbis net/xmlrpc-epi devel/xxhash
+# portmaster devel/cmake devel/pkgconf audio/freealut devel/apr1 x11-toolkits/fltk math/glm textproc/hunspell misc/meshoptimizer graphics/nanosvg graphics/openjpeg devel/sdl20 net/uriparser multimedia/vlc audio/libvorbis net/xmlrpc-epi devel/xxhash
# exit
$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=ON -DUSE_FMODSTUDIO:BOOL=OFF -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=OFF -DROOT_PROJECT_NAME:STRING=Megapahit -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../indra
$ make -j`nproc`
$ sudo cpack -G FREEBSD
$ sudo pkg add megapahit-`cat newview/viewer_version.txt`-FreeBSD.pkg
-$ sudo pkg set -yA 1 freealut apr1 collada-dom fltk hunspell meshoptimizer nanosvg openjpeg sdl20 uriparser vlc libvorbis xmlrpc-epi
+$ sudo pkg set -yA 1 freealut apr1 fltk hunspell meshoptimizer nanosvg openjpeg sdl20 uriparser vlc libvorbis xmlrpc-epi
$ megapahit
```
diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake
index 539f5c0d55..8174e8a851 100644
--- a/indra/cmake/LLPrimitive.cmake
+++ b/indra/cmake/LLPrimitive.cmake
@@ -11,16 +11,6 @@ add_library( ll::minizip-ng INTERFACE IMPORTED )
add_library( ll::libxml INTERFACE IMPORTED )
add_library( ll::colladadom INTERFACE IMPORTED )
-if ( NOT (USE_AUTOBUILD_3P OR USE_CONAN) )
- include(FindPkgConfig)
- pkg_check_modules(Colladadom REQUIRED collada-dom)
- target_compile_definitions( ll::colladadom INTERFACE COLLADA_DOM_SUPPORT141 )
- target_include_directories( ll::colladadom SYSTEM INTERFACE ${Colladadom_INCLUDE_DIRS} ${Colladadom_INCLUDE_DIRS}/1.4 )
- target_link_directories( ll::colladadom INTERFACE ${Colladadom_LIBRARY_DIRS} )
- target_link_libraries( ll::colladadom INTERFACE ${Colladadom_LIBRARIES} )
- return ()
-endif ()
-
# ND, needs fixup in collada conan pkg
if( USE_CONAN )
target_include_directories( ll::colladadom SYSTEM INTERFACE
@@ -28,12 +18,76 @@ if( USE_CONAN )
"${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/1.4/" )
endif()
+if( (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0) AND USESYSTEMLIBS )
+ if (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4.tar.gz)
+ file(DOWNLOAD
+ https://github.com/secondlife/3p-colladadom/archive/refs/tags/v2.3-r4.tar.gz
+ ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4.tar.gz
+ )
+ endif (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4.tar.gz)
+ file(ARCHIVE_EXTRACT
+ INPUT ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4.tar.gz
+ DESTINATION ${CMAKE_BINARY_DIR}
+ )
+ if (DARWIN)
+ try_compile(COLLADADOM_RESULT
+ PROJECT colladadom
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4
+ BINARY_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4
+ TARGET collada14dom
+ CMAKE_FLAGS
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ -DOPT_COLLADA14:BOOL=ON
+ -DCOLLADA_DOM_INCLUDE_INSTALL_DIR:FILEPATH=${LIBS_PREBUILT_DIR}/include/colladadom
+ -DCOLLADA_DOM_SOVERSION:STRING=0
+ -DCOLLADA_DOM_VERSION:STRING=2.3-r4
+ -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp
+ -DZLIB_LIBRARIES:STRING=xml2
+ -DBoost_FILESYSTEM_LIBRARY:STRING=boost_filesystem-mt
+ -DBoost_SYSTEM_LIBRARY:STRING=boost_system-mt
+ -DEXTRA_COMPILE_FLAGS:STRING=-I/opt/local/include/minizip
+ -DBoost_CFLAGS:STRING=-I/opt/local/include
+ -DCMAKE_SHARED_LINKER_FLAGS:STRING=-L/opt/local/lib
+ -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
+ -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15
+ OUTPUT_VARIABLE colladadom_installed
+ )
+ else (DARWIN)
+ try_compile(COLLADADOM_RESULT
+ PROJECT colladadom
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4
+ BINARY_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4
+ TARGET collada14dom
+ CMAKE_FLAGS
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ -DOPT_COLLADA14:BOOL=ON
+ -DCOLLADA_DOM_INCLUDE_INSTALL_DIR:FILEPATH=${LIBS_PREBUILT_DIR}/include/colladadom
+ -DCOLLADA_DOM_SOVERSION:STRING=0
+ -DCOLLADA_DOM_VERSION:STRING=2.3-r4
+ -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp
+ -DZLIB_LIBRARIES:STRING=xml2
+ OUTPUT_VARIABLE colladadom_installed
+ )
+ endif (DARWIN)
+ if (${MESHOPTIMIZER_RESULT})
+ file(
+ COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/dom/include
+ DESTINATION ${LIBS_PREBUILT_DIR}/include/colladadom
+ )
+ file(
+ COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/dom/libcollada14dom.a
+ DESTINATION ${LIBS_PREBUILT_DIR}/lib/release
+ )
+ file(WRITE ${PREBUILD_TRACKING_DIR}/colladadom_installed "0")
+ endif (${MESHOPTIMIZER_RESULT})
+else( (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0) AND USESYSTEMLIBS )
use_system_binary( colladadom )
use_prebuilt_binary(colladadom)
use_prebuilt_binary(minizip-ng) # needed for colladadom
use_prebuilt_binary(pcre)
use_prebuilt_binary(libxml2)
+endif( (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0) AND USESYSTEMLIBS )
target_link_libraries( ll::pcre INTERFACE pcrecpp pcre )
diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp
index a099a07cbd..43fb043363 100644
--- a/indra/llprimitive/lldaeloader.cpp
+++ b/indra/llprimitive/lldaeloader.cpp
@@ -941,20 +941,12 @@ bool LLDAELoader::OpenFile(const std::string& filename)
domCOLLADA* dom;
if (mPreprocessDAE)
{
-#ifdef LL_USESYSTEMLIBS
- dom = static_cast<domCOLLADA *>(dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str()));
-#else
dom = dae.openFromMemory(uri_filename, preprocessDAE(filename).c_str());
-#endif
}
else
{
LL_INFOS() << "Skipping dae preprocessing" << LL_ENDL;
-#ifdef LL_USESYSTEMLIBS
- dom = static_cast<domCOLLADA *>(dae.open(uri_filename));
-#else
dom = dae.open(uri_filename);
-#endif
}
if (!dom)
diff --git a/indra/newview/FixBundle.cmake.in b/indra/newview/FixBundle.cmake.in
index 3616d68676..0538918c9e 100644
--- a/indra/newview/FixBundle.cmake.in
+++ b/indra/newview/FixBundle.cmake.in
@@ -121,9 +121,9 @@ execute_process(
COMMAND lipo libbz2.1.0.8.dylib
-thin ${CMAKE_OSX_ARCHITECTURES}
-output libbz2.1.0.8.dylib
- COMMAND lipo libcollada-dom2.4-dp.2.4.0.dylib
+ COMMAND lipo libcollada14dom.2.3-r4.dylib
-thin ${CMAKE_OSX_ARCHITECTURES}
- -output libcollada-dom2.4-dp.2.4.0.dylib
+ -output libcollada14dom.2.3-r4.dylib
COMMAND lipo libexpat.1.9.2.dylib
-thin ${CMAKE_OSX_ARCHITECTURES}
-output libexpat.1.9.2.dylib
@@ -229,7 +229,7 @@ execute_process(
Frameworks/libbrotlicommon.1.1.0.dylib
Frameworks/libbrotlidec.1.1.0.dylib
Frameworks/libbz2.1.0.8.dylib
- Frameworks/libcollada-dom2.4-dp.2.4.0.dylib
+ Frameworks/libcollada14dom.2.3-r4.dylib
Frameworks/libexpat.1.9.2.dylib
Frameworks/libfreetype.6.dylib
Frameworks/libhunspell-1.7.0.dylib
diff --git a/indra/newview/FixPackage.cmake.in b/indra/newview/FixPackage.cmake.in
index 3ef3b5770f..9c68072b8a 100644
--- a/indra/newview/FixPackage.cmake.in
+++ b/indra/newview/FixPackage.cmake.in
@@ -121,9 +121,9 @@ execute_process(
COMMAND lipo libbz2.1.0.8.dylib
-thin ${CMAKE_OSX_ARCHITECTURES}
-output libbz2.1.0.8.dylib
- COMMAND lipo libcollada-dom2.4-dp.2.4.0.dylib
+ COMMAND lipo libcollada14dom.2.3-r4.dylib
-thin ${CMAKE_OSX_ARCHITECTURES}
- -output libcollada-dom2.4-dp.2.4.0.dylib
+ -output libcollada14dom.2.3-r4.dylib
COMMAND lipo libexpat.1.9.2.dylib
-thin ${CMAKE_OSX_ARCHITECTURES}
-output libexpat.1.9.2.dylib
@@ -229,7 +229,7 @@ execute_process(
Frameworks/libbrotlicommon.1.1.0.dylib
Frameworks/libbrotlidec.1.1.0.dylib
Frameworks/libbz2.1.0.8.dylib
- Frameworks/libcollada-dom2.4-dp.2.4.0.dylib
+ Frameworks/libcollada14dom.2.3-r4.dylib
Frameworks/libexpat.1.9.2.dylib
Frameworks/libfreetype.6.dylib
Frameworks/libhunspell-1.7.0.dylib