mountainlion apr compile lacking 'cc' - macos

Trying to build mod_auth_openid on MountainLion with XCode Version 4.4.1 (4F1003), I get a complaint about a missing 'cc' command, as follows:
/usr/share/apr-1/build-1/libtool --silent --mode=link /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc -o mod_auth_openid.la -rpath /usr/libexec/apache2 -module -avoid-version libmodauthopenid.la -I/usr/include/apache2 -I/usr/include/apr-1 -I/usr/local/include -L/usr/local/lib -lopkele -lcurl -lexpat -ltidy -lssl -lcrypto -lz -L/usr/lib -lpcre -lcurl
/usr/share/apr-1/build-1/libtool: line 4574: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc: No such file or directory
apxs:Error: Command failed with rc=8323072
What to do?

I faced a similar problem while trying to install mod_wsgi using homebrew on Mac (Mountain Lion).
Though bmargulies posted the answer in his comment by pointing to github link. But still posting the solution here for completeness.
Run the following command.
sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain
And then re-run the install command

Ran into exactly this problem with Mountain Lion/Homebrew/mod_wsgi. The toolchain symlink did not solve the problem in my case. Went back to another Mac where I used MacPorts to do this with no issues and looked at the Portfile for mod_wsgi. They had a --disable-framework flag in the configure step. Added this flag and everything worked great. Details available in the gist here https://gist.github.com/talonsensei/6284446

Related

Compiler Error when Compiling GCC 5.3.0 (-Lyes/lib and -Iyes/include)

When attempting to compile GNU GCC 5.3.0 I encounter the following error when it tries to build libjavamath.la.
/bin/bash ../../../libtool --tag=CC --mode=link /home/borish/Downloads/gcc-build/./gcc/xgcc -B/home/borish/Downloads/gcc-build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -Iyes/include -g -O2 -module -version-info 0:0:0 -no-undefined -Lyes/lib -lgmp -avoid-version -o libjavamath.la -rpath /usr/local/lib/../lib64/gcj-5.3.0-16 gnu_java_math_GMP.lo ../../../native/jni/classpath/jcl.lo
../../../libtool: line 5209: cd: yes/lib: No such file or directory
libtool: link: cannot determine absolute directory name of `yes/lib'
Makefile:403: recipe for target 'libjavamath.la' failed
This is on a Debian 8.4 system with GCC 4.9.2-10 installed. I believe I have satisfied all of the prerequisites, and Google wasn't been much help.
Any thoughts?
Update:
I used the following for running the configuration script:
../gcc-5.3.0/configure --disable-multilib --with-mpc --with-isl --with-mpfr --with-gmp
It sounds like you didn't run "configure" correctly. For example:
https://software.ecmwf.int/issues/browse/SUP-676
OK, I see a problem already, the "--with-jasper" option must point the
to the prefix of the "jasper" installation, for example
$./configure --with-jasper=/usr/local/jasper --with-png-support.
Otherwise the value "yes" is set as prefix..
For example, if you look here:
http://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
you'll see that a flag like ‘--with-headers=directory’ REQUIRES YOU TO ENTER A DIRECTORY PATH. I suspect the same thing is happening with your "-with-mpc" etc.
SUGGESTION: clean your build directory, and (carefully!) re-run ./configure.
The culprit appears to be the --with-gmp, --with-mpc and --with-mpfr switches when initiating the configure script. I suspect since libgmp is a prerequisite for libmpc and libmpfr, a bug feature in the configure script will include the offending -I and -L directives. Inclusion of any of them will result in the following in the root Makefile
HOST_GMPLIBS = -Lyes/lib -lmpc -lmpfr -lgmp
HOST_GMPINC = -Iyes/include
I haven't confirmed this to be the case in any of the other Makefiles, but I suspect something similar is going on elsewhere which is what I ran into when it attempted to building libjavamath.la.
The work around is to omit those switches from the configure invocation. They should be included in any event since the configure script will fail if they aren't present on the host.

Lektor installation fails on MacBookPro OS X 10.6.8

I am trying to install Lektor on a MacbookPro with OS X 10.6.8.
Imagemagick and Python2.7 are already installed.
When I run the installation command:
curl -sf https://www.getlektor.com/install.sh | sh
The build process runs until it gets an error when building '_watchdog_fsevents' extension. The error is:
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
I've cut and pasted the output just prior to the error into the following code section.
How should I overcome this?
running build_ext
building '_watchdog_fsevents' extension
creating build/temp.macosx-10.6-x86_64-2.7
creating build/temp.macosx-10.6-x86_64-2.7/src
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Wno-error=unused-command-line-argument-hard-error-in-future -DWATCHDOG_VERSION_STRING="0.8.3" -DWATCHDOG_VERSION_MAJOR=0 -DWATCHDOG_VERSION_MINOR=8 -DWATCHDOG_VERSION_BUILD=3 -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/watchdog_fsevents.c -o build/temp.macosx-10.6-x86_64-2.7/src/watchdog_fsevents.o -std=c99 -pedantic -Wall -Wextra -fPIC -Wno-error=unused-command-line-argument-hard-error-in-future
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
cc1: error: -Werror=unused-command-line-argument-hard-error-in-future: No option -Wunused-command-line-argument-hard-error-in-future
error: command 'gcc-4.2' failed with exit status 1
----------------------------------------
Failed building wheel for watchdog
Failed to build watchdog
Most likely your version of OS X is too old to support the installation of watchdog with the version of gcc you have. If you cannot upgrade your OS X installation then I recommend installing a recent version of clang via brew and install lektor after exporting CC=clang.
Note though that Lektor is not tested for OS X < 10.9.
Your problem may be an updated version of Xcode in which you have not agreed to the license. Try running this first:
sudo xcodebuild -license
scroll to the very bottom and it will allow you to type "agree".
This resolved the issue for me.

Failed to link program with OpenSSL

This is my compile command
gcc msg_utils.o -o mtm -lm -L/openssl-1.0.0a -lssl -lcrypto
I get error :
/usr/bin/ld: cannot find -lssl
Please tell me what wrong with my command ,the path to openssl is correct ,I get openssl source from :
https://www.openssl.org/source/openssl-1.0.0a.tar.gz
(I guess you are on Linux)
You should probably install some OpenSSL package in your Linux distribution.
Perhaps aptitude install libssl-dev on Debian related distributions.
If you compile OpenSSL from source code, you probably need some make install step and you might need to run ldconfig after that.
You might want to use pkg-config during compilation of your code:
gcc -Wall -g $(pkg-config -cflags openssl) \
msg_utils.o -o mtm \
$(pkg-config -libs openssl)
See also this and that

Scons Compile Error when switching from OSX 10.6 to 10.7

I am migrating from a Snow Leopard (10.6.8) MAC to a Lion MAC (10.7.5). I haven't changed anything in the code or the build scripts, but once I try to build my project using SCONS on OSX Lion, I get the following errors:
gcc -arch i386 -o build/osx/objs/installer/Controller.o -c -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -x objective-c++ -Oz -m32 -Wall -fno-common -fvisibility=hidden -fno-strict-aliasing -Wall -fno-common -fvisibility=hidden -DMACOSX_DEPLOYMENT_TARGET=10.5 -g -DOS_OSX=1 -D_OS_NAME=osx -D_PRODUCT_VERSION=1.1.0 -D_PRODUCT_NAME=Aspen -D_GLOBAL_NS_VARNAME=Aspen -D_CONFIG_FILENAME=Aspen.config -D_BOOT_RUNTIME_FLAG= -D_BOOT_HOME_FLAG= -D_DISTRIBUTION_URL=smithmicro.com -D_CRASH_REPORT_URL=smithmicro.com/p/v1/app-crash-report -DOS_32=1 -DDEBUG=1 -I. -Ikroll -Ibuild/osx/sdk/include -Ikroll/libkroll -Ikroll/libkroll/utils installer/osx/Controller.mm
In file included from kroll/libkroll/utils/../base.h:10,
from kroll/libkroll/utils/utils.h:8,
from installer/osx/Controller.h:8,
from installer/osx/Controller.mm:6:
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/string:44:28: error: bits/c++config.h: No such file or directory
I have the 10.5 sdk here: /Developer/SDKs/MacOSX10.5.sdk. When I compare the 10.5 SDK on my Snow Leopard to Lion MAC, they look they the same.
Any help would be greatly appreciated. Thanks in advance.
EDIT
After turning on verbose information I can see this on the 10.7 machine for include paths:
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/backward
/Developer/SDKs/MacOSX10.5.sdk/usr/include
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks (framework directory)
/Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks (framework directory)
When I look at the 10.6 machine it has
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/i686-apple-darwin10
That is the missing include, but I'm not sure how that gets included on 10.6 and not 10.7, its not explicitly added anywhere in the build scripts. I believe its based off the BaseSDK of the build, and they are the same.
So I ended up creating my own alias folder called
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/i686-apple-darwin11
on my 10.7 machine and now everything compiles. I wonder why the Xcode/SDK installation didn't create this folder for me, like it does on 10.6

Problems installing Haskell library regex-pcre on Mac OS X

I'm trying to install the Haskell regex-pcre library using:
cabal install --extra-include-dirs=/usr/local/include \
--extra-include-dirs=/usr/include regex-pcre
However I get this weird error:
Resolving dependencies...
Configuring regex-pcre-0.94.2...
Preprocessing library regex-pcre-0.94.2...
In file included from /Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/include/HsFFI.h:68,
from /Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/template-hsc.h:4,
from dist/build/Text/Regex/PCRE/Wrap_hsc_make.c:1:
/usr/include/float.h:8:24: error: float.h: No such file or directory
In file included from /Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/template-hsc.h:9,
from dist/build/Text/Regex/PCRE/Wrap_hsc_make.c:1:
/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
compiling dist/build/Text/Regex/PCRE/Wrap_hsc_make.c failed (exit code 1)
command was: /usr/bin/gcc -c dist/build/Text/Regex/PCRE/Wrap_hsc_make.c -o dist/build/Text/Regex/PCRE/Wrap_hsc_make.o -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -fno-stack-protector -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -fno-stack-protector -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -D__GLASGOW_HASKELL__=700 -Ddarwin_BUILD_OS -Ddarwin_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -I/usr/include -I/usr/local/include -DHAVE_PCRE_H -DSPLIT_BASE=1 -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/bytestring-0.9.1.10/include -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/base-4.3.1.0/include -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/include -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/include -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/include/
cabal: Error: some packages failed to install:
regex-pcre-0.94.2 failed during the building phase. The exception was:
ExitFailure 1
The gist of it, seems to be that it can't find a second float.h file:
/usr/include/float.h:8:24: error: float.h: No such file or directory
I've opened /usr/include/float.h and line 8 reads:
#include_next <float.h>
I've done my searching on Google, and although I don't know that much C I think I understand what that line is supposed to say, but... I don't know how to really solve this problem. I don't know where else I have a float.h file on my system.
The GHC and GCC versions I'm using. GCC comes from XCode 4. GHC is 32bit, but I've tried the 64bit version too, with the same results.
$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.2
OS X version is 10.6.7.
Any help greatly appreciated.
Looks to me like ticket #5011 - XCode 4 on Mac + GHC 7.0.2 fails to link.
This is fixed in GHC 7.0.3 which will be part of the mid-April release of the Haskell Platform.
And alternative fix is to downgrade to the 2010.2 Haskell Platform.
See this question yesterday: Can't install OpenGLRaw-1.1.0.1 on OS X

Resources