Compiling OpenMPI with AOCC clang (configure error: no working posix pthread package) - pthreads

I am trying to build OpenMPI on an eight-core AMD Ryzen CPU (1700). I have downloaded and installed the AOCC bundle of compilers. The OpenMPI version that I am trying to compile is a clone of the master branch.
Steps that led to the problem:
source setenv_AOCC.sh (this sets up the AOCC bundle (by polluting your environment))
cd into the build dir
$ompisrcdir/configure CC=clang --prefix="$HOME/$localmpiinst"
Configure goes on until:
checking for _SC_NPROCESSORS_ONLN... yes
checking whether byte ordering is bigendian... no
checking for broken qsort... no
checking if C compiler and POSIX threads work as is... no
checking if C++ compiler and POSIX threads work as is... no
checking if Fortran compiler and POSIX threads work as is... no
checking if C compiler and POSIX threads work with -Kthread... no
checking if C compiler and POSIX threads work with -kthread... no
checking if C compiler and POSIX threads work with -pthread... yes
checking if C++ compiler and POSIX threads work with -Kthread... no
checking if C++ compiler and POSIX threads work with -kthread... no
checking if C++ compiler and POSIX threads work with -pthread... no
checking if C++ compiler and POSIX threads work with -pthreads... no
checking if C++ compiler and POSIX threads work with -mt... no
checking if C++ compiler and POSIX threads work with -mthreads... no
checking if Fortran compiler and POSIX threads work with -Kthread... no
checking if Fortran compiler and POSIX threads work with -kthread... no
checking if Fortran compiler and POSIX threads work with -pthread... yes
checking if C++ compiler and POSIX threads work with -lpthreads... no
checking if C++ compiler and POSIX threads work with -llthread... no
checking if C++ compiler and POSIX threads work with -lpthread... no
checking for pthread_mutexattr_setpshared... yes
checking for pthread_condattr_setpshared... yes
checking for PTHREAD_MUTEX_ERRORCHECK_NP... yes
checking for PTHREAD_MUTEX_ERRORCHECK... yes
checking for working POSIX threads package... no
configure: WARNING: "*** POSIX threads are not"
configure: WARNING: "*** available on your system "
configure: error: "*** Can not continue"
So, it dies checking for POSIX threads c++ support.
output of clang --version:
AOCC.LLVM.1.3.0.B34.2018_10_22 clang version 7.0.0 (CLANG: Jenkins
AOCC_1_3_0_Release-Build#34) (based on LLVM AOCC.LLVM.1.3.0.B34.2018_10_22)
Target: x86_64-unknown-linux-gnu

Okay, the solution is, actually, simple.
I was supposed to supply the CXX flag to the configure script. So, instead of,
$ompisrcdir/configure CC=clang --prefix="$HOME/$localmpiinst"
the following works,
$ompisrcdir/configure CC=clang **CXX=clang++** --prefix="$HOME/$localmpiinst"

Related

The clang compiler does not support a feature it reportedly supports

I'm trying to tailor compiler flags of clang-11 to the apple-m1 CPU, which clang-11 doesn't know about yet.
The output of /usr/bin/clang -E - -mcpu=apple-m1 -### on macOS outputs a command with flags like these in it: "-target-feature" "+zcz"
From that you can infer the following features of the CPU:
armv8.5a+fp-armv8+neon+crc+crypto+dotprod+fp16fml+ras+lse+rdm+rcpc+zcm+zcz+fullfp16+sm4+sha3+sha2+aes
However, out of these, +fp-armv8+neon+zcm+zcz+fullfp16 are not recognised to be valid by any clang compiler:
$ cc -march=armv8.5a+zcz test.c
clang-11: error: the clang compiler does not support '-march=armv8.5a+zcz'
How can I tell clang to optimise for those target flags?

Home-brew OpenMPI installation issue

I am having an issue installing OpenMPI using Home-brew, having searched around I have not been able to find any answers for this. I am doing this because when installing an R package from GitHub I am receiving this error:
clang: error: unsupported option '-fopenmp'
The advice seems to be that in this case one should reinstall openmpi using homebrew. When I do that I get the following response:
brew reinstall openmpi --build-from-source
==> Reinstalling open-mpi
==> Downloading https://download.open-mpi.org/release/open-mpi/v3.1/openmpi-3.1.2.tar.bz2
Already downloaded: /Users/Dom/Library/Caches/Homebrew/open-mpi--3.1.2.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/open-mpi/3.1.2 --disable-silent-rules --enable-ipv6 --with-libevent=/usr/local/opt/libevent --with-sge
Last 15 lines from /Users/Dom/Library/Logs/Homebrew/open-mpi/01.configure:
checking to see if Fortran compilers need additional linker flags... -Wl,-flat_namespace
checking external symbol convention... single underscore
checking if C and Fortran are link compatible... yes
checking to see if Fortran compiler likes the C++ exception flags... skipped (no C++ exceptions flags)
checking to see if mpifort compiler needs additional linker flags... -Wl,-commons,use_dylibs
checking if Fortran compiler supports CHARACTER... yes
checking size of Fortran CHARACTER... 1
checking for C type corresponding to CHARACTER... char
checking alignment of Fortran CHARACTER... 1
checking for corresponding KIND value of CHARACTER... C_SIGNED_CHAR
checking KIND value of Fortran C_SIGNED_CHAR... no ISO_C_BINDING -- fallback
checking Fortran value of selected_int_kind(4)... no
configure: WARNING: Could not determine KIND value of C_SIGNED_CHAR
configure: WARNING: See config.log for more details
configure: error: Cannot continue
I seem to be going further down a rabbit hole I don't really understand, I have run brew doctor and it advises me that there are a bunch of .config files etc which could confound it but I'm not keen on deleting/moving those files as I don't know if they are dependencies for other things. Could anyone set me straight here?
Many Thanks for any responses

How can I install ImageMagick in Fedora 26 / Lampp?

I am using Fedora 26 with Lampp(Xampp) version (PhP)5.6.31 and I 'm trying to install ImageMagick through a terminal command like this:
sudo /opt/lampp/bin/pecl install imagick
I am getting this result:
Downloading imagick-3.4.3.tgz ...
Starting to download imagick-3.4.3.tgz (245,410 bytes)
...................................................done: 245,410 bytes
19 source files, building
running: phpize
grep: /opt/lampp/include/php/main/php.h: No such file or directory
grep: /opt/lampp/include/php/Zend/zend_modules.h: No such file or directory
grep: /opt/lampp/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Please provide the prefix of Imagemagick installation [autodetect] :
building in /tmp/pear/temp/pear-build-margaritisyJF8eL/imagick-3.4.3
running: /tmp/pear/temp/imagick/configure --with-php-config=/opt/lampp/bin/php-config --with-imagick
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/lampp
checking for PHP includes... -I/opt/lampp/include/php -I/opt/lampp/include/php/main -I/opt/lampp/include/php/TSRM -I/opt/lampp/include/php/Zend -I/opt/lampp/include/php/ext -I/opt/lampp/include/php/ext/date/lib
checking for PHP extension directory... /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226
checking for PHP installed headers prefix... /opt/lampp/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... Doesn't exist
checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
checking Testing /opt/bin/MagickWand-config... Doesn't exist
checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
ERROR: `/tmp/pear/temp/imagick/configure --with-php-config=/opt/lampp/bin/php-config --with-imagick' failed
As those are my first steps in Linux world, could anyone help me by giving me step-by-step instructions on how I can make ImageMagick extension work under my lampp ??
Thanks in advance for your help
Looks like you are building your own PHP rather than using the system one, but want to use the system PHP. Like so many other answers here, the problem is that you need to have the corresponding devel packages installed. In your case, that's ImageMagick-devel. You can look for lines like:
checking Testing /usr/bin/MagickWand-config... Doesn't exist
and then run sudo dnf install /usr/bin/MagickWand-config to pull in the needed packages. (And it looks from the earlier warning before the error that you also want sudo dnf install re2c.)

Failed to link to module 'rlm_python': rlm_python.so

I was trying to create a python authentication for freeradius 3.0.8. I followed this example. But when I'm trying to start freeradius in debug mode using command radiusd -X It shows following error.
/usr/local/etc/raddb/mods-enabled/python[9]: Failed to link to module 'rlm_python': rlm_python.so: cannot open shared object file: No such file or directory
I looked /usr/local/lib/ folder and found that rlm_python module is not there. How can I add that module? My python module inside /raddb/mods-available/ is as follows.
python {
module = example
mod_authorize = ${.module}
func_authorize = authorize
}
Appreciate any help.
rlm_python isn't always packaged depending on the distribution.
Basic build instructions can be found here: http://wiki.freeradius.org/building/Home
You will also need to have installed the python-dev/python-devel package on your system. If python still doesn't work you may need to specify the path to the python binary manually by passing it to configure e.g. ./configure --with-rlm-python-bin=/usr/bin/python2.7.
If you just wan to verify the configure scripts have picked up python cd src/modules/rlm_python; ./configure
On my system (macOS 10.11.6) the output when python is found is:
checking for gcc... /usr/local/opt/llvm/bin/clang
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 /usr/local/opt/llvm/bin/clang accepts -g... yes
checking for /usr/local/opt/llvm/bin/clang option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/local/opt/llvm/bin/clang -E
checking for python2.7... python2.7
configure: Python sys.prefix "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7"
configure: Python sys.exec_prefix "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7"
configure: Python sys.version "2.7"
configure: Python local_mod_libs ""
configure: Python base_mod_libs ""
configure: Python other_libs "-u _PyMac_Error $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) -ldl -framework CoreFoundation"
checking for Python.h in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7/... yes
checking for Py_Initialize in -lpython2.7 in /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config... yes
configure: creating ./config.status
config.status: creating all.mk
Once the configure script find the python binary, it'll generally all "just work", as it can then get compilation and linking flags from python itself.

Erlang Build Fails: Can not link the wx driver, wx will NOT be useable

./configure returns an error message when run:
wx:Can not link the wx driver, wx will NOT be useable
When I run .\configure | grep wx, the logs are as follows:
configure: configuring in wx/.
configure: running /bin/bash '/home/nihal/Downloads/otp_src_17.1/lib/wx/./configure' --prefix=/usr/local '--prefix=/usr/local' 'ERL_TOP=/home/nihal/Downloads/otp_src_17.1' '--cache-file=/dev/null' '--srcdir=/home/nihal/Downloads/otp_src_17.1/lib' --cache-file=/dev/null --srcdir=/home/nihal/Downloads/otp_src_17.1/lib/wx/.
rm: remove write-protected regular file './CONF_INFO'?
checking for debug build of wxWidgets... checking for wx-config... /usr/bin/wx-config
checking for wxWidgets version >= 2.8.4 (--unicode --debug=yes)... yes (version 2.8.12)
checking for wxWidgets static library... no
checking for standard build of wxWidgets... checking for wx-config... (cached) /usr/bin/wx-config
checking for wxWidgets version >= 2.8.4 (--unicode --debug=no)... yes (version 2.8.12)
checking for wxWidgets static library... no
checking if wxwidgets have opengl support... yes
checking for wx/stc/stc.h... yes
checking if we can link wxwidgets programs... yes
wx : Can not link the wx driver, wx will NOT be useable
How do I successfully build it?
If you don't need wx, you can build Erlang without it with:
./configure --without-wx
If you need wx support, see instructions at Building with wxErlang section.
Check the contents of the $ERL_TOP/lib/wx/config.log file for a possible cause.
In my case, I was missing the c++ compiler. After installing g++ I was able to compile and install OTP with no further problems.
I got the same error while building erlang on CentOS 7.
I too was missing the C++ compiler.
After doing yum install gcc-c++, I was able to build erlang successfully.

Resources