Installing glib from git in mac os x and gettext - macos

I'm trying build glib from source in Mac OS X.
I've clone glib repo from gnome site.
The autogen.sh script seems to run fine. But when it starts it shows this message :
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
This seems spooky. However it finishes without showing any error. After spawning configure script it stops with the error :
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
configure: error:
*** You must have either have gettext support in your C library, or use the
*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
Although i've install gettext from macports and it seems to be there :
arif#dev:~/sak/glib$ls /opt/local/lib/ | grep gettext
gettext
libgettextlib-0.18.3.dylib
libgettextlib.dylib
libgettextlib.la
libgettextpo.0.dylib
libgettextpo.a
libgettextpo.dylib
libgettextpo.la
libgettextsrc-0.18.3.dylib
libgettextsrc.dylib
libgettextsrc.la
One thing i've noticed that although gettext is installed, it does not have pkg-config file. Maybe that's why its happening .
arif#dev:~/sak/glib$ls /opt/local/lib/pkgconfig/ | grep gettext
comes out with nothing.

I ran into something similar and you might want to try to set CFLAGS="-L/opt/local/lib -I/opt/local/include". It seems that those are not included by default when running the gettext tests. You can either CFLAGS to the configure call or probably also to the autogen.sh

Related

C compiler can't create executables

I'm trying to install the elastic beanstalk cli, like so:
./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer
But I'm getting the following error:
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
python-build: use readline from homebrew
BUILD FAILED (OS X 11.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557
Results logged to /var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557.log
Last 10 log lines:
checking for python3.7... python3.7
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/var/folders/96/df02xppj77g7dx698gtmwmrw0000gn/T/python-build.20210319024756.38557/Python-3.7.2':
configure: error: C compiler cannot create executables
See `config.log' for more details
Exiting due to failure
For some reason, the installation script isn't detecting the C compiler. Of course, both the gcc and the cc commands work in the terminal. I'm using macOS 11.1. How do I fix this?
You need to run the commands using Roseta, and arch command can be used to run commands via Rosetta:
arch -x86_64 ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer

compilation of binutils-gdb can't find ncurses

I'm trying to compile the binutils for the i686-elf target according to this tutorial:
https://wiki.osdev.org/GCC_Cross-Compiler
I just added the --enable-tui option, so that I have the support in the gdb.
I did the following:
# get sources
git clone git://sourceware.org/git/binutils-gdb.git
# store settings
export PREFIX="`pwd`/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"
# create build folder
mkdir build-binutils
cd build-binutils
# run configure
../binutils-gdb/configure -target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror --enable-tui
# make
make
This runs for some time and terminates with the following error:
checking for library containing socketpair... (cached) none required
checking for ld used by GCC... (cached) ld
checking if the linker (ld) is GNU ld... (cached) yes
checking for shared library run path origin... (cached) done
checking for iconv... (cached) yes
checking for iconv declaration... (cached)
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for library containing waddstr... (cached) no
configure: error: no enhanced curses library found; disable TUI
make[1]: *** [Makefile:11329: configure-gdb] Error 1
make[1]: Leaving directory '/home/noexpandtab/dev/build-binutils'
make: *** [Makefile:853: all] Error 2
For me it seems, that the ncurses library cannot be found.
I have a Debian 10 running and installed the following additional packages:
libncurses-dev
ncurses-base
ncurses-doc
libncurses5-dev
Do I have to install additional packages? Or am I missing some options for the configure script?
You're cross-compiling to a different architecture (i686-elf) than whatever you're running on—the $TARGET mentioned in the question. gdb will have to be linked with libraries which are built for that architecture.
Debian provides ncurses packages which run on the current architecture, but does not provide a suitable package for the cross-compiled application. So you get to do this for yourself.
When cross-compiling ncurses, you'll have to keep in mind that part of it builds/runs on the current architecture (to generate source-files for compiling by the cross-compiler). That's defined in the environment as $BUILD_CC (rather than $CC), as you might see when reading the script for the mingw cross-compiling. There's a section in the INSTALL file (in the ncurses sources) which outlines the process.
There's no tutorial (that would be off-topic here anyway), but others have read the instructions and cross-compiled ncurses as evidenced by a recent bug report.
I retried the whole compilation, and suddenly it works! I tested a bit and I assume I found my fault: I executed configure without --enable-tui, where make worked. Then I executed configure with --enable-tui in the same folder without cleaning it. After cleaning or running in a new folder it compiled.
Thanks to the one user who posted to delete the contents of opt/cross. (The comment itself was already somehow deleted in between.) This wasn't the solution, but leaded me in the right direction.
TL;DR: Clean the build folder before running configure with different parameters again.

error installing libtorrent with boost

on Lubuntu 14.04 64 bit, I am getting this configure error when I try to install de libtorrent library:
checking for boostlib >= 1.35... yes
checking whether the Boost::System library is available... yes
checking for exit in -l/usr/local/boost_1_57_0/bin.v2/libs/system/build/gcc-4.8/release/threading-multi/... no
checking for exit in -lboost_system-/usr/local/boost_1_57_0/bin.v2/libs/system/build/gcc-4.8/release/threading-multi/... no
configure: error: Could not link against boost_system-/usr/local/boost_1_57_0/bin.v2/libs/system/build/gcc-4.8/release/threading-multi/ !
I executed this:
alberto#alberto-virtual-machine:~/trabajo/libtorrent-rasterbar-0.14.7$ ./configure --with-boost-system=/usr/local/boost_1_57_0/bin.v2/libs/system/build/gcc-4.8/release/threading-multi
there are this files on the directory:
alberto#alberto-virtual-machine:~/trabajo/libtorrent-rasterbar-0.14.7$ ls /usr/local/boost_1_57_0/bin.v2/libs/system/build/gcc-4.8/release/threading-multi/
error_code.o libboost_system.so.1.57.0
I haven't much idea about static libraries, could someone help me please? thank you.
The argument --with-boost-system takes either:
A library name suffix (like mt, which some distros use)
A full path including the library name
You did not pass in a full path with the library name, so the configure script interprets it as (1) and it fails to link against that library. Instead, try:
./configure --with-boost-system=/usr/local/boost_1_57_0/bin.v2/libs/system/build/gcc-4.8/release/threading-multi/libboost_system.so

Installing RPostgresql on a Mac with OSX 10.7.2

I'm trying to install rpostgresql on a mac. I want to be able to connect to a server using an IP address and read the data into a dataframe. I downloaded the package from CRAN, and ran the following line:
install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
This started to compile the package but resulted with the following error message:
> install.packages('/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz', type='source')
Installing package(s) into ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from the file name
* installing *source* package ‘RPostgreSQL’ ...
** package ‘RPostgreSQL’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for pg_config... /usr/bin/pg_config
checking for "/usr/include/libpq-fe.h"... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
*** arch - x86_64
gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/usr/include -I/usr/local/include -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o
make: gcc-4.2: No such file or directory
make: *** [RS-DBI.o] Error 1
ERROR: compilation failed for package ‘RPostgreSQL’
* removing ‘/Library/Frameworks/R.framework/Versions/2.14/Resources/library/RPostgreSQL’
Warning in install.packages :
installation of package ‘/Users/celenius/Downloads/RPostgreSQL_0.2-1.tar.gz’ had non-zero exit status
I've looked through advice on the rpostgresql webpage (1, 2) but a lot of the suggestions are more than a year old so I thought there might be more recent advice on how to install this package.
If you want to connect to a postgre db, you also can use RODBC. Just install an ODBC driver (Lion should already include that for postgres) and you are ready to go.
I do that for conecting to my local postgre / postgis server and it works just fine.
You need Xcode installed in order to compile. Go into the Mac app store and search for, then install Xcode. It's free.
you can tell whether you already have gcc by doing a quick which gcc-4.2. My guess is that you do not. After installing Xcode, you should get /usr/bin/gcc-4.2 in response.
****EDIT****
After the comments about how you installed Xcode and still don't have gcc-4.2, I did a little bit of reading and it looks like you need to do one of the options listed in this Stack Overflow question: Setting GCC 4.2 as the default compiler on Mac OS X Leopard
This makes me wonder where my gcc-4.2 came from. Probably some fortuitous accident when I first got my MBP.
Since postgresql is required to build the package from source, you will need to install it. The easiest way to do so, if you use homebrew, is to simply do the following in a Terminal:
## install postgresql
brew install postgresql
## install the R package
Rscript -e "install.packages('RPostgreSQL', type = 'source')"
## remove postgresql (optional)
brew remove postgresql

How to fix this RVM error on a Macbook Pro i7 Running 10.6

I received the error described on this page http://www.fakingfantastic.com/2010/11/26/fixing-the-you-have-to-install-development-tools-first-error-with-nokogiri/ and in following their instructions i recieved the following error:
[2011-02-13 11:05:03] ./configure --prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
I thought that this : https://gist.github.com/767866 looked like an aswer but i cannot locate .rvmrc.
EDIT: i think the problem is i386. My the 1.8.2 install is x8x_64, it seems.
EDIT 2: after a bit more work i have it spitting this error out
[2011-02-13 11:51:05] ./configure --prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136 --enable-shared --build=i386-apple-darwin10.6.0 --host=i386-apple-darwin10.6.0
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for i386-apple-darwin10.6.0-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for i386-apple-darwin10.6.0-g++... no
checking for i386-apple-darwin10.6.0-c++... no
checking for i386-apple-darwin10.6.0-gpp... no
checking for i386-apple-darwin10.6.0-aCC... no
checking for i386-apple-darwin10.6.0-CC... no
checking for i386-apple-darwin10.6.0-cxx... no
checking for i386-apple-darwin10.6.0-cc++... no
checking for i386-apple-darwin10.6.0-cl.exe... no
checking for i386-apple-darwin10.6.0-FCC... no
checking for i386-apple-darwin10.6.0-KCC... no
checking for i386-apple-darwin10.6.0-RCC... no
checking for i386-apple-darwin10.6.0-xlC_r... no
checking for i386-apple-darwin10.6.0-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... /lib/cpp
configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
[2011-02-13 11:58:36] ./configure --prefix=/Users/MYNAME/.rvm/rubies/ruby-1.9.2-p136 --enable-shared
checking build system type... i386-apple-darwin10.6.0
checking host system type... i386-apple-darwin10.6.0
checking target system type... i386-apple-darwin10.6.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/MYNAME/.rvm/src/ruby-1.9.2-p136':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
#eggie5 said:
I would put in your os x cd and install xcode again.
Do NOT install XCode from the DVD. The version that came on the 10.6 (Snow Leopard) disk is known to be buggy. Install the latest version from Apple's XCode site. You have to be registered to download, but it's a free registration.
I suspect you upgraded to 10.6, rather than it being installed by default when you bought your machine. 10.6 is 64-bit as is its related XCode version, so everything should have been 64-bit clean. Since it isn't it smells like regular Leopard or a pre-10.6 OS. That means all RVM hosted Rubies are suspicious and need to be cleaned up, along with any gems that were compiled prior to the upgrade and update of XCode.
After installing the XCode distribution, you'll need to uninstall, then install your RVM hosted Rubies. First, update RVM to the latest rev: Type rvm -v and note the revision number. Type rvm get head to load the latest version. When it has finished loading you should see a new revision number. RVM changes fast so you want to update to the latest pretty regularly.
This is from the RVM FAQ which is very good information for working with RVM, especially the comments about using sudo with gems:
My ruby is compiling as 32 bit but I am on Mac OS X Snow Leopard which has heavy advertisement that it is 64 bit!!!
RVM compiles to your current running kernel's architecture. This means that if your kernel is running as a 32 bit kernel (uname -m) it will compile 32 bit. You can override this behavior by placing the following in your ~/.rvmrc before installing the ruby interpreter:
rvm_archflags="-arch x86_64"
I think it's a good idea to set that rather than rely on defaults, since you're probably going to be on 64-bit from now on.
Type rvm reload or close your terminal window and reopen a session.
Type rvm notes and read it. This gives you a list of prerequisites you need for a smooth install of Ruby, based on your operating system. Failure to install those means various features might not work in Ruby, which will result in random, weird failures.
Type rvm list and make note of your installed Ruby versions. Pretend your first one is ruby-1.8.7-p330. Type:
rvm uninstall ruby-1.8.7-p330
rvm install ruby-1.8.7-p330
Repeat for each one you have installed. When you are done type rvm info and see if what it says passes sanity checks.
If everything looks good, it's time to rebuild the native drivers for your gems.
Both of these steps are optional, but are part of a good periodic house-keeping:
You might want to give your gems an update if you haven't run gem update for a while. rvm ruby 'gem update' will walk through the installed Rubies, updating them.
People accumulate old gems but often don't clean them up, so, to speed up rebuilding your gems you probably should clean out your old ones. You'll have to pay attention to what its telling you as it processes, because it will let you know about dependencies that will not be met. rvm ruby 'gem clean' will walk through the installed Rubies, and clean out the old stuff.
To rebuild the native drivers type rvm ruby 'gem pristine --all', which will reinstall all your gems.
Afterward, run rvm info and make sure it's returning sane information again.
Also, as an emergency escape hatch, it's entirely safe to blow away your ~/.rvm directory, either by typing rm -f ~/.rvm or using rvm implode, then starting over. Reinstalling a Ruby is the longest part of the process, and RVM makes it pretty painless once the supporting libraries are there.
I would put in your os x cd and install xcode again.

Resources