I am trying to add automated build to my github project, but I get the error fatal error: 'codecvt' file not found
This is what my travis.yml file looks like
sudo: required
dist: trusty
language: cpp
compiler:
- clang
env:
- LLVM_VERSION=3.8.1
os:
- linux
script:
- bash build.sh
I have also tried with gcc but neither seems to work.
After a bit of digging around it seems that gcc 5 added support for this c++11 feature, but it looks like travis does not, (yet?) support this.
Any suggestions on how I could get it to work? Maybe another compiler?
I finally found the solution bu piecing together various hints from sites.
language: cpp
sudo: required
script:
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-6 /usr/bin/gcc
- sudo unlink /usr/bin/g++ && sudo ln -s /usr/bin/g++-6 /usr/bin/g++
- gcc --version
- bash build.sh
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-6
- g++-6
See the working .travis.yml
Related
How do I deploy boost for arm64 to a GitHub Actions Runner Image under macOS?
I am using Github Actions to build my project, which depends on boost.
As far as I can tell, when I set the YAML label to macos-11, the runner image itself is intel.
For my x86_64 build, I simply say
brew install boost
And the job can then go on to compile and link my own code successfully.
If I understand correctly, it is not possible to use brew to install boost arm64 binaries to a macOS intel machine.
Maybe I could build boost from source using something like
./bootstrap.sh
./b2 install
What flags would I pass to tell it to cross compile the arm64 binaries?
Edit: I found the solution and posted the answer below, stack overflow tells me that I do not have enough karma to mark my own answer as accepted.
At the bottom of this page...
B2 4.7.1 MacOS Armv8 package bundles x86_64 binary
...it says:
./b2 architecture=arm address-model=64 -s NO_LZMA=1 -s NO_ZSTD=1 abi=aapcs
That worked for me. The entire step that I have on github actions is:
- name: Boost
run: |
curl -O -L https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.gz
tar xfz boost_1_80_0.tar.gz
cd boost_1_80_0
./bootstrap.sh
./b2 architecture=arm address-model=64 -s NO_LZMA=1 -s NO_ZSTD=1 abi=aapcs install
lipo /usr/local/lib/libboost_*.dylib -info
I'm trying to compile a package called Kraken on my M1 Mac running Big Sur.
MacOS fails to compile: clang gets upset. I installed gcc from Homebrew (twice) and $ brew doctor says I'm ready to go.
My path is now:
/usr/local/opt/llvm/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin.
The gcc-11 etc files exist at /opt/homebrew/bin
But /usr/local/bin does not exist!
MacOS does not update the command alias for gcc:
$ rm gcc
then
$ ln -s /opt/homebrew/bin/gcc-11 gcc
return no error
but then
$ which gcc
returns
/usr/bin/gcc
I'm lost and gather this compiler-pointing has been a mess; is there any new insight here? I've seen a bunch of entries but nothing I've tried has worked.
Hoping this is a stupid newbie (me) problem, I thank you for any help you can give.
Michael
Homebrew avoids linking binaries with the same name as system binaries like gcc(appleclang). ln -s /opt/homebrew/bin/gcc-11 /opt/homebrew/bin/gcc or tell your configurator to explicitly use gcc-11 via CC= etc. and the same for g++-11 if C++ is used.
If it's a ./configure script, you can try calling CC=/opt/homebrew/bin/gcc-11 CXX=/opt/homebrew/bin/g++-11 ./configure
if cmake then use cmake .. -DCMAKE_C_COMPILER=/opt/homebrew/bin/gcc-11 -DCMAKE_CXX_COMPILER=/opt/homebrew/gcc++-11
Also, try seeing where the homebrew gcc link points ls -l /opt/homebrew/bin/gcc
I am trying to install Graph-tool, but the following error is returned.
./cofigure
...
...
graph-tool will be installed at: /home/my_name/anaconda2/lib/python2.7/site-packages
===========================
Using python version: 2.7.12
===========================
checking for boostlib >= 1.54.0... configure: We could not detect the boost libraries (version 1.54 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
checking whether the Boost::Python library is available... yes
checking whether boost_python is the correct library... yes
checking whether the Boost::IOStreams library is available... yes
configure: error: Could not link against boost_python !
It seems this error is same as
Installing Thrift on CentOS: can't find Boost 1.40 or higher
. So I guess I should make an appropriate symbolic link to let the configure file find the path to the boost libraries. But I'm not sure where I should make the link because the result of "find" command is different from the asker of the above-mentioned question.
[root#localhost my_name]# su
[root#localhost my_name]# find / -name boost
/home/my_name/python/graph-tool-2.19/src/boost-workaround/boost
/home/my_name/boost_1_63_0/doc/html/boost
/home/my_name/boost_1_63_0/doc/test/gold/boost
/home/my_name/boost_1_63_0/tools/boostbook/test/doxygen/boost
/home/my_name/boost_1_63_0/boost
/home/my_name/boost_1_63_0/boost/chrono/typeof/boost
/home/my_name/boost_1_63_0/boost/hana/ext/boost
/home/my_name/boost_1_63_0/libs/sort/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/sort/doc/html/boost
/home/my_name/boost_1_63_0/libs/chrono/stopwatches/include/boost
/home/my_name/boost_1_63_0/libs/hana/example/ext/boost
/home/my_name/boost_1_63_0/libs/hana/test/ext/boost
/home/my_name/boost_1_63_0/libs/vmd/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/convert/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/convert/doc/html/boost
/home/my_name/boost_1_63_0/libs/functional/overloaded_function/doc/html/boost
/home/my_name/boost_1_63_0/libs/math/include_private/boost
/home/my_name/boost_1_63_0/libs/compute/doc/html/boost
/home/my_name/boost_1_63_0/libs/pool/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/pool/doc/html/boost
/home/my_name/boost_1_63_0/libs/log/doc/html/boost
/home/my_name/boost_1_63_0/libs/tti/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/tti/doc/html/boost
/home/my_name/boost_1_63_0/libs/icl/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/icl/doc/html/boost
/home/my_name/boost_1_63_0/libs/numeric/odeint/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/numeric/odeint/doc/html/boost
/home/my_name/boost_1_63_0/libs/core/doc/html/boost
/home/my_name/boost_1_63_0/libs/test/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/test/doc/html/boost
/usr/local/cuda-8.0/samples/6_Advanced/interval/boost
/usr/include/boost
Does anybody know how to solve this problem ? Thank you very much in advance.
After posting this question, I managed to solve this problem by my self.
It seems the error occurred because the Boost was actually not installed properly.
This time, I did:
$ cd /usr/local
$ tar --bzip2 -xf boost_1_63_0.tar.bz2
$ cd boost_1_63_0.tar.bz2
$ sh ./bootstrap.sh
$ sudo ./b2 install
Then, I found the following directories.
$ sudo find / -name boost
/home/tokudakeita/python/graph-tool-2.19/src/boost-workaround/boost
/usr/local/boost_1_63_0/doc/html/boost
/usr/local/boost_1_63_0/doc/test/gold/boost
/usr/local/boost_1_63_0/tools/boostbook/test/doxygen/boost
/usr/local/boost_1_63_0/boost
/usr/local/boost_1_63_0/boost/chrono/typeof/boost
/usr/local/boost_1_63_0/boost/hana/ext/boost
/usr/local/boost_1_63_0/libs/sort/doc/html/header/boost
/usr/local/boost_1_63_0/libs/sort/doc/html/boost
/usr/local/boost_1_63_0/libs/chrono/stopwatches/include/boost
/usr/local/boost_1_63_0/libs/hana/example/ext/boost
/usr/local/boost_1_63_0/libs/hana/test/ext/boost
/usr/local/boost_1_63_0/libs/vmd/doc/html/header/boost
/usr/local/boost_1_63_0/libs/convert/doc/html/header/boost
/usr/local/boost_1_63_0/libs/convert/doc/html/boost
/usr/local/boost_1_63_0/libs/functional/overloaded_function/doc/html/boost
/usr/local/boost_1_63_0/libs/math/include_private/boost
/usr/local/boost_1_63_0/libs/compute/doc/html/boost
/usr/local/boost_1_63_0/libs/pool/doc/html/header/boost
/usr/local/boost_1_63_0/libs/pool/doc/html/boost
/usr/local/boost_1_63_0/libs/log/doc/html/boost
/usr/local/boost_1_63_0/libs/tti/doc/html/header/boost
/usr/local/boost_1_63_0/libs/tti/doc/html/boost
/usr/local/boost_1_63_0/libs/icl/doc/html/header/boost
/usr/local/boost_1_63_0/libs/icl/doc/html/boost
/usr/local/boost_1_63_0/libs/numeric/odeint/doc/html/header/boost
/usr/local/boost_1_63_0/libs/numeric/odeint/doc/html/boost
/usr/local/boost_1_63_0/libs/core/doc/html/boost
/usr/local/boost_1_63_0/libs/test/doc/html/header/boost
/usr/local/boost_1_63_0/libs/test/doc/html/boost
/usr/local/cuda-8.0/samples/6_Advanced/interval/boost
/usr/local/include/boost
/usr/local/include/boost/chrono/typeof/boost
/usr/local/include/boost/hana/ext/boost
What I found was that just
$ ./b2
does not create the following directories:
/usr/local/include/boost
/usr/local/include/boost/chrono/typeof/boost
/usr/local/include/boost/hana/ext/boost
But the following command made the above directories:
$ sudo ./b2 install
Then, the configure file of the Graph-tool successfully found boost.
When i use this command pecl install imagick to install imagick for php i got this error message :
libtool: Version mismatch error. This is libtool 2.2.6b, but the
libtool: definition of this LT_INIT comes from an older release.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6b
libtool: and run autoconf again.
make: *** [imagick_file.lo] Erreur 63
I found the solution another question with the same error but different application install, but it still not working : libtool version mismatch error
How to fixed this, please ?
This solution seems to fix this problem. Seen in Bug #58979
wget http://pecl.php.net/get/imagick
tar xvzf imagick
cd ./imagick-3.2.0RC1
phpize
aclocal
libtoolize --force
autoheader
autoconf
./configure
make && make install
There's an ebuild available. I'd give it a try:
$ eix imagick
* dev-php/pecl-imagick
Available versions: 3.0.1-r1 3.1.0_rc2 ~3.1.2 ~3.2.0_rc1 {examples PHP_TARGETS="php5-3 php5-4 php5-5"}
Homepage: http://pecl.php.net/imagick
Description: PHP wrapper for the ImageMagick library.
Look into the gentoo bugzilla if there's a bug report and try not to install packages from outside of portage as it tends to break stuff! Usually there are at least some hacks around to get the ebuild working.
If not, just give it a day or two...
On OS X I'm trying to install the zlib prerequisite for haskell's Cabal. I get this error:
$ sudo ./Setup build
Preprocessing library zlib-0.5.0.0…
ld: library not found for -lgmp
collect2: ld returned 1 exit status
linking dist/build/Codec/Compression/Zlib/Stream_hsc_make.o failed
command was: /usr/bin/gcc -lz -L/sw/lib/ghc-6.8.3/lib/bytestring-0.9.0.1.1 -L/sw/lib/ghc-6.8.3/lib/array-0.1.0.0 -L/sw/lib/ghc-6.8.3/lib/base-3.0.2.0 -L/sw/lib/ghc-6.8.3 -lm -lgmp -ldl dist/build/Codec/Compression/Zlib/Stream_hsc_make.o -o dist/build/Codec/Compression/Zlib/Stream_hsc_make
The library -lgmp is found in /sw/lib, so I can run that command ("/usr/bin/gcc ...") successfully if I manually add -L/sw/lib. The problem is that sudo doesn't know about /sw/lib. Behold:
$ gcc -print-search-dirs | grep sw
libraries: =/lib/i686-apple-darwin9/4.0.1/:/lib/:/usr/lib/i686-apple-darwin9/4.0.1/:/usr/lib/:./i686-apple-darwin9/4.0.1/:./:/sw/lib/i686-apple-darwin9/4.0.1/:/sw/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../
$ sudo gcc -print-search-dirs | grep sw
$
How do I tell the sudo version of gcc to look in /sw/lib for libraries? Do I add an environment variable on root's .bash_profile? If so, which one?
UPDATE:
There’s probably a more proper way to do this, but here’s what worked. I created a bash script with this in it:
#!/bin/sh
export LIBRARY_PATH=/sw/lib:$LIBRARY_PATH
./Setup build
And then I ran
$ sudo ./script.sh
That compiled zlib without complaining - hooray! Unfortunately cabal-install is still giving me the error:
$ ./Setup configure
Configuring cabal-install-0.6.2…
Setup: At least the following dependencies are missing:
zlib >=0.4 && <0.6
So I went back to the cabal-install dir (which is what I'm trying to do in the first place), and ran...
$ ./bootstrap.sh
...and that installed everything as expected.
Why you use sudo ever? You should not compile as super user. Compile as normal user and install as super user.
Try setting LDFLAGS=-L/sw/lib.
GHC now comes with an installer for OS X (Leopard, not sure about Tiger). The only issue is that if you use macports or fink, these will probably not see that you have GHC installed and try to install their own version of it.