Error installing Blurilly gem on OSX 10.12.4 - ruby-on-rails

When installing the blurrily gem, I get the following issue.
For reference I'm using:
rvm 1.29.1
ruby 2.1.7p400
rails 3.2.22.5
And I'm trying to install Blurrily 1.0.2.
The error:
/Users/jonkeenan/.rvm/rubies/ruby-2.1.7/bin/ruby -r ./siteconf20170525-
62993-1jexk35.rb extconf.rb
creating Makefile
current directory: /Users/jonkeenan/.rvm/gems/ruby-
2.1.7#introhive/gems/blurrily-1.0.2/ext/blurrily
make "DESTDIR=" clean
current directory: /Users/jonkeenan/.rvm/gems/ruby-
2.1.7#introhive/gems/blurrily-1.0.2/ext/blurrily
make "DESTDIR="
compiling map_ext.c
compiling search_tree.c
compiling storage.c
storage.c:283:43: error: taking address of packed member 'refs' of
class or structure 'trigram_map_t' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
if (haystack->refs) blurrily_refs_free(&haystack->refs);
^~~~~~~~~~~~~~
storage.c:405:24: error: taking address of packed member 'refs' of
class or structure 'trigram_map_t' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
blurrily_refs_new(&haystack->refs);
^~~~~~~~~~~~~~
2 errors generated.
make: *** [storage.o] Error 1
make failed, exit code 2
It looks like a c compile issue, but I'm not sure.
I'm running a version of xcode that's using Apple LLVM version 8.1.0 (clang-802.0.42) if that helps.

Unfortunately, it appears that this is a known issue that the gem maintainers have not yet addressed.
As a workaround, it might be worthwhile to switch to a Vagrant/Docker development workflow until this is addressed upstream.

Related

Why I can't find g++ in my dictionary when I was trying to install "iRF" package in R?

I was trying to install "iRF" in R.
Here is the error:
/bin/sh: /usr/local/bin/g++: No such file or directory
make: *** [ExportedFunctionsRIT.o] Error 127
ERROR: compilation failed for package ‘iRF’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/iRF’
And when I turned into the terminal to see my g++ and gcc, I found them in a different path:
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I never faced this before. I was trying to install gfortran and this error came when I installed xcode and gcc again. I'd appreciate it if someone could help me fix this. By the way, if you know how to install gfortran to deal with the compline error in installing packages form gihub, that would be nice.
Thanks!

Armadillo compiler error

I am using armadillo C++ library. I see below error when doing the compile. Does it require new version of GCC compiler I am having "gcc version 4.1.2" right now with my system
[ 50%] Building CXX object CMakeFiles/armadillo.dir/src/wrapper.cpp.o
In file included from /home/mukuar01/armadillo/armadillo-7.800.3/src/wrapper.cpp:29:
/home/mukuar01/armadillo/armadillo-7.800.3/tmp/include/armadillo_bits/compiler_setup.hpp:168:6: error: #error "*** Need a newer compiler ***"
make[2]: *** [CMakeFiles/armadillo.dir/src/wrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/armadillo.dir/all] Error 2
make: *** [all] Error 2
Yes, you do need a newer version of gcc. At least version 4.4.0 is required. You can check in the source code, line 167. Versions 4.7.0 and 4.7.1 are also not supported due to a bug.
You could try to use clang instead of gcc, but not sure which version is needed.
Or you could try with older versions of armadillo, but I am not sure how far you'd need to go back.

Error compiling Mosquitto 1.4

I have tried to compile Mosquitto on both Arch and CentOS 7, but everytime I get the same error. I want to test the Websocket feature.
This is the procedure I am using for CentOS:
yum group install "Development Tools"
yum install cmake openssl-devel cmake
yum install uuid-devel libxslt docbook5-style-xsl.noarch docbook-style-xsl.noarch
git clone https://github.com/warmcat/libwebsockets.git
cd libwebsockets/
mkdir build;cd build
cmake ..
make
make install
git clone https://git.eclipse.org/r/mosquitto/org.eclipse.mosquitto
cd org.eclipse.mosquitto/
git checkout origin/1.4
vi config.mk
Change "WITH_WEBSOCKETS:=yes"
make
And this is where it dies on Arch and CentOS:
make[1]: Entering directory '/home/install/org.eclipse.mosquitto/src'
cc -Wall -ggdb -O2 -I. -I.. -I../lib -DVERSION="\"1.4\"" -DTIMESTAMP="\"2015-05-04 17:17:55+0200\"" -DWITH_BROKER -DWITH_TLS -DWITH_TLS_PSK -DWITH_UUID -DWITH_BRIDGE -DWITH_PERSISTENCE -DWITH_MEMORY_TRACKING -DWITH_SYS_TREE -DWITH_WEBSOCKETS -DWITH_EC -c mosquitto.c -o mosquitto.o
In file included from /usr/include/unistd.h:25:0,
from mosquitto.c:22:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
mosquitto.c: In function ‘main’:
mosquitto.c:275:101: error: expected expression before ‘,’ token
_mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s (build date %s) starting", VERSION, TIMESTAMP);
mosquitto.c:290:54: error: expected expression before ‘)’ token
snprintf(buf, 1024, "mosquitto version %s", VERSION);
mosquitto.c:368:88: error: expected expression before ‘)’ token
_mosquitto_log_printf(NULL, MOSQ_LOG_INFO, "mosquitto version %s terminating", VERSION);
Makefile:15: recipe for target 'mosquitto.o' failed
make[1]: *** [mosquitto.o] Error 1
make[1]: Leaving directory '/home/install/org.eclipse.mosquitto/src'
Makefile:21: recipe for target 'mosquitto' failed
make: *** [mosquitto] Error 2
If someone can please point out what I am doing wrong or missing ?
As #hardillb says, the VERSION defines are the problem. If I add the line
#define VERSION
to mosquitto.c, then I can reproduce the error that you see, but also get a warning about redefining VERSION.
If I remove the definition of VERSION from config.mk, then I get an error about VERSION not being defined.
These both make sense.
What seems to be happening for you is that the compiler is ignoring the command line definition -DVERSION="\"1.4.1\"" and replacing it with -DVERSION=, or isn't parsing the string properly. This doesn't make sense.
Other people have managed to compile on Arch, and the CentOS7 repository has a binary version - but without websockets.
After some investigation, it appears as though there is a bug in recent libwebsockets code. This changeset introduces some changes that mean that libwebsockets is claiming the macro VERSION all for itself, which isn't very polite for a library. If you use a released version of libwebsockets you should not have any problem compiling.
Just out of interest have you tried building from the TGZ src bundle for Mosquitto 1.4.1 available here:
http://mosquitto.org/download/
The errors look to be something to do with expanding the passed in VERSION and TIMESTAMP values. It builds fine [with the exception of the docs] on Fedora 20 which shouldn't be that far from RHEL 7.0 (and from there to Centos 7).

"unable to find utility g++" while trying to compile a MobileSubstrate tweak with Theos (OSX)

OSX Yosemite 10.10.2
I recently installed Theos following this guide, got no problems. However when I try to compile a simple MS tweak, I get this error in Terminal.app:
MBP:noeditnc ned$ cd /Users/ned/noeditnc
MBP:noeditnc ned$ make
Making all for tweak NoEditNC...
Preprocessing Tweak.xm...
Compiling Tweak.xm (armv7)...
xcrun: error: unable to find utility "clang++", not a developer tool or in PATH
make[3]: *** [.theos/obj/armv7/Tweak.xm.5e67a2f0.o] Error 72
make[2]: *** [.theos/obj/armv7/NoEditNC.dylib] Error 2
make[1]: *** [internal-library-all_] Error 2
make: *** [NoEditNC.all.tweak.variables] Error 2
I have Command Line Tools and Xcode both installed and updated to the latest version. Google couldn't help... What am I doing wrong?
EDIT: Clang++ is installed.
MBP:noeditnc ned$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
EDIT 2: Found a solution! I had the wrong sdk version number in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ (iPhoneOS8.1 instead of iPhoneOS8.2)

Ruby on Rails - Error installing bdb. Failed to build gem native extension

When running gem install bdb I get the following error:
Error installing bdb:
ERROR: Failed to build gem native extension.
Anyone know where I can find the bdb library for Mac OS X?
Full error:
Building native extensions. This could take a while...
ERROR: Error installing bdb:
ERROR: Failed to build gem native extension.
...
checking for db_version() in -ldb-5.1... yes
Writing bdb_aux._c (defines), this takes a while
don't know how to handle DB_DEGREE_2 DB_READ_COMMITTED, guessing UINT
don't know how to handle DB_DIRTY_READ DB_READ_UNCOMMITTED, guessing UINT
don't know how to handle DB_HEAP_RID_SZ (sizeof(db_pgno_t) + sizeof(db_indx_t)), guessing UINT
wrote 491 defines
creating Makefile
make
...
bdb.c:84:1: warning: "eDbE_create" redefined
bdb.c:50:1: warning: this is the location of the previous definition
bdb.c: In function ‘assoc_rescue’:
bdb.c:1200: warning: format not a string literal and no format arguments
bdb.c: In function ‘assoc_callback’:
bdb.c:1248: warning: comparison between signed and unsigned
bdb.c:1249: warning: pointer of type ‘void *’ used in arithmetic
bdb.c: In function ‘env_set_cachesize’:
bdb.c:1830: warning: implicit conversion shortens 64-bit value into a 32-bit value
bdb.c:1831: warning: implicit conversion shortens 64-bit value into a 32-bit value
bdb.c: In function ‘env_txn_stat’:
bdb.c:2299: warning: comparison between signed and unsigned
bdb.c: In function ‘env_repmgr_set_local_site’:
bdb.c:3005: error: ‘DB_ENV’ has no member named ‘repmgr_set_local_site’
bdb.c: In function ‘env_repmgr_add_remote_site’:
bdb.c:3024: error: ‘DB_ENV’ has no member named ‘repmgr_add_remote_site’
bdb.c:3331:1: warning: "eDbE_create" redefined
bdb.c:84:1: warning: this is the location of the previous definition
bdb.c:3424:1: warning: "ENV_LOG_CONFIG_FUNC" redefined
bdb.c:2533:1: warning: this is the location of the previous definition
make: *** [bdb.o] Error 1
Did you see the instructions on the bdb page?
As a Gem
At the moment this library is not available on RubyForge. To install
it as a gem, do the following:
[sudo] gem install bdb
For Berkeley DB v4.7 installed from MacPorts do
the following:
[sudo] env ARCHFLAGS="-arch i386" gem install bdb This assumes you're
on OS X and BerkeleyDB wasn't compiled as a universal binary.
So it looks like you need to install berkeley db via macports/brew to get the Gem to install.

Resources