wxWidget configure: cannot guess build type - c++

I'm trying to build wxWidget on Windows following this tutorial
. But when typed ../configure --enable-unicode --enable-debug -- --enable-monolithic --disable-shared, the output is a lot of "Segmentation fault" messages:
$ ./configure --enable-unicode --enable-debug --enable-monolithic --disable-shared
./configure: line 427: 3224 Segmentation fault expr a : '\(a\)' > /dev/null 2>&1
./configure: line 1492: 2560 Segmentation fault expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" > /dev/null
./configure: line 1492: 2452 Segmentation fault expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" > /dev/null
./configure: line 1492: 3692 Segmentation fault expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" > /dev/null
./configure: line 1492: 3436 Segmentation fault expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" > /dev/null
checking build system type... ./config.guess: unable to guess system type
This script, last modified 2015-08-20, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain; f=config.guess;hb=HEAD
and
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches#gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2015-08-20
uname -m = x86
uname -r = 1
uname -s = WindowsNT
uname -v = 5
/usr/bin/uname -p =
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = i686
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = x86
UNAME_RELEASE = 1
UNAME_SYSTEM = WindowsNT
UNAME_VERSION = 5
configure: error: cannot guess build type; you must specify one
The config.log is here.
I also downdloaded the config.sub and config.guess
My OS is Windows XP SP3. The wxWidgets version is 3.0.2.

Something is very wrong with either the environment you're running configure in (Cygwin? MSYS? MSYS2? We don't know as you don't say) as expr definitely shouldn't segfault. Try running it interactively to see if you just have a corrupted /usr/bin/expr executable. If not, run hardware tests on your machine.

Related

/bin/bash: no: command not found: when trying to use a make:model command with J.DepP

When trying to run a Makefile from J.DepP, I keep getting /bin/bash: no: command not found. Does anyone know how to fix this? Is there a no program to install?
// Command that fails (split into 2 lines for readability)
find /home/jdepp-2015-10-05/KNBC_v1.0_090925/corpus1 -type f -name "KN*" | LC_ALL=C sort | xargs cat |
no /home/jdepp-2015-10-05/tools/knbc2kyoto.py KNP | no /home/jdepp-2015-10-05/tools/replace_pos.py /home/linuxbrew/.linuxbrew/bin/mecab -d /home/linuxbrew/.linuxbrew/lib/mecab/dic/unidic > model/knbc/train.JDP.euc
/bin/bash: no: command not found
/bin/bash: no: command not found
xargs: cat: terminated by signal 13
make: *** [Makefile:948: knbc] Error 127
That is the error I'm getting, where it's trying to run the no command. When I type no in terminal, it doesn't exist. Line 948 of the Makefile is just the command above.
Has anyone successfully installed J.DepP and fixed this error?
This was actually an issue because python wasn't installed and J.DepP's makefile didn't return a fail for a critical dependency.
Install python, run make clean && ./configure and the issue with disappear.

How to cross compile pyinstaller bootloader to arm 32bit

How to cross compile pyinstaller-3.5 boot loader for arm soft float 32bit.
I tried to cross compile it:
getting error dl not found.
python2.7 ./waf CC=arm-linux-gnueabi-gcc all
'all' finished successfully (0.000s)
'distclean' finished successfully (0.000s)
Setting top to : /home/arjuncr/Downloads/PyInstaller-3.5/bootloader
Setting out to : /home/arjuncr/Downloads/PyInstaller-3.5/bootloader/build
Python Version : 2.7.17 (default, Nov 7 2019, 10:07:09) [GCC 7.4.0]
Checking for 'gcc' (C compiler) : arm-linux-gnueabi-gcc
Checking size of pointer : 4
Platform : Linux-32bit detected based on compiler
Checking for flags -m32 : yes
Checking for program 'arm-linux-gnueabi-strip' : /usr/bin/arm-linux-gnueabi-strip
Checking for program 'strip' : /usr/bin/arm-linux-gnueabi-strip
Checking for library dl : not found
The configuration failed
(complete log in /home/arjuncr/Downloads/PyInstaller-3.5/bootloader/build/config.log)
log:
[1/2] Compiling build/.conf_check_c80cac29ed913c100609f182ebb9efef/test.c
['arm-linux-gnueabi-gcc', '-m32', '-O2', '-Wdeclaration-after-statement', '-Wimplicit-function-declaration', '-Werror', '-U_FORTIFY_SOURCE', '-D_REENTRANT', '-D_BSD_SOURCE', '-D_DEFAULT_SOURCE', '-D_FORTIFY_SOURCE=2', '../test.c', '-c', '-o/home/arjuncr/Downloads/PyInstaller-3.5/bootloader/build/.conf_check_c80cac29ed913c100609f182ebb9efef/testbuild/test.c.1.o']
err: arm-linux-gnueabi-gcc: error: unrecognized command line option ‘-m32’
from /home/arjuncr/Downloads/PyInstaller-3.5/bootloader: Test does not build: Traceback (most recent call last):
File "/home/arjuncr/Downloads/PyInstaller-3.5/bootloader/.waf-2.0.9-6b5f17f340ec613b295ffa3dedcecc80/waflib/Configure.py", line 324, in run_build
bld.compile()
File "/home/arjuncr/Downloads/PyInstaller-3.5/bootloader/.waf-2.0.9-6b5f17f340ec613b295ffa3dedcecc80/waflib/Build.py", line 176, in compile
raise Errors.BuildError(self.producer.error)
BuildError: Build failed
-> task in 'testprog' failed with exit status 1 (run with -v to display more information)
not found
from /home/arjuncr/Downloads/PyInstaller-3.5/bootloader: The configuration failed
Also I used crosss compiled version of python 2.7.17
./configure --enable-shared \
--with-system-expat \
--with-ensurepip=yes \
--enable-unicode=ucs4 \
--build=x86_64-pc-linux-gnu\
--host=i686-pc-linux-gnu \
--enable-ipv6 \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no &&
make
Used cross compiled version of zlib
CC=arm-linux-gnueabi-gcc ./configure && make
and copied the lib to /usr/lib/gcc-cross/arm-linux-gnueabi/7/../../../../arm-linux-gnueabi/lib/
Editing the wsscript
<pre>
--- wscript 2019-07-10 00:44:04.000000000 +0530
+++ ../../../PyInstaller-3.5/bootloader/wscript 2020-01-04 23:05:17.877519450 +0530
## -366,9 +366,9 ##
# on 32-bit arm Linux. So skip the -m32 flag.
pass
else:
- ctx.check_cc(ccflags='-m32', msg='Checking for flags -m32')
- ctx.env.append_value('CFLAGS', '-m32')
- ctx.env.append_value('LINKFLAGS', '-m32')
+ ctx.check_cc(ccflags='', msg='Checking for flags -m32')
+ ctx.env.append_value('CFLAGS', '')
+ ctx.env.append_value('LINKFLAGS', '')
# Set LARGE_ADDRESS_AWARE_FLAG to True.
# On Windows this allows 32bit apps to use 4GB of memory and
# not only 2GB.
</pre>

ocamlc - compiling ocaml-wasm - Error: /usr/lib/ocaml/bigarray.cma is not a bytecode object file

I'm trying to make install ocaml-wasm 1.
Unfortunately the build is failing with the error-message:
Error: /usr/lib/ocaml/bigarray.cma is not a bytecode object file
Here's a Dockerfile so you may reproduce the error:
FROM base/archlinux
RUN pacman -Sy --noconfirm ocaml ocamlbuild wget unzip make
RUN wget https://github.com/WebAssembly/spec/archive/v1.0.zip
RUN unzip v1.0.zip
CMD cd spec-1.0; make -C interpreter install; bash
You may run it:
docker build -t ocaml-wasm . && docker run --rm -it ocaml-wasm
It should find it to produce the same error as above.
Here's the entire output of the make command:
make: Entering directory '/spec-1.0/interpreter'
ls util/*.ml* syntax/*.ml* binary/*.ml* text/*.ml* valid/*.ml* runtime/*.ml* exec/*.ml* script/*.ml* host/*.ml* main/*.ml* \
| sed 's:\(.*/\)\{0,1\}\(.*\)\.[^\.]*:\2:' \
| grep -v main \
| sort | uniq \
>wasm.mlpack
echo >_tags "true: bin_annot"
echo >>_tags "<{util,syntax,binary,text,valid,runtime,exec,script,host,main}/*.cmx>: for-pack(Wasm)"
ocamlbuild -cflags '-w +a-4-27-42-44-45 -warn-error +a' -I util -I syntax -I binary -I text -I valid -I runtime -I exec -I script -I host -I main -libs bigarray -quiet wasm.cmx
+ /usr/bin/ocamlc.opt -pack bigarray.cma -bin-annot util/lib.cmo binary/utf8.cmo exec/float.cmo exec/f32.cmo exec/f64.cmo exec/numeric_error.cmo exec/int.cmo exec/i32.cmo exec/i64.cmo syntax/types.cmo syntax/values.cmo runtime/memory.cmo util/source.cmo syntax/ast.cmo util/error.cmo binary/encode.cmo exec/i64_convert.cmo syntax/operators.cmo binary/decode.cmo script/script.cmo text/parser.cmo text/lexer.cmo text/parse.cmo util/sexpr.cmo text/arrange.cmo exec/i32_convert.cmo exec/f32_convert.cmo exec/f64_convert.cmo exec/eval_numeric.cmo runtime/func.cmo runtime/global.cmo runtime/table.cmo runtime/instance.cmo exec/eval.cmo host/env.cmo main/flags.cmo script/import.cmo script/js.cmo text/print.cmo valid/valid.cmo script/run.cmo host/spectest.cmo -o wasm.cmo
File "_none_", line 1:
Error: /usr/lib/ocaml/bigarray.cma is not a bytecode object file
Command exited with code 2.
make: *** [Makefile:83: _build/wasm.cmx] Error 10
rm wasm.mlpack _tags
make: Leaving directory '/spec-1.0/interpreter'
How do I get ocaml-wasm to compile?
I've seen 2, but the answer doesn't help me. I've not installed any non-standard binaries. Could the ocaml distribution on arch linux be broken?
I suspect that your ocamlbuild version is 0.13 (see ocamlbuild --version), which is known to have this issue. You should use 0.12 to avoid the problem.
ocamlbuild 0.13 is not package on opam because of this problem (so it's not visible to most users), but I hadn't considered that distribution packagers may decide to package it nonetheless.

library not found for -lgomp [duplicate]

I'm trying to get openmp to run in my program on Mavericks, however when I try to compile using the flag -fopenmp I get the following error:
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The command I am running is:
gcc myProgram.cpp -fopenmp -o myProgram
Also, when I run gcc I get Clang warnings which I find to be very strange. And looking into /usr/bin/gcc it does not appear to link to Clang.
Any suggestions on how to fix my Clang errors and get openmp to compile?
The gcc command in the latest Xcode suite is no longer the GCC frontend to LLVM (based on the very old GCC 4.2.1) but rather a symlink to clang. Clang does not (yet) support OpenMP. You have to install separately another version of GCC, e.g. by following this tutorial or by using any of the available software package management systems like MacPorts and Homebrew.
I just recently attacked this problem and have scripted the process of getting everything working based on the official instructions.
The script will download everything into ~/code for easy maintenance and will append the correct environment variables to your ~/.profile file. For advanced users, pick a nice location you want the lib, bin and include installed and move them manually. The script depends on knowing the latest OpenMP runtime from Intel, which can be altered at the top of the script.
The script should work out of the box with vanilla Mavericks, except for one small problem. In the OpenML runtime make script, it does not reliably accept clang when specified and continues with the default GCC. As such, if you don't have GCC installed (which is not normal on out of the box Mavericks), it will fail to build. To fix this, you must comment out two lines (as noted in the script) based on the libomp_20131209_oss.tgz build of OpenMP. Newer builds of OpenML might break this script, so use at your own peril on newer versions.
Simply save this script into a file, run 'chmod +x filename.sh', and run './filename.sh' from terminal. It will take a while to build LLVM and Clang, so be patient.
EDIT: This script will most likely fail on Yosemite and I am having issues using the built clang2 after the update to the dev builds of OSX 10.10.
INTEL_OPENMP_LATEST_BUILD_LINK=https://www.openmprtl.org/sites/default/files/libomp_20131209_oss.tgz
DEST_FOLDER = ~/code
CLANG_INCLUDE=${DEST_FOLDER}/llvm/include
CLANG_BIN=${DEST_FOLDER}/llvm/build/Debug+Asserts/bin
CLANG_LIB=${DEST_FOLDER}/llvm/build/Debug+Asserts/lib
OPENMP_INCLUDE=${DEST_FOLDER}/libomp_oss/exports/common/include
OPENMP_LIB=${DEST_FOLDER}/libomp_oss/exports/mac_32e/lib.thin
mkdir ${DEST_FOLDER}
cd ${DEST_FOLDER}
git clone https://github.com/clang-omp/llvm
git clone https://github.com/clang-omp/compiler-rt llvm/projects/compiler-rt
git clone -b clang-omp https://github.com/clang-omp/clang llvm/tools/clang
cd llvm
mkdir build
cd build
../configure
make
cd Debug+Asserts/bin
mv clang clang2
rm -rf clang++
ln -s clang2 clang2++
echo "LLVM+Clang+OpenMP Include Path : " ${CLANG_INCLUDE}
echo "LLVM+Clang+OpenMP Bin Path : " ${CLANG_BIN}
echo "LLVM+Clang+OpenMP Lib Path : " ${CLANG_LIB}
cd ${DEST_FOLDER}
curl ${INTEL_OPENMP_LATEST_BUILD_LINK} -o libomp_oss_temp.tgz
gunzip -c libomp_oss_temp.tgz | tar xopf -
rm -rf libomp_oss_temp.tgz
cd libomp_oss
echo "You need to do one or two things:"
echo "1.) [Required] Comment out line 433 from libomp_oss/src/makefile.mk"
echo "2.) [Optional] If you do not have GCC installed (not normal on vanilla Mavericks), you must comment out lines 450-451 in libomp_oss/tools/check-tools.pl. Have you done this or want to compile anyway?"
select yn in "Yes" "No"; do
case $yn in
Yes ) make compiler=clang; break;;
No ) exit;;
esac
done
echo "OpenMP Runtime Include Path : " ${OPENMP_INCLUDE}
echo "OpenMP Runtime Lib Path : " ${OPENMP_LIB}
(echo 'export PATH='${CLANG_BIN}':$PATH';
echo 'export C_INCLUDE_PATH='${CLANG_INCLUDE}':'${OPENMP_INCLUDE}':$C_INCLUDE_PATH';
echo 'export CPLUS_INCLUDE_PATH='${CLANG_INCLUDE}':'${OPENMP_INCLUDE}':$CPLUS_INCLUDE_PATH';
echo 'export LIBRARY_PATH='${CLANG_LIB}':'${OPENMP_LIB}':$LIBRARY_PATH';
echo 'export DYLD_LIBRARY_PATH='${CLANG_LIB}':'${OPENMP_LIB}':$DYLD_LIBRARY_PATH}') >> ~/.profile
source ~/.profile
echo "LLVM+Clang+OpenMP is now accessible through [ clang2 ] via terminal and does not conflict with Apple's clang"
If you are running homebrew you can fix this problem by calling:
brew install clang-omp
The compiler will be available under clang-omp++ name
Just worked through this problem. Here's the answer plus how to get it worked with Xcode.
Grab the latest version of openMP runtime library from
https://www.openmprtl.org/download
unzip and compile it by
mkdir build && cd build && cmake .. && make && sudo make install
install it by
sudo cp ./libiomp5.dylib /usr/lib/
sudo cp ./omp.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/
Grab openmp/clang from Git following the instructions on http://clang-omp.github.io/
compile openmp/clang
cd llvm && mkdir build && cd build && ../configure --enable-optimized && make -j
sudo make install
normally it would install clang/clang++ into /usr/local/bin, we need replace the Apple clang with our version
cd /usr/bin
sudo mv clang clang-apple
sudo mv clang++ clang++-apple
sudo ln -s /usr/local/bin/clang ./clang
sudo ln -s /usr/local/bin/clang++ ./clang++
cd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
sudo mv clang clang-apple
sudo mv clang++ clang++-apple
sudo ln -s /usr/local/bin/clang ./clang
sudo ln -s /usr/local/bin/clang++ ./clang++
cd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
sudo mv -f * ../../
Create a project in Xcode, using the Hello World code on clang-openmp website for test. After created, add "-fopenmp" to Custom Compiler Flags -> Other C Flags in project settings; add /usr/lib/libiomp5.dylib to the build phases of project (project settings -> Build Phases -> Drag /usr/lib/libiomp5.dylib into Link Binary with Libraries)
It should work. Yosemite + Xcode 6 is tested.
Note: the custom clang is NOT as stable as Apple's. Switch back if you meet strange instruction error after compiled.

Why does building ocaml-bin-prot using MacPorts fail?

I am trying to learn Ocaml using Real World Ocaml. I installed ocaml using MacPorts. Now, I am trying to install ocaml-core-extended:
$ sudo port install ocaml-core-extended
but it fails while installing dependency ocaml-bin-prot:
Here is the relevant part from the build log:
:notice:build ---> Building ocaml-bin-prot
:debug:build Executing org.macports.build (ocaml-bin-prot)
:debug:build Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_ocaml-bin-prot/ocaml-bin-prot/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.9'
:debug:build Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_ocaml-bin-prot/ocaml-bin-prot/work/bin_prot-108.00.02" && /opt/local/bin/ocaml setup.ml -build'
:debug:build Executing command line: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_ocaml-bin-prot/ocaml-bin-prot/work/bin_prot-108.00.02" && /opt/local/bin/ocaml setup.ml -build
:info:build getconf: no such configuration parameter `LFS64_CFLAGS'
:info:build ocamlfind ocamldep -pp 'cpp -traditional -undef -w -DARCH_SIXTYFOUR' -package unix -package bigarray -modules lib/type_class.mli > lib/type_class.mli.depends
:info:build + ocamlfind ocamldep -pp 'cpp -traditional -undef -w -DARCH_SIXTYFOUR' -package unix -package bigarray -modules lib/type_class.mli > lib/type_class.mli.depends
:info:build File "lib/type_class.mli", line 68, characters 16-20:
:info:build Error: Syntax error
:info:build Command exited with code 2.
:info:build E: Failure("Command '/opt/local/bin/ocamlbuild lib/libbin_prot_stubs.a lib/dllbin_prot_stubs.so lib/bin_prot.cma lib/bin_prot.cmxs lib/bin_prot.cmxa lib/bin_prot.a syntax/pa_bin_prot.cma -tag debug' terminated with error code 10")
:info:build Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_ocaml-bin-prot/ocaml-bin-prot/work/bin_prot-108.00.02" && /opt/local/bin/ocaml setup.ml -build
:info:build Exit code: 1
:error:build org.macports.build for port ocaml-bin-prot returned: command execution failed
I looked at the lib/type_class.mli and I have no clue why there would be a syntax error there. It is just a macro expansion. I would like my bug report to be a little better than "here's a problem".
So, has anyone encountered this failure? Any hints?
$ uname -a
Darwin zzzz.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013;
root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
$ ocaml -version
The OCaml toplevel, version 4.01.0
$ cpp --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
I am assuming the specific problems I had are more related to the transition to Mavericks than anything else.
In the mean time, I decided to install opam with ocamlbrew, and everything worked very smoothly.
I was able to set up my environment following the instructions.
What is the version of core library? Looks like the library is not updated for OCaml 4.01, probably the port is old and haven't catched up yet..