Closed SpotlightKid closed 8 years ago
Interesting for the first one... It should now be fixed. The second failure is due to the fact that I don't test libsndfile, as I don't use it that often. The tests for libsndfile will fail because it won't find the files at the location (ATK_SOURCE_TREE won't be defined). At least the compilation is now OK.
Here's the rationale for the patch:
https://gcc.gnu.org/gcc-4.6/porting_to.html
You should also probably add something like this to CMakeLists.txt
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c+11")
endif()
Indeed, thanks for the link. I'm still thinking about what to do with the C++11 stuff. By default, GCC know targets C++14, so I should be covered, ans I may use some features there (when GCC, VS and XCode support them). Thanks for the feedback!
I still get the following error when I enable tests (latest develop
branch version):
<...>/audiotk-git/src/audiotk/tests/Distortion/SimpleOverdriveFilter.cpp:6:21: fatal error: ATK/git.h: No such file or directory
When I remove #include <ATK/git.h>
from tests/Distortion/SimpleOverdriveFilter.cpp
and pass -DCMAKE_BUILD_TYPE=Release
to cmake, compilation finishes without error.
diff --git a/tests/Distortion/SimpleOverdriveFilter.cpp b/tests/Distortion/SimpleOverdriveFilter.cpp
index 61f16cd..24f1397 100644
--- a/tests/Distortion/SimpleOverdriveFilter.cpp
+++ b/tests/Distortion/SimpleOverdriveFilter.cpp
@@ -3,7 +3,6 @@
*/
#include <ATK/config.h>
-#include <ATK/git.h>
#include <ATK/Distortion/SimpleOverdriveFilter.h>
If I do not set the build type to "Release", compilation fails with:
<...>/audiotk-git/src/audiotk/ATK/Distortion/DiodeClipperFilter.cpp: In member function 'void ATK::DiodeClipperFilter<DataType_>::process_impl(int64_t) const':
<...>/audiotk-git/src/audiotk/ATK/Distortion/DiodeClipperFilter.cpp:125:4: error: 'nb_input_ports' was not declared in this scope
assert(nb_input_ports == nb_output_ports);
and a couple more errors about assert
s with undefined variables at other place in this file.
Yeah, there must be some remaining git.h include commands, and as the file still exists in my configurations, the issue doesn't show up for me. I'll try to start from scratch on Tuesday.
I've removed all the asserts (that are actually useless), and removed the git.h include. The issue there is that the test is only compiled with libsndfile, which I don't usually do :/
Except for still needing to add -std=c++1
to the CXXFLAGS, all compilation issues seem to be fixed now.
For reference, here's the build procedure I currently use on Linux:
BUILD_TYPE="Release"
PY_VER=$(python -c 'import sys; print("%d.%d" % sys.version_info[:2])')
rm -rf build
mkdir build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_CXX_FLAGS="-std=c++11" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_PYTHON=1 \
-DPYTHON_INSTALL_FOLDER=/usr/lib/python${PY_VER} \
-DENABLE_TESTS=1
LC_ALL=C make
Here's a link to my Arch Linux AUR package:
Thanks a lot! I'll fix the other issues today. I won't add the C++11 flag, as all the main compilers compile at least in C++11 mode.
Well, GCC from version 5 onward always needs this option to support C++11 features.
See https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Standards.html#Standards. Section 2.2 "C++ Language" states:
The default, if no C++ language dialect options are given, is -std=gnu++98.
Indeed... I would need to add some checks on the gcc version,a s GCC will be C++14 by default. I guess I must have ended up of GCC 6 page, and not GCC 5 when I looked for the default value. Makes no sense that GCC 5 isn't using C++11 though. But that's another topic ;)
CMake >= 2.8.8 has a CMAKE_CXX_COMPILER_VERSION
variable:
I had to jump through a few hoops to manage to get AudioTK compiled on Arch Linux with GCC 5.3.0. Here's what I did to successfully compile:
The
exp-cstdef.patch
:Without this patch I get this error:
When enabling tests I get the following error: