error compiling CPython with very unhelpful message - macos

I'm trying to compile CPython, specifically tag 3.9.0
( git checkout tags/v3.9.0 -b v3.9.0)
I'm following the instructions from the book CPython Internals by Real Python.
When I tried to compile with:
CPPFLAGS="-I$(brew --prefix zlib)/include" \
LDFLAGS="-L$(brew --prefix zlib)/lib" \
./configure --with-openssl=$(brew --prefix openssl) \
--with-pydebug --enable-framework
I received the error: configure: error: internal configure error for the platform triplet; please file a bug report.
Here is a screenshot :
This is my system:
Any help will be appreciated it.

Related

Mpif90 does not compile properly after updating to Mac Big Sur

I recently upgraded to Big Sur and am having trouble running a code on mpi. I am running a test code with the following command:
mpif90 -o test.f90 ./test
I receive the following error:
-bash: mpif90: command not found
I have updated homebrew and macports yet am unable to solve the problem. I suspect it has something to do with an incorrect path name somewhere. Any ideas? Thank you.
#Oo.oO Thank you. When configuring the build of gcc (per the link in your comment) by the command:
../configure --prefix=$HOME/opt/usr/local/gcc/gcc-9.2.0 \
--enable-checking=release \
--enable-languages=c,c++,fortran \
--disable-multilib \
--with-sysroot=$HOME/opt/usr/local/gcc_system_root \
--program-suffix=-9.2.0
the following error occurs:
configure: error: in `$HOME/opt/src/gcc/gcc-9.2.0/build':
configure: error: C compiler cannot create executables
I have updated Xcode (Version 12.3). Any thoughts? Thank you.
The problem was there were other /bin/ directories that had older versions of gcc and openmpi. When updating, the new files from /lib/ directories needed to be trasnfered to the /Cellar/ directories. The problem is fixed when first uninstalling all old macports and compilers with incorrect files and/or paths as sudo port -fp uninstall installed, and brew uninstall openmpi, and brew uninstall gcc. Then reinstall new homebrew compilers brew install gcc, brew install openmpi. This gives the correct paths with configured files when submitting a make file, or in this case, using the mpif90 command.

Couldn't load codegen backend when compiling Rust on Windows using mingw_64

I'm compiling Rust on Windows using mingw_64 and GCC. I get the following error:
error: couldn't load codegen backend "E:\rust_git\rust\build\x86_64-pc-windows-gnu\stage1\lib\rustlib\x86_64-pc-windows-gnu\codegen-backends\rustc_codegen_llvm-llvm.dll": "The specified procedure could not be found. (os error 127)"
Unlike How do I fix the error "couldn't load codegen backend" on macOS?, the file rustc_codegen_llvm-llvm.dll does live in the correct directory.
found the reason, latest mingw gcc 9.1.0 cause some missing dll problem. (although, compile rust source was fine).
if you have old version msys2, this will works for you:
pacman -R mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake
pacman -R mingw-w64-x86_64-gcc-libs
pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-libs-8.3.0-2-any.pkg.tar.xz
pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-gcc-8.3.0-2-any.pkg.tar.xz
pacman -U /var/cache/pacman/pkg/mingw-w64-x86_64-cmake-3.14.4-1-any.pkg.tar.xz
./x.py install
rustc -vV
rustc 1.37.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-pc-windows-gnu
release: 1.37.0-dev
LLVM version: 8.0

OpenCV error file INSTALL cannot find /bin/opencv_annotation

I have a problem on compiling OpenCV 3.X.X on Debian but It is OK on Ubuntu. I compile OpenCV with these commands:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/opt/opencv-3.3.0/build \
-D OPENCV_EXTRA_MODULES_PATH=/opt/opencv_contrib-3.3.0/modules \
-D BUILD_SHARED_LIBS=ON \
-D WITH_FFMPEG=ON \
-D PYTHON_EXECUTABLE=/opt/virtualenvs/cv/bin/python \
-D BUILD_EXAMPLES=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D WITH_TBB=OFF \
-D WITH_OPENMP=ON \
-D BUILD_opencv_apps=ON \
-D BUILD_DOCS=ON ..
make -j12
sudo make install - j12
After "make install" I get this error and all shared library in build/lib that were built successfully before error, are deleted!
CMake Error at apps/annotation/cmake_install.cmake:42 (file):
file INSTALL cannot find "/opt/opencv-3.3.0/build/bin/opencv_annotation".
Call Stack (most recent call first):
apps/cmake_install.cmake:39 (include)
cmake_install.cmake:88 (include)
Makefile:66: recipe for target 'install' failed
make: *** [install] Error 1
If I set -D BUILD_opencv_apps=OFF, there is no error in compiling but again at the end all *.so files in build/lib are deleted.
Once in another computer I manage to compile OpenCV successfully but I don't know what exactly I had done.
My system has:
OpenCV 3.3.0
Debian GNU/Linux 8.9 (jessie) 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
cmake version 3.0.2
gcc (Debian 4.9.2-10) 4.9.2
What's the problem?
I found the solution. This error happens when build directory is the same with install directory, At least on some Linux distributions!
I should change install directory.

Cross-compiling static QEMU for Windows

I've been trying to compile a static QEMU executable for Windows on a Debian box, and ran into some problems. (I'm using this guide as a reference.)
When I compile without the static flag everything works but when I compile using the static flag I get the following error during the call to configure:
ERROR: zlib check failed
Make sure to have the zlib libs and headers installed.
This is the command line:
WORK=/media/Work/qemu
cd $WORK/build/w32
(export PKG_CONFIG_PATH=$WORK/install/w32/lib/pkgconfig ;
export PKG_CONFIG_PREFIX=$WORK/install/w32 ;
#export BASH_X=-x ;
bash $BASH_X ../../qemu.git/configure --target-list="i386-softmmu" \
--cross-prefix=i686-w64-mingw32- \
--extra-ldflags="-L$WORK/install/w32/lib" \
--extra-cflags="-I$WORK/install/w32/include" \
--static \
)
You can disable the zlib test using the command line input
./configure --disable-zlib-test
Zlib will be needed to build qemu, but it will not test for the library during configure. If the library is available in the proper location during build process, you can try the above command to proceed.

Install happstack-server 6.5.3 on osx - missing libcryptopp

I'm trying to install the latest happstack-server on osx. They just added a dependency on libcryptopp, and I can't get it working.
~$ cabal install happstack-server
Resolving dependencies...
Configuring happstack-server-6.5.3...
cabal: Missing dependency on a foreign library:
* Missing C library: cryptopp
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal: Error: some packages failed to install:
happstack-server-6.5.3 failed during the configure step. The exception was:
ExitFailure 1
So, then I install libcryptopp with macports, which puts libcryptopp.a in /opt/local/lib
sudo port install libcryptopp
Then I install happstack-server again with --extra-lib-dirs
cabal install happstack-server --extra-lib-dirs=/opt/local/lib
It installs fine, everything seems to work until I actually run a happstack server.
~$ runhaskell Hello.hs
Hello.hs: <command line>: can't load .so/.DLL for: libcryptopp.dylib (dlopen(libcryptopp.dylib, 9): image not found)
What am I doing wrong? Or is this a bug with happstack? I don't even have a .dylib after installing the lib via macports, only a .a. ghc --make Hello.hs is even crazier
How about:
g++ -fpic -nostartfiles -nostdlib -shared /usr/local/Cellar/cryptopp/5.6.1/lib/libcryptopp.a -o libcryptopp.dylib
as a brute-force approach, You can disable https flag in .cabal file of happstack-server:
file: happstack-server.cabal :
Flag https
Default: False
configure/build/install happstack-server manually, them cabal install happstack.
(I use Archlinux, --extra-lib-dirs don't even work!)

Resources