Upgraded to Mavericks, C compiler cannot create executables - c

Upgrading to Mavericks, I appear to have broken my Ruby on Rails development environment, which requires ruby 1.9.3 because of various gem dependencies. Within that app directory, I'm trying to reinstall ruby 1.9.3-p547:
rvm reinstall ruby-1.9.3-p547
I then get an error:
checking whether the C compiler works... no
configure: error: in `/Users/dsfaulkenberry/.rvm/src/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
Looking at the config.log file (~/.rvm/src/ruby-1.9.3-p547/config.log), I see:
dyld: Library not loaded: /usr/local/opt/cloog-ppl015/lib/libcloog.0.dylib
Referenced from: /usr/local/Cellar/gcc46/4.6.4/gcc/libexec/gcc/x86_64-apple-darwin12.4.0/4.6.4/cc1
Reason: image not found
I can see that other people have encountered issues vis-à-vis upgrading to Mavericks and having c compiler issues, but I can't find any referencing this specific library or what I should do (reinstall gcc? is that even a thing I can do?)
Many solutions mention accepting an XCode license agreement, which I have done, and the problem persists.

Reinstalling gcc46 solved the issue for me:
brew uninstall gcc46 && brew install gcc46

Related

Homebrew Mac M1 can't find installs

I just switched to a M1 MacBook Air and I'm having trouble with Homebrew. The installation went fine I think, and then I added it to my path with the given commands:
Run these two commands in your terminal to add Homebrew to your PATH:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/xxx/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
I also did brew install cunit and then when I typed brew list CUnit was listed there so I'm assuming the brew install of cunit worked.
But when I run my C test code this is what I get:
test/test.c:3:10: fatal error: 'CUnit/Basic.h' file not found
#include <CUnit/Basic.h>
^~~~~~~~~~~~~~~
1 error generated.
make: *** [test_compile] Error 1
I have been sitting with this for three days, called Apple support, searched every page related to this and still can't find a solution that works.
Has anyone had the same problem? PLEASE help
Homebrew installs into /opt/homebrew by default on M1 Macs, and no longer links into /usr/local by default (to prevent clashes with Rosetta library installs). This means that include files and libraries can't be found without explicitly telling the compiler/linker where your Homebrew packages are installed.
The easiest way of doing this is by setting the CPATH environmental variable before compiling:
export CPATH=/opt/homebrew/include
Add the above line to your shell profile (.zprofile for zsh, or .bash_profile for bash) and it will be used in all future compilations.
For dependencies which also require shared libraries, you will need to also signpost the location of Homebrew's new lib path:
export LIBRARY_PATH=/opt/homebrew/lib

How to tell NetBeans where gnutls is on my system?

I tried to build a C/C++ project with NetBeans on my macOS Sierra, and got the following error message:
The following required libraries were not found:
gnutls
Maybe some development libraries/packages are missing?
I do have gnutls installed. How can I tell NetBeans where to look for it?
Create a symbolic link to gnutils inside /usr/local/bin, e.g.
ln -s /usr/local/Cellar/gnutls/3.5.14/bin /usr/local/bin/gnutls

Cannot install macvim due to Xcode as "pre-release"

I'm trying to upgrade my Vim to MacVim by running:
$ brew install macvim --with--override-system-vim
I'm getting this error message saying that the package cannot be compiled:
configure: creating cache auto/config.cache
checking whether make sets $(MAKE)... yes
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/private/tmp/macvim-20161028-10122-1pp1odr/macvim-snapshot-113/src':
configure: error: C compiler cannot create executables
See `config.log' for more details
I have Xcode 8.1 installed on my machine. But brew seems to think it's a pre-release version:
Warning: You are using a pre-release version of Xcode.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.

Yocto Build - loadlocale.c #130

So I've upgraded to a newer version of Linux kernel using Yocto. The new kernel version is for 4.1.15 and runs on an iMX6 chip. I've also included openssh-server, tools-sdk, and tools-debug for development recipes. The problem is that when I connect to build I get the following error:
loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof
(_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))'
failed
Now if I type into the command prompt sh -c "LANG=en_US" I get the same error as above. If I type in sh -c "LANG=/usr/lib/locale/en_US" then I do not get an error. When I type locale everything is listed as POSIX and when I type locale -a I get:
C
POSIX
en_GB
en_US
The last two are stored under /usr/lib/locale. My version of gcc is 5.2 and my glibc is v2.22. I've looked all over the internet for other solutions but they are either for Ubuntu where the package manager comes in handy or it's some really specific fix like editing a file that I don't have in my Yocto build.
Edit:
The machine is for a SMARC-FiMX6 SoM and the instructions are here. I'm not sure what branch of Yocto is being pulled down.
After troubleshooting the problem is from the glibc library. A patch, #114739, is on the openembedded website which details what to do to fix this issue. Just patch the file, rebuild, and the issue is fixed. See here for details, the patch is at the bottom of the page.

Compiling Ruby error: Failed to configure openssl. It will not be installed

On OSX, after downloading the ruby repository latest commit from github and following the instructions to build, I run make but I get the error:
Failed to configure openssl. It will not be installed.
If I run make check, I get more information.
Skipping `gem cert` tests. openssl not found.
...
`<class:TestGemRemoteFetcher>': uninitialized constant TestGemRemoteFetcher::OpenSSL (NameError)
Clearly it cannot find openssl, but I have it installed via Brew. What am I missing?
There are many answers to this sort of question out there (this, for example), but I can't seem to make any of the solutions work.
Brew install openssl library as a keg-only. Try passing path to your openssl to your build script:
./configure --with-openssl-dir="$(brew --prefix openssl)"

Resources