Octave io package installation on macOS - macos

I've searched the web high and low to no avail so I'm resorting to asking here..
I want to install the io package to Octave 4.4.1 on MacOS Catalina (10.15.5). I've tried installing directly from the Forge and again from the .gz file, but I get the following error every time:
configure: error: in `/var/folders/rh/y2fddn916sg3v_8pkln9z7jr0000gq/T/oct-JsL8yQ/io-2.6.1/src':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
checking for mkoctfile... /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/bin/mkoctfile-4.4.1
checking for octave-config... /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app#4.4.1/4.4.1/bin/octave-config-4.4.1
checking whether the C++ compiler works... no
pkg: error running the configure script for io.
error: called from
configure_make at line 82 column 9
install at line 184 column 7
pkg at line 437 column 9
I know I need to provide the config.log file to troubleshoot but I cannot for my life find this anywhere. So:
Where do I find the config file?
How do I get io to install?
I don't pretend to know anything about programming so less-technical answers appreciated if possible. I installed Octave using the native mac app version from the website.

configure: error: C++ compiler cannot create executables
...
checking whether the C++ compiler works... no
This generally means that either you have Xcode installed but have not yet run it and accepted the EULA (which you must do once before using Xcode for anything, including command line work), and/or don't have the Xcode Command Line Tools installed (which you can do using sudo xcode-select --install).
That being said, there are outstanding issues with installing several Octave Forge packages on macOS. If you have further trouble with it, you can drop by the Octave.app repo on GitHub for support.

Related

Issue with linker for Mac OS

I have recently started using ada for a lab in my systems programming class and I can say it is really interesting.
I tried most of it at the computers labs for testing and I decided to install the compiler and its linking tools in a MacBook.
Altough the installation is done and there seems to be no problem, when I tried to print the classic hello world program I am getting this message:
gprbuild greet.adb
using project file /Users/xyderos/opt/GNAT/2020/share/gpr/_default.gpr
Bind
[gprbind] greet.bexch
[Ada] greet.ali
Link
[link] greet.adb
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
gprbuild: link of greet.adb failed
gprbuild: failed command was: /users/name/opt/gnat/2020/bin/gcc greet.o b__greet.o - L/Users/name/ada/ -L/Users/name/ada// -L/users/name/opt/gnat/2020/lib/gcc/x86_64-apple-darwin17.7.0/8.4.1/adalib/ /users/name/opt/gnat/2020/lib/gcc/x86_64-apple-darwin17.7.0/8.4.1/adalib/libgnat.a -Wl,-rpath,#executable_path/ -Wl,-rpath,#executable_path/..//opt/gnat/2020/lib/gcc/x86_64-apple-darwin17.7.0/8.4.1/adalib -o greet
I am getting really confused about the lSystem library.
It seems that the library doesn't exist on Mac(maybe I need to install Xcode?).
Does anyone have a clue about that issue or is there a probably better way to install it via brew?
Thanks a lot in advance!
On my MacOS 10.14, the following worked for me, without having to download the massive blob that is Xcode, which I had neither the bandwidth nor the diskspace for. I don't know if this still works on MacOS 10.15 (not planning to upgrade).
Most of this info was from a blog post by Simon Wright: https://forward-in-code.blogspot.com/2019/06/macos-software-development-kit-changes.html
You only need the Xcode command line tools only (not Xcode): xcode-select --install
Now unpack the included headers: sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
And tell GNAT where to find them: mv ce2109-specs /usr/local/opt/GNAT/2019/lib/gcc/x86_64-apple-darwin17.7.0/8.3.1/specs
The ce2109-specs file is from the blog post above. This did the job for me and GNAT can now link working binaries on MacOS 10.14.
If you're on 10.15 and it doesn't work (because there's no more Xcode command line tools or they're missing the headers package), you will unfortunately have to install Xcode as per the GNAT Readme.

Fortran codes won't compile on Mac with gfortran

I recently moved from the SGI, Sun workstation environment to a Mac. SGI and Sun came with Fortran compilers so I have maybe 100 small f77 codes I wrote over the years for post-processing and analysis of simulated data. I was hoping to get these codes running on my iMac with gfortran. Most of these are very simple codes but I can't get them to compile and execute. I tried starting with the basics and wrote the Hello World code from a gfortran help page. My code, fortran.f is:
program helloworld
print *, "hello world"
end program helloworld
When I tried compiling this according to the example I typed:
gfortran fortran.f
But I keep getting the error message:
FATAL:/opt/local/bin/../libexec/as/x86_64/as: I don't understand 'm' flag!
This is the same error message I get on my other codes. Can someone tell me what I'm doing wrong? I can't think of a simpler example but I can't seem to get it to work.
When it comes to macOS, I think that building form sources is the best approach you can have. You can achieve that quite easily by downloading and compiling GFortran as part of GCC directly from: https://gcc.gnu.org/wiki/GFortran
However, there are few things you have to take care of:
make sure you have XCode installed, you can get it here
XCode
XCode is free of charge
Make sure you have command line tools
You can get them either from developer.apple.com
Command Line Tools
or directly from XCode. It might be that XCode will tell you to install Command Line Tools upon first execution
In the past, running command like "svn", when Command Line Tools were not installed, also triggered the installation.
Compile GCC
> ./configure --prefix=$HOME/opt/usr/local
> make all
> make install
Alternatively, you can install using macOS package from GFortran
gfortran-6.3-Sierra.dmg
Fully working sample with Fortran based MPI code:
http://www.owsiak.org/running-open-mpi-on-macos/
If your gfortran was installed a long time ago and you have updated macOS since installing, it may need re-installing to get correctly aligned and linked with the latest macOS tools and libraries.
My advice would be to:
uninstall gfortran,
check that Xcode and its command line tools are up-to-date,
re-install gfortran.
Hints for each of those steps follow:
Note that gfortran is a part of GCC - the "GNU Compiler Collection".
If you installed gfortran via homebrew, you can remove it with:
brew rm gcc
You can update Xcode by by going to AppStore and clicking Updates at top-right.
The Xcode Command Line tools include make and git and command-line versions of the compilers. You can install/update the Xcode command line tools with:
xcode-select --install
You can install gfortran with homebrew using:
brew install gcc
When you are finished, you should make sure that your PATH includes /usr/local/bin near the start and that there are no errors when you run:
brew doctor
which is a brilliant utility that checks your homebrew configuration is correct.
All I had to do was change the path.
Initially, my PATH was something like
/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
Because of this reason, the default assembler (as) was not called which is in the /usr/bin directory.
To enable the call to the right assembler (as), I had to add /usr/bin to the PATH in front of (before) /opt/local/bin, i.e. on a Mac this can be added by editing ~/.bash_profile such that one's $PATH looks like
/usr/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin
Once edited, execute at your command prompt:
source /etc/bash_profile
This worked for me.

TensorFlow: Compile Error for OpenCl Install from Source

Hello I have followed the Instructions to install from source and after running ./configure with clang/++ and ComputeCpp path provided and Yes to OpenCL.
With Bazel command :
bazel build --config opt --config=sycl //tensorflow/tools /pip_package:build_pip_package
I get the following compile error:
clang++: symbol lookup error: /usr/bin/clang++: undefined symbol: LLVMInitializeMipsAsmParser
I looked up the Symbol and it belongs to Rust which is not installed on my system nor can I see how to install it or the library required by this Install of TensorFlow. It only happens when I install for OpenCL. So it seems it is used for OpenCL along with ComputeCpp. I am installing on Fedora 25 (Yey)
Any ideas would be greatly appreciated. Also how do you stop it from downloading everytime you run ./Configure can it not just read that it already has the files downloaded and if so where?
Thanks
Hbyte
First off all, Fedora 25 is not officially supported by ComputeCpp yet. Although, we will do all we can to help.
You shouldn't need to change any of the bazel build files.
Could you confirm where is ComputeCpp installed?
I inserted ompute++ and have now found that header files located in my /usr/include path are not being used.
Do you mean that your system headers are not picked after configuring TF to use OpenCL?
From TensorFlow set up point of view you should point
./configure to what's the location.. there is no need to copy headers / binaries anywhere.
for instance my ComputeCpp is in my home directory
Do you wish to build TensorFlow with OpenCL support? [y/N] y
OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N]
No CUDA support will be enabled for TensorFlow
which: no clang++-3.6 in (/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/luke/.local/bin:/home/luke/bin)
Please specify which C++ compiler should be used as the host C++ compiler. [Default is ]: /usr/bin/clang++
Please specify which C compiler should be used as the host C compiler. [Default is /usr/local/bin/clang-3.6]: /usr/bin/clang
Please specify the location where ComputeCpp for SYCL 1.2 is installed. [Default is /usr/local/computecpp]: /home/luke/ComputeCpp-CE-0.1.2-Linux
As of the whl package, it boils down to Google, but as far as I am aware TensorFlow is not officially supporting Fedora 25 either.
If you have a fix for the build system please create Pull Request :)
What happens if you choose GCC for your host compiler?
Would it be possible to open an issue on GitHub to track the progress of this?

Configure error in Mac OS X Lion 10.7 -- Library 'crypto' is required for OpenSSL

Tried brew install postgres and got the following error:
datadir=/usr/local/Cellar/postgresql/9.2.4/share/postgresql --docdir=/usr/local/Cellar/postgresql
checking for library containing gss_init_sec_context... -lgssapi_krb5
checking for library containing com_err... none required
checking for library containing krb5_sendauth... none required
checking for CRYPTO_new_ex_data in -lcrypto... no
configure: error: library 'crypto' is required for OpenSSL
OpenSSL seems to be installed correctly (I brew installed it, with no complaints, and brew doctor doesn't raise any flags about it), and my XCode developer tools are also up to date. Looked around for how to install crypto on a mac, (OS X Lion 10.7), and there are surprisingly few resources. Any ideas what's wrong or how to fix it?
I tried uninstalling/reinstalling OpenSSL.
The problem ended up being based on an inexplicably empty libcrypto.dylib file. There was a backup (libcrypto.dylib.BAK), and I just overwrote the empty file with it and all the problems went away. No idea how that happened in the first place, but if anyone's having similar problems, I'd look for .BAK files in usr/lib/ and (if there are any) see if the associated files are empty.
For cryptography, PostgreSQL use Zlib, so, you need to install Zlib headers in your Mac, to be able to compile it with crypto support. You can see an example but is for Ubuntu. You need to figure out how to install zlib in Mac:
To read more about the pgcrypto module, visit this link.

Why can I not build a lower version compiler

I am currently trying to build a gcc 4.4 on a newly updated ubuntu 11.10. However building the compiler always fails with some problems, when trying to bootstrap.
First crti.o and crtn.o could not be found. I symlinked them into another directory within the search path, and so I could get a bootstrap compiler. However now it fails with the message:
configure: error: C compiler cannot create executables
I tried out to use the intermediate compiler on a simple test program, and I get the message:
$ ./host-x86_64-unknown-linux-gnu/prev-gcc/xgcc test.c
xgcc: error trying to exec 'cc1': execvp: File or directory not found
So something is seriously messed up with the paths of my intermediate compiler it seems. When I did the same thing on ubuntu 11.04 everything just worked fine.
I used the following command line to configure:
./configure --prefix=/opt --program-suffix=44
I also tried both a VPATH-built, as well as an in source build, but both have the same problem. I still have the gcc44 from before the update lying around within /opt, but it has become unusable since the update.
Is there any easy way to get gcc 4.4 working under Ubuntu 11.10? I does not have to be a self build compiler, if I can just download a package and install that, it would be fine as well.
This is caused by Ubuntu's switch to multi-arch. Basically all the "standard" paths have been changed so you can install libraries for multiple architectures on the same machine without any clashes.
Ubuntu GCC has been patched to fix the problem, of course, but the upstream compiler still wasn't fixed last time I checked.
See here: https://askubuntu.com/questions/69365/cant-build-gcc-anymore-since-upgrade-to-11-10

Resources