pip install readline on Mac OS X (10.7.3) fails - xcode4

When building the c extensions of readline when installing readline via pip install readline, I get an error message as follows:-
Beginning configuration for readline-6.2 for i386-apple-darwin11.3.0
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/Users/calvin/.virtualenvs/myproj/build/readline/rl/readline-lib':
configure: error: C compiler cannot create executables
See `config.log' for more details.
============ Building the readline library ============
============ Building the readline extension module ============
running install
running build
running build_ext
building 'readline' extension
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.7.sdk
Searching for the location of MacOSX10.7.sdk on my system reveals:-
calvin$ sudo find / -name "MacOSX10.7.sdk"
Password:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
Which is not where the readline compilation is expecting.
Is there a bug with how pip locates the MacOSX10.7.sdk?
How do I resolve this without resorting to copying MacOSX10.7 into the /Developer/SDKs directory?
CLARIFICATION
This is how I temporarily solve my problem.
calvin$ sudo mkdir -p /Developer/SDKs/
Password:
calvin$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk /Developer/SDKs/MacOSX10.7.sdk
calvin$ pip install readline
But I am not too sure this is the "appropriate" way to solve it as there might be some inherent problems either from how pip is supposed to locate my .sdk location or I am missing something in my system PATH. So any advice on how to resolve this the "appropriate" way would be much appreciated!

That's a good question. As a point of note, I do have a MacOSX10.7.sdk folder in /Developer/SDKs, so perhaps it's your filesystem's state that's wrong.
The safest approach is probably to install XCode, but that's horribly expensive in terms of time. I would start by creating a soft link:
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk /Developer/SDKs/MacOSX10.7.sdk
and see if that does the trick.

Related

not able to install GCC on Solaris 11.4

I installed Solaris 11.4 x86 in VirtualBox. I need to install the GCC compiler so that I can run c code in Solaris. But each time I try to install the package this error occurs:
Errors were encountered while attempting to retrieve package or file data for the
requested operation. Details follow:
http protocol error: Unknown error code: 500 reason: Internal Server Error
URL: 'http://pkg.oracle.com/solaris/release/solaris/file/1/53eb07cd6fade116a6fdea7397c6839929ec0925'
publisher information:
I have used the following commands:
sudo pkg install developer/gcc/gcc-c-7
also tried -nv option
sudo pkg install -nv gcc
sudo pkg install -nv gcc-7
sudo pkg install -nv developer/gcc-7
see the output of the following command:
kashif#OS:~$ pkg list | grep GCC
output:
system/library/gcc/gcc-c++-runtime 7.3.0-11.4.0.0.1.14.0 i--
system/library/gcc/gcc-c++-runtime-7 7.3.0-11.4.0.0.1.14.0 i--
system/library/gcc/gcc-c-runtime 7.3.0-11.4.0.0.1.14.0 i--
system/library/gcc/gcc-c-runtime-7 7.3.0-11.4.0.0.1.14.0 i--
image below shows gcc package information from repostiry
I am trying to solve this problem for 2 days. I have read documentation from
https://docs.oracle.com/cd/E37838_01/html/E60979/publisher-config.html
I also tried to install developerstudio 12.6 but it didn't work.
overall picture of error and command:
I have googled for errors tried to find information about errors and searched for how to install GCC on Oracle Solaris 11. I couldn't find any solution to this problem.
Try "wget http://pkg.oracle.com/solaris/release/p5i/0/developer%2Fgcc.p5i" or your preferred gcc package and manually install it with pkg install. You can try:
pkg install -v
after downloading.

Unable to compile R packages in C for Mac

I am requesting some help with my C compiler. I can't compile R packages from GitHub like dplyr. I can download the package and install it but when I go to load the package with library I get an error message (below).
`devtools::install_github("tidyverse/dplyr”)`
I receive the error message in a Mac OSX window:
Building R package from source requires installation of additional build tools.
Do you want to install the additional tools now?
I also get this error that makes me think that gcc might not be installed in the correct place:
checking for gcc... /usr/local/Cellar/gcc/8.2.0/bin/gcc-7
checking whether the C compiler works... no
So far I have tried to check my compiler.
gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
I successfully reinstalled Xcode for build tools directly from the Apple Development site and from the command line.
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
I checked my .bash_profile as I thought that might be the issue:
export PATH=/usr/local/bin:$PATH
#export PATH=/usr/local/clang8/bin:$PATH
PATH="/Library/Frameworks/Python.framework/Versions/3.8/bin:${PATH}"
export PATH
Thank you in advance,
Tyler

Rserve : ld: library not found for -lssl

I am getting an error while trying to install Rserve 1.8.6. I can successfully install 1.7.3 from CRAN. This is on Mac OS High Sierra.
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [forward] Error 1
make: *** [all] Error 2
ERROR: compilation failed for package ‘Rserve’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rserve’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rserve’
The downloaded source packages are in
‘/private/var/folders/v7/hyxrfmk94p1_03gdrm27fnxncy3vq1/T/RtmpFHKNMe/downloaded_packages’
This worked for me (MacOS):
In terminal:
brew install openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/
I'm running Mac OS 10.15 Catalina, I've spent 2 days trying to fix this same problem, scouring the internet for help. I finally managed it by cobbling together solutions from a few different sources.
The key thing I was missing was that Mac OS ships with its own version of openssl which it thinks is superior to anything else you can find. It is wrong. What you need to do is go and download the latest version of openssl, install that, then export THAT library to your library path variable. Here are the steps I took with openssl 1.1.1:
Get the version number for the latest version of openssl from the source (https://www.openssl.org/source/) and then manually install it directly where it's supposed to go:
cd /usr/local/src
If you're getting "No such file or directory", make it:
cd /usr/local && mkdir src && cd src
Download openssl using curl (shown) or using the link above to the source code (make sure you put the file in the directory you just made in the previous step):
curl --remote-name https://www.openssl.org/source/openssl-1.1.1f.tar.gz
Extract and cd in:
tar -xzvf openssl-1.1.1f.tar.gz
cd openssl-1.1.1f
Compile and install (these are the 64 bit Mac OS instructions. Refer to the openssl documentation for 32 bit and other OS instructions):
./Configure darwin64-x86_64-cc shared enable-ec_nistp_64_gcc_128 no-ssl2 no-ssl3 no-comp --openssldir=/usr/local/ssl/macos-x86_64
make depend
sudo make install
This created a new openssl folder so when you export the library path you have to feed it the right openssl folder:
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl#1.1/lib/
Hope that helps you if you haven't figured it out yet, and anyone else in the future who is ready to chuck their computer across the room, like I was.

Install Emacs without root privilege under my personal directory, error while running ./configure --prefix -my-personal-directory

I am using system RedHat 6.8 and I tried to install emacs under my personal directory as I don't have permission to run root command.
Below is my command:
cd emacs-24.5
./configure --prefix -my-home-directory
Then I got error message as below:
configure: error: The following required libraries were not found:
libXpm libgif/libungif libtiff
Maybe some development libraries/packages are missing?
If you don't want to link with them give
--with-xpm=no --with-gif=no --with-tiff=no
as options to configure
I did some google search and it told me I need to install dependence libXpm, libgif/libungif and libtiff, but all instructions online were teaching you how to install these dependence with root privilege, which I don't have.
Then I downloaded source code of libXpm from https://xorg.freedesktop.org/archive/individual/lib/ and run following command
tar xvf libXpm-3.5.12.tar.gz
cd libXpm-3.5.12
configure --prefix -my-home-directory
make
make install
Then the libXpm successfully installed and I also appended the path to the libXpm in $LD_LIBRARY_PATH by
export LD_LIBRARY_PATH=/path/to/libXpm:$LD_LIBRARY_PATH
However, after that I tried to ./configure emacs again it still output that error
configure: error: The following required libraries were not found:
libXpm libgif/libungif libtiff
Maybe some development libraries/packages are missing?
If you don't want to link with them give
--with-xpm=no --with-gif=no --with-tiff=no
as options to configure
Anybody can help me out?

configure error installing R-3.3.2 on Ubuntu: checking whether bzip2 support suffices... configure: error: bzip2 library and headers are required

Trying to install R-3.3.2 but when I use $./configure, I keep getting the error:
checking whether bzip2 support suffices... configure: error: bzip2 library and headers are required
It worked for me after:
sudo apt-get install libbz2-dev
I have successfully compiled R from source, the following steps need special attention:
install dependent libraries:
zlib-1.2.8, bzip2-1.0.6, xz-5.2.2, pcre-8.39, curl-7.52.1.
Specifically, to compile bzip2, The Makefile should be modified:
original: CC=gcc
after modification: CC=gcc -fPIC
pass the library and header file to the configure with proper variables:
export CPATH=/opt/zlib-1.2.8/include/:/opt/bzip2-1.0.6/include/:/opt/xz-5.2.2/include/:/opt/pcre-8.39/include/
export LD_LIBRARY_PATH=/opt/zlib-1.2.8/lib/:/opt/bzip2-1.0.6/lib/:/opt/xz-5.2.2/lib/:/opt/pcre-8.39/lib/
./configure --prefix=/opt/R/R_soft/ --enable-R-shlib --with-libpth-prefix=/opt/ CPPFLAGS="-I/opt/bzip2-1.0.6/include/ -I/opt/zlib-1.2.8/include/ -I/opt/xz-5.2.2/include/ -I/opt/pcre-8.39/include/ -I/opt/curl-7.52.1/include/" LDFLAGS="-L/opt/xz-5.2.2/lib/ -L/opt/zlib-1.2.8/lib/ -L/opt/bzip2-1.0.6/lib/ -L/opt/pcre-8.39/lib/ -L/opt/curl-7.52.1/lib/"
It seems CPATH and CPPFLAGS is redundant here, I found the CPPFLAGS AND LDFLAGS not worked.
First off, are you aware that you can get prebuilt binaries of current R ?
Second, your comment on the bzip2 binary has no bearing on the need for the library R needs to compile and link against.
Third, you can search: apt-cache search bzip2 | grep library would have gotten you there.
Fourth, for all existing packages you can actually install their known build dependencies. But see point one, you probably do not want to build from source.
Fifth, and closing: sudo apt-get install libbz2-dev answers your (narrow) question but you will likely have further issues. There is an entire manual devoted to installing and administering R which has all the answers for you.

Resources