How to fix **__attribute__(( packed ))** error - gcc

I cloned a copy of feng multimedia server, after running autoreconf -i in its directory, a configure script was created, but when I run this script, it gets stuck and exit with the following error:
checking if gcc -std=gnu99 supports __attribute__(( packed ))... no
configure: error: unable to find how the compiler declares packed structures
Any idea of how I can fix such a problem ?
Output of gcc --verbose :
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
Output of the config.log file:
| }
configure:7344: result: no
configure:7355: WARNING: POSIX realtime features not available
configure:7363: checking if gcc -std=gnu99 supports __attribute__(( packed ))
configure:7385: gcc -std=gnu99 -c -g -O2 -Wall -Wwrite-strings -fdiagnostics-show-option -Wformat=2 -Werror=implicit-function-declaration -Werror=return-type -DNDEBUG $
conftest.c:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'm4_ifnblank'
conftest.c:33:3: error: invalid preprocessing directive #Check
conftest.c:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'enableval'
conftest.c:36: error: expected identifier or '(' before 'else'
conftest.c:41:3: error: invalid preprocessing directive #Check
conftest.c:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'enableval'
conftest.c:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'if'
conftest.c:50: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'cat'
conftest.c:50: error: stray '\' in program
cc1: warnings being treated as errors
conftest.c:54: error: empty declaration
conftest.c:55: error: invalid application of 'sizeof' to incomplete type 'struct astructure'
conftest.c:55: error: size of array 'assert' is negative
configure:7392: $? = 1
configure: failed program was:
| /* confdefs.h. */
//...........OUTPUT TRIMMED.............//
#define _TANDEM_SOURCE 1
#define HAVE_LIBEV 1
_ACEOF
m4_ifnblank(, )
else
m4_ifnblank(AC_MSG_ERROR([libev not found, feng requires libev]), AC_MSG_ERROR([libev not found, feng requires libev]))
fi
# Check whether --enable-trace was given.
if test "${enable_trace+set}" = set; then
enableval=$enable_trace;
else
enable_trace="no"
fi
# Check whether --enable-tables was given.
if test "${enable_tables+set}" = set; then
enableval=$enable_tables;
fi
if test "x$enable_tables" = "xno"; then
cat >>confdefs.h <<\_ACEOF
#define AVOID_TABLES 1
#define HAVE_DECL_STRERROR_R 0
configure: exit 1

Related

Error running '__rvm_make -j8' in macos Monterey

I'm trying to install ruby 2.7.0 using RVM on MacOS(12.4: apple M2), but i'm getting below error and not able to install required ruby version. I have tried all the solutions available on internet related to openssl but nothing works for me and tried with rbenv also but no luck. Please help me, thank you in advance.
Current version: OpenSSL 1.1.1s 1 Nov 2022
+__rvm_make:0> make -j8
BASERUBY = /usr/bin/ruby --disable=gems
CC = gcc
LD = ld
LDSHARED = gcc -dynamiclib
CFLAGS = -O3 -ggdb3 -Wno-error=implicit-function-declaration -std=gnu99 -fno-common -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/-darwin21 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl#1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
DLDFLAGS = -Wl,-multiply_defined,suppress -L/opt/homebrew/opt/libyaml/lib -L/opt/homebrew/opt/libksba/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/openssl#1.1/lib -install_name /Users/rashmib/.rvm/rubies/ruby-2.7.0/lib/libruby.2.7.dylib -compatibility_version 2.7 -current_version 2.7.0 -fstack-protector-strong -framework Security -framework Foundation -fstack-protector-strong -framework Security -framework Foundation
SOLIBS = -lpthread -ldl -lobjc
LANG =
LC_ALL =
LC_CTYPE = UTF-8
MFLAGS = - --jobserver-fds=4,5 -j
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
compiling ./main.c
compiling dmydln.c
compiling miniinit.c
compiling dmyext.c
translating probes probes.d
compiling bignum.c
compiling class.c
compiling ast.c
. ./vm_opts.h
compiling compar.c
compiling compile.c
compiling complex.c
compiling cont.c
bignum.c:6127:33: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
bignum.c:6127:33: note: '{' token is here
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
{ \
^
bignum.c:6127:33: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1837:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
}
^
bignum.c:6127:33: note: ')' token is here
return rb_num_coerce_bin(x, y, rb_intern("remainder"));
^~~~~~~~~~~~~~~~~~~~~~
./include/ruby/ruby.h:1847:56: note: expanded from macro 'rb_intern'
__extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
^
class.c:541:13: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
After trying lot of suggestions, following these steps worked for me
MAC ports installation
https://trac.macports.org/wiki/Migration
Run
rvm install 2.7.0 --with-out-ext=fiddle

Errors building python_example from pybind11 docs on macos

I get compiler errors when following the instructions from the pybind11 docs for the example build housed at https://github.com/pybind/python_example
The instructions are (1) clone the repo, and (2) pip3 install ./python_example.
I'm on OS X (Mojave) with python 3.7.3 and
c++ --version
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I'm very new to python packages and to pybind11, so I'm more than a little lost and would appreciate newbie guidance. It looks like the errors have to do with implementations for C++ operator new and delete.
If so, I'm confident that I'm not the first person to have this issue and would appreciate a pointer to a solution.
I followed the steps given on the github repo:
Cloning into 'python_example'...
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 132 (delta 4), reused 11 (delta 4), pack-reused 119
Receiving objects: 100% (132/132), 31.03 KiB | 373.00 KiB/s, done.
Resolving deltas: 100% (62/62), done.
$ pip3 install ./python_example/
Here is the full output. Is something in the repo misconfigured (I did no configuration)? Is this a python version thing? A missing compiler flag? If I distribute code using this setup as a template, is there anything I need to do to increase portability? I'm a little worried that the "hello world" example has me on stack overflow! Thanks in advance for any help.
Processing ./python_example
Requirement already satisfied: pybind11>=2.3 in /usr/local/lib/python3.7/site-packages (from python-example==0.0.1) (2.3.0)
Building wheels for collected packages: python-example
Building wheel for python-example (setup.py) ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/pip-req-build-9f8udd0w/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/pip-wheel-fk0w8_oq --python-tag cp37:
running bdist_wheel
running build
running build_ext
creating var
creating var/folders
creating var/folders/7l
creating var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn
creating var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c /var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/tmpag19sot6.cpp -o var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/tmpag19sot6.o -std=c++17
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c /var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/tmpf327436e.cpp -o var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/tmpf327436e.o -fvisibility=hidden
building 'python_example' extension
creating build
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include/python3.7m -I/Users/stevescott/Library/Python/3.7/include/python3.7m -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/main.cpp -o build/temp.macosx-10.14-x86_64-3.7/src/main.o -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO="0.0.1" -std=c++17 -fvisibility=hidden
In file included from src/main.cpp:1:
In file included from /usr/local/include/python3.7m/pybind11/pybind11.h:49:
In file included from /usr/local/include/python3.7m/pybind11/attr.h:13:
/usr/local/include/python3.7m/pybind11/cast.h:579:34: error: aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.14 or newer
vptr = ::operator new(type->type_size,
^
/usr/local/include/python3.7m/pybind11/cast.h:579:34: note: if you supply your own aligned allocation functions, use -faligned-allocation to silence this diagnostic
In file included from src/main.cpp:1:
/usr/local/include/python3.7m/pybind11/pybind11.h:1009:9: error: no matching function for call to 'operator delete'
::operator delete(p, s, std::align_val_t(a));
^~~~~~~~~~~~~~~~~
note: candidate function not viable: requires 2 arguments, but 3 were provided
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:188:36: note: candidate function not viable: requires 2 arguments, but 3 were provided
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:190:74: note: candidate function not viable: requires 2 arguments, but 3 were provided
_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:221:40: note: candidate function not viable: requires 2 arguments, but 3 were provided
inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:187:36: note: candidate function not viable: requires single argument '__p', but 3 arguments were provided
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
^
In file included from src/main.cpp:1:
/usr/local/include/python3.7m/pybind11/pybind11.h:1011:9: error: call to unavailable function 'operator delete': introduced in macOS 10.12
::operator delete(p, s);
^~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:190:74: note: candidate function has been explicitly made unavailable
_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:221:40: note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'void *' for 2nd argument; take the address of the argument with &
inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:188:36: note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'const std::nothrow_t' for 2nd argument
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
^
note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'std::align_val_t' for 2nd argument
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:187:36: note: candidate function not viable: requires single argument '__p', but 2 arguments were provided
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
^
3 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for python-example
Running setup.py clean for python-example
Failed to build python-example
Installing collected packages: python-example
Running setup.py install for python-example ... error
Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/pip-req-build-9f8udd0w/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/pip-record-yvb3nloo/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c /var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/tmpkd6a1ugc.cpp -o var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/tmpkd6a1ugc.o -std=c++17
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c /var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/tmpywf858_h.cpp -o var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/tmpywf858_h.o -fvisibility=hidden
building 'python_example' extension
creating build
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include/python3.7m -I/Users/stevescott/Library/Python/3.7/include/python3.7m -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/main.cpp -o build/temp.macosx-10.14-x86_64-3.7/src/main.o -stdlib=libc++ -mmacosx-version-min=10.7 -DVERSION_INFO="0.0.1" -std=c++17 -fvisibility=hidden
In file included from src/main.cpp:1:
In file included from /usr/local/include/python3.7m/pybind11/pybind11.h:49:
In file included from /usr/local/include/python3.7m/pybind11/attr.h:13:
/usr/local/include/python3.7m/pybind11/cast.h:579:34: error: aligned allocation function of type 'void *(unsigned long, enum std::align_val_t)' is only available on macOS 10.14 or newer
vptr = ::operator new(type->type_size,
^
/usr/local/include/python3.7m/pybind11/cast.h:579:34: note: if you supply your own aligned allocation functions, use -faligned-allocation to silence this diagnostic
In file included from src/main.cpp:1:
/usr/local/include/python3.7m/pybind11/pybind11.h:1009:9: error: no matching function for call to 'operator delete'
::operator delete(p, s, std::align_val_t(a));
^~~~~~~~~~~~~~~~~
note: candidate function not viable: requires 2 arguments, but 3 were provided
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:188:36: note: candidate function not viable: requires 2 arguments, but 3 were provided
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:190:74: note: candidate function not viable: requires 2 arguments, but 3 were provided
_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:221:40: note: candidate function not viable: requires 2 arguments, but 3 were provided
inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:187:36: note: candidate function not viable: requires single argument '__p', but 3 arguments were provided
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
^
In file included from src/main.cpp:1:
/usr/local/include/python3.7m/pybind11/pybind11.h:1011:9: error: call to unavailable function 'operator delete': introduced in macOS 10.12
::operator delete(p, s);
^~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:190:74: note: candidate function has been explicitly made unavailable
_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:221:40: note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'void *' for 2nd argument; take the address of the argument with &
inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {}
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:188:36: note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'const std::nothrow_t' for 2nd argument
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
^
note: candidate function not viable: no known conversion from 'pybind11::size_t' (aka 'unsigned long') to 'std::align_val_t' for 2nd argument
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/new:187:36: note: candidate function not viable: requires single argument '__p', but 2 arguments were provided
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
^
3 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/pip-req-build-9f8udd0w/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/pip-record-yvb3nloo/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/7l/5r4qgkms4vb3xm6ktxdvh1l80000gn/T/pip-req-build-9f8udd0w/
I ran into the same issue with my pybind11 project on Mac OS.
I haven't been able to figure it out the root cause, but found a workaround: I disabled the C++17 cpp flag by removing the -std=c++17 from the list here.
Therefore instead of receiving the same errors that you mentioned, I got them as warnings. It's not a proper solution, and I really like to see a real explanation for this, but at least I have my source code compiled.
Update:
As eudoxos pointed out in his comment they opened an issue on pybind11's github page related to this and the fix should be in the next release.

Create a CUDA/cpp makefile

I am a newbie in CUDA and want to compile my first programms on a Jetson TK1.
I have searched the Internet and also this Site but dont found something, that was helpful for me.
I have found this example
http://bikulov.org/blog/2013/12/24/example-of-cmake-file-for-cuda-plus-cpp-code/
and tried to compile the CUDA example oceanFFT which runs with the sample Makefile.
http://developer.download.nvidia.com/compute/cuda/1.1-Beta/x86_website/samples.html#oceanFFT
I have changed this CMakeLists.txt a little bit, but I dont know if I did this correct.
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(lbmslv)
FIND_PACKAGE(CUDA REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
INCLUDE(FindCUDA)
INCLUDE_DIRECTORIES(/usr/local/cuda/include ${MPI_INCLUDE_PATH})
INCLUDE_DIRECTORIES(/usr/local/cuda-6.5/samples/common/inc ${CUS_INCLUDE_PATH})
INCLUDE_DIRECTORIES(/usr/local/cuda-6.5/samples/common/lib/linux/armv7l ${GLEW_INCLUDE_PATH})
FILE(GLOB SOURCES "*.cu" "*.cpp" "*.c" "*.h")
CUDA_ADD_EXECUTABLE(lbmslv ${SOURCES})
LIST(APPEND CMAKE_CXX_FLAGS "-std=c++0x -O3 -ffast-math -Wall")
LIST(APPEND CUDA_NVCC_FLAGS --compiler-options -fno-strict-aliasing -lineinfo -use_fast_math -Xptxas -dlcm=cg)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
TARGET_LINK_LIBRARIES(lbmslv /usr/local/cuda/lib/libcudart.so ${MPI_LIBRARIES})
When I run this I get a lot errors with :
undefined reference to .. gl.., glew.., glut..
so, not linked to this Libraries.
What did I wrong?
My problem with the sample Makefiles is, that they are to complicate for my.
I have also tried to make the sample Makefile easier.
# Location of the CUDA Toolkit
CUDA_PATH ?= /usr/local/cuda-6.5
OSUPPER = $(shell uname -s 2>/dev/null | tr "[:lower:]" "[:upper:]")
OSLOWER = $(shell uname -s 2>/dev/null | tr "[:upper:]" "[:lower:]")
OS_SIZE = $(shell uname -m | sed -e "s/x86_64/64/" -e "s/armv7l/32/" -e "s/aarch64/64/")
OS_ARCH = $(shell uname -m)
ARCH_FLAGS =
DARWIN = $(strip $(findstring DARWIN, $(OSUPPER)))
ifneq ($(DARWIN),)
XCODE_GE_5 = $(shell expr `xcodebuild -version | grep -i xcode | awk '{print $$2}' | cut -d'.' -f1` \>= 5)
endif
# Take command line flags that override any of these settings
# ARCH == ARMv7
OS_SIZE = 32
OS_ARCH = armv7l
ARCH_FLAGS = -target-cpu-arch ARM
# Common binaries
GCC := arm-linux-gnueabihf-g++
NVCC := $(CUDA_PATH)/bin/nvcc -ccbin $(GCC)
# internal flags
NVCCFLAGS := -m${OS_SIZE} ${ARCH_FLAGS}
CCFLAGS :=
LDFLAGS :=
# Extra user flags
EXTRA_NVCCFLAGS ?=
EXTRA_LDFLAGS ?=
EXTRA_CCFLAGS ?=
# OS-specific build flags
ifeq ($(abi),gnueabi)
CCFLAGS += -mfloat-abi=softfp
else
# default to gnueabihf
override abi := gnueabihf
LDFLAGS += --dynamic-linker=/lib/ld-linux-armhf.so.3
CCFLAGS += -mfloat-abi=hard
endif
ifneq ($(TARGET_FS),)
GCCVERSIONLTEQ46 := $(shell expr `$(GCC) -dumpversion` \<= 4.6)
ifeq ($(GCCVERSIONLTEQ46),1)
CCFLAGS += --sysroot=$(TARGET_FS)
endif
LDFLAGS += --sysroot=$(TARGET_FS)
LDFLAGS += -rpath-link=$(TARGET_FS)/lib
LDFLAGS += -rpath-link=$(TARGET_FS)/usr/lib
LDFLAGS += -rpath-link=$(TARGET_FS)/usr/lib/arm-linux-$(abi)
endif
# Debug build flags
ifeq ($(dbg),1)
NVCCFLAGS += -g -G
TARGET := debug
else
TARGET := release
endif
ALL_CCFLAGS :=
ALL_CCFLAGS += $(NVCCFLAGS)
ALL_CCFLAGS += $(EXTRA_NVCCFLAGS)
ALL_CCFLAGS += $(addprefix -Xcompiler ,$(CCFLAGS))
ALL_CCFLAGS += $(addprefix -Xcompiler ,$(EXTRA_CCFLAGS))
ALL_LDFLAGS :=
ALL_LDFLAGS += $(ALL_CCFLAGS)
ALL_LDFLAGS += $(addprefix -Xlinker ,$(LDFLAGS))
ALL_LDFLAGS += $(addprefix -Xlinker ,$(EXTRA_LDFLAGS))
# Common includes and paths for CUDA
INCLUDES := -I ~/NVIDIA_CUDA-6.5_Samples/common/inc
LIBRARIES :=
################################################################################
SAMPLE_ENABLED := 1
# Makefile include to help find GL Libraries
include ./findgllib.mk
# OpenGL specific libraries
ifneq ($(DARWIN),)
# Mac OSX specific libraries and paths to include
LIBRARIES += -L/System/Library/Frameworks/OpenGL.framework/Libraries
LIBRARIES += -lGL -lGLU ../../common/lib/darwin/libGLEW.a
ALL_LDFLAGS += -Xlinker -framework -Xlinker GLUT
else
LIBRARIES += -L ~/NVIDIA_CUDA-6.5_Samples/common/lib/$(OSLOWER)/$(OS_ARCH) $(GLLINK)
LIBRARIES += -lGL -lGLU -lX11 -lXi -lXmu -lglut -lGLEW
endif
# Gencode arguments
ifeq ($(OS_ARCH),armv7l)
SMS ?= 20 30 32 35 37 50 52
else
SMS ?= 11 20 30 35 37 50 52
endif
ifeq ($(SMS),)
$(info >>> WARNING - no SM architectures have been specified - waiving sample <<<)
SAMPLE_ENABLED := 0
endif
ifeq ($(GENCODE_FLAGS),)
# Generate SASS code for each SM architecture listed in $(SMS)
$(foreach sm,$(SMS),$(eval GENCODE_FLAGS += -gencode arch=compute_$(sm),code=sm_$(sm)))
# Generate PTX code from the highest SM architecture in $(SMS) to guarantee forward-compatibility
HIGHEST_SM := $(lastword $(sort $(SMS)))
ifneq ($(HIGHEST_SM),)
GENCODE_FLAGS += -gencode arch=compute_$(HIGHEST_SM),code=compute_$(HIGHEST_SM)
endif
endif
LIBRARIES += -lcufft
ifeq ($(SAMPLE_ENABLED),0)
EXEC ?= #echo "[#]"
endif
################################################################################
# Target rules
all: build
build: dat
check.deps:
ifeq ($(SAMPLE_ENABLED),0)
#echo "Sample will be waived due to the above missing dependencies"
else
#echo "Sample is ready - all dependencies have been met"
endif
dat.o:oceanFFT.cpp
$(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $# -c $<
dat_kernel.o:oceanFFT_kernel.cu
$(EXEC) $(NVCC) $(INCLUDES) $(ALL_CCFLAGS) $(GENCODE_FLAGS) -o $# -c $<
dat: dat.o dat_kernel.o
$(EXEC) $(NVCC) $(ALL_LDFLAGS) $(GENCODE_FLAGS) -o $# $+ $(LIBRARIES)
$(EXEC) mkdir -p ../bin
$(EXEC) cp $# ../bin
run: build
$(EXEC) ./dat
clean:
rm -f dat dat.o dat_kernel.o
rm -rf ../bin/dat
clobber: clean
Is their anything else, I can make easier or shorter?
I have less experience in creating makefiles and looking for a general way to create some for CUDA. I hope you can help me.
EDIT:
The new cmake file is:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(lbmslv)
FIND_PACKAGE(CUDA REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
INCLUDE(FindCUDA)
# include every include directory
INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS} ${MPI_INCLUDE_PATH} ${GLEW_INCLUDE_PATH})
INCLUDE_DIRECTORIES(/usr/local/cuda-6.5/samples/common/inc ${SAMPLE_INCLUDE_PATH})
FILE(GLOB SOURCES "*.cu" "*.cpp" "*.c" "*.h")
LIST(APPEND CMAKE_CXX_FLAGS "-std=c++0x -O3 -ffast-math -Wall")
LIST(APPEND CUDA_NVCC_FLAGS --compiler-options -fno-strict-aliasing -lineinfo -use_fast_math -Xptxas -dlcm=cg)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
CUDA_ADD_EXECUTABLE(lbmslv ${SOURCES})
# add every dependency to lbmslv
TARGET_LINK_LIBRARIES(lbmslv ${CUDA_LIBRARIES} ${MPI_LIBRARIES} ${OPENGL_LIBRARIES} ${SAMPLE_LIBRARIES})
I get the following terminal outputs:
ubuntu#tegra-ubuntu:~/Documents/CUDA/bin$ cmake ../myOzean/
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found CUDA: /usr/local/cuda-6.5 (found version "6.5")
-- Found MPI_C: /usr/lib/libmpi.so;/usr/lib/arm-linux-gnueabihf/libdl.so;/usr/lib/arm-linux-gnueabihf/libhwloc.so
-- Found MPI_CXX: /usr/lib/libmpi_cxx.so;/usr/lib/libmpi.so;/usr/lib/arm-linux-gnueabihf/libdl.so;/usr/lib/arm-linux-gnueabihf/libhwloc.so
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so
-- Looking for XOpenDisplay in /usr/lib/arm-linux-gnueabihf/libX11.so;/usr/lib/arm-linux-gnueabihf/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/arm-linux-gnueabihf/libX11.so
-- Found OpenGL: /usr/lib/arm-linux-gnueabihf/libGL.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/Documents/CUDA/bin
ubuntu#tegra-ubuntu:~/Documents/CUDA/bin$ make
[ 50%] Building NVCC (Device) object CMakeFiles/lbmslv.dir//./lbmslv_generated_oceanFFT_kernel.cu.o
/usr/lib/gcc/arm-linux-gnueabihf/4.8/include/stddef.h(432): error: identifier "nullptr" is undefined
/usr/lib/gcc/arm-linux-gnueabihf/4.8/include/stddef.h(432): error: expected a ";"
/usr/include/arm-linux-gnueabihf/c++/4.8/bits/c++config.h(190): error: expected a ";"
/usr/include/c++/4.8/exception(63): error: expected a ";"
/usr/include/c++/4.8/exception(68): error: expected a ";"
/usr/include/c++/4.8/exception(76): error: expected a ";"
/usr/include/c++/4.8/exception(83): error: expected a ";"
/usr/include/c++/4.8/exception(93): error: expected a "{"
/usr/include/c++/4.8/bits/exception_ptr.h(64): error: function "std::current_exception" returns incomplete type "std::__exception_ptr::exception_ptr"
/usr/include/c++/4.8/bits/exception_ptr.h(64): error: expected a "{"
/usr/include/c++/4.8/bits/exception_ptr.h(79): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(81): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(82): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(84): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(86): error: declaration is incompatible with previous "std::current_exception"
(64): here
/usr/include/c++/4.8/bits/exception_ptr.h(86): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(86): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(87): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(90): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(92): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(95): error: incomplete type is not allowed
/usr/include/c++/4.8/bits/exception_ptr.h(95): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(116): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(126): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(143): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(144): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(147): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(152): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(153): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(156): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(157): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(160): error: use of a local type to declare a function
/usr/include/c++/4.8/bits/exception_ptr.h(161): error: expected a ";"
/usr/include/c++/4.8/bits/exception_ptr.h(169): error: expected a ";"
/usr/include/c++/4.8/bits/nested_exception.h(57): error: incomplete type is not allowed
/usr/include/c++/4.8/bits/nested_exception.h(60): error: expected a ";"
/usr/include/c++/4.8/bits/nested_exception.h(66): error: expected a ";"
/usr/include/c++/4.8/bits/nested_exception.h(70): error: identifier "rethrow_exception" is undefined
/usr/include/c++/4.8/bits/nested_exception.h(73): error: function "std::nested_exception::nested_ptr" returns incomplete type "std::__exception_ptr::exception_ptr"
/usr/include/c++/4.8/new(95): error: expected a "{"
/usr/include/c++/4.8/new(110): error: identifier "__p" is undefined
/usr/include/c++/4.8/new(111): error: expected a "{"
/usr/include/c++/4.8/new(115): error: expected a "{"
/usr/include/c++/4.8/new(116): error: expected a "{"
/usr/local/cuda-6.5/include/common_functions.h(92): warning: exception specification is incompatible with that of previous function "operator new[](std::size_t, void *)"
/usr/include/c++/4.8/new(111): here
/usr/local/cuda-6.5/include/common_functions.h(93): warning: exception specification is incompatible with that of previous function "operator delete(void *, void *)"
/usr/include/c++/4.8/new(115): here
/usr/local/cuda-6.5/include/common_functions.h(94): warning: exception specification is incompatible with that of previous function "operator delete[](void *, void *)"
/usr/include/c++/4.8/new(116): here
/usr/include/c++/4.8/bits/cpp_type_traits.h(184): error: identifier "char16_t" is undefined
/usr/include/c++/4.8/bits/cpp_type_traits.h(191): error: identifier "char32_t" is undefined
/usr/include/c++/4.8/bits/cpp_type_traits.h(191): error: class "std::__is_integer<<error-type>>" has already been defined
/usr/include/c++/4.8/bits/cpp_type_traits.h(314): error: namespace "std::__gnu_cxx" has no member "__normal_iterator"
/usr/include/c++/4.8/bits/cpp_type_traits.h(314): error: expected a ">"
/usr/include/c++/4.8/cmath(80): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(80): error: expected a ";"
/usr/include/c++/4.8/cmath(105): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(105): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(105): error: expected a ";"
/usr/include/c++/4.8/cmath(124): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(124): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(124): error: expected a ";"
/usr/include/c++/4.8/cmath(143): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(143): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(143): error: expected a ";"
/usr/include/c++/4.8/cmath(162): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(162): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(162): error: expected a ";"
/usr/include/c++/4.8/cmath(183): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(183): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(183): error: expected a ";"
/usr/include/c++/4.8/cmath(202): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(202): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(202): error: expected a ";"
/usr/include/c++/4.8/cmath(221): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(221): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(221): error: expected a ";"
/usr/include/c++/4.8/cmath(240): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(240): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(240): error: expected a ";"
/usr/include/c++/4.8/cmath(259): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(259): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(259): error: expected a ";"
/usr/include/c++/4.8/cmath(278): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(278): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(278): error: expected a ";"
/usr/include/c++/4.8/cmath(297): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(297): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(297): error: expected a ";"
/usr/include/c++/4.8/cmath(328): error: "constexpr" is not a function or static data member
/usr/include/c++/4.8/cmath(337): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(337): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(337): error: expected a ";"
/usr/include/c++/4.8/cmath(356): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(356): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(356): error: expected a ";"
/usr/include/c++/4.8/cmath(375): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(375): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(375): error: expected a ";"
/usr/include/c++/4.8/cmath(406): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(406): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(406): error: expected a ";"
/usr/include/c++/4.8/cmath(443): error: inline specifier allowed on function declarations only
/usr/include/c++/4.8/cmath(443): error: variable "std::constexpr" has already been defined
/usr/include/c++/4.8/cmath(443): error: expected a ";"
Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00004dfc_00000000-12_oceanFFT_kernel.compute_35.cpp1.ii".
Compilation terminated.
CMake Error at lbmslv_generated_oceanFFT_kernel.cu.o.cmake:264 (message):
Error generating file
/home/ubuntu/Documents/CUDA/bin/CMakeFiles/lbmslv.dir//./lbmslv_generated_oceanFFT_kernel.cu.o
make[2]: *** [CMakeFiles/lbmslv.dir/./lbmslv_generated_oceanFFT_kernel.cu.o] Error 1
make[1]: *** [CMakeFiles/lbmslv.dir/all] Error 2
make: *** [all] Error 2
ubuntu#tegra-ubuntu:~/Documents/CUDA/bin$
I've changed your CMakeLists.txt a little bit:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(lbmslv)
FIND_PACKAGE(CUDA REQUIRED)
FIND_PACKAGE(MPI REQUIRED)
FIND_PACKAGE(OpenGL REQUIRED)
INCLUDE(FindCUDA)
# include every include directory
INCLUDE_DIRECTORIES(${CUDA_INCLUDE_DIRS} ${MPI_INCLUDE_PATH} ${MPI_INCLUDE_PATH} ${GLEW_INCLUDE_PATH})
FILE(GLOB SOURCES "*.cu" "*.cpp" "*.c" "*.h")
LIST(APPEND CMAKE_CXX_FLAGS "-std=c++0x -O3 -ffast-math -Wall")
LIST(APPEND CUDA_NVCC_FLAGS --compiler-options -fno-strict-aliasing -lineinfo -use_fast_math -Xptxas -dlcm=cg)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_30,code=sm_30)
LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_35,code=sm_35)
CUDA_ADD_EXECUTABLE(lbmslv ${SOURCES})
# add every dependency to lbmslv
TARGET_LINK_LIBRARIES(lbmslv ${CUDA_LIBRARIES} ${MPI_LIBRARIES} ${OPENGL_LIBRARIES})

Janus WebRTC installation issue?

I am installing Janus WebRTC on Beaglebone Black(BBB).
I execute the janus_config.sh script file below to set environment variables:
#!/bin/bash
if [ $# -gt 1 ] || [ $# -eq 0 ]; then
echo "Usage: source /path/to/this/build_script.sh path/where/dependencies/built"
fi
JANUS_PATH=$1
if ! [ -d $JANUS_PATH ]; then
mkdir -v $JANUS_PATH
fi
BUILD==$(./config.guess)
unset JANUS_CFLAGS
JANUS_CFLAGS+="-I$1/include/glib-2.0 "
JANUS_CFLAGS+="-I$1/lib/glib-2.0/include "
JANUS_CFLAGS+="-I$1/include "
JANUS_CFLAGS+="-I$1/include/gio-unix-2.0/gio "
JANUS_CFLAGS+="-I$1/include/nice "
JANUS_CFLAGS+="-I/home/debian/usr/local/include/openssl "
JANUS_CFLAGS+="-I$1/include/opus "
JANUS_CFLAGS+="-I$1/include/sofia-sip-1.12/sofia-resolv "
JANUS_CFLAGS+="-I$1/include/srtp "
JANUS_CFLAGS+="-I$1/include/stun "
JANUS_CFLAGS+="-I$1/include/stun/usages "
JANUS_CFLAGS+="-I$1/lib/libffi-3.2.1/include "
export JANUS_CFLAGS
unset JANUS_LIBS
JANUS_LIBS+="-L$1/lib -lglib-2.0 "
JANUS_LIBS+="-L/home/debian/usr/local/lib -lssl -lcrypto "
JANUS_LIBS+="-L$1/lib -lsrtp -lcrypto "
JANUS_LIBS+="-L$1/lib -lusrsctp"
export JANUS_LIBS
unset LDFLAGS
LDFLAGS+="-L$1/lib "
LDFLAGS+="-L/home/debian/usr/local/lib"
export LDFLAGS
unset LIBS
LIBS+="-lsrtp -lcrypto -lusrsctp -lglib-2.0 -lnice -lgio-2.0 -lgobject-2.0 -lsofia-sip-ua -ljansson -lssl -lgmodule-2.0 "
LIBS+="-lffi -lgthread-2.0 -lz "
export LIBS
unset CPPFLAGS
CPPFLAGS+="-I$1/include "
CPPFLAGS+="-I$1/include/glib-2.0 "
CPPFLAGS+="-I$1/lib/glib-2.0/include "
CPPFLAGS+="-pthread -I$1/include/nice "
CPPFLAGS+="-I$1/include/sofia-sip-1.12"
export CPPFLAGS
unset TRANSPORTS_CFLAGS
TRANSPORTS_CFLAGS+="-I$1/include/glib-2.0 "
TRANSPORTS_CFLAGS+="-I$1/lib/glib-2.0/include "
TRANSPORTS_CFLAGS+="-I$1/include"
export TRANSPORTS_CFLAGS
unset TRANSPORTS_LIBS
TRANSPORTS_LIBS+="-L$1/lib -lglib-2.0 "
TRANSPORTS_LIBS+="-L/home/debian/usr/local/lib -lssl -lcrypto "
TRANSPORTS_LIBS+="-L$1/lib -lsrtp -lcrypto "
TRANSPORTS_LIBS+="-L$1/lib -lusrsctp"
export TRANSPORTS_LIBS
unset PLUGINS_CFLAGS
unset PLUGINS_LIBS
PLUGINS_CFLAGS=$JANUS_CFLAGS
PLUGINS_LIBS=$JANUS_LIBS
export PLUGINS_CFLAGS
export PLUGINS_LIBS
./configure --build=$BUILD --disable-plugin-voicemail --disable-plugin-videoroom --disable-plugin-videocall --disable-plugin-recordplay --disable-plugin-echotest --disable-plugin-audiobridge --disable-websockets --disable-rabbitmq --disable-plugin-sip --disable-docs --prefix=$JANUS_PATH
When run command source janus_config.sh $PREFIX,I get error, see config.log below for more detail:
/*
$ ./configure --build==armv7l-unknown-linux-gnueabihf --disable-plugin-voicemail --disable-plugin-videoroom --disable-plugin-videocall --disable-plugin-recordplay --disable-plugin-echotest --disable-plugin-audiobridge --disable-websockets --disable-rabbitmq --disable-plugin-sip --disable-docs --prefix=/home/debian/Janus/usr
## --------- ##
## Platform. ##
## --------- ##
hostname = beaglebone
uname -m = armv7l
uname -r = 3.8.13-bone70
uname -s = Linux
uname -v = #1 SMP Fri Jan 23 02:15:42 UTC 2015
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/debian/bin
PATH: /home/debian/.linuxbrew/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/local/games
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2466: checking for a BSD-compatible install
configure:2534: result: /usr/bin/install -c
configure:2545: checking whether build environment is sane
configure:2600: result: yes
configure:2751: checking for a thread-safe mkdir -p
configure:2790: result: /bin/mkdir -p
configure:2797: checking for gawk
configure:2827: result: no
configure:2797: checking for mawk
configure:2813: found /usr/bin/mawk
configure:2824: result: mawk
configure:2835: checking whether make sets $(MAKE)
configure:2857: result: yes
configure:2886: checking whether make supports nested variables
configure:2903: result: yes
configure:3040: checking whether make supports nested variables
configure:3057: result: yes
configure:3081: checking for style of include used by make
configure:3109: result: GNU
configure:3180: checking for gcc
configure:3196: found /usr/bin/gcc
configure:3207: result: gcc
configure:3436: checking for C compiler version
configure:3445: gcc --version >&5
gcc (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:3456: $? = 0
configure:3445: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10)
configure:3456: $? = 0
configure:3445: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3456: $? = 4
configure:3445: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3456: $? = 4
configure:3476: checking whether the C compiler works
configure:3498: gcc -I/home/debian/Janus/usr/include -I/home/debian/Janus/usr/include/glib-2.0 -I/home/debian/Janus/usr/lib/glib-2.0/include -pthread -I/home/debian/Janus/usr/include/nice -I/home/debian/Janus/usr/include/sofia-sip-1.12 -L/home/debian/Janus/usr/lib -L/home/debian/usr/local/lib conftest.c -lsrtp -lcrypto -lusrsctp -lglib-2.0 -lnice -lgio-2.0 -lgobject-2.0 -lsofia-sip-ua -ljansson -lssl -lgmodule-2.0 -lffi -lgthread-2.0 -lz >&5
I think problem is here because openssl directory is not as I set in janus_config.sh, I install openssl in /home/debian/usr/local
/home/debian/Janus/usr/lib/libcrypto.a(mem_clr.o): In function `OPENSSL_cleanse':
mem_clr.c:(.text+0x0): multiple definition of `OPENSSL_cleanse'
/home/debian/Janus/usr/lib/libcrypto.a(armv4cpuid.o):(.text+0x1c): first defined here
/home/debian/Janus/usr/lib/libcrypto.a(armcap.o): In function `OPENSSL_cpuid_setup':
armcap.c:(.text.startup+0x0): multiple definition of `OPENSSL_cpuid_setup'
/home/debian/Janus/usr/lib/libcrypto.a(cryptlib.o):cryptlib.c:(.text+0x8d8): first defined here
collect2: error: ld returned 1 exit status
configure:3502: $? = 1
configure:3540: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Janus Gateway"
| #define PACKAGE_TARNAME "janus-gateway"
| #define PACKAGE_VERSION "0.1.0"
| #define PACKAGE_STRING "Janus Gateway 0.1.0"
| #define PACKAGE_BUGREPORT "https://github.com/meetecho/janus-gateway"
| #define PACKAGE_URL "https://janus.conf.meetecho.com"
| #define PACKAGE "janus-gateway"
| #define VERSION "0.1.0"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3545: error: in `/home/debian/Janus/Dependencies/janus-gateway-master':
configure:3547: error: C compiler cannot create executables
See `config.log' for more details;
*/
Could you help me find out the problem here?
Multiples definitions for the same resource, problably, how did you configure it??? try this:
./config -fPIC -DOPENSSL_PIC

Error installing pygraphviz 1.2 on Mac OS X 10.9 (missing library)

I'm using Mac OS X 10.9. I have already installed graphviz 2.36.0.
After downloading pygraphviz 1.2, I modified in setup.py the variables "library_path" and "include_path":
library_path='/usr/local/lib/graphviz'
include_path='/usr/local/include/graphviz'
When I try to install graphviz with python setup.py install, I get the following message:
library_path=/usr/local/lib/graphviz
include_path=/usr/local/include/graphviz
running install
running build
running build_py
running build_ext
building 'pygraphviz._graphviz' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/local/include/graphviz -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.9-intel-2.7/pygraphviz/graphviz_wrap.o
pygraphviz/graphviz_wrap.c:2040:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
res = SWIG_AddCast(res);
~~~ ^ ~~~
pygraphviz/graphviz_wrap.c:2043:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
res = SWIG_AddCast(res);
~~~ ^ ~~~
pygraphviz/graphviz_wrap.c:2829:15: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
len = strlen(val);
~ ^~~~~~~~~~~
pygraphviz/graphviz_wrap.c:2855:12: warning: incompatible pointer to integer conversion returning 'Agsym_t *' (aka 'struct Agsym_s *') from a function with result type 'int' [-Wint-conversion]
return agattr(g, kind, name, val);
^~~~~~~~~~~~~~~~~~~~~~~~~~
pygraphviz/graphviz_wrap.c:2847:15: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
len = strlen(val);
~ ^~~~~~~~~~~
pygraphviz/graphviz_wrap.c:4806:14: warning: explicitly assigning a variable of type 'void *' to itself [-Wself-assign]
clientdata = clientdata;
~~~~~~~~~~ ^ ~~~~~~~~~~
6 warnings generated.
pygraphviz/graphviz_wrap.c:2040:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
res = SWIG_AddCast(res);
~~~ ^ ~~~
pygraphviz/graphviz_wrap.c:2043:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
res = SWIG_AddCast(res);
~~~ ^ ~~~
pygraphviz/graphviz_wrap.c:2855:12: warning: incompatible pointer to integer conversion returning 'Agsym_t *' (aka 'struct Agsym_s *') from a function with result type 'int' [-Wint-conversion]
return agattr(g, kind, name, val);
^~~~~~~~~~~~~~~~~~~~~~~~~~
pygraphviz/graphviz_wrap.c:4806:14: warning: explicitly assigning a variable of type 'void *' to itself [-Wself-assign]
clientdata = clientdata;
~~~~~~~~~~ ^ ~~~~~~~~~~
4 warnings generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/pygraphviz/graphviz_wrap.o -L/usr/local/lib/graphviz -L/usr/local/lib/graphviz -lcgraph -lcdt -o build/lib.macosx-10.9-intel-2.7/pygraphviz/_graphviz.so
ld: library not found for -lcgraph
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
Does anybody know how I can fix this?
Make sure your XCode is updated to the latest version and then try this:
xcode-select --install
When prompted install the command line tools. Then try rebuilding.

Resources