From b7e093a78ee9008c9e6a1431aa2e192fbe68092b Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Fri, 25 Sep 2015 17:53:04 +0200 Subject: [PATCH 1/7] Update git tags in common.sh --- .gitignore | 4 +++- tools/MacOSX/common.sh | 10 +++++----- tools/Windows/common.sh | 10 +++++----- tools/linux/common.sh | 10 +++++----- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 01542e1ae5..660d6f4e3d 100644 --- a/.gitignore +++ b/.gitignore @@ -224,4 +224,6 @@ CrashReporterCLI/NatronRendererCrashReporter *local.sh* OpenColorIO-Configs PortIndex -PortIndex.quick \ No newline at end of file +PortIndex.quick +*.7z* +*.exe* \ No newline at end of file diff --git a/tools/MacOSX/common.sh b/tools/MacOSX/common.sh index ca3b68e0c6..a9f97e75a6 100755 --- a/tools/MacOSX/common.sh +++ b/tools/MacOSX/common.sh @@ -4,11 +4,11 @@ CWD=`pwd` #THE FOLLOWING CAN BE MODIFIED TO CONFIGURE RELEASE BUILDS #---------------------------------------------------------- -NATRON_GIT_TAG=tags/2.0.0 -IOPLUG_GIT_TAG=tags/2.0.0 -MISCPLUG_GIT_TAG=tags/2.0.0 -ARENAPLUG_GIT_TAG=tags/2.0.0 -CVPLUG_GIT_TAG=tags/2.0.0 +NATRON_GIT_TAG=tags/2.0.0-RC1 +IOPLUG_GIT_TAG=tags/2.0.0-RC1 +MISCPLUG_GIT_TAG=tags/2.0.0-RC1 +ARENAPLUG_GIT_TAG=tags/2.0.0-RC1 +CVPLUG_GIT_TAG=tags/2.0.0-RC1 #---------------------------------------------------------- GIT_NATRON=https://github.com/MrKepzie/Natron.git diff --git a/tools/Windows/common.sh b/tools/Windows/common.sh index 18f9904dbd..54cbb5703b 100644 --- a/tools/Windows/common.sh +++ b/tools/Windows/common.sh @@ -18,11 +18,11 @@ fi #THE FOLLOWING CAN BE MODIFIED TO CONFIGURE RELEASE BUILDS #---------------------------------------------------------- -NATRON_GIT_TAG=tags/2.0.0 -IOPLUG_GIT_TAG=tags/2.0.0 -MISCPLUG_GIT_TAG=tags/2.0.0 -ARENAPLUG_GIT_TAG=tags/2.0.0 -CVPLUG_GIT_TAG=tags/2.0.0 +NATRON_GIT_TAG=tags/2.0.0-RC1 +IOPLUG_GIT_TAG=tags/2.0.0-RC1 +MISCPLUG_GIT_TAG=tags/2.0.0-RC1 +ARENAPLUG_GIT_TAG=tags/2.0.0-RC1 +CVPLUG_GIT_TAG=tags/2.0.0-RC1 #---------------------------------------------------------- diff --git a/tools/linux/common.sh b/tools/linux/common.sh index 61936a43da..d65c35e572 100644 --- a/tools/linux/common.sh +++ b/tools/linux/common.sh @@ -24,11 +24,11 @@ #THE FOLLOWING CAN BE MODIFIED TO CONFIGURE RELEASE BUILDS #---------------------------------------------------------- -NATRON_GIT_TAG=tags/2.0.0 -IOPLUG_GIT_TAG=tags/2.0.0 -MISCPLUG_GIT_TAG=tags/2.0.0 -ARENAPLUG_GIT_TAG=tags/2.0.0 -CVPLUG_GIT_TAG=tags/2.0.0 +NATRON_GIT_TAG=tags/2.0.0-RC1 +IOPLUG_GIT_TAG=tags/2.0.0-RC1 +MISCPLUG_GIT_TAG=tags/2.0.0-RC1 +ARENAPLUG_GIT_TAG=tags/2.0.0-RC1 +CVPLUG_GIT_TAG=tags/2.0.0-RC1 #---------------------------------------------------------- From e1b1169952fc7db8a126a680f6696dee16a7dcbe Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Fri, 25 Sep 2015 18:02:36 +0200 Subject: [PATCH 2/7] Update README instruction for single release builds --- tools/Windows/README.md | 4 +++- tools/linux/README.md | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/Windows/README.md b/tools/Windows/README.md index 4c70bef531..4c1ca26fb0 100644 --- a/tools/Windows/README.md +++ b/tools/Windows/README.md @@ -34,4 +34,6 @@ The environment is now ready to build Natron and plug-ins, just run: BIT=64 sh snapshots.sh 64 - \ No newline at end of file +To launch a release build, edit common.sh to adjust which git tags should be used then: + #GPL build, without openfx-opencv plug-ins for 64bit target using 8 threads. + NATRON_LICENSE=GPL OFFLINE_INSTALLER=1 SYNC=1 NOCLEAN=1 CV=0 sh build.sh 64 tag 8 \ No newline at end of file diff --git a/tools/linux/README.md b/tools/linux/README.md index f7f2762f13..4614c54652 100644 --- a/tools/linux/README.md +++ b/tools/linux/README.md @@ -78,3 +78,10 @@ For this to work you need to create a file named **repo.sh** next to *snapshot.s REPO_DEST=user@host:/path REPO_URL=http://some.url + +Release build: +=============== + +To do a release build just edit the git tags accordingly in common.sh then type: + #Do a GPL build using 4 threads + NATRON_LICENSE=GPL OFFLINE_INSTALLER=1 SYNC=1 NOCLEAN=1 CV=0 sh build.sh tag 4 From f96bba4f633a15ed0726078b345799f4426c0d6e Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Fri, 25 Sep 2015 19:48:46 +0200 Subject: [PATCH 3/7] Windows: memoryFile: display last win32 error --- Engine/MemoryFile.cpp | 3 +++ Global/GlobalDefines.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/Engine/MemoryFile.cpp b/Engine/MemoryFile.cpp index ae6ac837bd..81ba8c757b 100644 --- a/Engine/MemoryFile.cpp +++ b/Engine/MemoryFile.cpp @@ -43,6 +43,7 @@ #include #include "Global/Macros.h" +#include "Global/GlobalDefines.h" #define MIN_FILE_SIZE 4096 @@ -239,8 +240,10 @@ MemoryFilePrivate::openInternal(MemoryFile::FileOpenModeEnum open_mode) #endif if (file_handle == INVALID_HANDLE_VALUE) { + std::string winError = Natron::GetLastErrorAsString(); std::string str("MemoryFile EXC : Failed to open file "); str.append(path); + str.append(winError); throw std::runtime_error(str); } diff --git a/Global/GlobalDefines.h b/Global/GlobalDefines.h index 8c00f47ef2..550f798153 100644 --- a/Global/GlobalDefines.h +++ b/Global/GlobalDefines.h @@ -188,6 +188,34 @@ s2ws(const std::string & s) #endif } + +#ifdef __NATRON_WIN32__ + + +//Returns the last Win32 error, in string format. Returns an empty string if there is no error. +inline +std::string GetLastErrorAsString() +{ + //Get the error message, if any. + DWORD errorMessageID = ::GetLastError(); + if(errorMessageID == 0) + return std::string(); //No error message has been recorded + + LPSTR messageBuffer = 0; + size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL); + + std::string message(messageBuffer, size); + + //Free the buffer. + LocalFree(messageBuffer); + + return message; } + +#endif + +} // Natron + #endif // ifndef NATRON_GLOBAL_GLOBALDEFINES_H From 8d9cdfb278237f1eceee59651e7da04f0def44b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Sat, 26 Sep 2015 04:47:05 +0200 Subject: [PATCH 4/7] Linux: sdk buildfix --- tools/linux/include/scripts/build-sdk.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/linux/include/scripts/build-sdk.sh b/tools/linux/include/scripts/build-sdk.sh index fff7ca763a..f5d7e7ace2 100644 --- a/tools/linux/include/scripts/build-sdk.sh +++ b/tools/linux/include/scripts/build-sdk.sh @@ -156,7 +156,7 @@ if [ ! -f "$INSTALL_PATH/bin/yasm" ]; then fi tar xvf "$SRC_PATH/$YASM_TAR" || exit 1 cd yasm* || exit 1 - ./configure --prefix="$INSTALL_PATH" CFLAGS="$BF" CXXFLAGS="$BF" || exit 1 + env CFLAGS="$BF" CXXFLAGS="$BF" ./configure --prefix="$INSTALL_PATH" || exit 1 make -j${MKJOBS} || exit 1 make install || exit 1 fi @@ -169,7 +169,7 @@ if [ ! -f "$INSTALL_PATH/bin/cmake" ]; then fi tar xvf "$SRC_PATH/$CMAKE_TAR" || exit 1 cd cmake* || exit 1 - ./configure --prefix="$INSTALL_PATH" CFLAGS="$BF" CXXFLAGS="$BF" || exit 1 + env CFLAGS="$BF" CXXFLAGS="$BF" ./configure --prefix="$INSTALL_PATH" || exit 1 make -j${MKJOBS} || exit 1 make install || exit 1 fi @@ -182,7 +182,7 @@ if [ ! -f "$INSTALL_PATH/lib/pkgconfig/python2.pc" ]; then fi tar xvf "$SRC_PATH/$PY2_TAR" || exit 1 cd Python-2* || exit 1 - ./configure --prefix="$INSTALL_PATH" --enable-shared CFLAGS="$BF" CXXFLAGS="$BF" || exit 1 + env CFLAGS="$BF" CXXFLAGS="$BF" ./configure --prefix="$INSTALL_PATH" --enable-shared || exit 1 make -j${MKJOBS} || exit 1 make install || exit 1 mkdir -p "$INSTALL_PATH/docs/python2" || exit 1 @@ -197,7 +197,7 @@ if [ ! -f "$INSTALL_PATH/lib/pkgconfig/python3.pc" ]; then fi tar xvf "$SRC_PATH/$PY3_TAR" || exit 1 cd Python-3* || exit 1 - ./configure --prefix=$INSTALL_PATH --enable-shared CFLAGS="$BF" CXXFLAGS="$BF" || exit 1 + env CFLAGS="$BF" CXXFLAGS="$BF" ./configure --prefix=$INSTALL_PATH --enable-shared || exit 1 make -j${MKJOBS} || exit 1 make install || exit 1 mkdir -p "$INSTALL_PATH/docs/python3" || exit 1 @@ -699,11 +699,11 @@ if [ ! -d $INSTALL_PATH/ffmpeg-gpl ] || [ ! -d $INSTALL_PATH/ffmpeg-lgpl ]; then fi tar xvf $SRC_PATH/$FFMPEG_TAR || exit 1 cd ffmpeg-2* || exit 1 - ./configure --prefix=$INSTALL_PATH/ffmpeg-gpl --libdir=$INSTALL_PATH/ffmpeg-gpl/lib --enable-shared --disable-static $GPL_SETTINGS CFLAGS="$BF" CXXFLAGS="$BF" CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib" || exit 1 + env CFLAGS="$BF" CXXFLAGS="$BF" CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib" ./configure --prefix=$INSTALL_PATH/ffmpeg-gpl --libdir=$INSTALL_PATH/ffmpeg-gpl/lib --enable-shared --disable-static $GPL_SETTINGS || exit 1 make -j${MKJOBS} || exit 1 make install || exit 1 make distclean - ./configure --prefix=$INSTALL_PATH/ffmpeg-lgpl --libdir=$INSTALL_PATH/ffmpeg-lgpl/lib --enable-shared --disable-static $LGPL_SETTINGS CFLAGS="$BF" CXXFLAGS="$BF" CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib" || exit 1 + env CFLAGS="$BF" CXXFLAGS="$BF" CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib" ./configure --prefix=$INSTALL_PATH/ffmpeg-lgpl --libdir=$INSTALL_PATH/ffmpeg-lgpl/lib --enable-shared --disable-static $LGPL_SETTINGS || exit 1 make install || exit 1 mkdir -p $INSTALL_PATH/docs/ffmpeg || exit 1 cp COPYING* CREDITS $INSTALL_PATH/docs/ffmpeg/ From c13db4d3a5243d4fb2ab3b2d9403cee7c539efb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Sat, 26 Sep 2015 09:44:37 +0200 Subject: [PATCH 5/7] missing include --- Gui/GuiAppInstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Gui/GuiAppInstance.cpp b/Gui/GuiAppInstance.cpp index 720b21f740..41f59917da 100644 --- a/Gui/GuiAppInstance.cpp +++ b/Gui/GuiAppInstance.cpp @@ -24,6 +24,7 @@ #include "GuiAppInstance.h" +#include #include #include From e7a429e4769f67092277bd2065308a939d267a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Sat, 26 Sep 2015 09:56:52 +0200 Subject: [PATCH 6/7] more include fixes --- Engine/MemoryFile.cpp | 2 -- Engine/ViewerInstance.cpp | 1 + Gui/Gui20.cpp | 1 + Gui/ViewerGL.cpp | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Engine/MemoryFile.cpp b/Engine/MemoryFile.cpp index 81ba8c757b..6bada5c788 100644 --- a/Engine/MemoryFile.cpp +++ b/Engine/MemoryFile.cpp @@ -24,8 +24,6 @@ #include "Engine/MemoryFile.h" -#include - #ifdef __NATRON_WIN32__ # include #else // unix diff --git a/Engine/ViewerInstance.cpp b/Engine/ViewerInstance.cpp index a5db6e054d..7e0b5718cd 100644 --- a/Engine/ViewerInstance.cpp +++ b/Engine/ViewerInstance.cpp @@ -26,6 +26,7 @@ #include "ViewerInstancePrivate.h" #include // min, max +#include #include GCC_DIAG_UNUSED_LOCAL_TYPEDEFS_OFF diff --git a/Gui/Gui20.cpp b/Gui/Gui20.cpp index d52efc07cd..eeeea39293 100644 --- a/Gui/Gui20.cpp +++ b/Gui/Gui20.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include "Global/Macros.h" diff --git a/Gui/ViewerGL.cpp b/Gui/ViewerGL.cpp index d4501a6276..ae254f2d4f 100644 --- a/Gui/ViewerGL.cpp +++ b/Gui/ViewerGL.cpp @@ -27,6 +27,7 @@ #include #include // min, max +#include #include "Global/Macros.h" #include "Global/GLIncludes.h" //! Date: Sat, 26 Sep 2015 12:44:55 +0200 Subject: [PATCH 7/7] Disk cache: bug fix --- Engine/Cache.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Engine/Cache.h b/Engine/Cache.h index 530c24c715..95b79cd9f2 100644 --- a/Engine/Cache.h +++ b/Engine/Cache.h @@ -1386,10 +1386,6 @@ class Cache we re-open the mapping to the RAM put the entry back into the memoryCache.*/ - if ( ret.empty() ) { - _diskCache.erase(diskCached); - } - try { (*it)->reOpenFileMapping(); } catch (const std::exception & e) { @@ -1406,6 +1402,7 @@ class Cache //put it back into the RAM _memoryCache.insert( (*it)->getHashKey(), *it ); + U64 memoryCacheSize, maximumInMemorySize; { @@ -1435,7 +1432,10 @@ class Cache if (_signalEmitter) { _signalEmitter->emitAddedEntry( key.getTime() ); } - + + ///Remove it from the disk cache + _diskCache.erase(diskCached); + return true; } }