Problems in building Xerces library as a universal binary on Mac - macos

I am trying to compile xerces 3.1.1 and 3.2.3 with XCode 12.3 to make universal library for both Intel and M1.
I am running the following for configuring step:
./configure CFLAGS="-arch x86_64 -arch arm64" CXXFLAGS="-arch x86_64 -arch arm64"
I am getting the following output:
checking build system type... x86_64-apple-darwin19.6.0
checking host system type... x86_64-apple-darwin19.6.0
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether UID '502' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to use rpath... yes
checking for g++... g++
checking whether the C++ compiler works... no
configure: error: in `/Users/prj/3rd Party/Apache/xerces-c-src_3_2_3':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
I want to therefore know if Xerces 3.1.1 or 3.2.3 can be built for both intel and M1 chip, i.e. essentially as a universal binary in Mac.
Thanks,

I would advise you to use CMake to build Xerces instead of the configure script and add the following variable on your cmake command:
CMAKE_OSX_ARCHITECTURES=arm64;x86_64

Related

Installing msstats software in Mac OS X. make command not working

I am trying to install the msstats software in my MacbookPro Yosemite 10.10.5 :
https://github.com/molpopgen/msstats
I follow the instructions and write: ./configure
Lucass-MacBook-Pro:msstats-master lucas$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/Users/lucas/Dropbox/puc/Softwares/msstats-master/missing: Unknown `--
is-lightweight' option
Try `/Users/lucas/Dropbox/puc/Softwares/msstats-master/missing --help'
for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for an ANSI C-conforming const... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for main in -lgslcblas... no
GSL BLAS runtime library not found
Then I write "make" and I get this message:
Lucass-MacBook-Pro:msstats-master lucas$ make
make: *** No targets specified and no makefile found. Stop.
Similarly, with "sudo make install" I get:
Lucass-MacBook-Pro:msstats-master lucas$ sudo make install
Password:
make: Nothing to be done for `install'.
Any suggestion will be highly appreciated

i want to install Tesseract and ./configure

this is the result from ./configue:
checking for g++... g++
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 g++ accepts -g... yes
Using git revision: 4.00.00alpha-358-g362b68e
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of g++... gcc3
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
./configure: line 4250: syntax error near unexpected token `-mavx,'
./configure: line 4250: `AX_CHECK_COMPILE_FLAG(-mavx, avx=true, avx=false)'
this is the error that i get after running make:
make: *** No targets specified and no makefile found. Stop.
thus sudo make install doesnt work either
I was getting the same error. Below is what worked for me.
cd tesseract-3.05.00
./autogen.sh
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
LIBLEPT_HEADERSDIR=/usr/local/include ./configure --with-extra-includes=/usr/local/include --with-extra-libraries=/usr/local/lib
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
make install
ldconfig
See below link for full script, that includes installing Leptonica and dependencies properly.
https://github.com/EisenVault/install-tesseract-redhat-centos/blob/master/install-tesseract.sh
If configure fails with errors like these, then double check you have installed autoconf-archive and restart Tesseract installation process (./autogen.sh,./configure` ...)
And make sure that you have installed the latest version of laptonica, in my case it was Laptonica-1.74, as it is required for the installation process.
Reference to tesseract-ocr compiling

No acceptable C compiler found in $PATH

So here's the situation. I want to setup a portable programming environment by installing my programming stuff (Vim, Clang, Git, GCC) in a single folder that I can create on any Mac. I am installing everything in /opt, which isn't there by default and I should have write permissions to create. I got Vim, Clang, and Git working by downloading the Xcode Command Line Tools and a program that can extract the contents of the PKG's. I put everything in their respective folders in /opt, e.g /opt/usr/bin. They are all doing dandy.
Here's the problem. I am trying to get GCC to work. I downloaded the OSX GCC Installer and did the same technique with GCC-4.2. The problem is that when I do a test compile, I run this. Edit: I get the same error message if I do CC=gcc-4.2
./configure --prefix=/opt/usr/bin
and receive
checking build system type... x86_64-apple-darwin11.4.2
checking host system type... x86_64-apple-darwin11.4.2
checking target system type... x86_64-apple-darwin11.4.2
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /usr/bin/sed
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking for libatomic support... yes
checking for libcilkrts support... yes
checking for libitm support... yes
checking for libsanitizer support... yes
checking for libvtv support... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/opt/gcc-master':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
This is strange because GCC-4.2 is in my $PATH
echo $PATH
/opt/usr/bin:/opt/usr/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
cd /opt/usr/bin ; ls | grep gcc
gcc
gcc-4.2
i686-apple-darwin11-gcc-4.2.1
FYI: 'gcc' is a symlink that doesn't point to anything.
which gcc-4.2
/opt/usr/bin/gcc-4.2
I solved this by adding this to my .zshrc. It forces any configure script to look for gcc-4.2 instead of gcc.
CC=/opt/usr/bin/gcc-4.2
configure: error: no acceptable C compiler found in $PATH
Before executing the ./configure command, i used the command:
sudo apt install gcc
And the error 'no acceptable ...' is solved.

configure: error: X11 library not found in Mountain Lion

I'm trying to install the FORTRAN program rmodel described at http://www.ucm.es/info/Astrof/software/rmodel/rmodel.html
./configure fails with the following error:
phym-ssweet2:rmodel-3.2.0 seasto$ sudo ./configure F77=gfortran
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether the Fortran 77 compiler works... yes
checking for Fortran 77 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 Fortran 77 compiler... yes
checking whether gfortran accepts -g... yes
checking uname -s for detecting host operating system... Darwin
LDFLAGS set to... -L/opt/local/lib
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... none
checking for main in -lX11... no
configure: error: X11 library not found
I tried pointing ./configure to the libraries using export CPPFLAGS=-I/opt/X11/include and export CPPFLAGS=-I/opt/X11/include LDFLAGS=-L/opt/X11/lib but to no avail. (These suggestions from Mountain Lion X11 libraries can't ./configure and Mountain Lion rvm install 1.8.7 x11 error)
Any suggestions would be greatly appreciated.
This worked: ./configure F77=gfortran LDFLAGS=-L/opt/X11/lib.
It seems the key was to not edit CPPFLAGS.
Look in config.log, you should be able to see the compile/link line for the program used to test for X11 (conftest.c) and the reason for failure.

how to compile libcurl with arch armv7s under macosx?

I have installed Xcode 4.5 and iOS6.0 SDK , MacOSX 10.7 SDK,command line tools on my computer. I download libcurl from http://curl.haxx.se/download/curl-7.27.0.tar.gz and compiled it for iOS with arch armv7s.
I did follows:
export
CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-arch armv7s"
export LDFLAG="-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk
--Wl,-syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk"
export CFLAG="-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk"
./configure --host=arm-apple-darwin10
and get errors below:
$ ./configure --host=arm-apple-darwin10
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to enable debug build options... no
checking whether to enable compiler optimizer... (assumed) yes
checking whether to enable strict compiler warnings... no
checking whether to enable compiler warnings as errors... no
checking whether to enable curl debug memory tracking... no
checking whether to enable hiding of library internal symbols... yes
checking whether to enable c-ares for DNS lookups... no
checking for sed... /usr/bin/sed
checking for grep... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for arm-apple-darwin10-ar... no
checking for ar... /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for arm-apple-darwin10-strip... no
checking for strip... strip
checking curl version... 7.27.0
checking build system type... i386-apple-darwin12.2.0
checking host system type... arm-apple-darwin10
checking for style of include used by make... GNU
checking for arm-apple-darwin10-gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s
checking for C compiler default output file name...
configure: error: in `/Users/eric/working/curl-7.27.0':
configure: error: C compiler cannot create executables
See `config.log' for more details.
does anyone known how to do it?

Resources